Euler Equations
EulerEquation{D, M, T, R} implements the compressible Euler equations for an ideal gas in $D$ dimensions, with conservative variables $U = (\rho, \rho\vec u, E)$ and $M = D + 2$:
\[\begin{aligned} \partial_t \rho + \nabla\cdot(\rho\vec u) &= 0,\\ \partial_t (\rho\vec u) + \nabla\cdot(\rho\vec u\otimes\vec u + p I) &= 0,\\ \partial_t E + \nabla\cdot\big(\vec u\,(E + p)\big) &= 0, \end{aligned} \qquad E = \frac{p}{\gamma - 1} + \frac{1}{2}\rho\lVert\vec u\rVert^2 .\]
In a configuration: :PDE_name => :euler, :PDE_D => D, :PDE_gamma => 1.4. Initial states are given as conservative variables.
Implementation
Construction.
EulerEquation(Val(D), T, gamma, rep)setsM = D + 2.repis the representation tag (defaultConservative()).Variables.
prim2consmaps $(\rho, \vec u, p) \mapsto (\rho, \rho\vec u, E)$.cons2primis its inverse and floors density and pressure at $10^{-7}$.Flux. Defined for the
Conservativerepresentation.Wave speed.
max_eigenvaluereturns $|u_d| + c$ with $c = \sqrt{\gamma p / \rho}$, using a $10^{-9}$ floor on density and pressure. ForConservativeit expects conservative variables; for anNCRepresentationit expects primitive variables.Admissibility.
is_admissibleaccepts finite conservative states with positive density and pressure. MOOD flags every candidate that fails it, whatever its criterion says (HyperCloudCore's PAD).Moving grids.
fluid_velocityreturns $\vec u$, so the Lagrangian movers work.
Exact solution: 1D Riemann problem
For Riemann initial data in 1D the closure computes the exact solution (e.g. for the Sod shock tube):
- Star pressure. $p^*$ is found with Newton's method on the pressure function, using a finite-difference derivative and the tolerance $|f(p^*)| < 10^{-9}$. This gives $u^*$.
- Wave types. Each outer wave is a shock if $p^* > p_{L/R}$, otherwise a rarefaction.
- Evaluation. At a point $(x, t)$ the closure selects the region by the similarity variable $(x - x_0)/t$: outer state, rarefaction fan, star state left or right of the contact. It returns conservative variables.
If the normal points in $-x$, the problem is solved in the mirrored frame, so both orientations of the same data give the same solution. Vacuum generation is not handled: $p^*$ is floored at $10^{-9}$.
API
HyperCloud.EulerEquation — Type
EulerEquation{D, M, T, R} <: HyperbolicPDE{D, M, T}Implements the compressible Euler equations for ideal gases.
Fields
gamma::T: The specific heat ratio of the gas.rep::R: The equation representation (e.g.,ConservativeorNCRepresentation).
Constructors
EulerEquation(::Val{D}, ::Type{T}, gamma::T = T(1.4), rep::R = Conservative()): Automatically configures the system for spatial dimensionDand sets the state vector length toM = D + 2.
HyperCloudCore.is_admissible — Method
Admissible conservative Euler state (MOOD PAD): finite, positive density and pressure.