Skip to content

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 ​

Variables ​

NameTypeAttributesDescription
BC_EXTRAPOLATIONinteger(kind=I4P)parameterZeroth-order extrapolation.
BC_INFLOWinteger(kind=I4P)parameterPrescribed state.
BC_WALL_INVISCIDinteger(kind=I4P)parameterInviscid (slip) wall: mirror with normal momentum negated.
BC_WALL_NOSLIPinteger(kind=I4P)parameterNo-slip adiabatic wall: velocity reflected about the wall's.
BC_WALL_ISOTHERMALinteger(kind=I4P)parameterNo-slip isothermal wall: also the temperature set.
BC_HYDROSTATICinteger(kind=I4P)parameterHydrostatic ghosts under gravity, mirrored velocity.
BC_EXTRAPOLATION_STRcharacter(len=13)parameterAccepted spelling of BC_EXTRAPOLATION.
BC_INFLOW_STRcharacter(len=6)parameterAccepted spelling of BC_INFLOW.
BC_WALL_INVISCID_STRcharacter(len=13)parameterAccepted spelling of BC_WALL_INVISCID.
BC_PERIODIC_STRcharacter(len=8)parameterAccepted spelling of BC_PERIODIC.
BC_WALL_NOSLIP_STRcharacter(len=11)parameterAccepted spelling of BC_WALL_NOSLIP.
BC_WALL_ISOTHERMAL_STRcharacter(len=15)parameterAccepted spelling of BC_WALL_ISOTHERMAL.
BC_HYDROSTATIC_STRcharacter(len=11)parameterAccepted spelling of BC_HYDROSTATIC.
WALL_VELOCITY_KEYcharacter(len=6)parameterWall velocity keys.
INFLOW_KEYcharacter(len=2)parameterInflow primitive state keys (MHD: all 8).
SECTION_NAMEcharacter(len=8)parameterINI section names of the 6 faces.

Derived Types ​

flume_bc_object ​

FLUME boundary conditions class definition.

Components ​

NameTypeAttributesDescription
bc_typeinteger(kind=I4P)Boundary condition type of each face.
q_inflowreal(kind=R8P)allocatableConservative inflow state of each face [nv, 6].
wall_signreal(kind=R8P)allocatableWall mirror sign of each variable per direction [nv, 3] (+1 or -1).
wall_velocityreal(kind=R8P)No-slip walls: wall velocity of each face.
wall_temperaturereal(kind=R8P)Isothermal walls: wall temperature of each face.

Type-Bound Procedures ​

NameAttributesDescription
descriptionpass(self)Return pretty-printed object description.
initializepass(self)Initialize boundary conditions.
load_from_filepass(self)Load config from file.

Subroutines ​

initialize ​

Initialize boundary conditions.

fortran
subroutine initialize(self, file_parameters, physics)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_bc_object)inoutBoundary conditions.
file_parameterstype(file_ini)inSimulation parameters ini file handler.
physicstype(flume_physics_object)inPhysics (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

NameTypeIntentAttributesDescription
selfclass(flume_bc_object)inoutBoundary conditions.
file_parameterstype(file_ini)inSimulation parameters ini file handler.
physicstype(flume_physics_object)inPhysics (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

NameTypeIntentAttributesDescription
faceinteger(kind=I4P)inFace (1..6: -x, +x, -y, +y, -z, +z).
face_kindinteger(kind=I4P)inKind of the face.
niinteger(kind=I4P)inGrid dimensions.
njinteger(kind=I4P)inGrid dimensions.
nkinteger(kind=I4P)inGrid dimensions.
iinteger(kind=I4P)inGhost cell.
jinteger(kind=I4P)inGhost cell.
kinteger(kind=I4P)inGhost cell.
irefinteger(kind=I4P)outDonor cell.
jrefinteger(kind=I4P)outDonor cell.
krefinteger(kind=I4P)outDonor 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

NameTypeIntentAttributesDescription
nvinteger(kind=I4P)inConservative variables number.
dinteger(kind=I4P)inWall-normal axis.
gammareal(kind=R8P)inSpecific heats ratio.
Rreal(kind=R8P)inGas constant.
psi_energyreal(kind=R8P)in1 if the total energy holds psi^2 / 2 (EGLM), else 0.
isothermallogicalinIsothermal (else adiabatic) wall.
wall_velocityreal(kind=R8P)inWall velocity.
wall_temperaturereal(kind=R8P)inWall temperature (isothermal).
qreal(kind=R8P)inMirrored interior state.
qgreal(kind=R8P)outGhost 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

NameTypeIntentAttributesDescription
nvinteger(kind=I4P)inConservative variables number.
gammareal(kind=R8P)inSpecific heats ratio.
psi_energyreal(kind=R8P)in1 if the total energy holds psi^2 / 2 (EGLM), else 0.
gsreal(kind=R8P)inGravity along the normal times the distance from q1 to the ghost.
wall_signreal(kind=R8P)inWall mirror sign of each variable along the normal (momentum used).
qmreal(kind=R8P)inMirrored interior state.
q1real(kind=R8P)inFirst interior state along the normal.
qgreal(kind=R8P)outGhost state.

Call graph

Functions ​

description ​

Return a pretty-formatted object description.

Returns: character(len=:)

fortran
function description(self) result(desc)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_bc_object)inBoundary 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

NameTypeIntentAttributesDescription
fecinteger(kind=I4P)inTree boundary fec of the row (7..26).
face_kindinteger(kind=I4P)inKind of each realm face (-x, +x, -y, +y, -z, +z), BC_SEAM for a seam.

Call graph