Appearance
adam_flume_bc_object
ADAM, FLUME boundary conditions class definition.
periodic is the library BC_PERIODIC, so the tree builds true periodic neighbors and the ghost exchange fills periodic ghosts across blocks and ranks (verified by src/tests/amr/test_periodic_ghost); the other kinds are filled by the backends on the boundary crown maps.
Realm edges and corners. A crown row beyond several realm faces (an edge or a corner of the realm) is filled by the kind of one of those faces, realm_edge_face, applied to the donor realm_edge_donor: mirrored (wall) or clamped (extrapolation) along that face's axis, so the donor lies beyond the other faces only and is a ghost already filled. The backends fill the rows beyond one face first, then two, then three (issue #65 P0).
No-slip walls (issue #65, D-M4-7). wall-noslip (adiabatic) and wall-isothermal mirror the interior cell like wall-inviscid but reflect the whole velocity about the wall velocity, u_g = 2 u_w - u (wall_u, wall_v, wall_w, tangential, default 0; a normal component is fatal), so the mean of the two cells is the wall velocity. The pressure is mirrored. The adiabatic wall mirrors the temperature (and the density); the isothermal wall sets the ghost temperature to the geometric mirror T_g = wall_temperature^2 / T, so the geometric mean of the two cells is the wall temperature, and the density from the mirrored pressure, rho_g = p / (R T_g). The geometric mirror is positive for any positive T; the linear one, 2 wall_temperature - T (P1), gave a negative ghost density beside gas hotter than twice the wall (issue #65 P2). For T = T_w + delta the two differ by delta^2 / T_w, so both are second-order at the wall. The field follows the MHD wall rule of wall-inviscid (normal component odd), psi is even.
Modelled wall (issue #119, T3.3). wall-modelled, with wall_temperature: the ghosts mirror as wall-inviscid; the flux through the face comes from the wall model (adam_flume_wall_model_library), sampled at the 3rd cell off the wall or at wall_model_height (interpolated between cells), damping wall_model_damping classical (wall units) or semi-local (local density and viscosity), the samples averaged in time over wall_model_filter (an exponential filter, 0 for none). wall_model = inverse-transformation (T3.5) takes the model of Griffin, Fu & Moin (2023) instead of the equilibrium one, with the state at the edge of the layer wall_model_edge_velocity, wall_model_edge_temperature. Euler with a viscosity only. wall_model_eddy_viscosity = .true. (default .false.) adds in the cells below the matching height the model's own eddy viscosity, kappa y sqrt(rho tau_w) D^2 from the instantaneous (unfiltered) sample's tau_w, the damping of the face (semi-local for the inverse model), the cell's density and viscosity, the larger of it and a subgrid-scale model's: the resolved layer then carries the modelled stress and heat flux to the face. Without it nothing below h does (issue #119, the Mach 3 first-cell drain).
Hydrostatic (issue #73, M7-G0). hydrostatic closes a stratified atmosphere under the constant gravity of [gravity]: the ghost density and pressure continue the isothermal hydrostatic equilibrium from the first interior cell along the normal, rho_g = rho_1 exp(g_d s / T_1), p_g = rho_g T_1 (T_1 = p_1 / rho_1, s the signed distance from that cell to the ghost along the axis d), so an isothermal atmosphere has exact ghosts; the velocity is mirrored as at wall-inviscid (normal component odd, no mass flux), the field and psi are mirrored even (the field lines pass through the boundary, so a uniform field along or across gravity stays uniform; a reflecting wall is wall-inviscid). Without gravity along the normal it is a slip wall that copies the thermodynamic state of the first interior cell (Zingale et al. 2002, ApJS 143, 539: hydrostatic ghosts integrated at constant temperature, reflecting velocity).
Non-reflecting (issue #121, S2). non-reflecting, with the target state r, u, v, w, p, nr_sigma (default 0.28) and nr_length (L, required), is a characteristic boundary for outflow and far-field faces in ghost-cell form: the ghosts are the first interior cell plus the jumps of the characteristic variables linearised about it (outward normal velocity u_n, sound speed c). An outgoing wave (speed > 0) is extrapolated (zero jump). The incoming acoustic wave (u_n - c < 0) has its normal gradient set by the relaxation of Rudy & Strikwerda (1980) and Poinsot & Lele (1992), d(p - rho c u_n)/dn = K (p - p_t) / (u_n - c), K = sigma (1 - M^2) c / L, so the mean pressure is pulled toward the target and a wave leaving the box is not sent back; ghost m lies m cells off the interior cell. Flow into the domain (u_n < 0) takes the entropy and the tangential velocity of the target; u_n + c <= 0 (supersonic inflow) the whole target state. A supersonic outflow, or sigma = 0 at an outflow, is extrapolation bit for bit. Euler (ideal gas, no passive scalars, no dual energy) only; the edge and corner rows beyond it are extrapolated. Digital-filter inflow (issue #119, T3.7). inflow-digital-filter feeds a turbulent boundary layer through the face: the keys and the method are in adam_flume_inflow_df_object (component df). The backends write its ghost states after the face pass; in the edge and corner passes it is extrapolated.
Source: src/app/flume/common/adam_flume_bc_object.F90
Dependencies
Contents
- flume_bc_object
- initialize
- load_from_file
- realm_edge_donor
- wall_noslip_ghost
- oblique_shock
- nonreflecting_ghost
- hydrostatic_ghost
- description
- realm_edge_face
Variables
| Name | Type | Attributes | Description |
|---|---|---|---|
BC_EXTRAPOLATION | integer(kind=I4P) | parameter | Zeroth-order extrapolation. |
BC_INFLOW | integer(kind=I4P) | parameter | Prescribed state. |
BC_WALL_INVISCID | integer(kind=I4P) | parameter | Inviscid (slip) wall: mirror with normal momentum negated. |
BC_WALL_NOSLIP | integer(kind=I4P) | parameter | No-slip adiabatic wall: velocity reflected about the wall's. |
BC_WALL_ISOTHERMAL | integer(kind=I4P) | parameter | No-slip isothermal wall: also the temperature set. |
BC_HYDROSTATIC | integer(kind=I4P) | parameter | Hydrostatic ghosts under gravity, mirrored velocity. |
BC_INFLOW_DF | integer(kind=I4P) | parameter | Digital-filter turbulent inflow (issue #119, T3.7). |
BC_NONREFLECTING | integer(kind=I4P) | parameter | Characteristic non-reflecting outflow (issue #121, S2). |
BC_SHOCK_GENERATOR | integer(kind=I4P) | parameter | Oblique-shock generator on a y face (issue #121, S3). |
BC_EXTRAPOLATION_STR | character(len=13) | parameter | Accepted spelling of BC_EXTRAPOLATION. |
BC_INFLOW_STR | character(len=6) | parameter | Accepted spelling of BC_INFLOW. |
BC_WALL_MODELLED_STR | character(len=13) | parameter | A modelled wall: mirrored as wall-inviscid, the wall-face flux by the wall model (issue #119, T3.3). |
BC_WALL_INVISCID_STR | character(len=13) | parameter | Accepted spelling of BC_WALL_INVISCID. |
BC_PERIODIC_STR | character(len=8) | parameter | Accepted spelling of BC_PERIODIC. |
BC_WALL_NOSLIP_STR | character(len=11) | parameter | Accepted spelling of BC_WALL_NOSLIP. |
BC_WALL_ISOTHERMAL_STR | character(len=15) | parameter | Accepted spelling of BC_WALL_ISOTHERMAL. |
BC_HYDROSTATIC_STR | character(len=11) | parameter | Accepted spelling of BC_HYDROSTATIC. |
BC_INFLOW_DF_STR | character(len=21) | parameter | Accepted spelling of BC_INFLOW_DF. |
BC_NONREFLECTING_STR | character(len=14) | parameter | Accepted spelling of BC_NONREFLECTING. |
BC_SHOCK_GENERATOR_STR | character(len=15) | parameter | Accepted spelling of BC_SHOCK_GENERATOR. |
NR_SIGMA_DEFAULT | real(kind=R8P) | parameter | Non-reflecting: relaxation (Rudy & Strikwerda 1980). |
WALL_VELOCITY_KEY | character(len=6) | parameter | Wall velocity keys. |
INFLOW_KEY | character(len=2) | parameter | Inflow primitive state keys (MHD: all 8). |
SECTION_NAME | character(len=8) | parameter | INI section names of the 6 faces. |
Derived Types
flume_bc_object
FLUME boundary conditions class definition.
Components
| Name | Type | Attributes | Description |
|---|---|---|---|
bc_type | integer(kind=I4P) | Boundary condition type of each face. | |
q_inflow | real(kind=R8P) | allocatable | Conservative inflow state of each face [nv, 6]. |
wall_sign | real(kind=R8P) | allocatable | Wall mirror sign of each variable per direction [nv, 3] (+1 or -1). |
wall_velocity | real(kind=R8P) | No-slip walls: wall velocity of each face. | |
wall_modelled | logical | Faces of a wall model (issue #119, T3.3). | |
wm_height | real(kind=R8P) | Wall model: matching height per face, 0 for the 3rd cell. | |
wm_semilocal | logical | Wall model: semi-local damping per face. | |
wm_filter | real(kind=R8P) | Wall model: time scale of the input filter per face, 0 for none. | |
wm_viscosity | logical | Wall model: its eddy viscosity in the cells below the matching height per face. | |
wm_inverse | logical | Wall model: the inverse-transformation model (Griffin et al. 2023) per face, else the equilibrium one. | |
wm_edge_u | real(kind=R8P) | Inverse model: speed at the edge of the layer per face. | |
wm_edge_t | real(kind=R8P) | Inverse model: temperature at the edge of the layer per face. | |
wall_temperature | real(kind=R8P) | Isothermal walls: wall temperature of each face. | |
nr_par | real(kind=R8P) | Non-reflecting faces: target r, u, v, w, p, then sigma and L. | |
sg_par | real(kind=R8P) | Shock generators: the post-shock conservative state, then the x range [x0, x1). | |
df | type(flume_inflow_df_object) | Digital-filter inflow (issue #119, T3.7). |
Type-Bound Procedures
| Name | Attributes | Description |
|---|---|---|
description | pass(self) | Return pretty-printed object description. |
initialize | pass(self) | Initialize boundary conditions. |
load_from_file | pass(self) | Load config from file. |
Subroutines
initialize
Initialize boundary conditions.
fortran
subroutine initialize(self, file_parameters, physics)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_bc_object) | inout | Boundary conditions. | |
file_parameters | type(file_ini) | in | Simulation parameters ini file handler. | |
physics | type(flume_physics_object) | in | Physics (for the inflow state conversion). |
Call graph
load_from_file
Load config from file; type is required on every face and an unknown value is fatal.
fortran
subroutine load_from_file(self, file_parameters, physics)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_bc_object) | inout | Boundary conditions. | |
file_parameters | type(file_ini) | in | Simulation parameters ini file handler. | |
physics | type(flume_physics_object) | in | Physics (for the inflow state conversion). |
Call graph
realm_edge_donor
Donor of the ghost (i, j, k) filled by the condition of face: the cell mirrored about the face (walls) or the first interior cell along its normal (extrapolation); the indexes along the other axes are kept.
Attributes: pure
fortran
subroutine realm_edge_donor(face, face_kind, ni, nj, nk, i, j, k, iref, jref, kref)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
face | integer(kind=I4P) | in | Face (1..6: -x, +x, -y, +y, -z, +z). | |
face_kind | integer(kind=I4P) | in | Kind of the face. | |
ni | integer(kind=I4P) | in | Grid dimensions. | |
nj | integer(kind=I4P) | in | Grid dimensions. | |
nk | integer(kind=I4P) | in | Grid dimensions. | |
i | integer(kind=I4P) | in | Ghost cell. | |
j | integer(kind=I4P) | in | Ghost cell. | |
k | integer(kind=I4P) | in | Ghost cell. | |
iref | integer(kind=I4P) | out | Donor cell. | |
jref | integer(kind=I4P) | out | Donor cell. | |
kref | integer(kind=I4P) | out | Donor cell. |
Call graph
wall_noslip_ghost
Ghost state of a no-slip wall (normal axis d) from its mirrored interior state q: the velocity reflected about the wall velocity, u_g = 2 u_w - u; the pressure mirrored; the temperature mirrored (adiabatic) or set to the geometric mirror T_w^2 / T (isothermal, the density then p / (R T_g), positive for any positive T); the normal field odd, psi even.
Model-agnostic: the field components are IQ_BX..min(IQ_BZ, nv_mhd) (none for Euler) and psi the slots beyond them up to nv_mhd; psi_energy (1 with EGLM, 0 otherwise) says whether the total energy holds psi^2 / 2. The slots beyond nv_mhd up to nv_entropy are the advected entropy (Euler with dual energy, issue #91): the ghost's own, p rho_g^(1-gamma); those beyond nv_entropy are passive scalars (issue #92), their specific value mirrored.
Attributes: pure
fortran
subroutine wall_noslip_ghost(nv, nv_mhd, nv_entropy, d, gamma, R, psi_energy, isothermal, wall_velocity, wall_temperature, q, qg)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
nv | integer(kind=I4P) | in | Conservative variables number. | |
nv_mhd | integer(kind=I4P) | in | Last slot of the MHD state: 5 (hydrodynamic models) or nv (MHD). | |
nv_entropy | integer(kind=I4P) | in | Last entropy slot: 6 (dual energy) or nv_mhd. | |
d | integer(kind=I4P) | in | Wall-normal axis. | |
gamma | real(kind=R8P) | in | Specific heats ratio. | |
R | real(kind=R8P) | in | Gas constant. | |
psi_energy | real(kind=R8P) | in | 1 if the total energy holds psi^2 / 2 (EGLM), else 0. | |
isothermal | logical | in | Isothermal (else adiabatic) wall. | |
wall_velocity | real(kind=R8P) | in | Wall velocity. | |
wall_temperature | real(kind=R8P) | in | Wall temperature (isothermal). | |
q | real(kind=R8P) | in | Mirrored interior state. | |
qg | real(kind=R8P) | out | Ghost state. |
Call graph
oblique_shock
The state behind an oblique shock in the x-y plane (issue #121, S3; Anderson, Modern Compressible Flow, ch. 4): the upstream primitive state up (r, u, v, w, p), the shock entering through a y face of outward sign s (+1 the top), so that it turns the flow by -s theta (toward the face opposite). deg is the deflection theta (the weak solution) or, by_angle, the shock angle beta from the upstream velocity, in degrees. The normal Mach number M_n = M sin(beta), with M of the in-plane velocity; w, tangent to the shock, is unchanged. error: 0, 1 not supersonic, 2 beta out of (mu, 90], 3 theta out of (0, theta_max).
Attributes: pure
fortran
subroutine oblique_shock(gamma, s, up, deg, by_angle, post, beta, theta, error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
gamma | real(kind=R8P) | in | Specific heats ratio. | |
s | real(kind=R8P) | in | Outward normal sign of the face along y. | |
up | real(kind=R8P) | in | Upstream primitive state. | |
deg | real(kind=R8P) | in | Deflection or shock angle, degrees. | |
by_angle | logical | in | deg is the shock angle. | |
post | real(kind=R8P) | out | Post-shock primitive state. | |
beta | real(kind=R8P) | out | Shock angle and deflection, degrees. | |
theta | real(kind=R8P) | out | Shock angle and deflection, degrees. | |
error | integer(kind=I4P) | out | Error status. |
Call graph
nonreflecting_ghost
Ghost state of a non-reflecting face (issue #121, S2) from the first interior cell q1 (Euler, conservative), dist off it along the outward normal of axis d, sign s (-1 for a min face, +1 for a max face); par = target r, u, v, w, p, sigma, L. The jumps of the characteristic variables linearised about q1 (outward normal velocity u_n, sound speed c): outgoing waves none; the incoming acoustic one, w1 = p - rho c u_n with speed u_n - c < 0, dist K (p - p_t) / (u_n - c), K = sigma (1 - M^2) c / L, with w5 = p + rho c u_n unchanged, so dp = A / 2, du_n = -A / (2 rho c); inflow through the face (u_n < 0) the entropy rho - p / c^2 and the tangential velocity of the target; u_n + c <= 0 the whole target.
Attributes: pure
fortran
subroutine nonreflecting_ghost(gamma, d, s, dist, par, q1, qg)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
gamma | real(kind=R8P) | in | Specific heats ratio. | |
d | integer(kind=I4P) | in | Normal axis. | |
s | real(kind=R8P) | in | Outward normal sign along d. | |
dist | real(kind=R8P) | in | Distance from the interior cell to the ghost. | |
par | real(kind=R8P) | in | Target r, u, v, w, p, sigma, L. | |
q1 | real(kind=R8P) | in | First interior cell, conservative. | |
qg | real(kind=R8P) | out | Ghost state, conservative. |
Call graph
hydrostatic_ghost
Ghost state of a hydrostatic boundary (issue #73, M7-G0): the density and the pressure of the isothermal hydrostatic equilibrium continued from the first interior cell q1, rho_g = rho_1 exp(gs / T_1), p_g = rho_g T_1, T_1 = p_1 / rho_1, gs = g_d s (the gravity along the normal times the signed distance from q1 to the ghost); the velocity of the mirrored cell qm times the wall signs (normal component odd), its field and psi unchanged (even).
Model-agnostic as wall_noslip_ghost: the field components are IQ_BX..min(IQ_BZ, nv_mhd), psi the slots beyond up to nv_mhd, the advected entropy past nv_mhd up to nv_entropy (issue #91) the ghost's own, the passive scalars beyond (issue #92) the mirrored cell's specific value.
Attributes: pure
fortran
subroutine hydrostatic_ghost(nv, nv_mhd, nv_entropy, gamma, psi_energy, gs, wall_sign, qm, q1, qg)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
nv | integer(kind=I4P) | in | Conservative variables number. | |
nv_mhd | integer(kind=I4P) | in | Last slot of the MHD state: 5 (hydrodynamic models) or nv (MHD). | |
nv_entropy | integer(kind=I4P) | in | Last entropy slot: 6 (dual energy) or nv_mhd. | |
gamma | real(kind=R8P) | in | Specific heats ratio. | |
psi_energy | real(kind=R8P) | in | 1 if the total energy holds psi^2 / 2 (EGLM), else 0. | |
gs | real(kind=R8P) | in | Gravity along the normal times the distance from q1 to the ghost. | |
wall_sign | real(kind=R8P) | in | Wall mirror sign of each variable along the normal (momentum used). | |
qm | real(kind=R8P) | in | Mirrored interior state. | |
q1 | real(kind=R8P) | in | First interior state along the normal. | |
qg | real(kind=R8P) | out | Ghost state. |
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_bc_object) | in | Boundary conditions. |
Call graph
realm_edge_face
Face whose condition fills a crown row beyond the realm faces of the edge or corner fec: the first inflow face among them (an inflow ghost holds the inflow state whatever else it lies beyond), else the first physical one, 0 when every one is a seam (the row lies outside the forest).
Attributes: pure
Returns: integer(kind=I4P)
fortran
function realm_edge_face(fec, face_kind) result(face)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
fec | integer(kind=I4P) | in | Tree boundary fec of the row (7..26). | |
face_kind | integer(kind=I4P) | in | Kind of each realm face (-x, +x, -y, +y, -z, +z), BC_SEAM for a seam. |
Call graph