Domain Boundary Conditions

Ideal Domain BCs

There are two primary types of physical/domain boundary conditions: those which rely only on the data in the valid regions, and those which rely on externally specified values.

ERF allows users to specify types of boundary condition with keywords in the inputs file. The information for each face is preceded by xlo, xhi, ylo, yhi, zlo, or zhi.

Currently available type of boundary conditions are inflow, outflow, slipwall, noslipwall, symmetry or MOST. (Spelling of the type matters; capitalization does not.)

For example, setting

xlo.type = "Inflow"
xhi.type = "Outflow"
zlo.type = "SlipWall"
zhi.type = "SlipWall"

geometry.is_periodic = 0 1 0

would define a problem with inflow in the low-\(x\) direction, outflow in the high-\(x\) direction, periodic in the \(y\)-direction, and slip wall on the low and high \(y\)-faces, and Note that no keyword is needed for a periodic boundary, here only the specification in geometry.is_periodic is needed.

Each of these types of physical boundary condition has a mapping to a mathematical boundary condition for each type; this is summarized in the table below.

ERF provides the ability to specify a variety of boundary conditions (BCs) in the inputs file. We use the following options preceded by xlo, xhi, ylo, yhi, zlo, and zhi:

Type

Normal vel

Tangential vel

Density

Theta

Scalar

inflow

ext_dir

ext_dir

ext_dir

ext_dir

ext_dir

outflow

foextrap

foextrap

foextrap

foextrap

foextrap

slipwall

ext_dir

foextrap

foextrap

ext_dir/foextrap/neumann

foextrap

noslipwall

ext_dir

ext_dir

foextrap

ext_dir/foextrap/neumann

foextrap

symmetry

reflect_odd

reflect_even

reflect_even

reflect_even

reflect_even

MOST

Here ext_dir, foextrap, and reflect_even refer to AMReX keywords. The ext_dir type refers to an “external Dirichlet” boundary, which means the values must be specified by the user. The foextrap type refers to “first order extrapolation” which sets all the ghost values to the same value in the last valid cell/face (AMReX also has a hoextrap, or “higher order extrapolation” option, which does a linear extrapolation from the two nearest valid values). By contrast, neumann is an ERF-specific boundary type that allows a user to specify a variable gradient. Currently, the neumann BC is only supported for theta to allow for weak capping inversion (\(\partial \theta / \partial z\)) at the top domain.

As an example,

xlo.type                =   "Inflow"
xlo.velocity            =   1. 0.9  0.
xlo.density             =   1.
xlo.theta               =   300.
xlo.scalar              =   2.

sets the boundary condtion type at the low x face to be an inflow with xlo.type = “Inflow”.

xlo.velocity = 1. 0. 0. sets all three componentns the inflow velocity, xlo.density = 1. sets the inflow density, xlo.theta = 300. sets the inflow potential temperature, xlo.scalar = 2. sets the inflow value of the advected scalar

The “slipwall” and “noslipwall” types have options for adiabatic vs Dirichlet boundary conditions. If a value for theta is given for a face with type “slipwall” or “noslipwall” then the boundary condition for theta is assumed to be “ext_dir”, i.e. theta is specified on the boundary. If no value is specified then the wall is assumed to be adiabiatc, i.e. there is no temperature flux at the boundary. This is enforced with the “foextrap” designation.

For example

zlo.type  = "NoSlipWall"
zhi.type  = "NoSlipWall"

zlo.theta = 301.0

would designate theta = 301 at the bottom (zlo) boundary, while the top boundary condition would default to a zero gradient (adiabatic) since no value is specified for zhi.theta or zhi.theta_grad. By contrast, thermal inversion may be imposed at the top boundary by providing a specified gradient for theta

zlo.type  = "NoSlipWall"
zhi.type  = "NoSlipWall"

zlo.theta = 301.0
zhi.theta_grad = 1.0

We note that “noslipwall” allows for non-zero tangential velocities to be specified, as in the Couette regression test example, in which we specify

geometry.is_periodic = 1 1 0

zlo.type = "NoSlipWall"
zhi.type = "NoSlipWall"

zlo.velocity    = 0.0 0.0 0.0
zhi.velocity    = 2.0 0.0 0.0

We also note that in the case of a “slipwall” boundary condition in a simulation with non-zero viscosity specified, the “foextrap” boundary condition enforces zero strain at the wall.

The keywork “MOST” is an ERF-specific boundary type; see MOST Boundaries for more information.

It is important to note that external Dirichlet boundary data should be specified as the value on the face of the cell bounding the domain, even for cell-centered state data.

Real Domain BCs

When using real lateral boundary conditions, time-dependent observation data is read from a file. The observation data is utilized to directly set Dirichlet values on the lateral domain BCs as well as nudge the solution state towards the observation data. The user may specify (in the inputs file) the total width of the interior Dirichlet and relaxation region with erf.real_width = <Int> (yellow + blue) and analogously the width of the interior Dirichlet region may be specified with erf.real_set_width = <Int> (yellow). The real BCs are only imposed for \(\psi = \left\{ \rho; \; \rho \theta; \; \rho q_v; \; u; \; v \right\}\). Due to the staggering of scalars (cell center) and velocities (face center) with an Arakawa C grid, we reduce the relaxation width of the scalars \(\left\{ \rho; \; \rho \theta; \; \rho q_v \right\}\) by 1 to ensure the momentum updates at the last relaxation cell involve a pressure gradient that is computed with relaxed and non-relaxed data.

1 Lateral boundaries

wrfbdy

Image taken from Skamarock et al. (2021)

Within the interior Dirichlet cells, the RHS is exactly \(\psi^{n} - \ps^{BDY} / \Delta t\) and, as such, we directly impose this value in the yellow region. Within the relaxation region (blue), the RHS (\(F\)) is given by the following:

\[\begin{split}\begin{align} F &= G + R, \\ R &= \left[ H_{1} \left( \psi^{BDY} - \psi^{\*} \right) - H_{2} \Delta^2 \left( \psi^{BDY} - \psi^{\*} \right) \right] \exp \left(-C_{01} \left(n - {\rm SpecWidth}\right) \right), \\ H_{1} &= \frac{1}{10 \Delta t} \frac{{\rm SpecWidth} + {\rm RelaxWidth} - n}{{\rm RelaxWidth} - 1}, \\ H_{2} &= \frac{1}{50 \Delta t} \frac{{\rm SpecWidth} + {\rm RelaxWidth} - n}{{\rm RelaxWidth} - 1}, \end{align}\end{split}\]

where \(G\) is the RHS of the Navier-Stokes equations, \(\psi^{*}\) is the state variable at the current RK stage, \(\psi^{BDY}\) is temporal interpolation of the observational data, \(C_{01} = -\ln(0.01) / ({\rm RealWidth - SpecWidth})\) is a constant that ensure the exponential blending function obtains a value of 0.01 at the last relaxation cell, and \(n\) is the minimum number of grid points from a lateral boundary.

Sponge zone domain BCs

ERF provides the capability to apply sponge zones at the boundaries to prevent spurious reflections that otherwise occur at the domain boundaries if standard extrapolation boundary condition is used. The sponge zone is implemented as a source term in the governing equations, which are active in a volumteric region at the boundaries that is specified by the user in the inputs file. Currently the target condition to which the sponge zones should be forced towards is to be specifed by the user in the inputs file.

\[\frac{dQ}{dt} = \mathrm{RHS} - A\xi^n(Q-Q_\mathrm{target})\]

where RHS are the other right-hand side terms. The parameters to be set by the user are – A is the sponge amplitude, n is the sponge strength and the \(Q_\mathrm{target}\) – the target solution in the sponge. xi is a linear coordinate that is 0 at the beginning of the sponge and 1 at the end. An example of the sponge inputs can be found in Exec/RegTests/Terrain2d_Cylinder.

erf.sponge_strength = 10000.0
erf.use_xlo_sponge_damping = true
erf.xlo_sponge_end = 4.0
erf.use_xhi_sponge_damping = true
erf.xhi_sponge_start = 26.0
erf.use_zhi_sponge_damping = true
erf.zhi_sponge_start = 8.0

erf.sponge_density = 1.2
erf.sponge_x_velocity = 10.0
erf.sponge_y_velocity = 0.0
erf.sponge_z_velocity = 0.0