Skip to content

adam_flume_euler_baro_library ​

ADAM, FLUME pointwise barotropic Euler physics shared by the CPU and FNL backends (issue #100, M13 P3).

The body of adam_flume_euler_iso_library on a piecewise polytrope, [eos] type = barotropic: the energy slot is inert (D-M13-1) and the EOS argument named gamma carries the id of the realm's table in adam_flume_eos_tables_library (as a real). Only the four EOS hooks below differ from the isothermal library; the eigensystem, the Roe average and the LLF/HLL/HLLC fluxes are the body's, with c = sqrt(dP/drho) of each state.

ADAM, FLUME pointwise barotropic Euler physics, the body of adam_flume_euler_iso_library and adam_flume_euler_baro_library (issue #100, M13).

The including module renames NV_K, NV_AUX_K (its widths) and NV_BASE = NV_EULER, NV_AUX_BASE = NV_AUX (the Euler widths): the components NV_BASE+1 ... NV_K are advected scalars, as in the Euler body; with NV_K = NV_BASE every scalar loop is empty. The public interface is the Euler one, routine by routine, so the model-agnostic kernel bodies call either library unchanged; the EOS parameter keeps the Euler keyword gamma, and HERE IT IS physics%eos_arg: the isothermal sound speed squared c0^2, or the id of a barotropic table (adam_flume_eos_tables_library).

A barotropic gas, P = P(rho) (D-M13-1): the energy slot IQ_RE is inert. Its flux is zero, every Riemann flux forces it to zero, its eigenvalue is zero and its eigenvector the unit vector, so it keeps its initial value, 0. The including module provides the EOS as four pure hooks, the only places it enters: eos_pressure(gamma, rho), eos_temperature(gamma, R, rho) (P / (rho R)), eos_sound_speed(gamma, rho) (sqrt(dP/drho)) and eos_roe_sound_speed(gamma, rhoL, rhoR, pL, pR), the speed of the Roe average. The total enthalpy is undefined (0).

Eigensystem in direction d: normal n = e_d, tangents taken cyclically t1 = e_{mod(d,3)+1}, t2 = e_{mod(d+1,3)+1}, waves in the Euler order with the inert slot in the place of the entropy wave:

 r1 = (1, u - a n, 0)       l1 = ((u_n + a) / (2 a), -n / (2 a), 0)       lambda1 = u_n - a
 r2 = (0, 0, 1)             l2 = (0, 0, 1)                               lambda2 = 0      (the inert slot)
 r3 = (0, t1, 0)            l3 = (-u.t1, t1, 0)                          lambda3 = u_n
 r4 = (0, t2, 0)            l4 = (-u.t2, t2, 0)                          lambda4 = u_n
 r5 = (1, u + a n, 0)       l5 = (-(u_n - a) / (2 a), n / (2 a), 0)      lambda5 = u_n + a

checked against dF/dU in src/tests/flume/verification/eos/eos_oracle.py (eigen). The Roe average of two barotropic states is the sqrt(rho)-weighted velocity with the speed of eos_roe_sound_speed: c0 for the isothermal gas, the secant sqrt([P] / [rho]) for a table (the Roe property [F] = A~ [U] needs exactly that speed).

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

Dependencies

Contents ​

Variables ​

NameTypeAttributesDescription
ROE_SECANT_MINreal(kind=R8P)parameterRelative density gap below which the Roe speed is c(rho mean).

Subroutines ​

compute_eigenvalues ​

Compute the eigenvalues of the flux Jacobian in direction d: (u_n - a, 0, u_n, u_n, u_n + a).

Attributes: pure

fortran
subroutine compute_eigenvalues(d, qa, lambda)

Arguments

NameTypeIntentAttributesDescription
dinteger(kind=I4P)inDirection, 1=x, 2=y, 3=z.
qareal(kind=R8P)inAuxiliary variables.
lambdareal(kind=R8P)outEigenvalues.

Call graph

compute_eigenvectors ​

Compute the left (rows) and right (columns) eigenvectors of the flux Jacobian in direction d at state qa.

Attributes: pure

fortran
subroutine compute_eigenvectors(gamma, d, qa, el, er)

Arguments

NameTypeIntentAttributesDescription
gammareal(kind=R8P)inIsothermal sound speed squared c0^2 (unused: a is in qa).
dinteger(kind=I4P)inDirection, 1=x, 2=y, 3=z.
qareal(kind=R8P)inAuxiliary variables (e.g. a Roe average).
elreal(kind=R8P)outLeft eigenvectors, el(k,:) = l_k.
erreal(kind=R8P)outRight eigenvectors, er(:,k) = r_k.

Call graph

compute_face_flux_back_projection ​

Return the face flux in conservative variables from the reconstructed split fields, F = R (f+ + f-).

Attributes: pure

fortran
subroutine compute_face_flux_back_projection(is_characteristic, er, vr, flux)

Arguments

NameTypeIntentAttributesDescription
is_characteristiclogicalinReconstruction variables: characteristic or conservative.
erreal(kind=R8P)inRight eigenvectors, er(:,k) = r_k (unused if conservative).
vrreal(kind=R8P)inReconstructed split fields at the face.
fluxreal(kind=R8P)outFace flux.

Call graph

compute_face_interpolation_fields ​

Return the fields of the stencil of face i+1/2 to be WENO-interpolated to the face (scheme weno-riemann), in the layout of the Euler body: characteristic w = L q on the Roe average of cells 0 and 1, or primitive (rho, u, v, w, slot), the inert slot in the place of the pressure (P = c0^2 rho needs no separate field).

Attributes: pure

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

Arguments

NameTypeIntentAttributesDescription
gammareal(kind=R8P)inIsothermal sound speed squared c0^2.
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

compute_face_split_fluxes ​

Project and Lax-Friedrichs-split the stencil of face i+1/2, ready for the WENO upwind reconstruction: the Euler body's algorithm on the isothermal eigensystem (the inert field has speed 0, state 0 and flux 0: it splits to 0).

Attributes: pure

fortran
subroutine compute_face_split_fluxes(gamma, d, S, is_characteristic, qs, qas, fsplit, er, mu)

Arguments

NameTypeIntentAttributesDescription
gammareal(kind=R8P)inIsothermal sound speed squared c0^2.
dinteger(kind=I4P)inDirection, 1=x, 2=y, 3=z.
Sinteger(kind=I4P)inWENO stencil half-width, S <= S_MAX.
is_characteristiclogicalinCharacteristic (or conservative) variables.
qsreal(kind=R8P)inStencil conservative variables.
qasreal(kind=R8P)inStencil auxiliary variables.
fsplitreal(kind=R8P)outSplit fields in the WENO upwind layout.
erreal(kind=R8P)outRight eigenvectors (identity if conservative).
mureal(kind=R8P)outMagnitude of each field (WENO descaler).

Call graph

compute_face_states ​

Return the conservative left and right states of face i+1/2 from the WENO-interpolated fields. A state with a non-positive density (or an inadmissible scalar) is replaced by the state of its cell: the face falls back to first order. The pressure follows from the density, so the density is the only thermodynamic condition.

Attributes: pure

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

Arguments

NameTypeIntentAttributesDescription
gammareal(kind=R8P)inIsothermal sound speed squared c0^2.
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 (left of the face).
q1real(kind=R8P)inConservative variables of cell 1 (right of the face).
qLreal(kind=R8P)outLeft state.
qRreal(kind=R8P)outRight state.

Call graph

compute_flux ​

Compute the physical flux in direction d: rho u_d (1, u, v, w, 0) + p (0, e_d, 0), p = c0^2 rho.

Attributes: pure

fortran
subroutine compute_flux(d, q, qa, f)

Arguments

NameTypeIntentAttributesDescription
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

compute_roe_average ​

Compute the Roe average of two barotropic states: the sqrt(rho)-weighted velocity, the density sqrt(rho_L rho_R), the speed of eos_roe_sound_speed and the pressure of the average density; enthalpy and temperature are set to zero.

Attributes: pure

fortran
subroutine compute_roe_average(gamma, qaL, qaR, roe)

Arguments

NameTypeIntentAttributesDescription
gammareal(kind=R8P)inEOS parameter (eos_arg).
qaLreal(kind=R8P)inLeft state auxiliary variables.
qaRreal(kind=R8P)inRight state auxiliary variables.
roereal(kind=R8P)outRoe average.

Call graph

compute_riemann_hll ​

Compute the HLL flux of two isothermal states in direction d with the Einfeldt speeds S_L = min(u_nL - c0, u~_n - c0), S_R = max(u_nR + c0, u~_n + c0) (~ the Roe average); the inert slot's flux is zero.

Attributes: pure

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

Arguments

NameTypeIntentAttributesDescription
gammareal(kind=R8P)inIsothermal sound speed squared c0^2.
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

compute_riemann_hllc ​

Compute the isothermal HLLC flux of two states in direction d: HLL for the mass and the normal momentum, the transverse momenta and the advected scalars the HLL mass flux times the upwind specific value (the contact, the only wave the isothermal system has between the acoustic ones, carries the tangential velocity and the scalars and nothing else: it needs no star pressure). Checked against eos_oracle.py (flux: consistency, isolated contact).

Attributes: pure

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

Arguments

NameTypeIntentAttributesDescription
gammareal(kind=R8P)inIsothermal sound speed squared c0^2.
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

compute_riemann_llf ​

Compute the local Lax-Friedrichs (Rusanov) flux of two states in direction d, F = (f(qL) + f(qR)) / 2 - alpha (qR - qL) / 2, alpha = max(|u_n|) + c0; the inert slot's flux is zero.

Attributes: pure

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

Arguments

NameTypeIntentAttributesDescription
gammareal(kind=R8P)inIsothermal sound speed squared c0^2.
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

conservative_to_auxiliary ​

Compute the auxiliary variables of a cell from its conservative variables: p = P(rho), a = sqrt(dP/drho), T = P / (rho R), H = 0 (no energy equation).

Attributes: pure

fortran
subroutine conservative_to_auxiliary(gamma, R, q, qa)

Arguments

NameTypeIntentAttributesDescription
gammareal(kind=R8P)inEOS parameter (eos_arg).
Rreal(kind=R8P)inGas constant.
qreal(kind=R8P)inConservative variables.
qareal(kind=R8P)outAuxiliary variables.

Call graph

primitive_to_conservative ​

Compute the conservative variables of a cell from its primitive variables: the pressure is not a state variable of the isothermal gas (P = c0^2 rho), so p is ignored and the inert slot set to 0 (the advected scalars, if any, are the caller's).

Attributes: pure

fortran
subroutine primitive_to_conservative(gamma, r, u, v, w, p, q)

Arguments

NameTypeIntentAttributesDescription
gammareal(kind=R8P)inIsothermal sound speed squared c0^2 (unused).
rreal(kind=R8P)inDensity.
ureal(kind=R8P)inVelocity components.
vreal(kind=R8P)inVelocity components.
wreal(kind=R8P)inVelocity components.
preal(kind=R8P)inPressure (ignored).
qreal(kind=R8P)outConservative variables.

Call graph

hll_flux ​

The HLL flux with the Einfeldt speeds, its auxiliary states, physical fluxes and speeds (shared by HLL and HLLC).

Attributes: pure

fortran
subroutine hll_flux(gamma, d, qL, qR, qaL, qaR, fL, fR, sL, sR, f)

Arguments

NameTypeIntentAttributesDescription
gammareal(kind=R8P)inIsothermal sound speed squared c0^2.
dinteger(kind=I4P)inDirection, 1=x, 2=y, 3=z.
qLreal(kind=R8P)inLeft state.
qRreal(kind=R8P)inRight state.
qaLreal(kind=R8P)outLeft auxiliary variables.
qaRreal(kind=R8P)outRight auxiliary variables.
fLreal(kind=R8P)outLeft physical flux.
fRreal(kind=R8P)outRight physical flux.
sLreal(kind=R8P)outLeft and right wave speeds.
sRreal(kind=R8P)outLeft and right wave speeds.
freal(kind=R8P)outFlux.

Call graph

compute_state_magnitudes ​

Return the reference magnitude of each conservative variable of a cell, the WENO descaler scale (the Euler body's definition: |rho|, the inert slot |q_5|, every momentum component |rho u|_1 + sqrt(rho p)).

Attributes: pure

fortran
subroutine compute_state_magnitudes(q, qa, qm)

Arguments

NameTypeIntentAttributesDescription
qreal(kind=R8P)inConservative variables.
qareal(kind=R8P)inAuxiliary variables.
qmreal(kind=R8P)outReference magnitudes.

Call graph

Functions ​

eos_pressure ​

P(rho) of the table.

Attributes: pure

Returns: real(kind=R8P)

fortran
function eos_pressure(gamma, rho) result(p)

Arguments

NameTypeIntentAttributesDescription
gammareal(kind=R8P)inTable id.
rhoreal(kind=R8P)inDensity.

Call graph

eos_temperature ​

T = P / (rho R).

Attributes: pure

Returns: real(kind=R8P)

fortran
function eos_temperature(gamma, R, rho) result(t)

Arguments

NameTypeIntentAttributesDescription
gammareal(kind=R8P)inTable id.
Rreal(kind=R8P)inGas constant.
rhoreal(kind=R8P)inDensity.

Call graph

eos_sound_speed ​

a = sqrt(dP/drho).

Attributes: pure

Returns: real(kind=R8P)

fortran
function eos_sound_speed(gamma, rho) result(a)

Arguments

NameTypeIntentAttributesDescription
gammareal(kind=R8P)inTable id.
rhoreal(kind=R8P)inDensity.

Call graph

eos_roe_sound_speed ​

The speed of the Roe average, the secant sqrt([P] / [rho]): with it the Roe matrix satisfies [F] = A~ [U] for any P(rho). P increases with rho, so the secant is positive, between the two one-sided speeds of a segment and across breaks too. Below a relative density gap of ROE_SECANT_MIN the secant loses digits to cancellation (about eps / gap) while the mid-point speed errs by O(gap^2): there the speed is c(rho mean), both errors below 2e-10.

Attributes: pure

Returns: real(kind=R8P)

fortran
function eos_roe_sound_speed(gamma, rhoL, rhoR, pL, pR) result(a)

Arguments

NameTypeIntentAttributesDescription
gammareal(kind=R8P)inTable id.
rhoLreal(kind=R8P)inDensities.
rhoRreal(kind=R8P)inDensities.
pLreal(kind=R8P)inPressures.
pRreal(kind=R8P)inPressures.

Call graph