Appearance
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
- compute_riemann_face_fluxes
- add_gravity_edge_correction
- face_interpolation_fields
- face_states
- riemann_flux
- cell_flux
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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
d | integer(kind=I4P) | in | Direction, 1=x, 2=y, 3=z. | |
di | integer(kind=I4P) | in | Unit step along d. | |
dj | integer(kind=I4P) | in | Unit step along d. | |
dk | integer(kind=I4P) | in | Unit step along d. | |
ni | integer(kind=I4P) | in | Grid dimensions. | |
nj | integer(kind=I4P) | in | Grid dimensions. | |
nk | integer(kind=I4P) | in | Grid dimensions. | |
ngc | integer(kind=I4P) | in | Grid dimensions. | |
blocks_number | integer(kind=I4P) | in | Actual blocks number. | |
gamma | real(kind=R8P) | in | Specific heats ratio. | |
ch | real(kind=R8P) | in | GLM cleaning speed (models with GLM only). | |
is_characteristic | logical | in | Characteristic (or primitive) variables. | |
weno | type(weno_object) | in | WENO coefficients (with interpolation tables). | |
cc | real(kind=R8P) | in | Correction coefficients. | |
tau | real(kind=R8P) | in | Sensor threshold. | |
q | real(kind=R8P) | in | Conservative variables. | |
q_aux | real(kind=R8P) | in | Auxiliary variables. | |
fl | real(kind=R8P) | inout | Face fluxes of direction d. | |
fallbacks | integer(kind=I4P) | out | Faces 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
d | integer(kind=I4P) | in | Direction, 1=x, 2=y, 3=z. | |
di | integer(kind=I4P) | in | Unit step along d. | |
dj | integer(kind=I4P) | in | Unit step along d. | |
dk | integer(kind=I4P) | in | Unit step along d. | |
ni | integer(kind=I4P) | in | Grid dimensions. | |
nj | integer(kind=I4P) | in | Grid dimensions. | |
nk | integer(kind=I4P) | in | Grid dimensions. | |
ngc | integer(kind=I4P) | in | Grid dimensions. | |
blocks_number | integer(kind=I4P) | in | Actual blocks number. | |
gamma | real(kind=R8P) | in | Specific heats ratio. | |
ch | real(kind=R8P) | in | GLM cleaning speed (models with GLM only). | |
is_characteristic | logical | in | Characteristic (or primitive) variables. | |
weno | type(weno_object) | in | WENO coefficients (with interpolation tables). | |
cc | real(kind=R8P) | in | Correction coefficients. | |
tau | real(kind=R8P) | in | Sensor threshold. | |
ir | integer(kind=I4P) | in | Index of the density (mass) variable. | |
gd | real(kind=R8P) | in | Gravity along d. | |
q | real(kind=R8P) | in | Conservative variables. | |
q_aux | real(kind=R8P) | in | Auxiliary variables. | |
gc | real(kind=R8P) | inout | Gravity 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
gamma | real(kind=R8P) | in | Specific heats ratio. | |
ch | real(kind=R8P) | in | GLM cleaning speed. | |
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. | |
mu | real(kind=R8P) | out | Magnitude 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
gamma | real(kind=R8P) | in | Specific heats ratio. | |
ch | real(kind=R8P) | in | GLM cleaning speed. | |
is_characteristic | logical | in | Characteristic (or primitive) variables. | |
er | real(kind=R8P) | in | Right eigenvectors. | |
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
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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
gamma | real(kind=R8P) | in | Specific heats ratio. | |
ch | real(kind=R8P) | in | GLM cleaning speed. | |
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 | Fallback 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
gamma | real(kind=R8P) | in | Specific heats ratio. | |
ch | real(kind=R8P) | in | GLM cleaning speed. | |
d | integer(kind=I4P) | in | Direction, 1=x, 2=y, 3=z. | |
q | real(kind=R8P) | in | Conservative variables. | |
qa | real(kind=R8P) | in | Auxiliary variables. | |
f | real(kind=R8P) | out | Physical flux. |
Call graph