Skip to content

adam_flume_mhd_riemann_library ​

ADAM, FLUME pointwise ideal MHD Riemann solvers and face states of the scheme weno-riemann (issue #47).

Same contract as adam_flume_mhd_library: pure, explicit-size dummies, !$acc routine seq + !$omp declare target, no branching on the model; one set of public routines per model variant (mhd_*: NV_MHD, no divergence control; mhd_glm_*: NV_MHD_GLM, mixed GLM cleaning with speed ch; mhd_eglm_*: NV_MHD_EGLM, EGLM cleaning, psi in B units and psi^2 / 2 in the energy).

Frame. Every solver works in the frame of direction d, primitive w = (rho, u_n, u_t1, u_t2, p, B_n, B_t1, B_t2) and conservative u = (rho, rho u_n, rho u_t1, rho u_t2, E, B_n, B_t1, B_t2), tangents cyclic (mhd_frame_indexes), every three-term sum through mhd_sum3: a problem rotated from x to y or z runs the same arithmetic, so the rotated runs are bitwise equal (issue #41, MV-4).

Solvers (issue #47, section 3.2), 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) (Miyoshi & Kusano 2005, eq. 67):

  • LLF (Rusanov), speed max(|u_n| + c_f);
  • HLL (Harten, Lax & van Leer 1983);
  • HLLD (Miyoshi & Kusano 2005, J. Comput. Phys. 208), one normal field B_n for both states. Degenerate cases: when rho_a (S_a - u_na)(S_a - S_M) - B_n^2 is negligible the star state takes the outer transverse velocity and field; B_n = 0 gives S*_L = S*_R = S_M and no double-star region. HLL is used instead, and fallback is set, when a star state has non-positive density or pressure (the pressure of the conservative star state, from its energy) or the speeds are out of order (S_L < S*_L <= S_M <= S*_R < S_R); measured on random pairs whose density, pressure and field ratios are within 10, 10^2: 0.4%, 1.8% of the faces, mostly S*_L <= S_L (the speed estimate no longer bounds the Alfven wave).

Normal field. Without divergence control LLF and HLL take each state's own B_n (the B_n flux is zero, the jump is dissipated), HLLD the average. With GLM the linear (B_n, psi) subsystem is solved exactly at the face (Dedner et al. 2002, eq. 42): B~_n = (B_nL + B_nR)/2 - (psi_R - psi_L)/(2 c_h), psi~ = (psi_L + psi_R)/2 - c_h (B_nR - B_nL)/2; both states take B~_n (pressure kept, energy recomputed: psi is not in the energy of the mixed GLM), the B_n flux is psi~ and the psi flux c_h^2 B~_n. With EGLM (issue #47, section 3.2) the subsystem in B units, B~_n = (B_nL + B_nR)/2 - (psi_R - psi_L)/2, psi~ = (psi_L + psi_R)/2 - (B_nR - B_nL)/2; the solvers see the MHD states (energy without psi^2 / 2); the B_n flux is c_h psi~, the psi flux c_h B~_n, and the energy flux gains c_h psi~ B~_n plus the advected cleaning energy, a passive scalar carried by the mass flux, F_rho psi~^2 / (2 rho_up) with the upwind density of the sign of F_rho (Larrouturou 1991): the flux of two equal states is the physical flux.

Positivity backbone (issue #47, D-9): the first-order Lax-Friedrichs flux of the cell states, (f(qL) + f(qR)) / 2 - sigma (qR - qL) / 2, each state with its own B_n, sigma the Wu (2018, doi:10.1137/18M1168017) speed max(s_L, s_R, |u~_n| + max(c_fL, c_fR)) + |B_L - B_R| / (sqrt(rho_L) + sqrt(rho_R)), s = |u_n| + c_f, u~_n the sqrt(rho)-weighted normal velocity (with EGLM at least c_h): with the Godunov-Powell (EGLM) sources it keeps the first-order update admissible (Wu & Shu 2018, doi:10.1137/18M1168042), the backbone of the M3 limiter (prototype M3-P0).

Face states. Interpolated fields: characteristic (the eigenvectors of the arithmetic face average, projected in the frame order; the MHD default, #47 D-5) or primitive (rho, u, v, w, p, B_x, B_y, B_z[, psi]), p the thermal pressure; a face state with non-positive density or pressure is replaced by the adjacent cell's state.

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

Dependencies

Contents ​

Variables ​

NameTypeAttributesDescription
EPS_HLLDreal(kind=R8P)parameterDegenerate HLLD star: |rho d (S-S_M) - B_n^2| <= EPS_HLLD (|rho d (S-S_M)| + B_n^2).

Subroutines ​

mhd_backbone_flux ​

Compute the positivity backbone flux of two states in direction d (MHD without divergence control): the Lax-Friedrichs flux with the Wu speed.

Attributes: pure

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

Arguments

NameTypeIntentAttributesDescription
gammareal(kind=R8P)inSpecific heats ratio.
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_eglm_backbone_flux ​

Compute the positivity backbone flux of two states in direction d (MHD with EGLM): the Lax-Friedrichs flux of the EGLM physical fluxes with the Wu speed, at least c_h.

Attributes: pure

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

Arguments

NameTypeIntentAttributesDescription
chreal(kind=R8P)inGLM cleaning speed.
gammareal(kind=R8P)inSpecific heats ratio.
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_eglm_face_interpolation_fields ​

Compute the fields of the stencil of face i+1/2 to interpolate (MHD with EGLM): as mhd_glm_face_interpolation_fields, with the EGLM eigenvectors (psi the average of cells 0 and 1) or the primitive fields with the thermal pressure.

Attributes: pure

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

Arguments

NameTypeIntentAttributesDescription
gammareal(kind=R8P)inSpecific heats ratio.
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_eglm_face_states ​

Compute the two face states from the interpolated fields (MHD with EGLM): as mhd_glm_face_states, the primitive states with psi^2 / 2 in the energy; the admissibility is that of the thermal pressure.

Attributes: pure

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

Arguments

NameTypeIntentAttributesDescription
gammareal(kind=R8P)inSpecific heats ratio.
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_eglm_riemann_hll ​

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

Attributes: pure

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

Arguments

NameTypeIntentAttributesDescription
chreal(kind=R8P)inGLM cleaning speed.
gammareal(kind=R8P)inSpecific heats ratio.
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_eglm_riemann_hlld ​

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

Attributes: pure

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

Arguments

NameTypeIntentAttributesDescription
chreal(kind=R8P)inGLM cleaning speed.
gammareal(kind=R8P)inSpecific heats ratio.
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_eglm_riemann_llf ​

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

Attributes: pure

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

Arguments

NameTypeIntentAttributesDescription
chreal(kind=R8P)inGLM cleaning speed.
gammareal(kind=R8P)inSpecific heats ratio.
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 (MHD without divergence control), in the WENO upwind layout of the Euler compute_face_interpolation_fields: fint(2,m,k) and fint(1,m-1,k) hold field k of cell m.

Attributes: pure

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

Arguments

NameTypeIntentAttributesDescription
gammareal(kind=R8P)inSpecific heats ratio.
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 (MHD without divergence control): the left state from vr(2,:), the right one from vr(1,:); a state with non-positive density or pressure 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)inSpecific heats ratio.
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 (MHD with 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)inSpecific heats ratio.
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 (MHD with 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)inSpecific heats ratio.
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 (MHD with 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)inSpecific heats ratio.
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 (MHD with 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)inSpecific heats ratio.
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 (MHD with 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)inSpecific heats ratio.
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 (MHD without 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)inSpecific heats ratio.
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 (MHD without 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)inSpecific heats ratio.
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 (MHD without 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)inSpecific heats ratio.
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

double_star ​

Build the HLLD double-star state of a side from its star state (density, normal velocity and B_n unchanged).

Attributes: pure

fortran
subroutine double_star(us, vss, bss, e, uss)

Arguments

NameTypeIntentAttributesDescription
usreal(kind=R8P)inStar state of the side.
vssreal(kind=R8P)inDouble-star tangential velocity.
bssreal(kind=R8P)inDouble-star tangential field.
ereal(kind=R8P)inDouble-star energy.
ussreal(kind=R8P)outDouble-star state.

Call graph

eglm_face_subsystem ​

Solve the linear (B_n, psi) subsystem of EGLM (flux c_h (psi, B_n), psi in B units) exactly at the face: the characteristic fields B_n + psi (speed +c_h, from the left) and B_n - psi (-c_h, from the right).

Attributes: pure

fortran
subroutine eglm_face_subsystem(bnL, bnR, psiL, psiR, bn, psi)

Arguments

NameTypeIntentAttributesDescription
bnLreal(kind=R8P)inNormal fields of the two states.
bnRreal(kind=R8P)inNormal fields of the two states.
psiLreal(kind=R8P)inEGLM scalars of the two states.
psiRreal(kind=R8P)inEGLM scalars of the two states.
bnreal(kind=R8P)outFace normal field and EGLM scalar.
psireal(kind=R8P)outFace normal field and EGLM scalar.

Call graph

eglm_frame_state ​

Compute the frame primitive and conservative variables of an EGLM state whose normal field is set to bn: the MHD state, the energy without the cleaning energy psi^2 / 2 (as frame_state).

Attributes: pure

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

Arguments

NameTypeIntentAttributesDescription
gammareal(kind=R8P)inSpecific heats ratio.
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

frame_flux ​

Compute the physical flux along the frame normal: (rho u_n, rho u u_n + p_t n - B B_n, (E + p_t) u_n - (u.B) B_n, B u_n - u B_n), the B_n component zero.

Attributes: pure

fortran
subroutine frame_flux(w, u, f)

Arguments

NameTypeIntentAttributesDescription
wreal(kind=R8P)inFrame primitive variables.
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)inSpecific heats ratio.
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 HLLD flux in the frame (Miyoshi & Kusano 2005, section 5), B_n = wL(6) = wR(6).

Attributes: pure

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

Arguments

NameTypeIntentAttributesDescription
gammareal(kind=R8P)inSpecific heats ratio.
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)inSpecific heats ratio.
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)inSpecific heats ratio.
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: the pressure of the state is kept, the energy recomputed with bn (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)inSpecific heats ratio.
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 HLLD star state of a side (Miyoshi & Kusano 2005, eqs. 43-48); ok is false when its density or pressure (from its energy) is not positive. Near the degeneracy rho d (s - S_M) = B_n^2 the outer transverse state is kept.

Attributes: pure

fortran
subroutine hlld_star(s, sM, pts, w, u, us, ok)

Arguments

NameTypeIntentAttributesDescription
sreal(kind=R8P)inOuter wave speed of the side.
sMreal(kind=R8P)inContact wave speed.
ptsreal(kind=R8P)inStar total pressure.
wreal(kind=R8P)inFrame primitive variables of the side.
ureal(kind=R8P)inFrame conservative variables of the side.
usreal(kind=R8P)outStar state.
oklogicaloutAdmissible star 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

scatter_eglm_flux ​

Return the EGLM face flux in the global order: the frame flux scattered, the B_n flux c_h psi~, the psi flux c_h B~_n, the energy flux plus c_h psi~ B~_n and the cleaning energy carried by the mass flux, F_rho psi~^2 / (2 rho_up), rho_up the density of the side the mass flows from.

Attributes: pure

fortran
subroutine scatter_eglm_flux(ch, pv, fr, bn, psi, rhoL, rhoR, 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 EGLM scalar.
psireal(kind=R8P)inFace normal field and EGLM scalar.
rhoLreal(kind=R8P)inDensities of the two states.
rhoRreal(kind=R8P)inDensities of the two states.
freal(kind=R8P)outFlux.

Call graph

Functions ​

eglm_is_admissible ​

Return true when an EGLM state has positive density and thermal pressure (energy without psi^2 / 2).

Attributes: pure

Returns: logical

fortran
function eglm_is_admissible(q) result(ok)

Arguments

NameTypeIntentAttributesDescription
qreal(kind=R8P)inConservative variables.

Call graph

frame_fast_speed ​

Return the fast magnetosonic speed along the frame normal (as mhd_fast_speed, from the frame primitive state).

Attributes: pure

Returns: real(kind=R8P)

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

Arguments

NameTypeIntentAttributesDescription
gammareal(kind=R8P)inSpecific heats ratio.
wreal(kind=R8P)inFrame primitive variables.

Call graph

is_admissible ​

Return true when a state (its leading NV_MHD entries) has positive density and pressure (the pressure up to the positive factor gamma - 1).

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 (see the module header).

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