To set up the problem we have three steps. The first is setting up a mesh as discussed in section 2.1. The second one is setting the expansion bases as explained in section 2.2. We also need to configure the problem initial conditions, boundary conditions and parameters which are discussed in 2.3.
The first pre-processing step consists in generating the mesh in a Nektar + + compatible format. One option to do this is to use the open-source mesh-generator Gmesh to first create the geometry. The mesh format provided by Gmesh is not consistent with the Nektar + + solvers and, therefore, it needs to be converted. An example of how to do this can be found in the Advection Solver Tutorial.
For two-dimensional simulations, the mesh definition contains 6 tags encapsulated within
the GEOMETRY
tag. The first tag, VERTEX
, contains the spatial coordinates of the
vertices of the various elements of the mesh. The second tag, EDGE
contains the lines
connecting the vertices. The third tag, ELEMENT
, defines the elements (note that in this
case we have only quadrilateral - e.g. <Q ID="85">
- elements). The fourth tag,
CURVED
, is used to describe the control points for the curve. Note this tag is only
necessary if curved edges or faces are present in the mesh and may otherwise be
obmitted. The fifth tag, COMPOSITE
, is constituted by the physical regions of the mesh
called composite, where the composites formed by elements represent the solution
sub-domains - i.e. the mesh sub-domains where we want to solve our set of equations (note
that we will use these composites to define expansion bases on each sub-domain
in section 2.3) - while the composites formed by edges are the boundaries of the
domain where we need to apply suitable boundary conditions (note that we will use
these composites to specify the boundary conditions in section 2.3). Finally, the
sixth tag, DOMAIN
, formally specifies the overall solution domain as the union of the
composites forming the solution subdomains (note that the specification of different
subdomain - i.e. composites - in this case is not necessary since they are constituted
by same element shapes). For additional details on the GEOMETRY
tag refer to the
User-Guide.
GEOMETRY
tag with the EXPANSIONS
definition and the CONDITIONS
section in the same .xml file. However, the mesh can be a
separate input .xml format containing only the geometry definition. Also, note that this mesh
is in uncompressed format. In order to reduce the size of a large mesh compressed format
should be used.
We need to specify the expansion bases we want to use in each of the composites or
sub-domains (COMPOSITE=".."
) introduced in section 2.1:
For this case there is only one composite, COMPOSITE="C[0]"
, where NUMMODES
is the number
of coefficients we want to use for the basis functions (that is commonly equal to
P+1 where P is the polynomial order of the basis functions), TYPE
allows selecting
the basis functions, FIELDS
is the solution variable of our problem and COMPOSITE
are the mesh regions. For additional details on the EXPANSIONS
tag refer to the
User-Guide.
An example of dealiasing technique on for quadrilateral elements:
We will now proceed to set up the various problem parameters, the solver settings, initial and boundary conditions.
Parameters
The case will be run at Mach number equal to M∞ = 0.2, Reynolds number ReL=1 = 200 and Pr = 0.72, with the pressure set to p∞ = 101325 Pa and the density equal to ρ = 1.225 Kg∕m3. The cylinder is defined as an isothermal wall with imposed temperature Twall = 300.15 K.
Within PARAMETERS
tag, we can can also define the final physical time of the simulation,
FinTime
, the number of steps NumSteps
, the step-interval when an output file is written
IO_CheckSteps
and the step-interval when information about the simulation is printed to the
screen IO_InfoSteps
.
PARAMETERS
, define all the flow parameters as
described above. These are declared as Mach, Re, Pr, pinf, rhoinf and Twall. Define
the number of steps NumSteps as the ratio of the FinalTime to the time-step
TimeStep.
Solver Settings
We now declare how the flow will be solved. We want to include the effects of fluid viscosity and heat conduction and consequently the equation type we are going to use is the Navier-Stokes equations.
Projection
to
DisContinuous
, as Continuous Projection is not supported in the Compressible Flow
Solver.
We must specify the advection type which will be the classical DG in weak form. Note Nektar + + also presents the FRDG scheme, which recovers the DG scheme with exact mass matrix, the FRHU scheme, which recovers the DG scheme with lumped mass matrix and the FRSD scheme, which recovers a spectral difference scheme. We must also define the diffusion operator we want to use, which will be local Discontinuous Galerkin and the time integration method which will be the Classical Runge Kutta of order 4.
SOLVERINFO
, define all the solver parameters as
described above. These are declared as EQType, Projection, AdvectionType, DiffusionType,
TimeIntegrationMethod, UpwindType, ViscosityType.
Variables
In the VARIABLES
tag we set the solution variable. For the 2D case we have:
Note again the weak enforcement of the boundary conditions. The BCs are applied to the fluxes rather than to the non conservative variables of the problem. For further understanding, please check A guide to the Implementation of the Boundary Conditions.
Boundary Conditions
The BOUNDARYREGIONS
tag specifies the regions where to apply the boundary conditions.
The next tag is BOUNDARYCONDITIONS
by which the boundary conditions are actually specified
for each boundary ID specified in the BOUNDARYREGIONS
tag. The boundary conditions have
been set as explained in section 1.3
The initial conditions have been set as explained in section 1.3.
In order to stabilise the flow in the presence of flow discontinuities we utilise a shock capturing technique which makes use of artificial viscosity to damp oscillations in the solution, in conjunction with a discontinuity sensor to decide where the addition of artificial viscosity is needed.
ShockCaptureType
option in SOLVERINFO
tag and set it to NonSmooth
.
Skappa
, Kappa
and mu0
in the PARAMETERS
tag. mu0
is the
maximum value for the viscosity, Kappa
is half of the width of the transition interval
and SKappa
is value of the centre of the interval.
The viscosity varies from 0 to the maximum values as the sensor goes from Skappa-Kappa to SKappa+Kappa.
Skappa
=-1.3; kappa
=0.2; mu0
=1.0.