Appearance
Physical models
FLUME solves hyperbolic conservation laws of compressible, inviscid flow in the form
with nv and selects, on the host, the compute kernels compiled for that width (no branching on the model inside a kernel).
| Model | [physics] physical_model | [mhd] divergence_control | nv | |
|---|---|---|---|---|
| Compressible Euler | euler | — | 5 | |
| Ideal MHD with mixed GLM cleaning | mhd-ideal | glm | 9 | |
| Ideal MHD with EGLM cleaning ( | mhd-ideal | eglm | as GLM | 9 |
| Ideal MHD without divergence control | mhd-ideal | none | the first 8 of the above | 8 |
All models use a calorically perfect ideal gas and are inviscid by default. Viscosity, heat conduction and Ohmic resistivity are milestone M4 (#65), each given as a coefficient or as its number (input): with a viscosity or a conductivity each model is its compressible Navier–Stokes form, and mhd-ideal with a resistivity is resistive MHD (Ohm's law
Thermodynamics
The gas is defined by the specific heats at constant pressure and volume, [physics] cp, cv (J/(kg K)), or by their ratio alone, [physics] gamma, with the gas constant then 1 (code units):
Air, the value of most inputs, is cp = 1040.004, cv = 742.86 (
Compressible Euler
The flux along direction
Eigensystem
The characteristic decomposition used by the WENO schemes is written once for every direction: the tangents are taken cyclically,
| 1 | |||
| 2 | |||
| 3 | |||
| 4 | |||
| 5 |
evaluated at the Roe average of the two cells adjacent to the face (test_flume_euler_library checks
Ideal MHD
In code units the magnetic permeability is absorbed into the field,
The flux of
Wave speeds. Along
FLUME evaluates the discriminant as
Eigensystem. The 7×7 core is the Roe–Balsara-normalised eigensystem of Stone et al. (2008, ApJS 178, appendix B), evaluated at the arithmetic average of the two face states (a physical state, so the Roe-matrix factors are test_flume_mhd_library checks the eigensystem, including the degenerate states.
Divergence control: mixed GLM
The induction equation preserves divergence_control = glm FLUME uses the mixed hyperbolic–parabolic cleaning of Dedner et al. (2002): a ninth variable
so the
with glm_alpha glm_damping_length min-cell for the minimum cell spacing of the realm, as Mignone & Tzeferacos 2010; with runtime regridding the spacing of the finest level allowed, so that the damping rate does not change with the grid). glm_ch) is constant and uniform, and it bounds the time step (below). glm_ch_check warns or stops when the fastest wave
The weno-riemann (Dedner et al. 2002, eq. 42):
divergence_control = none drops glm.
Divergence control: EGLM
In the mixed GLM divergence_control = eglm selects the ideal GLM-MHD of Derigs et al. (2018, eqs. 3.16–3.18), with
the
in the order weno-riemann the
Positivity floors
[mhd] rho_floor, p_floor (both
External gravity
A constant gravitational acceleration [gravity], input; milestone M7, #73) adds sources to both models, with the potential
- Momentum:
at the cell centre. - Energy: from the scheme's own mass fluxes
, never from at the centre (Mikami et al. 2008, Mullen et al. 2021): . A face's weights sum to one over the cells it touches, so changes only by boundary fluxes, to round-off; the fourth-order weights make the source the cell value of to fourth order (the face form is second order on a finite-difference scheme, whose fluxes are point values of the primitive function of ). At a reflecting wall the invariant is , the sum plus an term of the wall rows (verification). It takes one more ghost layer, ngc >= S + 1. - Positivity limiter: the backbone carries the time-centred energy
, which leaves its internal energy unchanged, and the high-order excess of the source is limited with the fluxes. - Time step: no bound of its own; the regime
is printed at the first step. - Boundary:
hydrostaticfaces continue the isothermal equilibrium of the boundary cell into the ghosts. - Well-balanced mode (
[gravity] equilibrium = atmosphere): the residual of the initial atmosphere at rest, computed with the run's own operator once per grid, is subtracted from every residual (the deviation method of Edelmann et al. 2021, §4.3). The atmosphere is then an exact discrete steady state, and the scheme evolves the deviation from it; without it a stratified atmosphere at rest drives a stationary flow of the truncation error's size (verification). - Through a cell potential (
[gravity] potential = linear, M8-P1, #81): the same field as the cell potential, applied by the path self-gravity uses. The face gravity is , the cell gravity the mean of its two faces; the momentum gains times the cell gravity, the energy . That is the face form, second order, and is conserved without a wall term. The hydrostatic ghosts take the potential drop, and the limiter the face and cell gravity. A test of that path (SV-1); refused with the well-balanced mode.
The equilibria FLUME builds are the isothermal-atmosphere, polytropic-atmosphere and rayleigh-taylor initial conditions (initial conditions).
Self-gravity
[gravity] self_gravity (#81, M8-P3) adds the gravity of the gas itself:
with the mean density removed on a periodic domain (the Jeans swindle), or poisson_bc = isolated, M8-P4). The discretisation is that of Mullen et al. (2021):
What is conserved, and why. The solvers are linear and symmetric,
The coupling is second order in space whatever the WENO order. A linear Jeans mode obeys
On AMR grids (M8-P5b; isolated boundaries: #87, below),
Both sides of the seam see the same face gravity,
It rides on the reflux. Every stage adds to the flux register's energy entry:
- the coarse side: its own seam source, taken back;
- the fine side: the exact two-point work less the fine cell's own source.
The end-of-step correction then gives the coarse cell exactly the missing work. The semi-discrete
The fully discrete exchange is first order in
- with the seam work:
, , at CFL 0.4, 0.2, 0.1; - without it:
at every CFL, a spatial leak.
[numerics] reflux_cadence = stage (P5c) restores the Runge–Kutta order: every stage corrects the coarse cells' residual from that stage's fluxes, and the drift falls at third order in
Under runtime AMR (P5c) every regrid sets the solver up on the new grid and solves
Isolated boundaries on AMR (#87) use a symmetric form of James's method. With
symmetric because
Units and scaling
The equations above carry no dimensionless number. Take three references, a density
| Quantity | Reference |
|---|---|
| time | |
| pressure, energy density | |
| magnetic field ( | |
| GLM speed | |
| temperature |
Dividing every variable by its reference, every term of the Euler and MHD systems, the GLM and EGLM terms and the GLM damping
What the invariance does not remove:
- The parameters move into the data. The Mach number, the Alfvén Mach number and the plasma
live in the initial and boundary states; one reference speed can set only one of the flow, sound and Alfvén speeds to 1. - The temperature needs
, and later a reference temperature, once conduction, cooling or a temperature-dependent resistivity exist. - Gravity is not free: an external field brings
( [gravity], milestone M7, #73, above), self-gravity(M8, #81); the dissipative terms of M4 bring the Reynolds, Prandtl, magnetic Reynolds and Lundquist numbers, each accepted in place of its coefficient (input). - The discrete scheme must be scale-free too. FLUME's is, apart from the classic WENO weights: their absolute
stops the limiting at small magnitudes (numerics). With [weno] weights = sia run whose input is scaled by powers of two (lengths, velocities, density) equals the base run bit for bit (the scaling oracle, NV-4); the admissibility floor of the positivity limiter and the immersed-boundary cut spacing are relative.
FLUME uses the invariance in two ways. An input in physical units can carry a [reference] section: the values are divided by their references once, on the loaded file, and the solver runs on numbers of order 1, whatever the weights; output_units = dimensional writes the results back in the input units. Or the input runs as it is with weights = si. On Sod at an interstellar density both match the code-units run to
Time-step bound
The time step is the minimum over the realm of
with [time] CFL). With GLM the cleaning waves add the bound
Derived output fields
With [IO] save_auxiliary_fields = .true. the checkpoints also hold pt beta, the field magnitude bmag and the discrete divergence divb. Their exact definitions are on the input reference page.
References
- Dedner A. et al. (2002), Hyperbolic divergence cleaning for the MHD equations, J. Comput. Phys. 175, 645–673.
- Edelmann P. V. F. et al. (2021), Well-balanced treatment of gravity in astrophysical fluid dynamics simulations at low Mach numbers, Astron. Astrophys. 652, A53, doi:10.1051/0004-6361/202140653.
- Goedbloed J. P., Poedts S. (2004), Principles of Magnetohydrodynamics, Cambridge University Press.
- Derigs D. et al. (2018), Ideal GLM-MHD: about the entropy consistent nine-wave magnetic field divergence diminishing ideal MHD equations, J. Comput. Phys. 364, 420–467.
- Mignone A., Tzeferacos P. (2010), A second-order unsplit Godunov scheme for cell-centered MHD: the CTU-GLM scheme, J. Comput. Phys. 229, 2117–2138.
- Mikami H., Sato Y., Matsumoto T., Hanawa T. (2008), Astrophys. J. 683, 357, doi:10.1086/589759.
- Mullen P. D., Hanawa T., Gammie C. F. (2021), An extension of the Athena++ framework for fully conservative self-gravitating hydrodynamics, Astrophys. J. Suppl. 252, 30, doi:10.3847/1538-4365/abcfbd.
- Stone J. M. et al. (2008), Athena: a new code for astrophysical MHD, ApJS 178, 137–177.
- Toro E. F. (2009), Riemann Solvers and Numerical Methods for Fluid Dynamics, 3rd ed., Springer.