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.
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).
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
- 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_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_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. |
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_temperature | real(kind=R8P) | Isothermal walls: wall temperature of each face. |
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) (none for Euler) and psi the slots beyond them; psi_energy (1 with EGLM, 0 otherwise) says whether the total energy holds psi^2 / 2.
Attributes: pure
fortran
subroutine wall_noslip_ghost(nv, 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. | |
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
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) and psi the slots beyond.
Attributes: pure
fortran
subroutine hydrostatic_ghost(nv, gamma, psi_energy, gs, wall_sign, qm, q1, qg)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
nv | integer(kind=I4P) | in | Conservative variables number. | |
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