Skip to content

adam_flume_cpu_mhd_eglm_llf_kernels ​

ADAM, FLUME CPU kernels of the MHD-EGLM model with the LLF Riemann solver (scheme weno-riemann).

The model- and solver-agnostic face loop (adam_flume_cpu_riemann_face_kernels_agnostic.INC, issue #47) instantiated on the MHD-EGLM model and the LLF solver of adam_flume_mhd_riemann_library: the local arrays are sized by NV_K = NV_MHD_EGLM, NV_AUX_K = NV_AUX_MHD, and the four adapters call the MHD libraries.

Source: src/app/flume/cpu/adam_flume_cpu_mhd_eglm_llf_kernels.F90

Dependencies

Contents ​

Subroutines ​

compute_riemann_face_fluxes ​

Compute the weno-riemann face fluxes of direction d: face (i,j,k) lies between cells (i,j,k) and (i+di,j+dj,k+dk), so the face array starts at index 0 along d.

Per face: gather the stencil m = min(1-S,-1) ... max(S,2), WENO-interpolate its fields to the two face states (interpolation tables weno%a_interp, weno%p_interp), take the Riemann flux F of the states and add the correction F^ = F + s (cc(1) F + cc(2) (f_0 + f_1) + cc(3) (f_-1 + f_2) - F), with f_m the physical flux of cell m and the sensor s = 1 where the WENO weights ratio of every field on both sides is >= tau, else 0; fallbacks counts the faces whose Riemann solver fell back (HLLD to HLL; always 0 for the other solvers).

fortran
subroutine compute_riemann_face_fluxes(d, di, dj, dk, ni, nj, nk, ngc, blocks_number, gamma, ch, is_characteristic, weno, cc, tau, q, q_aux, fl, fallbacks)

Arguments

NameTypeIntentAttributesDescription
dinteger(kind=I4P)inDirection, 1=x, 2=y, 3=z.
diinteger(kind=I4P)inUnit step along d.
djinteger(kind=I4P)inUnit step along d.
dkinteger(kind=I4P)inUnit step along d.
niinteger(kind=I4P)inGrid dimensions.
njinteger(kind=I4P)inGrid dimensions.
nkinteger(kind=I4P)inGrid dimensions.
ngcinteger(kind=I4P)inGrid dimensions.
blocks_numberinteger(kind=I4P)inActual blocks number.
gammareal(kind=R8P)inSpecific heats ratio.
chreal(kind=R8P)inGLM cleaning speed (models with GLM only).
is_characteristiclogicalinCharacteristic (or primitive) variables.
wenotype(weno_object)inWENO coefficients (with interpolation tables).
ccreal(kind=R8P)inCorrection coefficients.
taureal(kind=R8P)inSensor threshold.
qreal(kind=R8P)inConservative variables.
q_auxreal(kind=R8P)inAuxiliary variables.
flreal(kind=R8P)inoutFace fluxes of direction d.
fallbacksinteger(kind=I4P)outFaces whose Riemann solver fell back.

Call graph

add_gravity_edge_correction ​

Add the faces beyond the block to the gravity energy correction of direction d (issue #73, M7-G2a), as the split kernel's add_gravity_edge_correction, with the weno-riemann face of compute_riemann_face_fluxes (the same body, its mass component kept): its stencil reaches max(S, 2) + 1 ghost cells.

fortran
subroutine add_gravity_edge_correction(d, di, dj, dk, ni, nj, nk, ngc, blocks_number, gamma, ch, is_characteristic, weno, cc, tau, ir, gd, q, q_aux, gc)

Arguments

NameTypeIntentAttributesDescription
dinteger(kind=I4P)inDirection, 1=x, 2=y, 3=z.
diinteger(kind=I4P)inUnit step along d.
djinteger(kind=I4P)inUnit step along d.
dkinteger(kind=I4P)inUnit step along d.
niinteger(kind=I4P)inGrid dimensions.
njinteger(kind=I4P)inGrid dimensions.
nkinteger(kind=I4P)inGrid dimensions.
ngcinteger(kind=I4P)inGrid dimensions.
blocks_numberinteger(kind=I4P)inActual blocks number.
gammareal(kind=R8P)inSpecific heats ratio.
chreal(kind=R8P)inGLM cleaning speed (models with GLM only).
is_characteristiclogicalinCharacteristic (or primitive) variables.
wenotype(weno_object)inWENO coefficients (with interpolation tables).
ccreal(kind=R8P)inCorrection coefficients.
taureal(kind=R8P)inSensor threshold.
irinteger(kind=I4P)inIndex of the density (mass) variable.
gdreal(kind=R8P)inGravity along d.
qreal(kind=R8P)inConservative variables.
q_auxreal(kind=R8P)inAuxiliary variables.
gcreal(kind=R8P)inoutGravity energy correction [1, ...].

Call graph

face_interpolation_fields ​

Interpolation-fields adapter of the shared face kernel: the MHD fields, the EGLM eigenvectors, ch unused.

Attributes: pure

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

Arguments

NameTypeIntentAttributesDescription
gammareal(kind=R8P)inSpecific heats ratio.
chreal(kind=R8P)inGLM cleaning speed.
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.
mureal(kind=R8P)outMagnitude of each field (WENO descaler).

Call graph

face_states ​

Face-states adapter of the shared face kernel: the MHD states, ch unused.

Attributes: pure

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

Arguments

NameTypeIntentAttributesDescription
gammareal(kind=R8P)inSpecific heats ratio.
chreal(kind=R8P)inGLM cleaning speed.
is_characteristiclogicalinCharacteristic (or primitive) variables.
erreal(kind=R8P)inRight eigenvectors.
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

riemann_flux ​

Riemann-solver adapter of the shared face kernel: MHD LLF, ch the GLM cleaning speed, never a fallback.

Attributes: pure

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

Arguments

NameTypeIntentAttributesDescription
gammareal(kind=R8P)inSpecific heats ratio.
chreal(kind=R8P)inGLM cleaning speed.
dinteger(kind=I4P)inDirection, 1=x, 2=y, 3=z.
qLreal(kind=R8P)inLeft state.
qRreal(kind=R8P)inRight state.
freal(kind=R8P)outFlux.
fallbacklogicaloutFallback flag (always false).

Call graph

cell_flux ​

Cell-flux adapter of the shared face kernel: the MHD physical flux, gamma unused.

Attributes: pure

fortran
subroutine cell_flux(gamma, ch, d, q, qa, f)

Arguments

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