Appearance
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
- flume_physics_object
- initialize
- load_from_file
- load_barotropic
- primitive_state_to_conservative
- description
- eos_pressure
- eos_sound_speed2
Variables
| Name | Type | Attributes | Description |
|---|---|---|---|
INI_SECTION_NAME | character(len=7) | parameter | INI (config) file section name containing physics configs. |
Derived Types
flume_physics_object
FLUME physics class definition.
Components
| Name | Type | Attributes | Description |
|---|---|---|---|
physical_model | character(len=:) | allocatable | Physical model. |
model | integer(kind=I4P) | Physical model id (MODEL_*), the host controllers dispatch on it. | |
cp | real(kind=R8P) | Specific heat at constant pressure. | |
cv | real(kind=R8P) | Specific heat at constant volume. | |
gamma | real(kind=R8P) | Specific heats ratio, cp/cv. | |
R | real(kind=R8P) | Gas constant, cp-cv. | |
temperature_unit_kelvin | real(kind=R8P) | [physics].(temperature_unit_kelvin): the kelvin value of | |
eos | character(len=:) | allocatable | [eos].(type): ideal (default), isothermal or barotropic (#100). |
sound_speed | real(kind=R8P) | [eos].(sound_speed): c0, the isothermal speed sqrt(P/rho) at | |
eos_arg | real(kind=R8P) | The EOS parameter the kernels take as gamma: gamma (ideal gas), | |
rho_ref | real(kind=R8P) | [eos].(reference_density) of a barotropic table. | |
eos_breaks | real(kind=R8P) | allocatable | [eos].(densities): the barotropic breaks, increasing. |
eos_exponents | real(kind=R8P) | allocatable | [eos].(exponents): one per segment, size(eos_breaks) + 1. |
nv | integer(kind=I4P) | Conservative variables number. | |
nv_aux | integer(kind=I4P) | Auxiliary variables number. | |
nv_mhd | integer(kind=I4P) | Last slot of the MHD state: NV_EULER (hydrodynamic models) or nv (MHD). | |
dual_energy_eta | real(kind=R8P) | Dual-energy switch (euler-de, issue #91). | |
passive_scalars | integer(kind=I4P) | Passive scalars in use, 0..NS_MAX (issue #92). | |
iq_scalar1 | integer(kind=I4P) | Slot of the first passive scalar (0 without the scalar slots). | |
nv_entropy | integer(kind=I4P) | Last entropy slot: IQ_S with dual energy, else nv_mhd. | |
mhd | type(flume_mhd_object) | MHD configs ([mhd], loaded with mhd-ideal only). | |
dissipation | type(flume_dissipation_object) | Dissipative coefficients ([physics], issue #65). | |
gravity | type(flume_gravity_object) | External gravity ([gravity], issue #73). | |
cooling | type(flume_cooling_object) | Radiative cooling ([cooling], issue #93). |
Type-Bound Procedures
| Name | Attributes | Description |
|---|---|---|
description | pass(self) | Return pretty-printed object description. |
eos_pressure | pass(self) | Pressure of a cell by the equation of state (host). |
eos_sound_speed2 | pass(self) | Sound speed squared, dP/drho, of a cell (host). |
initialize | pass(self) | Initialize physics. |
load_from_file | pass(self) | Load config from file. |
load_barotropic | pass(self) | Load and register the [eos] barotropic table. |
Subroutines
initialize
Initialize physics.
fortran
subroutine initialize(self, file_parameters)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_physics_object) | inout | Physics. | |
file_parameters | type(file_ini) | in | Simulation 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_physics_object) | inout | Physics. | |
file_parameters | type(file_ini) | in | Simulation 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_physics_object) | inout | Physics. | |
file_parameters | type(file_ini) | in | Simulation 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
model | integer(kind=I4P) | in | Physical model id. | |
gamma | real(kind=R8P) | in | Specific heats ratio. | |
prim | real(kind=R8P) | in | Primitive state (first 5 used by Euler). | |
q | real(kind=R8P) | out | Conservative variables [nv]. |
Call graph
Functions
description
Return a pretty-formatted object description.
Returns: character(len=:)
fortran
function description(self) result(desc)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_physics_object) | in | Physics. |
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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_physics_object) | in | Physics. | |
rho | real(kind=R8P) | in | Density. | |
e | real(kind=R8P) | in | Internal 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_physics_object) | in | Physics. | |
rho | real(kind=R8P) | in | Density. | |
e | real(kind=R8P) | in | Internal energy per unit volume (ideal gas only). |
Call graph