# Boundary Conditions

PeleC manages boundary conditions in a form consistent with many AMReX codes. Ghost cell data are updated over an AMR level during a `FillPatch`

operation and fluxes are then computed over the entire box without specifically recognizing boundary cells. A generic boundary filler function fills standard boundary condition types that do not require user input, including:

*Interior*- Copy-in-intersect in index space (same as periodic boundary conditions). Periodic boundaries are set in the PeleC inputs file*Symmetry*- All conserved quantities and the tangential momentum component are reflected from interior cells without sign change (REFLECT_EVEN) while the normal component is reflected with a sign change (REFLECT_ODD)*NoSlipWall*- REFLECT_EVEN is applied to all conserved quantities except for both tangential and normal momentum components which are updated using REFLECT_ODD*SlipWall*- SlipWall is identical to Symmetry*FOExtrap*- First-order extrapolation: the value in the ghost-cells are a copy of the last interior cell.

More complex boundary conditions require user input that is prescribed explicitly. Boundaries identified as `UserBC`

or `Hard`

in the inputs will be tagged as `EXT_DIR`

in `pc_hypfill`

. Users will then fill the boundary values, by calling the helper function, `bcnormal`

. The `bcnormal`

function fills an exterior (ghost) cell based on the value of the outermost interior cell. Its arguments include a problem-specific data structure, the location, direction, and orientation of the boundary being filled, and potentially fluctuating turbulent velocities from the TurbInflow utility in PelePhysics. This gives the user flexibility to specify a variety of boundary conditions, including faces that contain both walls and inflow regions. Note that the external state `s_ext`

is prepopulated with the same values as are used for the `NoSlipWall`

condition, so the default if the `bcnormal`

function does nothing is to specify a `NoSlipWall`

.

Note

To ensure conservation, when Godunov schemes are used the order of accuracy is reduced at boundaries specified using `bcnormal`

; PLM is used and the predictor step is omitted when computing fluxes through these boundaries. This does not affect any other boundary types or simulations using MOL.

Special care should be taken when prescribing subsonic `Inflow`

or an `Outflow`

boundary conditions. It might be tempting to directly impose target values in the boundary filler function (for `Inflow`

), or to perform a simple extrapolation (for `Outflow`

). However, this approach would fail to correctly respect the flow of information along solution characteristics - the system would be ill-posed and would lead to unphysical behavior. In particular, at a subsonic inflow boundary, at a subsonic inlet there is one outgoing characteristic, so one flow variable must be specified using information from inside the domain. Similarly, there is one incoming characteristic at outflow boundaries. The NSCBC method, described below, is the preferred method to account for this, but has not been ported to the all C++ version of PeleC. In the meantime, the recommended strategy for subsonic inflow and outflow boundaries for confined geometries such as nozzles and combustors is as follows:

Subsonic Inflows: Specify the desired temperature, velocity, and composition (if relevant) in the ghost cells. Take the pressure from the domain interior. Based on these values, compute the density, internal energy, and total energy for the ghost cells.

Subsonic Outflows: Specify the desired outlet pressure and extrapolate the other flow quantities. In particular, we recommend following the simple characteristic-based extrapolation proposed by Whitfield and Janus (Three-Dimensional Unsteady Euler Equations Solution Using Flux Vector Splitting. AIAA Paper 84-1552, 1984.) and described in Ch. 8 of Blazek’s textbook (Computational Fluid Dunamics - Principles and Applications). Implementations of this method can be found in the

`bcnormal`

function in`prob.H`

for various test cases, including EB-C10 and EB-ConvergingNozzle.

A detailed analysis comparing various boundary condition strategies and demonstrating their implementation is available for the Converging Nozzle Case case.

## Isothermal Walls

By default, the boundaries specified as `NoSlipWall`

and `SlipWall`

are adiabatic. For isothermal wall boundaries, energy fluxes through the isothermal wall are computed separately, rather than being based on values populated in the ghost cells. To activate computation of isothermal wallfluxes, use the input file option `pelec.do_isothermal_walls = 1`

and then specify the desired wall temperatures using, for example, `pelec.domlo_wall_temp = -1 -1 300.0`

and `pelec.domhi_isothermal_temp = -1 -1 400.0`

, which would leave the x and y boundaries as adiabatic, make the lower z boundary isothermal at 300 K, and make the upper z boundary isothermal at 400 K. Any boundary with a negative (or zero) value for the specified temperature is treated as adiabatic; boundaries that are not `NoSlipWall`

, `SlipWall`

, `UserBC`

, or `Hard`

must always have a negative value specified.