Documentation of the main branch
These pages follow Mallard's main branch, which is ahead of release 0.8.0: some features they describe come with the next release.
Governing equations¶
Mallard solves the compressible Euler or Navier-Stokes equations in conservative form, for a single calorically perfect gas or for a thermally perfect mixture of \(N_s\) species, in planar 2D, 3D or axisymmetric (r-z) geometry. This chapter states the equations and the constitutive laws of a single gas; the thermodynamics and transport of mixtures are in chapter 2, the chemical source terms in chapter 3, and the filtered equations of large-eddy simulation in chapter 4. Usage: Physics.
Conservation laws¶
With \(\mathbf{x}\in\mathbb{R}^d\) (\(d = 2\) or 3), Mallard advances the conservative variables
where the partial densities \(\rho Y_k\) are present for mixtures only
([physics] gas = "mixture"). All \(N_s\) species are transported, besides
\(\rho\); the discretization keeps \(\sum_k \rho Y_k = \rho\)
(chapter 6). The equations are
or, in compact form,
\(E = e + \tfrac12\lvert\mathbf{u}\rvert^2\) is the specific total energy. For mixtures \(e\) includes the enthalpies of formation of the species, so heat release appears as a change of composition at constant \(\rho E\) and the energy equation has no chemical source. The source \(\mathbf{S}\) collects the momentum and energy sources \(\mathbf{s}_u\), \(s_E\) of gravity, mass-flow forcing, user expressions, sponge layers and radiation, and the production rates \(\dot\omega_k\) (chapter 8, chapter 3).
With [physics] type = "euler" (the default) the viscous flux
\(\mathbf{F}^v\) is dropped; type = "navier_stokes" keeps it.
Single gas¶
Equation of state¶
A single gas is calorically perfect:
The input gives \(\gamma\) and a reference state \((p_\mathrm{ref}, T_\mathrm{ref}, \rho_\mathrm{ref})\),
from which \(R = p_\mathrm{ref}/(\rho_\mathrm{ref} T_\mathrm{ref})\) (src/physics/physics.cpp).
Nothing is nondimensionalized internally: inputs in SI units give results in
SI units, and a nondimensional reference state (for example
\(p_\mathrm{ref} = 1/\gamma\), \(\rho_\mathrm{ref} = T_\mathrm{ref} = 1\)) gives a
nondimensional solver. Pressure follows from the conservative variables as
\(p = (\gamma - 1)\left(\rho E - \tfrac12\rho\lvert\mathbf{u}\rvert^2\right)\).
Viscous stress and heat flux¶
The fluid is Newtonian with Stokes' hypothesis (no bulk viscosity), and heat conduction follows Fourier's law with a constant Prandtl number:
with \(Pr\) = Pr (default 0.72). The dynamic viscosity is one of
(viscosity_model, src/physics/physics.h)
with \(\mu_\mathrm{ref}\) = mu, \(T_\mu\) = T_mu_ref (default 273.15 K for
Sutherland's law, required for the power law), \(S\) = sutherland_S
(default 110.4 K, air; Sutherland 1893)
and \(n\) = viscosity_exponent. The viscous flux of eq. \(\eqref{eq:conservation-laws-3}\) is
For a single gas there are no species fluxes. For mixtures, \(\mu\), \(\lambda\) and the diffusive mass fluxes \(\mathbf{j}_k\) come from the transport model of chapter 2, and the heat flux also carries the enthalpy of the diffusing species, \(\mathbf{q} = -\lambda\nabla T + \sum_k h_k\mathbf{j}_k\).
Axisymmetric flows¶
With [physics] axisymmetric = true (2D builds) the mesh is the meridian
half-plane of a flow symmetric about the \(x\) axis without swirl: \(x\) is the
axial coordinate and \(y = r \ge 0\) the radius, and \(\mathbf{u} = (u_x, u_r)\).
Mallard integrates eq. \(\eqref{eq:conservation-laws-3}\) over the solid of revolution of each cell, per
radian. With \(\mathrm{d}A\) and \(\mathrm{d}l\) the planar area and length
elements,
where the only geometric source acts on the radial momentum:
The stress tensor in the face fluxes uses the same three-dimensional divergence, including the hoop term \(u_r/r\) (on the axis, its limit \(\partial u_r/\partial r\)). In this area-weighted form mass, axial momentum, energy and species have no source and are conserved exactly in the revolved geometry, faces on the axis have zero revolved area, and a gas at rest at uniform pressure is an exact discrete steady state, because \(\oint p\,n_r\,r\,\mathrm{d}l = \int_\Omega p\,\mathrm{d}A\) for uniform \(p\). The cell unknowns are r-weighted averages \(\overline{\mathbf{U}} = \int_\Omega \mathbf{U}\,r\,\mathrm{d}A \big/ \int_\Omega r\,\mathrm{d}A\); the discretization is in chapter 5 and the design in Axisymmetric flows. All integral outputs (forces, integrals, conserved totals) are per radian.