Primitive-Variable Recovery
Scrollable formula. Use Left and Right arrow keys to reveal hidden content.
Scrollable table. Use Left and Right arrow keys to reveal additional columns.
Scrollable figure. Use Left and Right arrow keys to inspect hidden content.
Relativistic finite-volume schemes update conserved variables but need density, pressure, velocity, and magnetic fields to reconstruct fluxes. Recovering these primitives is a nonlinear inversion that can become ill-conditioned at high Lorentz factor, high magnetization, low internal energy, or near EOS boundaries. A robust implementation distinguishes valid difficult states from conserved states that no physical primitive can produce, reports fallbacks and repairs, and validates round trips across the intended parameter domain.
Helpful background. Formulations of General Relativity supplies the spacetime split, Ordinary Differential Equations supplies nonlinear root solving, Relativistic Matter and Compact Objects supplies EOS and material regimes, Computational Relativity supplies evidence standards, and Fluid and Kinetic Theory supplies fluid variables and physical admissibility.
The inverse map
Section titled “The inverse map”In pure hydrodynamics, conserved variables , , and are nonlinear functions of , internal energy , pressure , and velocity. In GRMHD, magnetic terms couple to the Lorentz factor and enthalpy. Many algorithms introduce
and reduce the inversion to one or two scalar equations for , , pressure, or temperature, using the EOS at each iteration. Other schemes solve a higher-dimensional system. The implementation must state its unknowns, residual scaling, brackets, stopping condition, derivative evaluation, maximum iterations, and fallback chain.
Noble et al. 2006, §§3–5 and §5.1, Tables 2–3 compares several GRMHD inversions over millions of trial states. Its success rates depend on the sampled distribution and EOS; they are not universal guarantees.
A scalar hydrodynamic recovery
Section titled “A scalar hydrodynamic recovery”For a nonmagnetic -law gas, use undensitized as defined on Conservative Relativistic Hydrodynamics. If the code stores times these fields, divide by first. With , a trial pressure determines
Using and reduces the inverse problem to
Only evaluate it where and ; those inequalities define an admissible search region, not by themselves a root bracket. Establish a sign-changing bracket before a safeguarded solve. Once is known, and . For the forward-test state and , inserting gives , , , and .
In ideal MHD, with Eulerian and absorbed, the forward map instead contains
Here . Setting recovers hydrodynamics; setting gives . The latter limit exposes a fundamental loss of information. With , , and , storing in binary64 and subtracting gives approximately : a relative thermal error before any nonlinear solve. A smaller solver tolerance cannot restore discarded digits. Kastaun et al. 2021, §§II.3 and V.2–V.3 separates recovery accuracy from this amplification of errors in the evolved state.
Physical admissibility before iteration
Section titled “Physical admissibility before iteration”Require , , , , and subluminal velocity, plus EOS-domain and causality restrictions. Magnetized conserved variables obey additional inequalities. Screen obviously invalid inputs separately from solver nonconvergence. Silently flooring an invalid state and counting it as a successful recovery hides a failure of the evolution update.
Use analytic or rigorous brackets where possible. Newton iteration is fast near a root but can leave the physical domain; safeguarded Newton or Brent steps preserve a bracket. Scale residuals relative to the conserved magnitudes, and check both nonlinear residual and primitive change. Kastaun et al. 2021, §II including §II.H and §§III–V, Figures 3–5 develops robust recovery with explicit admissibility and error controls.
After convergence, reconstruct conserved variables from the recovered primitives using an independently coded forward map. Define a normalized round-trip error for every component. A small root residual can coexist with a forward mismatch when EOS derivatives, metric lowering, or magnetic contractions are inconsistent.
Stress-test the intended domain
Section titled “Stress-test the intended domain”Construct a reproducible sample spanning log density and temperature, Lorentz factor, magnetization, field–velocity angle, metric condition, and EOS regions. Include boundary cases deliberately but report the sampling measure; a uniform grid in one parametrization can nearly omit the difficult regime. Separate valid samples from injected invalid conserved states.
For each method report success fraction, iterations, forward residual, primitive error against known inputs, fallback rate, repair magnitude, and timing. Refine nonlinear tolerance and working precision. Compare at least two independent algorithms, such as a bracketed one-dimensional method and a multidimensional Newton solve. The benchmark suite should include shock-tube states, TOV surfaces, magnetized torus cells, and atmosphere interfaces.
During an evolution, output where and when recovery fails. Spatial clustering often identifies a surface, refinement boundary, or unphysical update. Global failure counts alone hide repeated repairs in a scientifically important ejecta region. The validity claim is restricted to the sampled EOS, magnetization, Lorentz factor, and metric range.
Specified round-trip benchmark
Section titled “Specified round-trip benchmark”Use flat spacetime and a ideal-gas EOS, and . Let
At sample levels , use equally spaced points in each of and . Cross them with magnetizations and field–velocity cosines . Here is the comoving magnetic four-vector, , and is absorbed into the magnetic field. Choose and an Eulerian in the – plane; set its magnitude from . The parameter box is the complete algebraic domain, so there is no spatial boundary condition. Its EOS limits and the physical conditions , , and are the state-space boundaries.
Generate each conserved state with an independently coded binary128 forward map, retain the generating primitives as the reference, and recover with both binary64 and binary128 arithmetic at nonlinear tolerances . For every valid state add one negative control by replacing with while retaining the other conserved components; it must be classified invalid before iteration.
At there is no velocity direction, and at there is no magnetic direction. Treat the angular labels as redundant in those cases, use the axis only as an arbitrary reference, and count each distinct state once in success fractions. Density is reported relative to one fixed reference density so its logarithmic sampling coordinate is dimensionless.
Define the primitive error by
and let be the maximum conserved-variable round-trip difference, componentwise normalized by . Preserve two references: the original high-precision primitives, and a high-precision recovery of the same rounded input supplied to the binary64 solver. The first measures input-rounding plus recovery error; the second isolates recovery error. Screen the rounded state again for physical admissibility because rounding can move a boundary state outside the physical domain.
For the , tolerance- study, require all deliberately negative- controls to be rejected and every repair to be reported. Require for unrepaired recoveries. Apply the primitive target only to the subset for which perturbing each input by its rounding uncertainty, then recovering at high precision, changes the primitives by at most in the same norm. On the remaining cold, highly boosted, or magnetically dominated states, report the attainable componentwise accuracy and compare it with that conditioning estimate; explicitly flag a requested accuracy that the input cannot support. Escalating recovery arithmetic alone does not repair an already rounded conservative state. Tightening the sample grid, input precision, and nonlinear tolerance independently must distinguish new failure classes from these information limits.
Observed discrepancy: not available—specification only.
Environment and failure criteria
Section titled “Environment and failure criteria”Pin variable definitions, EOS implementation and version, metric convention, algorithm and brackets, tolerances, derivatives, precision, fallback order, floors and repair policy, sample seed and distribution, and code revision. A clean interface could be primitive-test --config extreme-states.toml --output run/, emitting inputs, recovered states, round-trip residuals, iteration traces, classifications, failure maps, sweeps, and environment metadata. This specifies a rerun record rather than claiming software is supplied.
Reject a method if it returns superluminal or EOS-invalid states, labels repaired inputs as converged, lacks tolerance convergence, or fails a forward round trip. Other failure modes include cancellation in thermal energy, an EOS derivative on the wrong branch, loss of a root bracket, magnetic contractions formed with the wrong metric, and a fallback that changes total mass or energy without recording it.
Diagnostic
Section titled “Diagnostic”A Newton solve reaches a residual of and returns positive pressure, but reconstructing conserved energy differs from the input by . A bracketed fallback gives a larger root residual, , but a round-trip error. Which solution is supported?
Solution
The bracketed result is supported. The Newton residual pertains to its implemented scalar equation, which may use an inconsistent EOS derivative or contraction; the independent forward map rejects it. Verify residual scaling and the forward implementation, tighten the fallback tolerance if needed, and require physicality plus round-trip agreement, not the smallest internal residual alone.
References
Section titled “References”- Kastaun, W., Kalinani, J. V., and Ciolfi, R. (2021). “Robust recovery of primitive variables in relativistic ideal magnetohydrodynamics.” Physical Review D 103, 023018. arXiv.
- Noble, S. C., Gammie, C. F., McKinney, J. C., and Del Zanna, L. (2006). “Primitive variable solvers for conservative general relativistic magnetohydrodynamics.” Astrophysical Journal 641, 626–637. arXiv.