Ideal-gas thermodynamic contracts
Inviscid flux paths repeatedly convert between static enthalpy, total
enthalpy, internal energy and sound speed. For chemModel == 0 these are
closed-form ideal-gas relations and are pure.
Formulas
Static enthalpy:
\[h = \frac{\gamma}{\gamma-1}\frac{p}{\rho}\]
Specific total internal energy (used by PrimToQ):
\[e = \frac{p}{\rho(\gamma-1)} + \tfrac{1}{2}|\mathbf{v}|^2\]
Sound speed from pressure:
\[c = \sqrt{\gamma p / \rho}\]
Relation to total enthalpy:
\[H = h + \tfrac{1}{2}|\mathbf{v}|^2
= e + \frac{p}{\rho}\]
Pipeline role
primitives (rho, v, p)
|
+--> IdealGasStaticEnthalpy -> hint
+--> TotalEnthalpy(hint, |v|^2) -> H
+--> IdealGasSpecificInternalEnergy -> e (PrimToQ)
+--> IdealGasSoundSpeedFromPressure -> c (Mach, AUSM, Van Leer)
Pure APIs in NsInvFluxPolicy.h. Tests: inv_flux_policy_test.
Conservative variables (5-eq)
\[\mathbf{q} = \big(\rho,\;\rho u,\;\rho v,\;\rho w,\;\rho e\big),
\quad
e = \frac{p}{\rho(\gamma-1)} + \tfrac{1}{2}|\mathbf{v}|^2\]
Face Mach number:
\[M = v_n^{\mathrm{rel}} / c\]
PrimToQ uses IdealGasPrimToConservative for the five core equations;
extra species equations remain rho * prim[i] in the caller.
Bilateral face sound speeds (AUSM-family)
\[c_L = \sqrt{\gamma_L p_L/\rho_L},\quad
c_R = \sqrt{\gamma_R p_R/\rho_R},\quad
c_{\mathrm{avg}} = \tfrac12(c_L+c_R)\]
Some schemes replace \(c_{\mathrm{avg}}\) with \(\max(c_L,c_R)\).