The aim of this tutorial is to introduce the user to the spectral/hp element framework Nektar++ and its use for global stability computations. Information on how to install the libraries, solvers, and utilities on your own computer is available on the webpage www.nektar.info.
Installed and tested Nektar++ v5.7.0from a binary package, or compiled it from
source. By default binary packages will install all executables in /usr/bin
. If
you compile from source they will be in the sub-directory dist/bin
of the build
directory you created in the Nektar++ source tree. We will refer to the directory
containing the executables as $NEK
for the remainder of the tutorial.
Downloaded the tutorial files: flow-stability-channel.tar.gz
Unpack it using unzip flow-stability-channel.tar.gz
to produce a directory
flow-stability-channel
with subdirectories called tutorial
and complete
We
will refer to the tutorial
directory as $NEKTUTORIAL
.
a visualization package capable of reading VTK files, such as ParaView (which can be downloaded from here) or VisIt (downloaded from here). Alternatively, you can generate Tecplot formatted .dat files for use with Tecplot.
a plotting program capable of reading data from ASCII text files, such as GNUPlot or MATLAB.
Optionally, you can install the open-source mesh generator Gmsh (which can be downloaded from here) to generate the meshes for the tutorial examples yourself. However, pre-generated meshes are provided.
In this tutorial, we will cover the stability analysis of a two-dimensional channel flow, through both a splitting scheme (the Velocity Correction Scheme) and the direct inversion algorithm (also referred to as the Coupled Linearised Navier-Stokes solver). We will briefly show the application of the stability tools presented to a three-dimensional channel flow test case.
Linear stability analysis is a technique that allows us to determine the asymptotic stability of a flow. By decomposing the velocity and pressure in the Navier-Stokes equations as a summation of a base flow (U,P) and perturbation (u′,p′), such that u = U + ϵu′, p = P + ϵp′, with ϵ « 1, we derive the linearised Navier-Stokes equations,
+ U ⋅∇u′ + u′⋅∇U | = -∇p′ + ∇2u′ + f′, | (1.1) |
∇⋅u′ | = 0. | (1.2) |
We will consider a parallel base flow through a 2-D channel (known as Poiseuille flow) at Reynolds number Re = 7500. The velocity has the following analytic form:
(1.3) |
The domain is Ω = [-π,π] × [-1,1] and it is composed by 48 quadrilateral elements as shown in figure 1.1. The problem has been made non-dimensional using the centreline velocity and the channel half-height.
This mesh was created using the software Gmsh and the first step is to convert it into a suitable input format so that it can be processed by the Nektar++ libraries.
The files in the $NEKTUTORIAL
directory are as follows:
Folder geometry
Channel.geo
- Gmsh file that contains the geometry of the problem
Channel.msh
- Gmsh generated mesh data listing mesh vertices and elements.
Folder base
Channel-Base.xml
- Nektar++ session file, generated with the $NEK/NekMesh
utility, for computing the base flow.
Folder stability/VCS
Channel-VCS.xml
- Nektar++ session file, generated with $NEK/NekMesh
, for
performing the stability analysis.
Channel-VCS.rst
- Nektar++ field file that contains a set of initial conditions
closer to the solution in order to achieve faster convergence.
Folder stability/Coupled
Channel-Coupled.xml
- Nektar++ session file, generated with
$NEK/NekMesh
, for performing the stability analysis.
Folder stability3D
PPF_R10000_3D.xml
- Nektar++ session file for performing coupled 3D
stability analysis at Re = 10000.
PPF_R15000_3D.xml
- Nektar++ session file for performing coupled 3D
stability analysis at Re = 15000.
The first step is to generate a mesh that is readable by Nektar++. The files necessary in this
section can be found in $NEKTUTORIAL/geometry/
. To achieve this task we use Gmsh in
conjunction with the Nektar++ pre-processing utility called $NEK/NekMesh
. Specifically, we
first generate the mesh in figure 1.1 using Gmsh and successively we convert it into a suitable
Nektar++ format using $NEK/NekMesh
.
Channel.msh
can be generated using Gmsh by running the following command:
gmsh -2 Channel.geo
Channel.xml
can be generated using the $NEK/NekMesh
pre-processing tool:
$NEK/NekMesh Channel.msh Channel.xml
Channel-al.xml
can be generated using the module peralign
available with the
pre-processing tool $NEK/NekMesh
:
$NEK/NekMesh -m peralign:surf1=2:surf2=3:dir=x Channel.xml
Channel-al.xml
where surf1
and surf2
correspond to the periodic physical surface IDs specified in
Gmsh (in our case the inflow has a physical ID=2 while the outflow has a physical
ID=3) and dir
is the periodicity direction (i.e. the direction normal to the inflow
and outflow boundaries - in our case x).
Examine the Channel.xml
and Channel-al.xml
files you have just created. Only the mesh
and default expansions are defined at present and the only difference between the two files is
the ordering of the edges in the section composite ID=3 which has been re-ordered in order to
apply periodic boundary conditions correctly.
$NEKTUTORIAL/stability/Coupled
.