Skip to content

adam_flume_physics_object ​

ADAM, FLUME physics class definition.

The physical model is the ONE predicate that decides the state vector width nv (and nv_aux): the name arrays of the common object are built from the same predicate, so allocation and names cannot disagree. For mhd-ideal the predicate is (physical_model, [mhd].(divergence_control)) (issue #41, D-4): none gives MODEL_MHD (nv = 8), glm gives MODEL_MHD_GLM (nv = 9), eglm gives MODEL_MHD_EGLM (nv = 9). euler-de (issue #91) is the Euler model with dual energy: nv = 6, the sixth variable the advected entropy rho s, s = p / rho^gamma; [physics].(dual_energy_eta) (optional, default DUAL_ENERGY_ETA) is its switch. [physics].(passive_scalars) = N (issue #92, optional, 0 by default, 0 <= N <= NS_MAX, the hydrodynamic models only) selects the scalar variant of euler or euler-de: NS_MAX more slots at the end of the state (nv = 9 or 10), the first N carrying rho s_k, the others zero.

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

Dependencies

Contents ​

Variables ​

NameTypeAttributesDescription
INI_SECTION_NAMEcharacter(len=7)parameterINI (config) file section name containing physics configs.

Derived Types ​

flume_physics_object ​

FLUME physics class definition.

Components ​

NameTypeAttributesDescription
physical_modelcharacter(len=:)allocatablePhysical model.
modelinteger(kind=I4P)Physical model id (MODEL_*), the host controllers dispatch on it.
cpreal(kind=R8P)Specific heat at constant pressure.
cvreal(kind=R8P)Specific heat at constant volume.
gammareal(kind=R8P)Specific heats ratio, cp/cv.
Rreal(kind=R8P)Gas constant, cp-cv.
temperature_unit_kelvinreal(kind=R8P)[physics].(temperature_unit_kelvin): the kelvin value of
eoscharacter(len=:)allocatable[eos].(type): ideal (default), isothermal or barotropic (#100).
sound_speedreal(kind=R8P)[eos].(sound_speed): c0, the isothermal speed sqrt(P/rho) at
eos_argreal(kind=R8P)The EOS parameter the kernels take as gamma: gamma (ideal gas),
rho_refreal(kind=R8P)[eos].(reference_density) of a barotropic table.
eos_breaksreal(kind=R8P)allocatable[eos].(densities): the barotropic breaks, increasing.
eos_exponentsreal(kind=R8P)allocatable[eos].(exponents): one per segment, size(eos_breaks) + 1.
nvinteger(kind=I4P)Conservative variables number.
nv_auxinteger(kind=I4P)Auxiliary variables number.
nv_mhdinteger(kind=I4P)Last slot of the MHD state: NV_EULER (hydrodynamic models) or nv (MHD).
dual_energy_etareal(kind=R8P)Dual-energy switch (euler-de, issue #91).
passive_scalarsinteger(kind=I4P)Passive scalars in use, 0..NS_MAX (issue #92).
iq_scalar1integer(kind=I4P)Slot of the first passive scalar (0 without the scalar slots).
nv_entropyinteger(kind=I4P)Last entropy slot: IQ_S with dual energy, else nv_mhd.
mhdtype(flume_mhd_object)MHD configs ([mhd], loaded with mhd-ideal only).
dissipationtype(flume_dissipation_object)Dissipative coefficients ([physics], issue #65).
gravitytype(flume_gravity_object)External gravity ([gravity], issue #73).
coolingtype(flume_cooling_object)Radiative cooling ([cooling], issue #93).

Type-Bound Procedures ​

NameAttributesDescription
descriptionpass(self)Return pretty-printed object description.
eos_pressurepass(self)Pressure of a cell by the equation of state (host).
eos_sound_speed2pass(self)Sound speed squared, dP/drho, of a cell (host).
initializepass(self)Initialize physics.
load_from_filepass(self)Load config from file.
load_barotropicpass(self)Load and register the [eos] barotropic table.

Subroutines ​

initialize ​

Initialize physics.

fortran
subroutine initialize(self, file_parameters)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_physics_object)inoutPhysics.
file_parameterstype(file_ini)inSimulation parameters ini file handler.

Call graph

load_from_file ​

Load config from file; every key is required and an unknown or inconsistent value is fatal.

fortran
subroutine load_from_file(self, file_parameters)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_physics_object)inoutPhysics.
file_parameterstype(file_ini)inSimulation parameters ini file handler.

Call graph

load_barotropic ​

Load [eos] type = barotropic (issue #100, P3): sound_speed c0 (required, > 0), reference_density (> 0, default 1), and the table, densities (the breaks, > 0, strictly increasing) with exponents (one per segment, each >= 1), at most EOS_SEGMENTS_MAX segments; without both lists the Mathew & Federrath 2021 table (MNRAS 507, 2448, eqs. 5-7: breaks in g cm^-3, so a cgs input). The table is registered (adam_flume_eos_tables_library) and its id becomes eos_arg. A break where the exponent decreases is not genuinely nonlinear (P0: composite waves, which the exact solver of the verification refuses); it is accepted, the schemes do not depend on convexity, and reported.

fortran
subroutine load_barotropic(self, file_parameters)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_physics_object)inoutPhysics.
file_parameterstype(file_ini)inSimulation parameters ini file handler.

Call graph

primitive_state_to_conservative ​

Convert one primitive state (r, u, v, w, p [, bx, by, bz]) to the conservative variables of the model; with dual energy the advected entropy is rho s = p rho^(1-gamma) (issue #91).

Initialisation only (IC regions, BC inflow states): the model branch is outside every kernel and hot loop.

Attributes: pure

fortran
subroutine primitive_state_to_conservative(model, gamma, prim, q)

Arguments

NameTypeIntentAttributesDescription
modelinteger(kind=I4P)inPhysical model id.
gammareal(kind=R8P)inSpecific heats ratio.
primreal(kind=R8P)inPrimitive state (first 5 used by Euler).
qreal(kind=R8P)outConservative variables [nv].

Call graph

Functions ​

description ​

Return a pretty-formatted object description.

Returns: character(len=:)

fortran
function description(self) result(desc)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_physics_object)inPhysics.

Call graph

eos_pressure ​

Return the pressure of a cell (issue #100, P4; host code: the sinks): (gamma - 1) e for the ideal gas, c0^2 rho for the isothermal gas, the table's P(rho) for the barotropic gas, whose e is ignored.

Attributes: pure

Returns: real(kind=R8P)

fortran
function eos_pressure(self, rho, e) result(p)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_physics_object)inPhysics.
rhoreal(kind=R8P)inDensity.
ereal(kind=R8P)inInternal energy per unit volume (ideal gas only).

Call graph

eos_sound_speed2 ​

Return the sound speed squared c_s^2 = dP/drho of a cell (issue #100, P4, D-M13-4; host code: the sinks and the Jeans marker): gamma (gamma - 1) e / rho for the ideal gas, c0^2 for the isothermal gas, the table's Gamma_k P / rho for the barotropic gas, whose e is ignored.

Attributes: pure

Returns: real(kind=R8P)

fortran
function eos_sound_speed2(self, rho, e) result(c2)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_physics_object)inPhysics.
rhoreal(kind=R8P)inDensity.
ereal(kind=R8P)inInternal energy per unit volume (ideal gas only).

Call graph