Appearance
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_nfor both states. Degenerate cases: whenrho_a (S_a - u_na)(S_a - S_M) - B_n^2is negligible the star state takes the outer transverse velocity and field;B_n = 0givesS*_L = S*_R = S_Mand no double-star region. HLL is used instead, andfallbackis 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, mostlyS*_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
- mhd_backbone_flux
- mhd_eglm_backbone_flux
- mhd_eglm_face_interpolation_fields
- mhd_eglm_face_states
- mhd_eglm_riemann_hll
- mhd_eglm_riemann_hlld
- mhd_eglm_riemann_llf
- mhd_face_interpolation_fields
- mhd_face_states
- mhd_glm_face_interpolation_fields
- mhd_glm_face_states
- mhd_glm_riemann_hll
- mhd_glm_riemann_hlld
- mhd_glm_riemann_llf
- mhd_riemann_hll
- mhd_riemann_hlld
- mhd_riemann_llf
- double_star
- eglm_face_subsystem
- eglm_frame_state
- frame_flux
- frame_hll
- frame_hlld
- frame_llf
- frame_speeds
- frame_state
- glm_face_subsystem
- hll_select
- hlld_star
- scatter_glm_flux
- scatter_eglm_flux
- eglm_is_admissible
- frame_fast_speed
- is_admissible
- wu_speed
Variables
| Name | Type | Attributes | Description |
|---|---|---|---|
EPS_HLLD | real(kind=R8P) | parameter | Degenerate 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
gamma | real(kind=R8P) | in | Specific heats ratio. | |
d | integer(kind=I4P) | in | Direction, 1=x, 2=y, 3=z. | |
qL | real(kind=R8P) | in | Left state. | |
qR | real(kind=R8P) | in | Right state. | |
f | real(kind=R8P) | out | Flux. |
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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
ch | real(kind=R8P) | in | GLM cleaning speed. | |
gamma | real(kind=R8P) | in | Specific heats ratio. | |
d | integer(kind=I4P) | in | Direction, 1=x, 2=y, 3=z. | |
qL | real(kind=R8P) | in | Left state. | |
qR | real(kind=R8P) | in | Right state. | |
f | real(kind=R8P) | out | Flux. |
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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
gamma | real(kind=R8P) | in | Specific heats ratio. | |
d | integer(kind=I4P) | in | Direction, 1=x, 2=y, 3=z. | |
S | integer(kind=I4P) | in | WENO stencil half-width, S <= S_MAX. | |
is_characteristic | logical | in | Characteristic (or primitive) variables. | |
qs | real(kind=R8P) | in | Stencil conservative variables. | |
qas | real(kind=R8P) | in | Stencil auxiliary variables. | |
fint | real(kind=R8P) | out | Fields in the WENO upwind layout. | |
er | real(kind=R8P) | out | Right eigenvectors (unused if primitive). | |
mu | real(kind=R8P) | out | Magnitude 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
gamma | real(kind=R8P) | in | Specific heats ratio. | |
is_characteristic | logical | in | Characteristic (or primitive) variables. | |
er | real(kind=R8P) | in | Right eigenvectors (unused if primitive). | |
vr | real(kind=R8P) | in | Interpolated fields. | |
q0 | real(kind=R8P) | in | Conservative variables of cell 0. | |
q1 | real(kind=R8P) | in | Conservative variables of cell 1. | |
qL | real(kind=R8P) | out | Left state. | |
qR | real(kind=R8P) | out | Right 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
ch | real(kind=R8P) | in | GLM cleaning speed. | |
gamma | real(kind=R8P) | in | Specific heats ratio. | |
d | integer(kind=I4P) | in | Direction, 1=x, 2=y, 3=z. | |
qL | real(kind=R8P) | in | Left state. | |
qR | real(kind=R8P) | in | Right state. | |
f | real(kind=R8P) | out | Flux. |
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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
ch | real(kind=R8P) | in | GLM cleaning speed. | |
gamma | real(kind=R8P) | in | Specific heats ratio. | |
d | integer(kind=I4P) | in | Direction, 1=x, 2=y, 3=z. | |
qL | real(kind=R8P) | in | Left state. | |
qR | real(kind=R8P) | in | Right state. | |
f | real(kind=R8P) | out | Flux. | |
fallback | logical | out | HLL 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
ch | real(kind=R8P) | in | GLM cleaning speed. | |
gamma | real(kind=R8P) | in | Specific heats ratio. | |
d | integer(kind=I4P) | in | Direction, 1=x, 2=y, 3=z. | |
qL | real(kind=R8P) | in | Left state. | |
qR | real(kind=R8P) | in | Right state. | |
f | real(kind=R8P) | out | Flux. |
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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
gamma | real(kind=R8P) | in | Specific heats ratio. | |
d | integer(kind=I4P) | in | Direction, 1=x, 2=y, 3=z. | |
S | integer(kind=I4P) | in | WENO stencil half-width, S <= S_MAX. | |
is_characteristic | logical | in | Characteristic (or primitive) variables. | |
qs | real(kind=R8P) | in | Stencil conservative variables. | |
qas | real(kind=R8P) | in | Stencil auxiliary variables. | |
fint | real(kind=R8P) | out | Fields in the WENO upwind layout. | |
er | real(kind=R8P) | out | Right eigenvectors (unused if primitive). | |
mu | real(kind=R8P) | out | Magnitude 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
gamma | real(kind=R8P) | in | Specific heats ratio. | |
is_characteristic | logical | in | Characteristic (or primitive) variables. | |
er | real(kind=R8P) | in | Right eigenvectors (unused if primitive). | |
vr | real(kind=R8P) | in | Interpolated fields. | |
q0 | real(kind=R8P) | in | Conservative variables of cell 0. | |
q1 | real(kind=R8P) | in | Conservative variables of cell 1. | |
qL | real(kind=R8P) | out | Left state. | |
qR | real(kind=R8P) | out | Right 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
ch | real(kind=R8P) | in | GLM cleaning speed. | |
gamma | real(kind=R8P) | in | Specific heats ratio. | |
d | integer(kind=I4P) | in | Direction, 1=x, 2=y, 3=z. | |
S | integer(kind=I4P) | in | WENO stencil half-width, S <= S_MAX. | |
is_characteristic | logical | in | Characteristic (or primitive) variables. | |
qs | real(kind=R8P) | in | Stencil conservative variables. | |
qas | real(kind=R8P) | in | Stencil auxiliary variables. | |
fint | real(kind=R8P) | out | Fields in the WENO upwind layout. | |
er | real(kind=R8P) | out | Right eigenvectors (unused if primitive). | |
mu | real(kind=R8P) | out | Magnitude 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
gamma | real(kind=R8P) | in | Specific heats ratio. | |
is_characteristic | logical | in | Characteristic (or primitive) variables. | |
er | real(kind=R8P) | in | Right eigenvectors (unused if primitive). | |
vr | real(kind=R8P) | in | Interpolated fields. | |
q0 | real(kind=R8P) | in | Conservative variables of cell 0. | |
q1 | real(kind=R8P) | in | Conservative variables of cell 1. | |
qL | real(kind=R8P) | out | Left state. | |
qR | real(kind=R8P) | out | Right 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
ch | real(kind=R8P) | in | GLM cleaning speed. | |
gamma | real(kind=R8P) | in | Specific heats ratio. | |
d | integer(kind=I4P) | in | Direction, 1=x, 2=y, 3=z. | |
qL | real(kind=R8P) | in | Left state. | |
qR | real(kind=R8P) | in | Right state. | |
f | real(kind=R8P) | out | Flux. |
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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
ch | real(kind=R8P) | in | GLM cleaning speed. | |
gamma | real(kind=R8P) | in | Specific heats ratio. | |
d | integer(kind=I4P) | in | Direction, 1=x, 2=y, 3=z. | |
qL | real(kind=R8P) | in | Left state. | |
qR | real(kind=R8P) | in | Right state. | |
f | real(kind=R8P) | out | Flux. | |
fallback | logical | out | HLL 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
ch | real(kind=R8P) | in | GLM cleaning speed. | |
gamma | real(kind=R8P) | in | Specific heats ratio. | |
d | integer(kind=I4P) | in | Direction, 1=x, 2=y, 3=z. | |
qL | real(kind=R8P) | in | Left state. | |
qR | real(kind=R8P) | in | Right state. | |
f | real(kind=R8P) | out | Flux. |
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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
gamma | real(kind=R8P) | in | Specific heats ratio. | |
d | integer(kind=I4P) | in | Direction, 1=x, 2=y, 3=z. | |
qL | real(kind=R8P) | in | Left state. | |
qR | real(kind=R8P) | in | Right state. | |
f | real(kind=R8P) | out | Flux. |
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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
gamma | real(kind=R8P) | in | Specific heats ratio. | |
d | integer(kind=I4P) | in | Direction, 1=x, 2=y, 3=z. | |
qL | real(kind=R8P) | in | Left state. | |
qR | real(kind=R8P) | in | Right state. | |
f | real(kind=R8P) | out | Flux. | |
fallback | logical | out | HLL 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
gamma | real(kind=R8P) | in | Specific heats ratio. | |
d | integer(kind=I4P) | in | Direction, 1=x, 2=y, 3=z. | |
qL | real(kind=R8P) | in | Left state. | |
qR | real(kind=R8P) | in | Right state. | |
f | real(kind=R8P) | out | Flux. |
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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
us | real(kind=R8P) | in | Star state of the side. | |
vss | real(kind=R8P) | in | Double-star tangential velocity. | |
bss | real(kind=R8P) | in | Double-star tangential field. | |
e | real(kind=R8P) | in | Double-star energy. | |
uss | real(kind=R8P) | out | Double-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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
bnL | real(kind=R8P) | in | Normal fields of the two states. | |
bnR | real(kind=R8P) | in | Normal fields of the two states. | |
psiL | real(kind=R8P) | in | EGLM scalars of the two states. | |
psiR | real(kind=R8P) | in | EGLM scalars of the two states. | |
bn | real(kind=R8P) | out | Face normal field and EGLM scalar. | |
psi | real(kind=R8P) | out | Face 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
gamma | real(kind=R8P) | in | Specific heats ratio. | |
pv | integer(kind=I4P) | in | State in the frame order. | |
q | real(kind=R8P) | in | Conservative variables. | |
bn | real(kind=R8P) | in | Normal field of the frame state. | |
w | real(kind=R8P) | out | Frame primitive variables. | |
u | real(kind=R8P) | out | Frame 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
w | real(kind=R8P) | in | Frame primitive variables. | |
u | real(kind=R8P) | in | Frame conservative variables. | |
f | real(kind=R8P) | out | Frame 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
gamma | real(kind=R8P) | in | Specific heats ratio. | |
wL | real(kind=R8P) | in | Left frame primitive variables. | |
uL | real(kind=R8P) | in | Left frame conservative variables. | |
wR | real(kind=R8P) | in | Right frame primitive variables. | |
uR | real(kind=R8P) | in | Right frame conservative variables. | |
f | real(kind=R8P) | out | Frame 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
gamma | real(kind=R8P) | in | Specific heats ratio. | |
wL | real(kind=R8P) | in | Left frame primitive variables. | |
uL | real(kind=R8P) | in | Left frame conservative variables. | |
wR | real(kind=R8P) | in | Right frame primitive variables. | |
uR | real(kind=R8P) | in | Right frame conservative variables. | |
f | real(kind=R8P) | out | Frame flux. | |
fallback | logical | out | HLL 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
gamma | real(kind=R8P) | in | Specific heats ratio. | |
wL | real(kind=R8P) | in | Left frame primitive variables. | |
uL | real(kind=R8P) | in | Left frame conservative variables. | |
wR | real(kind=R8P) | in | Right frame primitive variables. | |
uR | real(kind=R8P) | in | Right frame conservative variables. | |
f | real(kind=R8P) | out | Frame 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
gamma | real(kind=R8P) | in | Specific heats ratio. | |
wL | real(kind=R8P) | in | Left frame primitive variables. | |
wR | real(kind=R8P) | in | Right frame primitive variables. | |
sL | real(kind=R8P) | out | Outer wave speeds. | |
sR | real(kind=R8P) | out | Outer 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
gamma | real(kind=R8P) | in | Specific heats ratio. | |
pv | integer(kind=I4P) | in | State in the frame order. | |
q | real(kind=R8P) | in | Conservative variables. | |
bn | real(kind=R8P) | in | Normal field of the frame state. | |
w | real(kind=R8P) | out | Frame primitive variables. | |
u | real(kind=R8P) | out | Frame 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
ch | real(kind=R8P) | in | GLM cleaning speed. | |
bnL | real(kind=R8P) | in | Normal fields of the two states. | |
bnR | real(kind=R8P) | in | Normal fields of the two states. | |
psiL | real(kind=R8P) | in | GLM scalars of the two states. | |
psiR | real(kind=R8P) | in | GLM scalars of the two states. | |
bn | real(kind=R8P) | out | Face normal field and GLM scalar. | |
psi | real(kind=R8P) | out | Face 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
sL | real(kind=R8P) | in | Outer wave speeds. | |
sR | real(kind=R8P) | in | Outer wave speeds. | |
uL | real(kind=R8P) | in | Left frame conservative variables. | |
uR | real(kind=R8P) | in | Right frame conservative variables. | |
fL | real(kind=R8P) | in | Left physical flux. | |
fR | real(kind=R8P) | in | Right physical flux. | |
f | real(kind=R8P) | out | Flux. |
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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
s | real(kind=R8P) | in | Outer wave speed of the side. | |
sM | real(kind=R8P) | in | Contact wave speed. | |
pts | real(kind=R8P) | in | Star total pressure. | |
w | real(kind=R8P) | in | Frame primitive variables of the side. | |
u | real(kind=R8P) | in | Frame conservative variables of the side. | |
us | real(kind=R8P) | out | Star state. | |
ok | logical | out | Admissible 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
ch | real(kind=R8P) | in | GLM cleaning speed. | |
pv | integer(kind=I4P) | in | State in the frame order. | |
fr | real(kind=R8P) | in | Frame flux. | |
bn | real(kind=R8P) | in | Face normal field and GLM scalar. | |
psi | real(kind=R8P) | in | Face normal field and GLM scalar. | |
f | real(kind=R8P) | out | Flux. |
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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
ch | real(kind=R8P) | in | GLM cleaning speed. | |
pv | integer(kind=I4P) | in | State in the frame order. | |
fr | real(kind=R8P) | in | Frame flux. | |
bn | real(kind=R8P) | in | Face normal field and EGLM scalar. | |
psi | real(kind=R8P) | in | Face normal field and EGLM scalar. | |
rhoL | real(kind=R8P) | in | Densities of the two states. | |
rhoR | real(kind=R8P) | in | Densities of the two states. | |
f | real(kind=R8P) | out | Flux. |
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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
q | real(kind=R8P) | in | Conservative 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
gamma | real(kind=R8P) | in | Specific heats ratio. | |
w | real(kind=R8P) | in | Frame 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
q | real(kind=R8P) | in | Conservative 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
d | integer(kind=I4P) | in | Direction, 1=x, 2=y, 3=z. | |
qaL | real(kind=R8P) | in | Left auxiliary variables. | |
qaR | real(kind=R8P) | in | Right auxiliary variables. |
Call graph