compressible_flow
The dream.compressible_flow module provides a high-order HDG/DG solver for the
compressible Navier-Stokes equations. It covers everything from equation-of-state and viscosity
models through Riemann solvers and non-reflecting boundary conditions to a wide selection of
implicit, explicit, and IMEX time integration schemes.
Note
We currently only support two-dimensional domains.
Solver Architecture
CompressibleFlowSolver is configured by composing
interchangeable sub-objects for the finite element method, equation of state, viscosity model,
non-dimensionalisation scaling, and Riemann solver. As with all dream solvers, solver.time
selects the outer solution loop and solver.fem.scheme selects the numerical time integration
scheme.
Compressible flow equations
The fundamental equations describing the motion of an unsteady, viscous and compressible flow in a space-time cylinder \(\Omega \times (0, t_{end}] \in \mathbb{R}^{d+1}\) with non-empty bounded \(d\)-dimensional spatial domain \(\Omega\), with boundary \(\partial \Omega\), and final time \(t_{end}\), are specified by the Navier-Stokes equations. In terms of conservative variables, \(\vec{U} = \begin{pmatrix} \rho, & \rho \vec{u}, & \rho E \end{pmatrix}^\T\), with density \(\rho\), velocity \(\vec{u}\), and total specific energy \(E\), this system can be expressed in dimensionless form as
In a general form the convective \(\vec{F}\) and the viscous fluxes \(\vec{G}\) are given by
where \(p\) denotes the pressure, \(H = E + p/\rho\) the specific enthalpy, \(\mat{\tau}\) the deviatoric stress tensor, and \(\vec{q}\) the heat flux vector.
To close the system of equations we need to specify the equation of state (see eos) and the constitutive relations for the deviatoric stress tensor \(\mat{\tau}\) and the heat flux vector \(\vec{q}\) (see viscosity).
Quasi-linear Euler equations
The hyperbolic nature of the Navier-Stokes equations with respect to time lies in the Euler equations [3]
which are derived by neglecting the viscous contributions. From a characteristic point of view, it is essential to express these equations in quasi-linear form
where the \(\mat{A}_i\) are the directional convective Jacobians.
Flow Configuration
Before selecting a discretisation, the physical model is configured by setting the equation of state, viscosity model, non-dimensionalisation scaling, Mach number, and Riemann solver.
Equation of State
The equation of state closes the system by relating pressure, density, and temperature. The only currently supported option is the ideal gas law:
cfg.equation_of_state = 'ideal'
cfg.equation_of_state.heat_capacity_ratio = 1.4
Class |
Key |
Description |
|---|---|---|
|
Ideal gas: \(p = (\gamma-1)\,\rho E_i\), |
Viscosity
The viscosity model controls the deviatoric stress tensor \(\mat{\tau}\) and heat flux \(\vec{q}\):
cfg.dynamic_viscosity = 'inviscid' # Euler equations (no viscosity)
cfg.dynamic_viscosity = 'constant' # constant dynamic viscosity
cfg.dynamic_viscosity = 'sutherland' # temperature-dependent viscosity
Class |
Key |
Description |
|---|---|---|
|
\(\mat{\tau} = 0\), \(\vec{q} = 0\) — Euler equations |
|
|
Constant dynamic viscosity \(\mu\) |
|
|
Sutherland’s law: \(\mu \propto T^{3/2}/(T + S)\) |
Non-Dimensionalisation Scaling
The scaling determines how the reference state \((\rho_\infty, c_\infty, p_\infty, T_\infty)\) is constructed from the Mach number. It affects all non-dimensional quantities used by the solver.
cfg.scaling = 'acoustic' # acoustic: rho_inf=1, c_inf=1, p_inf=1/gamma
cfg.scaling = 'aerodynamic' # aerodynamic: rho_inf=1, u_inf=1, p_inf=1/(gamma*M^2)
cfg.scaling = 'aeroacoustic' # combined aerodynamic/acoustic scaling
cfg.mach_number = 0.03
Class |
Key |
Characteristic velocity |
|---|---|---|
|
\(u_\mathrm{ref} = c_\infty\) |
|
|
\(u_\mathrm{ref} = u_\infty\) |
|
|
\(u_\mathrm{ref} = \sqrt{u_\infty c_\infty}\) |
Riemann Solver
The Riemann solver defines the convective numerical flux at element interfaces and boundary faces. It affects both accuracy and stability:
cfg.riemann_solver = 'lax_friedrich'
Class |
Key |
Notes |
|---|---|---|
|
Simple, robust; adds maximum-speed dissipation |
|
|
Characteristic upwinding |
|
|
Roe-averaged flux; accurate but no entropy fix |
|
|
Two-wave HLL flux |
|
|
HLL with entropy-fix correction |
Discretisation
The solver discretises the compressible Navier-Stokes equations on a mesh \(\mesh\) using either
the Hybridised Discontinuous Galerkin (HDG) method (ConservativeHDG)
or the standard Discontinuous Galerkin (DG) method
(ConservativeDG).
HDG introduces an additional skeleton unknown \(\widehat{\vec{U}}_h\) living on the mesh
facets \(\facets\). The local element problems are solved independently for each element \(K \in
\mesh\) given \(\widehat{\vec{U}}_h\), and then a global system is assembled solely in terms of the
skeleton degrees of freedom. This static condensation makes HDG particularly efficient for
high-order discretisations since the global system is much smaller than the full DG system. The
viscous terms are handled by the viscous_treatment sub-object of
ConservativeHDG: the default
StrainHeat formulation uses the
physical strain-rate and heat-flux form; Gradient
and InteriorPenaltyHDG are
available as alternatives.
DG keeps all degrees of freedom element-local with no additional skeleton unknowns. It is
straightforward to use with explicit time integrators, at the cost of a
larger globally coupled system for implicit schemes. The viscous treatment for DG is
InteriorPenaltySDG.
In both formulations the convective numerical flux at element interfaces is determined by the
selected RiemannSolver. The available
options range from the simple LaxFriedrich
solver to the more accurate
Upwind,
Roe,
HLL, and
HLLEM solvers.
Boundary Conditions
Boundary conditions are assigned to named mesh boundaries via the solver’s bcs
(BoundaryConditions) attribute. The following condition types are
available:
Class |
Description |
|---|---|
Characteristic inflow/outflow; |
|
Pressure outflow: prescribe static pressure \(p\) |
|
Inflow: prescribe \((\rho, \mathbf{u})\) |
|
Slip wall: zero normal velocity |
|
Symmetry plane |
|
No-slip wall with fixed temperature |
|
No-slip wall with zero heat flux |
|
Non-reflecting BC; |
|
IMEX coupling: solution fields |
Initial and Domain Conditions
Domain conditions are assigned via the solver’s dcs
(DomainConditions) attribute and apply over named mesh regions
rather than boundaries. For transient simulations the initial state is mandatory:
Uinf = solver.get_farfield_fields((1, 0))
solver.dcs['domain'] = Initial(fields=Uinf)
The fields object passed to Initial must be a flowfields
instance, typically obtained via
get_farfield_fields()
for a uniform free-stream state, or assembled manually from density, velocity, and pressure (or
temperature) using flowfields(rho=..., u=..., p=...).
Class |
Description |
|---|---|
Initial state \(\mathbf{U}(\cdot,0)\) projected onto the solution space; |
|
Body force term added to the momentum equation |
|
|
Superimposed perturbation field |
Volumetric damping term that drives the solution toward a |
|
Polynomial sponge layer: same damping as |
|
Mesh deformation mapping defined by |
Time Integration
The outer solution loop is selected via solver.time and the numerical time integration
scheme via solver.fem.scheme
(see the time module for the full time infrastructure).
Implicit schemes (unconditionally stable — recommended for viscous or diffusion-dominated problems and large time steps):
Scheme |
Stages |
Order |
Key |
|---|---|---|---|
1 |
1 |
|
|
1 |
2 |
|
|
1 |
3 |
|
|
2 |
2 |
|
|
3 |
3 |
|
|
4 |
3 |
|
|
5 |
4 |
|
|
4 |
3 (WSO 3) |
|
|
3 |
4 |
|
Explicit schemes (require CFL condition — suitable for inviscid or convection-dominated problems):
Scheme |
Stages |
Order |
Key |
|---|---|---|---|
1 |
1 |
|
|
2 |
2 |
|
|
2 |
2 |
|
|
3 |
3 |
|
|
4 |
3 |
|
|
3 |
3 |
|
|
4 |
4 |
|
IMEX schemes (geometry splitting — two submeshes \(\mesh^{im} \cup \mesh^{ex}\)):
The implicit HDG solver runs on \(\mesh^{im}\) and the explicit DG solver on \(\mesh^{ex}\). Each solver uses its own scheme, but the stage times must be synchronised: \(c_i^{im} = \bar{c}_{i+1}^{ex}\). The ARS-family schemes are designed for exactly this pairing:
Order |
Implicit scheme |
Explicit scheme |
|---|---|---|
2 |
|
|
2 |
|
|
3 |
|
|
3 |
|
|
API Reference
Compressible flow solver configuration |
|
Definitions of conservative methods |
|
Definitions of equation of states for compressible flow. |
|
Definitions of Riemann solvers for compressible flow. |
|
Definitions of viscous constitutive relations for compressible flow |
|
Definitions of dimensionless compressible flow equations. |
|
Definitions of boundary/domain conditions for compressible flow |