Appearance
Initial conditions
The initial state is set by the [initial_conditions] section: type selects one of the fourteen initial conditions below, and the primitive states of the regions are given in [initial_conditions_region_N] sections. The value of every key is checked: an unknown type, a missing key or an inconsistent value stops the run with a message naming the accepted values.
type | Euler | MHD (none) | MHD (glm) | Region sections |
|---|---|---|---|---|
uniform | ✓ | ✓ | ✓ | 1 |
isentropic-vortex | ✓ | ✗ | ✗ | 1 |
riemann-problem | ✓ | ✓ | ✓ | regions_number |
shu-osher | ✓ | ✗ | ✗ | 2 |
rotated-riemann | ✓ | ✓ | ✓ | 2 |
glm-pulse, divb-peak, mhd-linear-wave, mhd-cpaw, mhd-vortex, mhd-rotor, field-loop | ✗ | ✓ | ✓ | 1 |
orszag-tang | ✗ | ✓ | ✓ | 0 |
linear (verification) | ✓ | ✓ | ✓ | 1 |
polytrope (self-gravity) | ✓ | ✗ | ✗ | 1 (the atmosphere) |
"MHD" in the error messages means [physics] physical_model = mhd-ideal. glm versus none is chosen separately by [mhd] divergence_control.
Conventions
State vectors. The conservative variables are [mhd] divergence_control = none) or
Primitive to conservative conversion is used by every initial condition and by the inflow boundary condition. MHD uses rationalised units, so no
Sources: Euler at common/adam_flume_euler_library.F90, MHD at common/adam_flume_mhd_library.F90. The MHD sums go through mhd_sum3, which sorts the three terms before adding them so that a rotated problem gives bitwise-identical results.
primitive_state_to_conservative sets q(IQ_PSI) = 0 for MODEL_MHD_GLM. Every initial condition goes through this routine, either directly or through the pre-converted region states q_region. The one exception is mhd-linear-wave, which adds its eigenvector only to components 1–8, so
Coordinates. Every initial condition is a point value at the cell centre, not a cell average: field%x_cell(i,b), y_cell(j,b), z_cell(k,b), and set_initial_conditions fills only the interior cells update_ghost call that follows.
Keys common to every type. Both are read from [initial_conditions]:
| key | type | meaning |
|---|---|---|
type | string (control characters are blanked by strip_control, so CRLF files parse) | one of the 22 names below. Any other value stops the run and the message lists all 22. |
amr_iterations | integer, required | the number of init-time AMR passes (set the IC, refine, repeat). The value is clamped to cpu/adam_flume_cpu_object.F90 and fnl/adam_flume_fnl_object.F90. When the value is 2 ngc, otherwise error_stop. |
Region sections are named [initial_conditions_region_N], with regions_number. They hold the primitive keys r, u, v, w, p, plus bx, by, bz for either MHD model. Every one of these keys is required.
| type | regions read | extent keys |
|---|---|---|
uniform, isentropic-vortex, glm-pulse, divb-peak, mhd-linear-wave, mhd-cpaw, mhd-vortex, mhd-rotor, field-loop, linear | 1 | none |
shu-osher, rotated-riemann | 2 | none (any extent keys present are ignored) |
riemann-problem | regions_number (from the INI) | emin_x, emin_y, emin_z, emax_x, emax_y, emax_z (required) |
orszag-tang | 0 | none |
uniform: seeded uniform state
Model: any. Keys: [initial_conditions] s (real, required), plus region 1.
The state of region 1 is imposed everywhere, with density and pressure perturbed by a relative amplitude
The pair hash_cell(code, i, j, k). The hash is a chained integer mix of the block Morton code and the cell indexes: xorshift steps (13, 7, 17), then a multiplication by 39083855 modulo
Validation: none on s. Setting
Test input: src/tests/flume/verification/uniform/input.ini
ini
[initial_conditions]
type = uniform
amr_iterations = 0
s = 0.0 ; relative amplitude of the seeded density/pressure perturbation
[initial_conditions_region_1]
r = 1.2
u = 10.0
v = 0.0
w = 0.0
p = 101325.0MHD with GLM, from src/tests/flume/verification/mhd/plumbing/mhd-uniform-glm.ini:
ini
[initial_conditions]
type = uniform
amr_iterations = 0
s = 0.05 ; relative amplitude of the seeded density/pressure perturbation
[initial_conditions_region_1]
r = 1.0
u = 0.3
v = -0.2
w = 0.1
p = 1.0
bx = 0.8
by = 0.5
bz = -0.3The companion file is mhd-uniform-none.ini, and src/tests/flume/regression/amr-periodic-reflux/input.ini and regression/uniform-amr-mhd/input.ini use this type too.
isentropic-vortex
Reference: Shu 1998, ICASE 97-65, §5.1, generalised to any free stream. Model: Euler only. Any other model stops the run with requires [physics].(physical_model) = euler. Keys: x0, y0, radius, strength, plus region 1 (r,u,v,w,p, the free stream). Validation: radius <= 0 stops the run.
Let strength, radius,
Here
Test input: src/tests/flume/verification/vortex/vortex-n064.ini (and -n128, -n256, regression/vortex-periodic)
ini
[initial_conditions]
type = isentropic-vortex
amr_iterations = 0
x0 = 0.5
y0 = 0.5
radius = 0.07
strength = 5.0
[initial_conditions_region_1]
r = 1.0
u = 1.0
v = 1.0
w = 0.0
p = 1.0riemann-problem: piecewise-constant axis-aligned regions
Model: any. Keys: [initial_conditions] regions_number (integer, required, must be
A cell with centre cell center (x, y, z) is covered by no [initial_conditions_region_*]. The half-open interval puts a cell centre that sits exactly on an interface into the lower region.
The null_z. The tests use emin_z = 0, emax_z = 1.
Test input (Sod along x): src/tests/flume/verification/sod/sod-x.ini
ini
[initial_conditions]
type = riemann-problem
regions_number = 2
amr_iterations = 0
[initial_conditions_region_1]
r = 1.0
u = 0.0
v = 0.0
w = 0.0
p = 1.0
emin_x = 0.0
emin_y = 0.0
emin_z = 0.0
emax_x = 0.5
emax_y = 1.0
emax_z = 1.0
[initial_conditions_region_2]
r = 0.125
u = 0.0
v = 0.0
w = 0.0
p = 0.1
emin_x = 0.5
emin_y = 0.0
emin_z = 0.0
emax_x = 1.0
emax_y = 1.0
emax_z = 1.0MHD (Brio-Wu): src/tests/flume/regression/brio-wu/input.ini
ini
[initial_conditions]
type = riemann-problem
regions_number = 2
amr_iterations = 0
[initial_conditions_region_1]
r = 1.0
u = 0.0
v = 0.0
w = 0.0
p = 1.0
emin_x = 0.0
emin_y = 0.0
emin_z = 0.0
emax_x = 0.5
emax_y = 1.0
emax_z = 1.0
bx = 0.75
by = 1.0
bz = 0.0
[initial_conditions_region_2]
r = 0.125
u = 0.0
v = 0.0
w = 0.0
p = 0.1
emin_x = 0.5
emin_y = 0.0
emin_z = 0.0
emax_x = 1.0
emax_y = 1.0
emax_z = 1.0
bx = 0.75
by = -1.0
bz = 0.0Other inputs that use this type: sod-{y,z}.ini, sod-wall-{x,y,z}.ini, regression/rj2a-{x,y,z}, regression/sod-{x,y,z}, and the multi-realm *-r1.ini/*-r2.ini files.
shu-osher: shock and density-wave interaction
Reference: Shu & Osher 1989, J. Comput. Phys. 83, example 8. Model: Euler only. Any other model stops the run with requires [physics].(physical_model) = euler. Keys: axis, interface, rho_amplitude, rho_wavenumber, plus regions 1 and 2, without extents. Validation: rho_amplitude must be smaller than the density of [initial_conditions_region_2].
Let axis:
The phase is
Test input: the RV-3 shu-osher leg of src/tests/flume/verification/riemann-flux/check.sh (function set_shu_osher) rewrites verification/sod/sod-{x,y,z}.ini, for example:
ini
[initial_conditions]
axis = x
interface = -4.0
rho_amplitude = 0.2
rho_wavenumber = 5.0
type = shu-osher
regions_number = 2
amr_iterations = 0
[initial_conditions_region_1]
r = 3.857143
u = 2.629369
v = 0.0
w = 0.0
p = 10.33333
emin_x = 0.0
emin_y = 0.0
emin_z = 0.0
emax_x = 0.5
emax_y = 1.0
emax_z = 1.0
[initial_conditions_region_2]
r = 1.0
u = 0.0
v = 0.0
w = 0.0
p = 1.0
emin_x = 0.5
emin_y = 0.0
emin_z = 0.0
emax_x = 1.0
emax_y = 1.0
emax_z = 1.0regions_number and the emin_*/emax_* keys are left over from the Sod input and are ignored for this type.
glm-pulse: Gaussian pulse in one field component
Reference: the GLM d'Alembert test (issue #41, MV-3). Model: MHD (mhd-ideal, with or without GLM). Euler stops the run with requires [physics].(physical_model) = mhd-ideal. Keys: pulse_axis, pulse_center, pulse_width, pulse_amplitude, plus region 1 (8 keys). Validation: pulse_width <= 0 stops the run. No check stops a pulse along a null axis.
With
All other primitives are those of region 1, and
Test input: src/tests/flume/regression/glm-pulse/input.ini
ini
[initial_conditions]
type = glm-pulse
amr_iterations = 0
pulse_axis = x
pulse_center = 0.5
pulse_width = 0.1
pulse_amplitude = 0.1
[initial_conditions_region_1]
r = 1.0
u = 0.0
v = 0.0
w = 0.0
p = 1.0
bx = 0.0
by = 0.0
bz = 0.0(The verification variant is generated by src/tests/flume/verification/mhd/glm-pulse/make_glm_pulse.py.)
divb-peak: Dedner et al. peak in
Reference: after Dedner et al. 2002, §5.1 (issue #41, MV-10); the support convention of peak_radius (a radius here) is being checked against the paper. Model: MHD. Keys: peak_x0, peak_y0, peak_radius, peak_amplitude, plus region 1. Validation: peak_radius <= 0 stops the run.
With
Test input: generated by src/tests/flume/verification/mhd/divb-peak/make_divb_peak.py, for example:
ini
[initial_conditions]
type = divb-peak
amr_iterations = 1
peak_x0 = 0.0
peak_y0 = 0.0
peak_radius = 0.125
peak_amplitude = 0.28209479177387814
[initial_conditions_region_1]
r = 1.0
u = 1.0
v = 1.0
w = 0.0
p = 6.0
bx = 0.0
by = 0.0
bz = 0.28209479177387814mhd-linear-wave: small-amplitude MHD eigenmode
Reference: Stone et al. 2008, ApJS 178, §8.2 (issue #41, MV-5). The eigenvector normalisation is that of Stone et al. 2008, appendix B. Model: MHD. Keys: wave, wave_angle (degrees, in the x-y plane), wave_amplitude, wavelength, plus region 1, which is the background wavelength <= 0 stops the run.
The background is rotated into the wave frame, mhd_eigenvectors, d = 1; tangents are cyclic, so
wave | column | eigenvalue |
|---|---|---|
fast | 7 | |
alfven | 6 | |
slow | 5 | |
entropy | 4 |
The momentum and field components of
The perturbation is added to the conservative vector, and
Test input: generated by src/tests/flume/verification/mhd/linear-wave/make_linear_wave.py, for example:
ini
[initial_conditions]
type = mhd-linear-wave
amr_iterations = 0
wave = alfven
wave_angle = 0.0
wave_amplitude = 1.0e-7
wavelength = 1.0
[initial_conditions_region_1]
r = 1.0
u = 0.0
v = 0.0
w = 0.0
p = 0.6
bx = 1.0
by = 1.4142135623730951
bz = 0.5mhd-cpaw: circularly polarised Alfvén wave
Reference: Tóth 2000, J. Comput. Phys. 161 (issue #41, MV-6). This is an exact nonlinear solution of any amplitude. Model: MHD. Keys: polarisation (right gives left gives wave_angle, wave_amplitude, wavelength, b_par, plus region 1. Validation: wavelength <= 0 is fatal and b_par == 0 is fatal. Region 1 must have u = v = w = bx = by = bz = 0, otherwise the run stops. Only
With wave_angle,
Test input: generated by src/tests/flume/verification/mhd/cpaw/make_cpaw.py, for example:
ini
[initial_conditions]
type = mhd-cpaw
amr_iterations = 0
polarisation = left
b_par = 1.0
wave_angle = 63.43494882292201
wave_amplitude = 0.1
wavelength = 1.0
[initial_conditions_region_1]
r = 1.0
u = 0.0
v = 0.0
w = 0.0
p = 0.1
bx = 0.0
by = 0.0
bz = 0.0mhd-vortex: magnetised vortex
Reference: Balsara 2004, ApJS 151 (issue #41, MV-7). Model: MHD. Keys: x0, y0, radius, kappa, mu, plus region 1 (the free stream). Validation: radius <= 0 is fatal. Region 1 must have bx = by = 0, otherwise error_stop with the message "an equilibrium only without an in-plane free-stream field". bz is kept.
With
The field is divergence-free pointwise, and the vortex is an exact steady equilibrium convected by the free stream.
Test input: generated by src/tests/flume/verification/mhd/vortex/make_mhd_vortex.py, for example:
ini
[initial_conditions]
type = mhd-vortex
amr_iterations = 0
x0 = 0.0
y0 = 0.0
radius = 1.0
kappa = 1.0
mu = 1.0
[initial_conditions_region_1]
r = 1.0
u = 1.0
v = 1.0
w = 0.0
p = 1.0
bx = 0.0
by = 0.0
bz = 0.0orszag-tang
Reference: Stone et al. 2008, §8.4 (issue #41, MV-12). Model: MHD. Keys: none beyond type and amr_iterations. regions_number = 0, so no region section is read. The unit period is assumed: the domain is not checked against
With
These equal the textbook
Test input: src/tests/flume/regression/orszag-tang/input.ini
ini
[initial_conditions]
type = orszag-tang
amr_iterations = 0mhd-rotor
Reference: Balsara & Spicer 1999 and Tóth 2000, first rotor (issue #41, MV-13). Model: MHD. Keys: x0, y0, r0, r1, rho_in, v0, plus region 1 (ambient). Validation: the run stops unless needs 0 < r0 < r1, and stops if
With
Pressure,
Test input: src/tests/flume/regression/rotor/input.ini
ini
[initial_conditions]
type = mhd-rotor
amr_iterations = 0
x0 = 0.5
y0 = 0.5
r0 = 0.1
r1 = 0.115
rho_in = 10.0
v0 = 2.0
[initial_conditions_region_1]
r = 1.0
u = 0.0
v = 0.0
w = 0.0
p = 1.0
bx = 1.4104739588693909
by = 0.0
bz = 0.0field-loop: advected field loop
Reference: Gardiner & Stone 2005; Mignone & Tzeferacos 2010, §4.4.1 (issue #41, MV-9). Model: MHD. Keys: x0, y0, loop_radius, loop_amplitude. The centre keys are plain x0/y0, not loop_x0. Region 1 is also required. Validation: loop_radius <= 0 is fatal.
The field comes from the vector potential
The centre cell itself (
Test input: src/tests/flume/regression/field-loop/input.ini
ini
[initial_conditions]
type = field-loop
amr_iterations = 0
x0 = 0.0
y0 = 0.0
loop_radius = 0.3
loop_amplitude = 1.0e-3
[initial_conditions_region_1]
r = 1.0
u = 2.0
v = 1.0
w = 1.0
p = 1.0
bx = 0.0
by = 0.0
bz = 0.0rotated-riemann: 1-D Riemann problem rotated in x-y, periodic along its normal
Reference: Tóth 2000, J. Comput. Phys. 161, §6.3.2 (issue #41, MV-8). Model: any. It is not restricted to MHD; for Euler only u, v are rotated. Keys: normal_x, normal_y, interface_1, interface_2, period, interface_2_width, plus regions 1 and 2. The region states are given in the frame of the normal: u and bx are the normal components, v and by the tangential ones, w and bz lie along
normal_x = normal_y = 0is fatal;period <= 0is fatal;- the run stops unless
, and .
Rotation to x, y. With
Region assignment. Let
With
Test input: src/tests/flume/regression/rotated-shock-tube/input.ini
ini
[initial_conditions]
type = rotated-riemann
amr_iterations = 0
normal_x = 1.0
normal_y = 2.0
interface_1 = 0.25390625
interface_2 = 0.50390625
interface_2_width = 0.4
period = 1.0
[initial_conditions_region_1]
r = 1.0
u = 10.0
v = 0.0
w = 0.0
p = 20.0
bx = 1.4104739588693909
by = 1.4104739588693909
bz = 0.0
[initial_conditions_region_2]
r = 1.0
u = -10.0
v = 0.0
w = 0.0
p = 1.0
bx = 1.4104739588693909
by = 1.4104739588693909
bz = 0.0linear: a linear field (verification)
Every conservative variable is linear in space,
where [initial_conditions_region_1] and gradient_x, gradient_y, gradient_z) a relative gradient (inverse length; the [reference] layer scales it by
It is not a flow. It is the field on which every ghost fill FLUME uses is exact: the same-level copy, the 2:1 restriction (the mean of the fine cells) and the tricubic coarse-to-fine fill reproduce a linear field to round-off, and every boundary condition maps it to a known value. The ghost probe GP (verification, verification/ghosts/) runs it for one negligible step (CFL = 1e-30) and checks every face and edge ghost against that value. The state is admissible only while
ini
[initial_conditions]
type = linear
gradient_x = 0.05
gradient_y = 0.11
gradient_z = 0.07
amr_iterations = 1
[initial_conditions_region_1]
r = 1.0
u = 0.3
v = -0.2
w = 0.1
p = 1.0polynomial: a polynomial field (verification)
The linear field raised to a per-direction degree degree (an integer, at least 1; linear):
The keys are those of linear plus degree, all required. The copies and every boundary condition still map it to a known value (they copy cells), but each seam operator reproduces it only up to its degree: the mean restriction and the restriction-compatible fill lagrange6 restriction and the quintic fill --degree N runs it, so the probe checks the high-order seam operators in situ: their footprints, shifts and every exchange path. [reference] layer does not convert: a reference with polynomial is fatal.
sine-wave: a small sine wave on a uniform state (verification)
A sine of amplitude [initial_conditions_region_1] (
wave_mode | Perturbation | wave_amplitude |
|---|---|---|
shear | a velocity | |
acoustic | relative | |
entropy | relative | |
magnetic (MHD) | a field | |
jeans (self-gravity) | relative |
Keys: wave_mode (shear, acoustic, entropy, magnetic or jeans, other → fatal; magnetic needs mhd-ideal, jeans needs [gravity] self_gravity), wave_angle wave_amplitude wavelength > 0). The values are point values at the cell centres. It is the initial state of the viscous verifications VV-1 (shear-wave decay) and VV-2 (viscous-thermal acoustic attenuation) (verification) and of the Ohmic ones VV-5 and VV-6 (verification); the wave is periodic in a box whose sides are multiples of
ini
[initial_conditions]
type = sine-wave
amr_iterations = 0
wave_mode = shear
wave_angle = 45.0
wave_amplitude = 1.0e-4
wavelength = 0.7071067811865476couette: exact compressible Couette flow (verification)
The steady compressible Couette flow with constant [initial_conditions_region_1] p; the other region keys are read and ignored), and, with
It is an exact solution of the compressible Navier–Stokes equations, so a run started from it keeps it as its exact solution at every time, and any departure is the error of the scheme (VV-3, with the walls wall-isothermal at wall-noslip with wall_u = U at wall_y0, height (wall_velocity (wall_temperature (
becker-shock: Becker's exact viscous shock (verification)
Becker's (1922) steady shock along x, in the shock frame: constant viscosity and Prandtl number 3/4 ([physics] prandtl = 0.75, fatal otherwise), for which the total enthalpy
solved by bisection in each cell ([initial_conditions_region_1] moving at mach (shock_x0. Pair it with an inflow of the upstream state at bc_x_min and extrapolation at bc_x_max. It is the initial state of VV-4: like couette, an exact steady solution, so the error needs no relaxation run and no fit of the shock position.
isothermal-atmosphere, polytropic-atmosphere: hydrostatic equilibria under gravity
The hydrostatic equilibrium of the constant gravity [gravity] (required, fatal otherwise), with the state of [initial_conditions_region_1] at the origin (#73, M7-G0):
with the region's velocity and field uniform. polytropic_gamma pulse_amplitude, pulse_x, pulse_y, pulse_z, pulse_width; M7-G2b). Close them with hydrostatic faces along [gravity] equilibrium = atmosphere the atmosphere at rest is an exact discrete steady state (verification).
ini
[initial_conditions]
type = polytropic-atmosphere
amr_iterations = 1
polytropic_gamma = 1.2rayleigh-taylor: two isothermal layers, heavy over light
A heavy cold layer over a light hot one under the gravity of [gravity], which must lie along one axis (M7-G3). With the height
and the pressure is hydrostatic in closed form,
rt_height rt_width rt_density_ratio rt_wavelength rt_amplitude rt_seed_width verification/gravity/rt_oracle.py computes from the same profile (GV-4, verification); [gravity] equilibrium = atmosphere keeps the unseeded layers.
ini
[initial_conditions]
type = rayleigh-taylor
amr_iterations = 1
rt_height = 0.5
rt_width = 0.05
rt_density_ratio = 2.0
rt_wavelength = 0.5
rt_amplitude = 1.0e-5
rt_seed_width = 0.1polytrope: an n = 1 polytrope star (self-gravity)
A self-gravitating star in equilibrium (#81, M8-P4; Euler, [gravity] self_gravity required). The n = 1 polytrope,
- inside,
: , ; - outside: the atmosphere isothermal at
and hydrostatic in the star's field, , . A uniform atmosphere would fall onto the star and thin at its surface.
Density and pressure are continuous at the surface. star_pressure_factor star_radius star_density star_x0, star_y0, star_z0 (the centre, default 0), star_pressure_factor (default 1, [gravity] poisson_bc = isolated the star sits in a box without its periodic images (SV-7, SV-8, verification). A light atmosphere ([numerics] positivity_limiter = cell at the surface.
ini
[gravity]
self_gravity = .true.
G = 1.0
poisson_bc = isolated
[initial_conditions]
type = polytrope
amr_iterations = 0
star_radius = 0.5
star_density = 1.0
star_pressure_factor = 1.0
[initial_conditions_region_1]
r = 1.0e-4
u = 0.0
v = 0.0
w = 0.0
p = 1.5915494309189535e-05