Helper functions
Notation
, , : cell sizes in the x-, y- and z- directions, respectively. : Volume of cell-centered element . : Area of a cell face. For example, represents the area of the lower x-face of the -th cell,
For problems with embedded boundaries, we also define
: Volume fraction of cell . Data are in the range of with zero representing covered cells and one for regular cells, so that for regular cells : Area fractions. For example, corresponds to the the lower x-face of the -th cell. Data are in the range of with zero representing a covered face and one an un-cut face, so that for regular cells .
Note that EB is only an option for Cartesian geometries as of this writing.
Slopes
AMReX-Hydro’s implementation of the piecewise linear method provides several options, and leverages slopes routines from AMReX. For cells where this calculation would involve all regular cells (i.e. no cut or covered cells), there are second-order and fourth-order stencils along with options to apply limiters. Note that the piecewise parabolic and BDS methods have their own routines for formulating slopes (and these are housed within AMReX-Hydro).
For (EB)Godunov, the default is monotonicity-limited fourth-order slopes. Default limiting is as described in Colella (1985) [Colella and Glaz, 1985], where limiting is done on each component of the velocity individually.
For (EB)MOL, the default is monotonicity-limited second-order slopes. Default is the second order Monotonized Central (MC) limiter (van Leer, 1977 [Van Leer, 1977]), where limiting is applied direction by direction.
NOTE ON BOUNDARY CONDITIONS:
When periodic or Neumann BCs are imposed, schemes can be applied without any change since the ghost cells outside the domain are filled by either periodicity or by extrapolation.
For Dirichlet BCs, the BC value stored in the first ghost cell outside the domain is considered as located directly on the boundary, despite the fact that it is stored in what is otherwise considered a cell-centered array. We then utilize one-sided differencing schemes that use ONLY values from inside or on the domain boundary.
EB Slopes
The procedure for problems with embedded boundaries is detailed below, and attempts to use standard (non-EB) stencils wherever possible.
First, AMReX-Hydro attempts to compute the slope of the desired order (4 for Godunov and 2 for MOL) using standard stencils and limiters.
For cases where a fourth-order slope is desired but the stencil would require the use of cut cells (as happens in EBGodunov), the code next attempts to use the standard second-order slope and limiter.
If the standard second-order slope calculation would require the use of cut cells, then the slope computation will use a least squares approach, involving a linear fit to the at-most 26 (or 8 in 2D) nearest neighbors, with the function going through the centroid of cell (i,j,k) to the face centroid. This does not assume that the cell centroids, where the data is assumed to live, are the same as cell centers. This least-squares slope is then multiplied by a limiter based on the work of Barth-Jespersen that enforces no new maxima or minima when the state is predicted to the face centroids.
Boundary conditions
AMReX-Hydro uses underlying AMReX functionality in implementing boundary conditions
(see AMReX’s documentation section Boundary Conditions).
Physical boundary conditions, such as
inflow, outflow, slip/no-slip walls, etc., and are ultimately linked to
mathematical Dirichlet or Neumann conditions.
See amrex/Src/Base/AMReX_BC_TYPES.H
for common physical and mathematical types.
Domain boundary conditions affect the pre-MAC extrapolated velocities in three ways.
Potential impact to the slope computation in cells adjacent to the domain boundary (see Slopes section).
Direct enforcement of the boundary condition: If the face is on a domain boundary and the boundary condition type is
External Dirichlet (
extdir
): we set to the boundary value, and then for the normal component of the velocity only, we set This is done because for turbulent inflow, there can be times when the inflow face actually has outflowing velocity. In this case, we want to use the normal component as specified by the BC, but then allow that outflowing velocity to transport values that come from the interior.First-order extrapolation (
foextrap
), higher order extrapolation (hoextrap
), or even reflection about the boundary (reflecteven
):on the low side of the domain, we set
on the high side, we set
Odd reflection about the boundary (
reflectodd
) , we set
To prohibit back flow into the domain at an outflow face (
foextrap
orhoextrap
mathematical BCs):on the low side, we set
on the high side, we set
For the post-MAC edge state,
Same as pre-MAC
Same as pre-MAC
Here, we do not impose the no-inflow-at-outflow condition quite as described above; instead we enforce that if
on an outflow face is inflowing, the normal velocity component must be outflowing or zero. We do this by imposingon the low side, if
(i.e the flow is coming in at an outflow face) and is the x-velocity, thenon the high side, if
on the domain face, then
Note
Boundary conditions are imposed before the upwinding described in the Advection schemes section.
API documentation can be found in the Doxygen Technical Reference, functions SetXEdgeBCs, SetYEdgeBCs, SetZEdgeBCs .
Computing Fluxes
Doxygen links ComputeFluxes and EB_ComputeFluxes .
AMReX-Hydro has the option to compute intesive or extensive, i.e. area-weighted, fluxes. Extensive fluxes are always used for problems using R-Z geometry, and AMReX has functions for computing the position dependent cell volume and face areas (see Geometry::GetFaceArea and Geometry::GetVolume). We first give the formulas for the EB-regular case, and then those used when embedded boundaries are present.
Intensive
Intensive fluxes are computed from the advective velocity,
on all x-faces,
on all y-faces, and
on all z-faces.
When embedded boundaries are present, intensive fluxes are computed as
on all x-faces,
on all y-faces,
on all z-faces.
Here
Extensive
Extensive fluxes are computed as
on all x-faces,
on all y-faces,
on all z-faces.
where
For EB, we simply scale area the by the area fraction in the above equations. For example, we use
Constructing the advective term
AMReX-Hydro provides the option to compute the advective term either in
conservative (
Intensive fluxes
If the variable,
while if
where
and
Extensive fluxes
Given extensive fluxes we must divide by the cell volume in constructing the advective term.
Here, we give the form for EB and note that the EB-regular case is obtained by setting both
while if
where