Theory and Background¶
HONEE solves the time-dependent Navier-Stokes equations of compressible gas dynamics in a static Eulerian three-dimensional frame using unstructured high-order finite/spectral element spatial discretizations and explicit or implicit high-order time-stepping (available in PETSc). Moreover, HONEE has been developed using PETSc, so that the pointwise physics (defined at quadrature points) is separated from the parallelization and meshing concerns.
Boundary Conditions¶
Below we detail the natural BC types for Newtonian. Natural BCs are applied by replacing the normal flux in the boundary integral with a specific \(\bm{h}\) flux:
Below, we specify what \(\bm{h}\) is equal to.
Consistency Integral¶
The most basic natural BC type is the consistency integral. This simply evaluates the flux in (4) based on the interior solution at the boundary:
where \(\bm{q}^\mathrm{int}\) is the solution state at the boundary.
The consistency natural BC type is not meant to be used on its own, but in conjunction with some kind of essential boundary condition, such as Synthetic Turbulence Generation (STG).
It is specified by -bc_{name}_natural_type consistent and has no other options.
Riemann Solvers¶
In HONEE, we use Riemann solvers at to determine the flux to apply at natural boundary conditions. We give a brief introduction to them below.
Riemann solvers are methods to approximately solve the Riemann problem. The Riemann problem asks what is the inviscid flux normal to a boundary between fluids at two different constant states. We refer to the two different states at the interior and exterior state, respectively. The solution to the Riemann problem can be expressed as:
where \(\bm{F}^{\mathrm{Riemann}}\) is the flux, \(\bm{Y}^{\mathrm{int}}\) is the interior state (given in primitive variables), and \(\bm{Y}^{\mathrm{ext}}\) is the exterior state.
In HONEE, we use Riemann solvers at to determine the flux to apply at natural boundary conditions. As such, \(\bm{Y}^{\mathrm{int}}\) is nearly always the solution at the boundary of the domain, while \(\bm{Y}^{\mathrm{ext}}\) is some other state, often specified by the user. The advantage of using Riemann solvers is that they allow acoustic waves to exit the domain cleanly and are generally stable to recirculation.
Freestream¶
The freestream natural type uses a Riemann solver at the boundary for far-field boundaries with known exterior state and is set by -bc_{name}_natural_type freestream:
It can handle local inflow and outflow dynamically and is the least acoustically reflective natural BC type.
The Riemann solver finds the flux at the boundary based on the state on the interior of the domain (at the boundary) and a user-set exterior state.
The exterior primitive state \(\bm{Y}^\mathrm{ext} = (P^\mathrm{ext}, \bm{u}^\mathrm{ext}, T^\mathrm{ext})\) is set by-bc_{name}_freestream_pressure, -bc_{name}_freestream_velocity, and -bc_{name}_freestream_temperature.
Option |
Description |
Default value |
Unit |
|---|---|---|---|
|
Riemann solver used for freestream boundary flux ( |
|
|
|
Pressure at freestream condition |
|
|
|
Velocity at freestream condition, array of size 3 |
|
|
|
Temperature at freestream condition |
|
|
Outflow¶
The outflow natural type has two different modes for use with predominantly-outflow boundaries
It is set by -bc_{name}_natural_type outflow.
The first mode is -bc_{name}_outflow_type pressure, which applies the consistency integral, but forcing the pressure to a user-set value.
where \(P^\mathrm{ext}\) is the user-set value.
This has the effect of weakly enforcing a pressure at the boundary.
The pressure outflow requires that the flow have no recirculation at the boundary or the problem becomes unstable.
Additionally, the pressure outflow is very acoustically reflective.
These limitations motivate the second mode.
The second mode is -bc_{name}_outflow_type riemann, which uses a Riemann solver at the outflow to define the inviscid flux and adds in viscous fluxes at the boundary:
where the diffusive flux is defined in (4).
This is similar to freestream, but differs in 2 key ways.
First, the exterior state uses the interior velocity, which allows the boundary condition to handle significant velocity changes of the interior solution (a common feature at simulation outflows).
Second, we add in the diffusive (viscous) flux.
This makes the riemann outflow more consistent in viscous-dominated regions such as near no-slip walls.
This combination of features allows the riemann flux to be applied at boundaries near viscous-dominate boundaries, handle unknown velocity profiles, allow acoustic waves to exit the domain, and be resilient to recirculation.
As such, we generally recommend riemann over pressure: pressure variant is retained to facilitate comparison with other codes.
For riemann outflow, the velocity set in the exterior state can be modified to only allow some amount of recirculation in the exterior state.
That modification is given as \(\Delta u_n = (1-r)\,\mathrm{Softplus}(-u_n, u_s)\), where \(r\) is set by -bc_{name}_outflow_recirc, and \(u_s\) is set by -bc_{name}_outflow_softplus_velocity.
The intention is to penalize recirculation, but it has not shown much benefit and often makes the simulation more unstable.
Option |
Description |
Default value |
Unit |
|---|---|---|---|
|
Outflow model selection ( |
|
|
|
Pressure at outflow condition |
|
|
|
Temperature at outflow condition (Riemann outflow only) |
|
|
|
Fraction of recirculation allowed in exterior velocity state, \(r \in [0,1]\) (Riemann outflow only) |
|
|
|
Characteristic velocity scale (Riemann outflow only) |
|
|
Slip¶
A slip natural type uses a Riemann function to weakly impose no-penetration, while allowing acoustic waves to exit the domain cleanly.
To do this, slip sets the exterior state identical to the interior state, but reflects the velocity vector normal to the boundary:
where \(\bm{u}^\mathrm{ext} = u_i^{int} - 2 n_i u_j^\mathrm{int} n_j\).
It is set by -bc_{name}_natural_type slip and has no other options.
Periodicity¶
PETSc provides two ways to specify periodicity:
Isoperiodicity, in which the donor and receiver dofs are distinct in local vectors. To use isoperiodicity with a PETSc-built box mesh, use the
zboxshape, as in:
dm_plex:
shape: zbox
box_faces: 10,12,4
box_bd: none,none,periodic
Isoperiodicity enables standard boundary integrals, and is fully supported periodicity method.
The zbox method uses Z-ordering to construct the mesh in parallel and provide an adequate initial partition, which makes it higher performance and avoids needing a partitioning package.
Topological periodicity, in which the donor and receiver dofs are the same, obtained using:
dm_plex:
shape: box
box_faces: 10,12,4
box_bd: none,none,periodic
The coordinates for such cases are stored as a new field with special cell-based indexing to enable wrapping through the boundary. This choice of coordinates prevents evaluating boundary integrals that cross the periodicity, such as for the outflow Riemann problem in the presence of spanwise periodicity.
Synthetic Turbulence Generation (STG)¶
We use the STG method described in [SSST14]. Below follows a re-description of the formulation to match the present notation, and then a description of the implementation and usage.
Equation Formulation¶
Here, we define the number of wavemodes \(N\), set of random numbers \( \{\bm{\sigma}^n, \bm{d}^n, \phi^n\}_{n=1}^N\), the Cholesky decomposition of the Reynolds stress tensor \(\bm{C}\) (such that \(\bm{R} = \bm{CC}^T\) ), bulk velocity \(U_0\), wavemode amplitude \(q^n\), wavemode frequency \(\kappa^n\), and \(\kappa_{\min} = 0.5 \min_{\bm{x}} (\kappa_e)\).
where \(l_t\) is the turbulence length scale, and \(d_w\) is the distance to the nearest wall.
The set of wavemode frequencies is defined by a geometric distribution:
The wavemode amplitudes \(q^n\) are defined by a model energy spectrum \(E(\kappa)\):
\(\kappa_\eta\) represents turbulent dissipation frequency, and is given as \(2\pi (\nu^3/\varepsilon)^{-1/4}\) with \(\nu\) the kinematic viscosity and \(\varepsilon\) the turbulent dissipation. \(\kappa_\mathrm{cut}\) approximates the effective cutoff frequency of the mesh (viewing the mesh as a filter on solution over \(\Omega\)) and is given by:
The enforcement of the boundary condition is identical to the blasius inflow; it weakly enforces velocity, with the option of weakly enforcing either density or temperature using the -weakT flag.
Initialization Data Flow¶
Data flow for initializing function (which creates the context data struct) is given below:
flowchart LR
subgraph STGInflow.dat
y
lt[l_t]
eps
Rij[R_ij]
ubar
end
subgraph STGRand.dat
rand[RN Set];
end
subgraph User Input
u0[U0];
end
subgraph init[Create Context Function]
ke[k_e]
N;
end
lt --Calc-->ke --Calc-->kn
y --Calc-->ke
subgraph context[Context Data]
yC[y]
randC[RN Set]
Cij[C_ij]
u0 --Copy--> u0C[U0]
kn[k^n];
ubarC[ubar]
ltC[l_t]
epsC[eps]
end
ubar --Copy--> ubarC;
y --Copy--> yC;
lt --Copy--> ltC;
eps --Copy--> epsC;
rand --Copy--> randC;
rand --> N --Calc--> kn;
Rij --Calc--> Cij[C_ij]
This is done once at runtime. The spatially-varying terms are then evaluated at each quadrature point on-the-fly, either by interpolation (for \(l_t\), \(\varepsilon\), \(C_{ij}\), and \(\overline{\bm u}\)) or by calculation (for \(q^n\)).
The STGInflow.dat file is a table of values at given distances from the wall.
These values are then interpolated to a physical location (node or quadrature point). It has the following format:
[Total number of locations] 14
[d_w] [u_1] [u_2] [u_3] [R_11] [R_22] [R_33] [R_12] [R_13] [R_23] [sclr_1] [sclr_2] [l_t] [eps]
where each [ ] item is a number in scientific notation (ie. 3.1415E0), and sclr_1 and sclr_2 are reserved for turbulence modeling variables.
They are not used in this example.
The STGRand.dat file is the table of the random number set, \(\{\bm{\sigma}^n, \bm{d}^n, \phi^n\}_{n=1}^N\).
It has the format:
[Number of wavemodes] 7
[d_1] [d_2] [d_3] [phi] [sigma_1] [sigma_2] [sigma_3]
The following table is presented to help clarify the dimensionality of the numerous terms in the STG formulation.
Math |
Label |
\(f(\bm{x})\)? |
\(f(n)\)? |
|---|---|---|---|
\( \{\bm{\sigma}^n, \bm{d}^n, \phi^n\}_{n=1}^N\) |
RN Set |
No |
Yes |
\(\bm{\overline{u}}\) |
ubar |
Yes |
No |
\(U_0\) |
U0 |
No |
No |
\(l_t\) |
l_t |
Yes |
No |
\(\varepsilon\) |
eps |
Yes |
No |
\(\bm{R}\) |
R_ij |
Yes |
No |
\(\bm{C}\) |
C_ij |
Yes |
No |
\(q^n\) |
q^n |
Yes |
Yes |
\(\{\kappa^n\}_{n=1}^N\) |
k^n |
No |
Yes |
\(h_i\) |
h_i |
Yes |
No |
\(d_w\) |
d_w |
Yes |
No |
Runtime Options¶
To use the STG boundary condition, the -bc_inflow option should be set to the boundary faces that need the inflow (see Boundary Conditions and above).
The -stg_use flag is then used to enable/disable applying STG to those faces.
Option |
Description |
Default value |
Unit |
|---|---|---|---|
|
Enable STG for |
|
|
|
Path to the STGInflow file |
|
|
|
Path to the STGRand file |
|
|
|
Growth rate of the wavemodes |
|
|
|
Convective velocity, \(U_0\) |
|
|
|
Only impose the mean velocity (no fluctutations) |
|
|
|
Strongly enforce the STG inflow boundary condition |
|
|
|
“Extrude” the fluctuations through the domain as an initial condition |
|
|
|
Set the element size in the x direction. Default is calculated for box meshes, assuming equispaced elements. |
|
|
|
Scale element size for cutoff frequency calculation |
\(1/p\) |
Internal Damping Layer (IDL)¶
Note
IDL is not a boundary condition, but it’s primary application is for use with STG.
The STG inflow boundary condition creates large amplitude acoustic waves. We use an internal damping layer (IDL) to damp them out without disrupting the synthetic structures developing into natural turbulent structures. This implementation was inspired by [SSST14], but is implemented here as a ramped volumetric forcing term, similar to a sponge layer (see 8.4.2.4 in [Col23] for example). It takes the following form:
where \(\bm{Y}' = [P - P_\mathrm{ref}, \bm{0}, 0]^T\), and \(\sigma(\bm{x})\) is a linear ramp starting at -idl_start with length -idl_length and an amplitude of inverse -idl_decay_rate.
The damping is defined in terms of a pressure-primitive anomaly \(\bm Y'\) converted to conservative source using \(\partial \bm{q}/\partial \bm{Y}\rvert_{\bm{q}}\), which is linearized about the current flow state.
\(P_\mathrm{ref}\) has a default value equal to -reference_pressure flag, with an optional flag -idl_pressure to set it to a different value.
Option |
Description |
Default value |
Unit |
|---|---|---|---|
|
Characteristic timescale of the pressure deviance decay. The timestep is good starting point |
|
|
|
Start of IDL in the x direction |
|
|
|
Length of IDL in the positive x direction |
|
|
|
Pressure used for IDL reference pressure |
|
|