Appearance
adam_flume_cpu_mhd_kernels
ADAM, FLUME CPU kernels of the ideal MHD (no divergence control) model.
The model-agnostic auxiliary-variables loop (adam_flume_cpu_aux_kernels_agnostic.INC) and the MHD dt loop (adam_flume_cpu_mhd_kernels_agnostic.INC) instantiated with NV_K = NV_MHD, NV_AUX_K = NV_AUX_MHD (issue #41, section 4). The face-flux kernel is the shared body with the MHD split (M2-P3).
Source: src/app/flume/cpu/adam_flume_cpu_mhd_kernels.F90
Dependencies
Contents
- compute_face_fluxes
- add_gravity_edge_correction
- compute_q_aux
- count_nonfinite
- compute_lambda_max
- compute_lambda_max_dissipative
- apply_floors
- compute_speed_max
- compute_divb_norms
- compute_positivity_factors
- compute_seam_positivity_factors
- compute_backbone_fluxes
- positivity_cell_factor
- blend_positivity_fluxes
- blend_inadmissible_ghosts
- face_split_fluxes
- backbone_face_flux
- cell_sources
- cleaning_energy
- internal_energy
Subroutines
compute_face_fluxes
Compute the WENO 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 = 1-S ... S into constant-bound locals, project and split it, reconstruct every field (the local v is the packed stencil of the WENO primitive), back-project.
fortran
subroutine compute_face_fluxes(d, di, dj, dk, ni, nj, nk, ngc, blocks_number, gamma, ch, is_characteristic, weno, q, q_aux, fl)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 conservative) variables. | |
weno | type(weno_object) | in | WENO coefficients. | |
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. |
Call graph
add_gravity_edge_correction
Add the faces beyond the block to the gravity energy correction of direction d (issue #73, M7-G2a): cell 1 takes -g_d F^rho / 24 of face -1 (between cells -1 and 0), cell n_d that of face n_d + 1 (between cells n_d + 1 and n_d + 2), the two terms of g_d (-F_{i-3/2} + F_{i-1/2} + F_{i+1/2} - F_{i+3/2}) / 24 whose faces the block does not hold. Each face is computed as compute_face_fluxes does (the same body, its mass component kept), from the ghosts: its stencil reaches S + 1 ghost cells, which the initialisation requires with gravity.
fortran
subroutine add_gravity_edge_correction(d, di, dj, dk, ni, nj, nk, ngc, blocks_number, gamma, ch, is_characteristic, weno, 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 conservative) variables. | |
weno | type(weno_object) | in | WENO coefficients. | |
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
compute_q_aux
Compute the auxiliary variables on every cell, ghost cells included.
fortran
subroutine compute_q_aux(ni, nj, nk, ngc, blocks_number, gamma, R, q, q_aux)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
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. | |
R | real(kind=R8P) | in | Gas constant. | |
q | real(kind=R8P) | in | Conservative variables. | |
q_aux | real(kind=R8P) | inout | Auxiliary variables. |
Call graph
count_nonfinite
Count the non-finite (NaN or infinite) conservative values of the interior cells (issue #45): the exponent field has all its bits set. Tested on the bit pattern, so that no floating point mode can fold the test away.
fortran
subroutine count_nonfinite(ni, nj, nk, ngc, blocks_number, q, n)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
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. | |
q | real(kind=R8P) | in | Conservative variables. | |
n | integer(kind=I8P) | out | Non-finite values number. |
Call graph
compute_lambda_max
Compute max(sum_d (|u_d| + c_{f,d}) / dx_d) over the interior cells (null directions excluded), c_{f,d} the fast magnetosonic speed along d (issue #41, section 3.5).
fortran
subroutine compute_lambda_max(ni, nj, nk, ngc, blocks_number, gamma, R, dxyz, is_null, q, lambda_max)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
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. | |
R | real(kind=R8P) | in | Gas constant. | |
dxyz | real(kind=R8P) | in | Blocks space steps [3, nb]. | |
is_null | logical | in | Null directions. | |
q | real(kind=R8P) | in | Conservative variables. | |
lambda_max | real(kind=R8P) | out | Maximum of sum_d (|u_d| + c_{f,d}) / dx_d. |
Call graph
compute_lambda_max_dissipative
Compute max(sum_d (|u_d| + c_{f,d}) / dx_d + 2 nu sum_d 1 / dx_d^2) over the interior cells (issue #65, D-M4-3), nu the largest diffusivity of the cell (Ohmic included), with the maxima of the two parts and the minimum cell Reynolds number; the MHD twin of the Euler compute_lambda_max_dissipative.
fortran
subroutine compute_lambda_max_dissipative(ni, nj, nk, ngc, blocks_number, gamma, R, cp, mu0, k0, eta, t_wall, tref, omega_mu, omega_k, dxyz, is_null, q, lambda_max, lambda_hyp, lambda_dif, re_cell_min)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
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, gas constant, cp. | |
R | real(kind=R8P) | in | Specific heats ratio, gas constant, cp. | |
cp | real(kind=R8P) | in | Specific heats ratio, gas constant, cp. | |
mu0 | real(kind=R8P) | in | Dissipative coefficients. | |
k0 | real(kind=R8P) | in | Dissipative coefficients. | |
eta | real(kind=R8P) | in | Dissipative coefficients. | |
t_wall | real(kind=R8P) | in | Hottest isothermal wall temperature, 0 if none. | |
tref | real(kind=R8P) | in | Temperature laws. | |
omega_mu | real(kind=R8P) | in | Temperature laws. | |
omega_k | real(kind=R8P) | in | Temperature laws. | |
dxyz | real(kind=R8P) | in | Blocks space steps [3, nb]. | |
is_null | logical | in | Null directions. | |
q | real(kind=R8P) | in | Conservative variables. | |
lambda_max | real(kind=R8P) | out | Maximum of the sum. | |
lambda_hyp | real(kind=R8P) | out | Maximum of the hyperbolic part. | |
lambda_dif | real(kind=R8P) | out | Maximum of the diffusive part. | |
re_cell_min | real(kind=R8P) | out | Minimum cell Reynolds number. |
Call graph
apply_floors
Apply the MHD positivity floors to the interior cells of a stage state, before its ghost exchange (issue #41, section 3.8): a cell with rho < rho_floor or p < p_floor gets rho = max(rho, rho_floor) at fixed velocity and p = max(p, p_floor) (internal energy added; the model's cleaning_energy adapter adds psi^2 / 2 under EGLM, zero otherwise). Interior only: the exchange then carries the floored values to the ghost cells, and ghost cells that no map fills (never read by the stencils) are not inspected. Returns the floored cells, the cells with a non-positive density or pressure (counted before flooring) and the minimum density and pressure. Floors are not conservative: the caller logs the counters.
fortran
subroutine apply_floors(ni, nj, nk, ngc, blocks_number, gamma, R, rho_floor, p_floor, q, floored, nonpositive, rho_min, p_min)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
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. | |
R | real(kind=R8P) | in | Gas constant. | |
rho_floor | real(kind=R8P) | in | Density and pressure floors. | |
p_floor | real(kind=R8P) | in | Density and pressure floors. | |
q | real(kind=R8P) | inout | Conservative variables. | |
floored | integer(kind=I4P) | out | Floored cells. | |
nonpositive | integer(kind=I4P) | out | Cells with non-positive density or pressure. | |
rho_min | real(kind=R8P) | out | Minimum density and pressure. | |
p_min | real(kind=R8P) | out | Minimum density and pressure. |
Call graph
compute_speed_max
Compute max(|u_d| + c_{f,d}) over the interior cells and the active directions, the fastest wave speed (the GLM c_h check, issue #41, section 3.5).
fortran
subroutine compute_speed_max(ni, nj, nk, ngc, blocks_number, gamma, R, is_null, q, speed_max)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
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. | |
R | real(kind=R8P) | in | Gas constant. | |
is_null | logical | in | Null directions. | |
q | real(kind=R8P) | in | Conservative variables. | |
speed_max | real(kind=R8P) | out | Maximum of |u_d| + c_{f,d}. |
Call graph
compute_divb_norms
Compute the div(B) norms over the interior cells (issue #41, D-10): max|div B|, sum |div B| dV and the maximum over the seam-local cells (within band cells of a block face with seam(b,face) /= 0, a 2:1 AMR or inter-realm seam). div B is the centred finite difference of the library (half stencil hs), null directions weighted zero; the cell volume includes the null directions (issue #37). The caller has refreshed the ghost cells.
fortran
subroutine compute_divb_norms(ni, nj, nk, ngc, blocks_number, hs, band, dxyz, is_null, seam, q, divb_max, divb_l1, divb_seam_max)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
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. | |
hs | integer(kind=I4P) | in | Finite difference half stencil, <= ngc. | |
band | integer(kind=I4P) | in | Seam-local band width, in cells. | |
dxyz | real(kind=R8P) | in | Blocks space steps [3, nb]. | |
is_null | logical | in | Null directions. | |
seam | integer(kind=I4P) | in | Seam faces flags [nb, 6] (0: not a seam face). | |
q | real(kind=R8P) | in | Conservative variables. | |
divb_max | real(kind=R8P) | out | Maximum of |div B|. | |
divb_l1 | real(kind=R8P) | out | Sum of |div B| dV. | |
divb_seam_max | real(kind=R8P) | out | Maximum of |div B| over the seam-local cells. |
Call graph
compute_positivity_factors
Compute the cell factor Lambda of every interior cell into lam(1,:,:,:,:) (the other components untouched) and count the cells whose backbone is not admissible (Lambda = 0 there: the floors, if enabled, take over) and those with a non-finite high-order face flux (Lambda = 0 too: a NaN or infinite flux carries no information, and every comparison with it is false, so the corner factors would keep it; tested on the bit pattern as count_nonfinite).
fortran
subroutine compute_positivity_factors(ni, nj, nk, ngc, blocks_number, gamma, ch, damping, hs, dt, g, has_phi, phi, dxyz, is_null, q, q_aux, flx, fly, flz, gc, lam, bad, nonfinite)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
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 (EGLM only). | |
damping | real(kind=R8P) | in | GLM damping rate (EGLM only). | |
hs | integer(kind=I4P) | in | Half stencil of the high-order sources. | |
dt | real(kind=R8P) | in | Forward-Euler step of the stage. | |
g | real(kind=R8P) | in | Gravity (issue #73), zero without it. | |
has_phi | logical | in | The cell potential is applied (issue #81). | |
phi | real(kind=R8P) | in | Gravitational potential (read with has_phi). | |
dxyz | real(kind=R8P) | in | Blocks space steps [3, nb]. | |
is_null | logical | in | Null directions. | |
q | real(kind=R8P) | in | Conservative variables (ghosts updated). | |
q_aux | real(kind=R8P) | in | Auxiliary variables. | |
flx | real(kind=R8P) | in | X-face high-order fluxes. | |
fly | real(kind=R8P) | in | Y-face high-order fluxes. | |
flz | real(kind=R8P) | in | Z-face high-order fluxes. | |
gc | real(kind=R8P) | in | Gravity energy correction (zero without it). | |
lam | real(kind=R8P) | inout | Cell factors (component 1). | |
bad | integer(kind=I4P) | out | Cells with an inadmissible backbone. | |
nonfinite | integer(kind=I4P) | out | Cells with a non-finite high-order face flux. |
Call graph
compute_seam_positivity_factors
Recompute the factor of the cells beside a 2:1 seam with the seam faces' backbone and high-order fluxes overridden (issue #50, D1: per-stage seam flux synchronisation). Cell n is cell(1:4,n) = (i, j, k, b); its face fec (1..6: -x, +x, -y, +y, -z, +z) takes olo(:,fec,n) and ohi(:,fec,n) where omask(fec,n), the backbone flux of q and the high-order flux of flx/fly/flz elsewhere, exactly as compute_positivity_factors. dbad and dnonfinite return the change of the two counts against the factors without the overrides, which compute_positivity_factors has already counted.
fortran
subroutine compute_seam_positivity_factors(ngc, gamma, ch, damping, hs, dt, g, has_phi, phi, dxyz, is_null, q, q_aux, flx, fly, flz, gc, ncells, cell, omask, olo, ohi, lam, dbad, dnonfinite)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
ngc | integer(kind=I4P) | in | Ghost cells number. | |
gamma | real(kind=R8P) | in | Specific heats ratio. | |
ch | real(kind=R8P) | in | GLM cleaning speed (EGLM only). | |
damping | real(kind=R8P) | in | GLM damping rate (EGLM only). | |
hs | integer(kind=I4P) | in | Half stencil of the high-order sources. | |
dt | real(kind=R8P) | in | Forward-Euler step of the stage. | |
g | real(kind=R8P) | in | Gravity (issue #73), zero without it. | |
has_phi | logical | in | The cell potential is applied (issue #81). | |
phi | real(kind=R8P) | in | Gravitational potential (read with has_phi). | |
dxyz | real(kind=R8P) | in | Blocks space steps [3, nb]. | |
is_null | logical | in | Null directions. | |
q | real(kind=R8P) | in | Conservative variables (ghosts updated). | |
q_aux | real(kind=R8P) | in | Auxiliary variables. | |
flx | real(kind=R8P) | in | X-face high-order fluxes. | |
fly | real(kind=R8P) | in | Y-face high-order fluxes. | |
flz | real(kind=R8P) | in | Z-face high-order fluxes. | |
gc | real(kind=R8P) | in | Gravity energy correction (zero without it). | |
ncells | integer(kind=I4P) | in | Seam cells. | |
cell | integer(kind=I4P) | in | Seam cells (i, j, k, b) [4, ncells]. | |
omask | logical | in | Overridden faces [6, ncells]. | |
olo | real(kind=R8P) | in | Override backbone fluxes [nv, 6, ncells]. | |
ohi | real(kind=R8P) | in | Override high-order fluxes [nv, 6, ncells]. | |
lam | real(kind=R8P) | inout | Cell factors (component 1). | |
dbad | integer(kind=I4P) | out | Change of the inadmissible backbones count. | |
dnonfinite | integer(kind=I4P) | out | Change of the non-finite cells count. |
Call graph
compute_backbone_fluxes
Compute the backbone flux of n face state pairs of direction d (issue #50: the fine faces of a 2:1 seam take the coarse donor cell as their outer state).
fortran
subroutine compute_backbone_fluxes(n, d, gamma, ch, qL, qR, flo)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
n | integer(kind=I4P) | in | Faces number. | |
d | integer(kind=I4P) | in | Direction, 1=x, 2=y, 3=z. | |
gamma | real(kind=R8P) | in | Specific heats ratio. | |
ch | real(kind=R8P) | in | GLM cleaning speed (EGLM only). | |
qL | real(kind=R8P) | in | Left states [nv, n]. | |
qR | real(kind=R8P) | in | Right states [nv, n]. | |
flo | real(kind=R8P) | out | Backbone fluxes [nv, n]. |
Call graph
positivity_cell_factor
The factor of one cell from its backbone update qb, the antidiffusive differences dlt(:,1:nf) of its active faces and the source difference dsrc: status 1 (and lc = 0) if the backbone is not admissible, 2 (and lc = 0) if a face difference is not finite (a NaN passes every comparison of the corners), else 0 with lc the largest factor of the corner box.
Attributes: pure
fortran
subroutine positivity_cell_factor(nf, qb, dlt, dsrc, lc, status)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
nf | integer(kind=I4P) | in | Active faces. | |
qb | real(kind=R8P) | in | Backbone update. | |
dlt | real(kind=R8P) | in | Antidiffusive differences. | |
dsrc | real(kind=R8P) | in | Source difference. | |
lc | real(kind=R8P) | out | Cell factor. | |
status | integer(kind=I4P) | out | 0 admissible, 1 inadmissible backbone, 2 non-finite. |
Call graph
blend_positivity_fluxes
Blend the face fluxes of direction d with the backbone: F <- F^LLF + theta (F - F^LLF), theta the smaller factor of the two cells (ghost factors from the exchange; a ghost never written keeps 1, so a physical-boundary face takes the interior cell's factor). Faces with theta = 1 are left untouched (bitwise), and counted otherwise; a face with theta = 0 takes the backbone flux itself (0 * NaN would keep a non-finite high-order flux).
fortran
subroutine blend_positivity_fluxes(d, di, dj, dk, ni, nj, nk, ngc, blocks_number, gamma, ch, q, lam, fl, limited)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 (EGLM only). | |
q | real(kind=R8P) | in | Conservative variables. | |
lam | real(kind=R8P) | in | Cell factors (component 1). | |
fl | real(kind=R8P) | inout | Face fluxes of direction d. | |
limited | integer(kind=I4P) | out | Faces with theta < 1. |
Call graph
blend_inadmissible_ghosts
Blend every inadmissible face ghost of q toward the adjacent interior cell and count the ghosts blended.
fortran
subroutine blend_inadmissible_ghosts(ni, nj, nk, ngc, blocks_number, is_null, q, blended)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
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. | |
is_null | logical | in | Null directions. | |
q | real(kind=R8P) | inout | Conservative variables (ghosts updated). | |
blended | integer(kind=I4P) | out | Ghosts blended. |
Call graph
face_split_fluxes
Split adapter of the shared face kernel (issue #41, M2-P3): the MHD split without cleaning, ch unused.
Attributes: pure
fortran
subroutine face_split_fluxes(gamma, ch, d, S, is_characteristic, qs, qas, fsplit, 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 conservative) variables. | |
qs | real(kind=R8P) | in | Stencil conservative variables. | |
qas | real(kind=R8P) | in | Stencil auxiliary variables. | |
fsplit | real(kind=R8P) | out | Split 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
backbone_face_flux
Backbone adapter of the positivity limiter: the Lax-Friedrichs flux with the Wu speed, ch unused.
Attributes: pure
fortran
subroutine backbone_face_flux(gamma, ch, d, qL, qR, 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. | |
qL | real(kind=R8P) | in | Left state. | |
qR | real(kind=R8P) | in | Right state. | |
f | real(kind=R8P) | out | Flux. |
Call graph
cell_sources
Sources adapter of the positivity limiter: none (MHD without divergence control).
Attributes: pure
fortran
subroutine cell_sources(ngc, hs, damping, dxyz, is_null, q, q_aux, i, j, k, b, s_lo, s_hi)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
ngc | integer(kind=I4P) | in | Ghost cells number. | |
hs | integer(kind=I4P) | in | Half stencil of the high-order sources. | |
damping | real(kind=R8P) | in | GLM damping rate. | |
dxyz | real(kind=R8P) | in | Block space steps. | |
is_null | logical | in | Null directions. | |
q | real(kind=R8P) | in | Conservative variables. | |
q_aux | real(kind=R8P) | in | Auxiliary variables. | |
i | integer(kind=I4P) | in | Cell indexes. | |
j | integer(kind=I4P) | in | Cell indexes. | |
k | integer(kind=I4P) | in | Cell indexes. | |
b | integer(kind=I4P) | in | Cell indexes. | |
s_lo | real(kind=R8P) | out | Backbone sources. | |
s_hi | real(kind=R8P) | out | High-order sources. |
Call graph
Functions
cleaning_energy
Cleaning-energy adapter of the floors kernel: zero, psi (if any) is not part of the energy of this model.
Attributes: pure
Returns: real(kind=R8P)
fortran
function cleaning_energy(q) result(e)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
q | real(kind=R8P) | in | Conservative variables. |
Call graph
internal_energy
Internal-energy adapter of the positivity limiter: E minus the kinetic and magnetic energies, per unit volume.
Attributes: pure
Returns: real(kind=R8P)
fortran
function internal_energy(q) result(e)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
q | real(kind=R8P) | in | Conservative variables. |
Call graph