Skip to content

adam_flume_mhd_iso_library ​

ADAM, FLUME pointwise isothermal MHD physics and Riemann solvers shared by the CPU and FNL backends (issue #100, M13 P5).

Every routine is pure, takes explicit-size dummies and is tagged !$acc routine seq + !$omp declare target. The public interface repeats, routine by routine, the one adam_flume_mhd_library and adam_flume_mhd_riemann_library give the MHD kernels and objects without divergence control and with the mixed GLM (EGLM is refused for these gases). Isothermal gas, p = c0^2 rho, a = c0: the energy slot is inert (D-M13-1), and the EOS argument named gamma carries c0^2. The body (adam_flume_mhd_iso_library_body.INC) documents the eigensystem (Kim et al. 1999) and the HLLD solver (Mignone 2007).

Source: src/app/flume/common/adam_flume_mhd_iso_library.F90

Dependencies

Contents ​

Variables ​

NameTypeAttributesDescription
EPS_BTreal(kind=R8P)parameterDegenerate transverse field: |B_t| <= EPS_BT max(|B|, sqrt(rho) a).
EPS_FSreal(kind=R8P)parameterDegenerate fast-slow pair (triple umbilic): c_f^2 - c_s^2 <= EPS_FS c_f^2.
EPS_HLLDreal(kind=R8P)parameterDegenerate HLLD star: rho* |(S-S*_L)(S-S*_R)| <= EPS_HLLD (rho (S-u)^2 + B_n^2).

Subroutines ​

mhd_conservative_to_auxiliary ​

Compute the auxiliary variables of a cell: qa(IA_P) = P(rho), qa(IA_A) = sqrt(dP/drho), qa(IA_H) the total pressure over the density (no enthalpy without an energy equation), the field copied into qa(IA_BX:IA_BZ).

Attributes: pure

fortran
subroutine mhd_conservative_to_auxiliary(gamma, R, q, qa)

Arguments

NameTypeIntentAttributesDescription
gammareal(kind=R8P)inEOS parameter.
Rreal(kind=R8P)inGas constant.
qreal(kind=R8P)inConservative variables.
qareal(kind=R8P)outAuxiliary variables.

Call graph

mhd_eigenvalues ​

Compute the eigenvalues in direction d: (u_n - c_f, u_n - c_a, u_n - c_s, u_n + c_s, u_n + c_a, u_n + c_f, 0, 0), the last two of the inert energy slot and of the decoupled B_n.

Attributes: pure

fortran
subroutine mhd_eigenvalues(d, qa, lambda)

Arguments

NameTypeIntentAttributesDescription
dinteger(kind=I4P)inDirection, 1=x, 2=y, 3=z.
qareal(kind=R8P)inAuxiliary variables.
lambdareal(kind=R8P)outEigenvalues.

Call graph

mhd_eigenvectors ​

Compute the left (rows) and right (columns) eigenvectors in direction d at state qa: the 6x6 core of Kim et al. on (rho, rho u_n, rho u_t1, rho u_t2, B_t1, B_t2), the inert energy slot and the decoupled B_n (unit rows).

Attributes: pure

fortran
subroutine mhd_eigenvectors(gamma, d, qa, el, er)

Arguments

NameTypeIntentAttributesDescription
gammareal(kind=R8P)inEOS parameter (unused: the core reads qa(IA_A)).
dinteger(kind=I4P)inDirection, 1=x, 2=y, 3=z.
qareal(kind=R8P)inAuxiliary variables (e.g. a face average).
elreal(kind=R8P)outLeft eigenvectors, el(k,:) = l_k.
erreal(kind=R8P)outRight eigenvectors, er(:,k) = r_k.

Call graph

mhd_face_average ​

Compute the arithmetic average of two states for the face eigenvectors: density, velocity and field averaged, the pressure and the speed of sound of the averaged density (a physical state, so its eigensystem is exact).

Attributes: pure

fortran
subroutine mhd_face_average(gamma, qaL, qaR, avg)

Arguments

NameTypeIntentAttributesDescription
gammareal(kind=R8P)inEOS parameter.
qaLreal(kind=R8P)inLeft state auxiliary variables.
qaRreal(kind=R8P)inRight state auxiliary variables.
avgreal(kind=R8P)outAverage state auxiliary variables.

Call graph

mhd_face_flux_back_projection ​

Return the face flux in conservative variables from the reconstructed split fields, F = R (f+ + f-).

Attributes: pure

fortran
subroutine mhd_face_flux_back_projection(is_characteristic, er, vr, flux)

Arguments

NameTypeIntentAttributesDescription
is_characteristiclogicalinReconstruction variables: characteristic or conservative.
erreal(kind=R8P)inRight eigenvectors, er(:,k) = r_k (unused if conservative).
vrreal(kind=R8P)inReconstructed split fields at the face.
fluxreal(kind=R8P)outFace flux.

Call graph

mhd_face_split_fluxes ​

Project and Lax-Friedrichs-split the stencil of face i+1/2 (no divergence control), as the adiabatic library: the eigenvectors of the arithmetic face average; the energy slot and the B_n row have speed 0 and zero flux.

Attributes: pure

fortran
subroutine mhd_face_split_fluxes(gamma, d, S, is_characteristic, qs, qas, fsplit, er, mu)

Arguments

NameTypeIntentAttributesDescription
gammareal(kind=R8P)inEOS parameter.
dinteger(kind=I4P)inDirection, 1=x, 2=y, 3=z.
Sinteger(kind=I4P)inWENO stencil half-width, S <= S_MAX.
is_characteristiclogicalinCharacteristic (or conservative) variables.
qsreal(kind=R8P)inStencil conservative variables.
qasreal(kind=R8P)inStencil auxiliary variables.
fsplitreal(kind=R8P)outSplit fields in the WENO upwind layout.
erreal(kind=R8P)outRight eigenvectors (identity if conservative).
mureal(kind=R8P)outMagnitude of each field (WENO descaler).

Call graph

mhd_flux ​

Compute the physical flux in direction d: (rho u_n, rho u u_n + p_t n - B B_n, 0, B u_n - u B_n), `p_t = P(rho)

  • |B|^2 / 2, the energy slot and the B_n` component zero.

Attributes: pure

fortran
subroutine mhd_flux(d, q, qa, f)

Arguments

NameTypeIntentAttributesDescription
dinteger(kind=I4P)inDirection, 1=x, 2=y, 3=z.
qreal(kind=R8P)inConservative variables.
qareal(kind=R8P)inAuxiliary variables.
freal(kind=R8P)outPhysical flux.

Call graph

mhd_frame_indexes ​

Return the conservative variables in the frame order of direction d, (rho, rho u_n, rho u_t1, rho u_t2, slot5, B_n, B_t1, B_t2), tangents cyclic (bitwise rotation invariance, issue #41, MV-4).

Attributes: pure

fortran
subroutine mhd_frame_indexes(d, pv)

Arguments

NameTypeIntentAttributesDescription
dinteger(kind=I4P)inDirection, 1=x, 2=y, 3=z.
pvinteger(kind=I4P)outFull-state index of each frame variable.

Call graph

mhd_glm_eigenvalues ​

Compute the eigenvalues with GLM cleaning in direction d: the six waves, the energy slot (0) and the (B_n, psi) pair -c_h, +c_h.

Attributes: pure

fortran
subroutine mhd_glm_eigenvalues(ch, d, qa, lambda)

Arguments

NameTypeIntentAttributesDescription
chreal(kind=R8P)inGLM cleaning speed.
dinteger(kind=I4P)inDirection, 1=x, 2=y, 3=z.
qareal(kind=R8P)inAuxiliary variables.
lambdareal(kind=R8P)outEigenvalues.

Call graph

mhd_glm_eigenvectors ​

Compute the left (rows) and right (columns) eigenvectors with GLM cleaning in direction d: block-diagonal, the core, the energy slot and the (B_n, psi) pair of the flux (psi, c_h^2 B_n), r = (1, -+c_h), l = (1, -+1/c_h) / 2.

Attributes: pure

fortran
subroutine mhd_glm_eigenvectors(ch, gamma, d, qa, el, er)

Arguments

NameTypeIntentAttributesDescription
chreal(kind=R8P)inGLM cleaning speed.
gammareal(kind=R8P)inEOS parameter (unused: the core reads qa(IA_A)).
dinteger(kind=I4P)inDirection, 1=x, 2=y, 3=z.
qareal(kind=R8P)inAuxiliary variables (e.g. a face average).
elreal(kind=R8P)outLeft eigenvectors, el(k,:) = l_k.
erreal(kind=R8P)outRight eigenvectors, er(:,k) = r_k.

Call graph

mhd_glm_face_flux_back_projection ​

Return the face flux in conservative variables from the reconstructed split fields, F = R (f+ + f-) (GLM).

Attributes: pure

fortran
subroutine mhd_glm_face_flux_back_projection(is_characteristic, er, vr, flux)

Arguments

NameTypeIntentAttributesDescription
is_characteristiclogicalinReconstruction variables: characteristic or conservative.
erreal(kind=R8P)inRight eigenvectors, er(:,k) = r_k (unused if conservative).
vrreal(kind=R8P)inReconstructed split fields at the face.
fluxreal(kind=R8P)outFace flux.

Call graph

mhd_glm_face_split_fluxes ​

Project and Lax-Friedrichs-split the stencil of face i+1/2 (GLM cleaning): as mhd_face_split_fluxes, with the (B_n, psi) pair at speeds -+c_h (conservative variant: one speed, max(|u_n| + c_f, c_h)).

Attributes: pure

fortran
subroutine mhd_glm_face_split_fluxes(ch, gamma, d, S, is_characteristic, qs, qas, fsplit, er, mu)

Arguments

NameTypeIntentAttributesDescription
chreal(kind=R8P)inGLM cleaning speed.
gammareal(kind=R8P)inEOS parameter.
dinteger(kind=I4P)inDirection, 1=x, 2=y, 3=z.
Sinteger(kind=I4P)inWENO stencil half-width, S <= S_MAX.
is_characteristiclogicalinCharacteristic (or conservative) variables.
qsreal(kind=R8P)inStencil conservative variables.
qasreal(kind=R8P)inStencil auxiliary variables.
fsplitreal(kind=R8P)outSplit fields in the WENO upwind layout.
erreal(kind=R8P)outRight eigenvectors (identity if conservative).
mureal(kind=R8P)outMagnitude of each field (WENO descaler).

Call graph

mhd_glm_flux ​

Compute the physical flux with GLM cleaning in direction d: the flux with the B_n component psi and the psi component c_h^2 B_n (mixed GLM).

Attributes: pure

fortran
subroutine mhd_glm_flux(ch, d, q, qa, f)

Arguments

NameTypeIntentAttributesDescription
chreal(kind=R8P)inGLM cleaning speed.
dinteger(kind=I4P)inDirection, 1=x, 2=y, 3=z.
qreal(kind=R8P)inConservative variables.
qareal(kind=R8P)inAuxiliary variables.
freal(kind=R8P)outPhysical flux.

Call graph

mhd_primitive_to_conservative ​

Compute the conservative variables of a cell from its primitive variables: the energy slot is inert (0), the pressure p is that of the gas law and is not read (psi, if any, is set by the caller).

Attributes: pure

fortran
subroutine mhd_primitive_to_conservative(gamma, r, u, v, w, p, bx, by, bz, q)

Arguments

NameTypeIntentAttributesDescription
gammareal(kind=R8P)inEOS parameter (unused).
rreal(kind=R8P)inDensity.
ureal(kind=R8P)inVelocity components.
vreal(kind=R8P)inVelocity components.
wreal(kind=R8P)inVelocity components.
preal(kind=R8P)inPressure (unused: P(rho)).
bxreal(kind=R8P)inMagnetic field components.
byreal(kind=R8P)inMagnetic field components.
bzreal(kind=R8P)inMagnetic field components.
qreal(kind=R8P)outConservative variables.

Call graph

mhd_state_magnitudes ​

Return the reference magnitude of each conservative variable of a cell (the WENO descaler scales, as the adiabatic library: momentum |rho u|_1 + sqrt(rho p), field |B|_1 + sqrt(p), p = P(rho); the inert slot its own value).

Attributes: pure

fortran
subroutine mhd_state_magnitudes(q, qa, qm)

Arguments

NameTypeIntentAttributesDescription
qreal(kind=R8P)inConservative variables.
qareal(kind=R8P)inAuxiliary variables.
qmreal(kind=R8P)outReference magnitudes.

Call graph

mhd_backbone_flux ​

Compute the positivity backbone flux of two states in direction d (no divergence control): the Lax-Friedrichs flux with the Wu speed, as the adiabatic library.

Attributes: pure

fortran
subroutine mhd_backbone_flux(gamma, d, qL, qR, f)

Arguments

NameTypeIntentAttributesDescription
gammareal(kind=R8P)inEOS parameter.
dinteger(kind=I4P)inDirection, 1=x, 2=y, 3=z.
qLreal(kind=R8P)inLeft state.
qRreal(kind=R8P)inRight state.
freal(kind=R8P)outFlux.

Call graph

mhd_face_interpolation_fields ​

Compute the fields of the stencil of face i+1/2 to interpolate (no divergence control), in the WENO upwind layout: characteristic, or primitive (rho, u, v, w, 0, B_x, B_y, B_z) (the inert slot in place of p).

Attributes: pure

fortran
subroutine mhd_face_interpolation_fields(gamma, d, S, is_characteristic, qs, qas, fint, er, mu)

Arguments

NameTypeIntentAttributesDescription
gammareal(kind=R8P)inEOS parameter.
dinteger(kind=I4P)inDirection, 1=x, 2=y, 3=z.
Sinteger(kind=I4P)inWENO stencil half-width, S <= S_MAX.
is_characteristiclogicalinCharacteristic (or primitive) variables.
qsreal(kind=R8P)inStencil conservative variables.
qasreal(kind=R8P)inStencil auxiliary variables.
fintreal(kind=R8P)outFields in the WENO upwind layout.
erreal(kind=R8P)outRight eigenvectors (unused if primitive).
mureal(kind=R8P)outMagnitude of each field (WENO descaler).

Call graph

mhd_face_states ​

Compute the two face states from the interpolated fields (no divergence control): the left state from vr(2,:), the right one from vr(1,:); a state with non-positive density falls back to its cell.

Attributes: pure

fortran
subroutine mhd_face_states(gamma, is_characteristic, er, vr, q0, q1, qL, qR)

Arguments

NameTypeIntentAttributesDescription
gammareal(kind=R8P)inEOS parameter.
is_characteristiclogicalinCharacteristic (or primitive) variables.
erreal(kind=R8P)inRight eigenvectors (unused if primitive).
vrreal(kind=R8P)inInterpolated fields.
q0real(kind=R8P)inConservative variables of cell 0.
q1real(kind=R8P)inConservative variables of cell 1.
qLreal(kind=R8P)outLeft state.
qRreal(kind=R8P)outRight state.

Call graph

mhd_glm_face_interpolation_fields ​

Compute the fields of the stencil of face i+1/2 to interpolate (GLM): as mhd_face_interpolation_fields, psi the ninth field (primitive) or the GLM eigenvectors (characteristic).

Attributes: pure

fortran
subroutine mhd_glm_face_interpolation_fields(ch, gamma, d, S, is_characteristic, qs, qas, fint, er, mu)

Arguments

NameTypeIntentAttributesDescription
chreal(kind=R8P)inGLM cleaning speed.
gammareal(kind=R8P)inEOS parameter.
dinteger(kind=I4P)inDirection, 1=x, 2=y, 3=z.
Sinteger(kind=I4P)inWENO stencil half-width, S <= S_MAX.
is_characteristiclogicalinCharacteristic (or primitive) variables.
qsreal(kind=R8P)inStencil conservative variables.
qasreal(kind=R8P)inStencil auxiliary variables.
fintreal(kind=R8P)outFields in the WENO upwind layout.
erreal(kind=R8P)outRight eigenvectors (unused if primitive).
mureal(kind=R8P)outMagnitude of each field (WENO descaler).

Call graph

mhd_glm_face_states ​

Compute the two face states from the interpolated fields (GLM): as mhd_face_states, psi included.

Attributes: pure

fortran
subroutine mhd_glm_face_states(gamma, is_characteristic, er, vr, q0, q1, qL, qR)

Arguments

NameTypeIntentAttributesDescription
gammareal(kind=R8P)inEOS parameter.
is_characteristiclogicalinCharacteristic (or primitive) variables.
erreal(kind=R8P)inRight eigenvectors (unused if primitive).
vrreal(kind=R8P)inInterpolated fields.
q0real(kind=R8P)inConservative variables of cell 0.
q1real(kind=R8P)inConservative variables of cell 1.
qLreal(kind=R8P)outLeft state.
qRreal(kind=R8P)outRight state.

Call graph

mhd_glm_riemann_hll ​

Compute the HLL flux of two states in direction d (GLM, the (B_n, psi) subsystem solved exactly).

Attributes: pure

fortran
subroutine mhd_glm_riemann_hll(ch, gamma, d, qL, qR, f)

Arguments

NameTypeIntentAttributesDescription
chreal(kind=R8P)inGLM cleaning speed.
gammareal(kind=R8P)inEOS parameter.
dinteger(kind=I4P)inDirection, 1=x, 2=y, 3=z.
qLreal(kind=R8P)inLeft state.
qRreal(kind=R8P)inRight state.
freal(kind=R8P)outFlux.

Call graph

mhd_glm_riemann_hlld ​

Compute the HLLD flux of two states in direction d (GLM, the (B_n, psi) subsystem solved exactly); fallback is set when HLL replaced HLLD.

Attributes: pure

fortran
subroutine mhd_glm_riemann_hlld(ch, gamma, d, qL, qR, f, fallback)

Arguments

NameTypeIntentAttributesDescription
chreal(kind=R8P)inGLM cleaning speed.
gammareal(kind=R8P)inEOS parameter.
dinteger(kind=I4P)inDirection, 1=x, 2=y, 3=z.
qLreal(kind=R8P)inLeft state.
qRreal(kind=R8P)inRight state.
freal(kind=R8P)outFlux.
fallbacklogicaloutHLL used instead of HLLD.

Call graph

mhd_glm_riemann_llf ​

Compute the LLF flux of two states in direction d (GLM, the (B_n, psi) subsystem solved exactly).

Attributes: pure

fortran
subroutine mhd_glm_riemann_llf(ch, gamma, d, qL, qR, f)

Arguments

NameTypeIntentAttributesDescription
chreal(kind=R8P)inGLM cleaning speed.
gammareal(kind=R8P)inEOS parameter.
dinteger(kind=I4P)inDirection, 1=x, 2=y, 3=z.
qLreal(kind=R8P)inLeft state.
qRreal(kind=R8P)inRight state.
freal(kind=R8P)outFlux.

Call graph

mhd_riemann_hll ​

Compute the HLL flux of two states in direction d (no divergence control, each state's own B_n).

Attributes: pure

fortran
subroutine mhd_riemann_hll(gamma, d, qL, qR, f)

Arguments

NameTypeIntentAttributesDescription
gammareal(kind=R8P)inEOS parameter.
dinteger(kind=I4P)inDirection, 1=x, 2=y, 3=z.
qLreal(kind=R8P)inLeft state.
qRreal(kind=R8P)inRight state.
freal(kind=R8P)outFlux.

Call graph

mhd_riemann_hlld ​

Compute the HLLD flux of two states in direction d (no divergence control, B_n the average of the two states, its flux zero); fallback is set when HLL replaced HLLD.

Attributes: pure

fortran
subroutine mhd_riemann_hlld(gamma, d, qL, qR, f, fallback)

Arguments

NameTypeIntentAttributesDescription
gammareal(kind=R8P)inEOS parameter.
dinteger(kind=I4P)inDirection, 1=x, 2=y, 3=z.
qLreal(kind=R8P)inLeft state.
qRreal(kind=R8P)inRight state.
freal(kind=R8P)outFlux.
fallbacklogicaloutHLL used instead of HLLD.

Call graph

mhd_riemann_llf ​

Compute the LLF flux of two states in direction d (no divergence control, each state's own B_n).

Attributes: pure

fortran
subroutine mhd_riemann_llf(gamma, d, qL, qR, f)

Arguments

NameTypeIntentAttributesDescription
gammareal(kind=R8P)inEOS parameter.
dinteger(kind=I4P)inDirection, 1=x, 2=y, 3=z.
qLreal(kind=R8P)inLeft state.
qRreal(kind=R8P)inRight state.
freal(kind=R8P)outFlux.

Call graph

mhd_eigenvectors_core ​

Compute the 6x6 eigenvectors of Kim et al. (1999) in direction d at the physical state qa (a = qa(IA_A)), core variables (rho, rho u_n, rho u_t1, rho u_t2, B_t1, B_t2) in the full-state indexes mp, waves ordered (u_n - c_f, u_n - c_a, u_n - c_s, u_n + c_s, u_n + c_a, u_n + c_f); l6(k,:) the row l_k, r6(:,k) the column r_k, l6 r6 = I. Kim's b = B / sqrt(rho); alpha_f = alf c_f / a, alpha_s = als with the cancellation-free Ryu-Jones pair (alf, als) and the degenerate values of the adiabatic core (see the module); Kim's eq. 2-53 flips the slow pair (a^2 > c_a^2) or the fast pair (a^2 < c_a^2) with the sign of the transverse field.

Attributes: pure

fortran
subroutine mhd_eigenvectors_core(d, qa, l6, r6, mp)

Arguments

NameTypeIntentAttributesDescription
dinteger(kind=I4P)inDirection, 1=x, 2=y, 3=z.
qareal(kind=R8P)inAuxiliary variables.
l6real(kind=R8P)outLeft eigenvectors, rows.
r6real(kind=R8P)outRight eigenvectors, columns.
mpinteger(kind=I4P)outFull-state index of each core variable.

Call graph

mhd_wave_eigenvalues ​

Compute the six wave speeds in direction d, (u_n - c_f, u_n - c_a, u_n - c_s, u_n + c_s, u_n + c_a, u_n + c_f).

Attributes: pure

fortran
subroutine mhd_wave_eigenvalues(d, qa, lambda)

Arguments

NameTypeIntentAttributesDescription
dinteger(kind=I4P)inDirection, 1=x, 2=y, 3=z.
qareal(kind=R8P)inAuxiliary variables.
lambdareal(kind=R8P)outWave speeds.

Call graph

frame_flux ​

Compute the physical flux along the frame normal, the energy slot and the B_n component zero.

Attributes: pure

fortran
subroutine frame_flux(w, u, f)

Arguments

NameTypeIntentAttributesDescription
wreal(kind=R8P)inFrame primitive variables (w(5) = P(rho)).
ureal(kind=R8P)inFrame conservative variables.
freal(kind=R8P)outFrame flux.

Call graph

frame_hll ​

Compute the HLL flux in the frame.

Attributes: pure

fortran
subroutine frame_hll(gamma, wL, uL, wR, uR, f)

Arguments

NameTypeIntentAttributesDescription
gammareal(kind=R8P)inEOS parameter.
wLreal(kind=R8P)inLeft frame primitive variables.
uLreal(kind=R8P)inLeft frame conservative variables.
wRreal(kind=R8P)inRight frame primitive variables.
uRreal(kind=R8P)inRight frame conservative variables.
freal(kind=R8P)outFrame flux.

Call graph

frame_hlld ​

Compute the isothermal HLLD flux in the frame (Mignone 2007, section 3), B_n = wL(6) = wR(6): the HLL averages, the advective velocity u* = F_rho^hll / rho^hll, the rotational speeds u* -+ |B_n| / sqrt(rho*), the outer star states (eqs. 30-33) and the centre state (eqs. 34-37), sampled by eq. 38.

Attributes: pure

fortran
subroutine frame_hlld(gamma, wL, uL, wR, uR, f, fallback)

Arguments

NameTypeIntentAttributesDescription
gammareal(kind=R8P)inEOS parameter.
wLreal(kind=R8P)inLeft frame primitive variables.
uLreal(kind=R8P)inLeft frame conservative variables.
wRreal(kind=R8P)inRight frame primitive variables.
uRreal(kind=R8P)inRight frame conservative variables.
freal(kind=R8P)outFrame flux.
fallbacklogicaloutHLL used instead of HLLD.

Call graph

frame_llf ​

Compute the LLF (Rusanov) flux in the frame, speed max(|u_n| + c_f) of the two states.

Attributes: pure

fortran
subroutine frame_llf(gamma, wL, uL, wR, uR, f)

Arguments

NameTypeIntentAttributesDescription
gammareal(kind=R8P)inEOS parameter.
wLreal(kind=R8P)inLeft frame primitive variables.
uLreal(kind=R8P)inLeft frame conservative variables.
wRreal(kind=R8P)inRight frame primitive variables.
uRreal(kind=R8P)inRight frame conservative variables.
freal(kind=R8P)outFrame flux.

Call graph

frame_speeds ​

Compute the outer wave speeds S_L = min(u_nL, u_nR) - max(c_fL, c_fR), S_R = max(u_nL, u_nR) + max(c_fL, c_fR).

Attributes: pure

fortran
subroutine frame_speeds(gamma, wL, wR, sL, sR)

Arguments

NameTypeIntentAttributesDescription
gammareal(kind=R8P)inEOS parameter.
wLreal(kind=R8P)inLeft frame primitive variables.
wRreal(kind=R8P)inRight frame primitive variables.
sLreal(kind=R8P)outOuter wave speeds.
sRreal(kind=R8P)outOuter wave speeds.

Call graph

frame_state ​

Compute the frame primitive and conservative variables of a state whose normal field is set to bn: w(5) = P(rho), the energy slot of u zero (q may be longer than NV_MHD: its leading entries).

Attributes: pure

fortran
subroutine frame_state(gamma, pv, q, bn, w, u)

Arguments

NameTypeIntentAttributesDescription
gammareal(kind=R8P)inEOS parameter.
pvinteger(kind=I4P)inState in the frame order.
qreal(kind=R8P)inConservative variables.
bnreal(kind=R8P)inNormal field of the frame state.
wreal(kind=R8P)outFrame primitive variables.
ureal(kind=R8P)outFrame conservative variables.

Call graph

glm_face_subsystem ​

Solve the linear (B_n, psi) subsystem of the mixed GLM exactly at the face (Dedner et al. 2002, eq. 42).

Attributes: pure

fortran
subroutine glm_face_subsystem(ch, bnL, bnR, psiL, psiR, bn, psi)

Arguments

NameTypeIntentAttributesDescription
chreal(kind=R8P)inGLM cleaning speed.
bnLreal(kind=R8P)inNormal fields of the two states.
bnRreal(kind=R8P)inNormal fields of the two states.
psiLreal(kind=R8P)inGLM scalars of the two states.
psiRreal(kind=R8P)inGLM scalars of the two states.
bnreal(kind=R8P)outFace normal field and GLM scalar.
psireal(kind=R8P)outFace normal field and GLM scalar.

Call graph

hll_select ​

Return the HLL flux of two frame states from their outer speeds and physical fluxes.

Attributes: pure

fortran
subroutine hll_select(sL, sR, uL, uR, fL, fR, f)

Arguments

NameTypeIntentAttributesDescription
sLreal(kind=R8P)inOuter wave speeds.
sRreal(kind=R8P)inOuter wave speeds.
uLreal(kind=R8P)inLeft frame conservative variables.
uRreal(kind=R8P)inRight frame conservative variables.
fLreal(kind=R8P)inLeft physical flux.
fRreal(kind=R8P)inRight physical flux.
freal(kind=R8P)outFlux.

Call graph

hlld_star ​

Build the outer star state of a side (Mignone 2007, eqs. 20-21 and 30-33): the HLL density and normal momentum, the transverse momentum and field from the jump across the outer wave. Near the degeneracy (s - S*_L)(s - S*_R) -> 0 (no transverse field, B_n^2 > a^2 rho) the outer transverse state is kept.

Attributes: pure

fortran
subroutine hlld_star(s, ssL, ssR, rs, ms, us, w, ust)

Arguments

NameTypeIntentAttributesDescription
sreal(kind=R8P)inOuter wave speed of the side.
ssLreal(kind=R8P)inRotational wave speeds.
ssRreal(kind=R8P)inRotational wave speeds.
rsreal(kind=R8P)inHLL density and normal momentum.
msreal(kind=R8P)inHLL density and normal momentum.
usreal(kind=R8P)inAdvective velocity.
wreal(kind=R8P)inFrame primitive variables of the side.
ustreal(kind=R8P)outStar state.

Call graph

scatter_glm_flux ​

Return the GLM face flux in the global order: the frame flux scattered, the B_n flux psi~, the psi flux c_h^2 B~_n.

Attributes: pure

fortran
subroutine scatter_glm_flux(ch, pv, fr, bn, psi, f)

Arguments

NameTypeIntentAttributesDescription
chreal(kind=R8P)inGLM cleaning speed.
pvinteger(kind=I4P)inState in the frame order.
frreal(kind=R8P)inFrame flux.
bnreal(kind=R8P)inFace normal field and GLM scalar.
psireal(kind=R8P)inFace normal field and GLM scalar.
freal(kind=R8P)outFlux.

Call graph

Functions ​

mhd_fast_speed ​

Return the fast magnetosonic speed of a cell along direction d (as the adiabatic library, a = qa(IA_A)).

Attributes: pure

Returns: real(kind=R8P)

fortran
function mhd_fast_speed(d, qa) result(cf)

Arguments

NameTypeIntentAttributesDescription
dinteger(kind=I4P)inDirection, 1=x, 2=y, 3=z.
qareal(kind=R8P)inAuxiliary variables.

Call graph

mhd_sum3 ​

Return a + b + c summed in increasing order (rotation-invariant sums, issue #41, MV-4).

Attributes: pure

Returns: real(kind=R8P)

fortran
function mhd_sum3(a, b, c) result(s)

Arguments

NameTypeIntentAttributesDescription
areal(kind=R8P)inTerms.
breal(kind=R8P)inTerms.
creal(kind=R8P)inTerms.

Call graph

frame_fast_speed ​

Return the fast magnetosonic speed along the frame normal, a^2 = dP/drho of the state.

Attributes: pure

Returns: real(kind=R8P)

fortran
function frame_fast_speed(gamma, w) result(cf)

Arguments

NameTypeIntentAttributesDescription
gammareal(kind=R8P)inEOS parameter.
wreal(kind=R8P)inFrame primitive variables.

Call graph

is_admissible ​

Return true when a state has positive density (the one positive quantity without an energy equation).

Attributes: pure

Returns: logical

fortran
function is_admissible(q) result(ok)

Arguments

NameTypeIntentAttributesDescription
qreal(kind=R8P)inConservative variables.

Call graph

wu_speed ​

Return the Wu (2018) Lax-Friedrichs speed of two states in direction d (as the adiabatic library).

Attributes: pure

Returns: real(kind=R8P)

fortran
function wu_speed(d, qaL, qaR) result(sigma)

Arguments

NameTypeIntentAttributesDescription
dinteger(kind=I4P)inDirection, 1=x, 2=y, 3=z.
qaLreal(kind=R8P)inLeft auxiliary variables.
qaRreal(kind=R8P)inRight auxiliary variables.

Call graph

eos_pressure ​

P = c0^2 rho.

Attributes: pure

Returns: real(kind=R8P)

fortran
function eos_pressure(gamma, rho) result(p)

Arguments

NameTypeIntentAttributesDescription
gammareal(kind=R8P)inc0^2.
rhoreal(kind=R8P)inDensity.

Call graph

eos_temperature ​

T = P / (rho R) = c0^2 / R.

Attributes: pure

Returns: real(kind=R8P)

fortran
function eos_temperature(gamma, R, rho) result(t)

Arguments

NameTypeIntentAttributesDescription
gammareal(kind=R8P)inc0^2.
Rreal(kind=R8P)inGas constant.
rhoreal(kind=R8P)inDensity (unused: T is uniform).

Call graph

eos_sound_speed ​

a = c0.

Attributes: pure

Returns: real(kind=R8P)

fortran
function eos_sound_speed(gamma, rho) result(a)

Arguments

NameTypeIntentAttributesDescription
gammareal(kind=R8P)inc0^2.
rhoreal(kind=R8P)inDensity (unused: a is uniform).

Call graph