|
rizer.cantera_ext
C++ Cantera 1-D plasma extension (custom Domain1D models and solvers)
|
Pure-arithmetic primitives for the explicit hydrodynamic sub-step of the 1D radial channel: one face's Rusanov (local Lax-Friedrichs) flux, and the cell-integrated cylindrical momentum source. More...
#include <algorithm>#include <cmath>Go to the source code of this file.
Namespaces | |
| namespace | rizer |
| namespace | rizer::numeric |
Functions | |
| double | rizer::numeric::maxWaveSpeed (double u_left, double c_left, double u_right, double c_right) |
| Rusanov dissipation coefficient at a face: the fastest wave speed that can reach it from either side, NUMERICS.md equation (9)'s \(S_{i+1/2}\). | |
| double | rizer::numeric::rusanovScalarFlux (double r_face, double phi_left, double phi_right, double u_left, double u_right, double wave_speed) |
| Rusanov face flux for any node-centred conserved scalar – \(\rho\) and each \(\rho Y_s\). | |
| double | rizer::numeric::rusanovMomentumFlux (double r_face, double rho_left, double u_left, double p_left, double rho_right, double u_right, double p_right, double wave_speed) |
| Pressure-inclusive Rusanov face flux for the radial momentum row, NUMERICS.md equation (12): | |
| double | rizer::numeric::rusanovEnergyFlux (double r_face, double E_left, double p_left, double u_left, double E_right, double p_right, double u_right, double wave_speed) |
| Pressure-inclusive Rusanov face flux for the total energy row, NUMERICS.md equation (14a) – the face flux, not (14), which is the cell update this feeds: | |
| double | rizer::numeric::faceVelocityFlux (double r_face, double u_left, double u_right) |
| Face velocity flux \(G_{i+1/2} = r_{i+1/2}\,\tfrac12(u_{r,i}+u_{r,i+1})\), whose difference gives the electron-pool compression source of NUMERICS.md equation (15). | |
| double | rizer::numeric::momentumGeometricSourceIntegral (double p, double dr) |
| Cell-integrated cylindrical momentum source, the second term of NUMERICS.md equation (13): | |
Pure-arithmetic primitives for the explicit hydrodynamic sub-step of the 1D radial channel: one face's Rusanov (local Lax-Friedrichs) flux, and the cell-integrated cylindrical momentum source.
Cantera-free and pybind-free by design, so the hydro core can be unit tested with no mechanism and no Cantera object. The split of responsibilities mirrors DiffusiveFlux.h: everything here is per-face or per-cell arithmetic, and the cell integration that divides by the cell volume is the caller's (HydroStep's) job.
The conservative system these discretize is NUMERICS.md equation (7):
\[ \frac{\partial \vec U}{\partial t} + \frac1r \frac{\partial (r \vec F)}{\partial r} = \vec S \]
with
\[ \vec U = \left[\rho,\; \rho Y_s,\; \rho u_r,\; \rho E,\; \rho_\mathrm{e} e_\mathrm{e}\right]^T, \quad \vec F = \left[\rho u_r,\; \rho Y_s u_r,\; \rho u_r^2 + p,\; u_r(\rho E + p),\; \rho_\mathrm{e} e_\mathrm{e} u_r\right]^T \]
\[ \vec S = \left[0,\; 0,\; \frac{p}{r},\; 0,\; -p_\mathrm{e}\vec\nabla\cdot\vec u\right]^T \]
with \(\rho E = \rho e_\mathrm{H} + \rho_\mathrm{e}e_\mathrm{e} + \tfrac12\rho u_r^2\). The total row carries no source, because the compression work rides inside the enthalpy its flux transports; the electron row keeps its own. The heavy pool has no row at all and is recovered as total minus kinetic minus electron, which hands it \(-p_\mathrm{H}\vec\nabla\cdot\vec u\) exactly. NUMERICS.md section 5.4 derives why carrying BOTH pools conservatively instead cannot be right.
There are THREE flux functions, not one, because neither the momentum row nor the total-energy row is a passive scalar: their face fluxes carry a pressure term, which is the physical content that makes momentum and total-energy transport different from scalar advection. The electron row and the species rows are passive scalars and use the first.
Every flux carries its own \(r_\mathrm{face}\). The geometry belongs inside the face flux, not as an afterthought correction: that is what lets the same functions run a planar case by passing \(r_\mathrm{face} \equiv 1\) (NUMERICS.md section "Full system, planar - Sod shock tube"), and what makes the axis face vanish by passing \(r_\mathrm{face} = 0\).
Definition in file EulerFlux.h.