Advection schemes
In AMReX-Hydro, the fundamental algorithm is either a Method-of-Lines (MOL) or Godunov approach. Each method provides functions for two separate usages:
Construct values of the normal velocity at the centroid on each cell face, termed “Pre-MAC” or extrapolated velocity. Typically, this velocity is later MAC projected before being used as the advective velocity. (Information on the MAC projection is in the MAC Projection section.)
Construct states on faces, termed “edge states” or “Post-MAC.” These are typically later used to make fluxes which are then differenced to create the advective term. (Information on how fluxes and the convective term are constructed from edge states is given in the Computing Fluxes and Constructing the advective term sections.)
Domain boundary conditions affect the computation of these pre- and post-MAC states in the same way for all advection methods, and this is described in the Boundary conditions section. Note that while these routines ensure that the resulting computed states obey the boundary conditions, they also still require input with filled grow cells. All schemes also use the same routines to construct fluxes and then the convective term.
Next, we provide notation, and then detail the available advection schemes in EB-regular, as well as EB-aware form when available.
Note
If a cell and all of its neighbors have volume fraction of 1 (i.e. they are not cut or covered cells), the EB methodology will return exactly the same answer (to machine precision) as the non-EB methodology. Here we define neighbor to mean any cell that would be involved in the calculation of the face-based state, and the extent of the resulting neighborhood varies depending on the order of the slope used.
Notation
Here we use
Super- or subscript
Similarly, for the y-dimension,
We define
Method of Lines (MOL)
The procedure for computing MAC velocities and edge states with MOL involves extrapolation in space only, and does not involve any time derivatives. All slope computations use second-order limited slopes as described in Slopes.
These alogrithms are applied in the MOL namespace. For API documentation, see Doxygen: MOL Namespace.
Pre-MAC (API ref. MOL::ExtrapVelToFaces)
For computing the pre-MAC edge states to be MAC-projected, we define on every x-face:
where
Boundary conditions are applied (as decribed in Boundary conditions).
Then, at each face we upwind based on
We similarly compute
Post-MAC (API ref. MOL::ComputeEdgeState)
Once we have the MAC-projected velocities, we extrapolate all quantities to faces as above:
where
Boundary conditions are applied (as decribed in Boundary conditions).
Then, at each face, we upwind based on
Method of Lines with Embedded Boundaries (EBMOL)
AMReX-Hydro has also implemented an embedded boundary (EB) aware version of the MOL algorithm discussed above. All slope computations use second-order limited slopes as described in EB Slopes.
Pre-MAC (API ref. EBMOL::ExtrapVelToFaces)
For computing the pre-MAC edge states to be MAC-projected, we define on every x-face with non-zero area fraction:
where we calculate
Boundary conditions are applied (as decribed in Boundary conditions).
Then, at each face we upwind based on
We similarly compute
Post-MAC (API ref. EBMOL::ComputeEdgeState)
Once we have the MAC-projected velocities, we predict all quantities to faces with non-zero area fractions as above:
where we calculate
Boundary conditions are applied (as decribed in Boundary conditions).
Then, at each face we then upwind based on
Godunov Methods
AMReX-Hydro’s implementation uses dimenensionally unsplit algorithms with full corner coupling in 3D, with the option to use either piecewise linear (PLM) [Saltzman, 1994, Colella, 1990] or piecewise parabolic (PPM) [Colella and Woodward, 1984, Miller and Colella, 2002] reconstructions of the state.
These alogrithms are applied in the Godunov namespace. For API documentation, see Doxygen: Godunov Namespace.
Pre-MAC (API ref. Godunov::ExtrapVelToFaces)
We extrapolate the normal velocities to cell faces using a second-order Taylor series expansion
in space and time. For each face, we extrapolate the normal velocity
component from the centers of the cells on either side to the face, creating left (L)
and right (R) states. For face
extrapolated from
extrapolated from
If the parameter use_ppm
is false, the first derivatives normal to the face (in this
case
The transverse derivative terms (
Values are similarly traced from
If the parameter use_forces_in_trans
is true, the forcing terms (
Next, boundary conditions are enforced on domain faces as decribed in Boundary conditions #2. Note that this means face-based values lying within the physical boundary but not exactly on the boundary face (e.g. values located on the y-faces of ghost cells abutting the x-boundary but not on the y-boundary) do not have boundary conditions enforced at this point.
Now, we define a normal advective velocity on the face
(suppressing the
We now upwind
In 3D, we complete the intermediate transverse-face centered states by accounting for transverse corner coupling
following [Saltzman, 1994, Colella, 1990]. For example, for
and then apply boundary conditions on domian faces before upwinding according to
We use these upwind values to form the transverse derivatives in Eqs. (1) and (2) :
We now have all the terms needed to form use_forces_in_trans
is false, the forcing terms were not included in the computation of the
transverse deriviates and are instead included at this point.
We apply boundary conditions on domain faces,
including preventing backflow (as decribed in Boundary conditions #2 & 3).
The normal velocity at each face is then determined by an upwinding procedure
based on the states predicted from the cell centers on either side. The
procedure is similar to that described above, i.e.
(suppressing the (
We follow a similar
procedure to construct
Post-MAC (API ref. Godnuov::ComputeEdgeState)
Here, the face-centered advective velocity field, which we will call
extrapolated from
extrapolated from
At each face we then upwind based on
Godunov with Embedded Boundaries (EBGodunov)
AMReX-Hydro contains an embedded boundary (EB) aware version of the Godunov algorithm discussed above, although with fewer options available. This EB implementation employs a piecewise linear method (PLM) [], and always includes any forcing terms after the computation of the transverse terms. EBGodunov attempts to use fourth-order limited slopes wherever possible, as described in EB Slopes.
Pre-MAC (API ref. EBGodunov::ExtrapVelToFaces)
We extrapolate the normal velocities to cell faces using a second-order Taylor series expansion
in space and time. For each face with a non-zero area fraction, we extrapolate the normal velocity
component from the centroids of the cells on either side to the face centroid, creating left (L)
and right (R) states. For face
extrapolated from
and
extrapolated from
Here,
The transverse derivative terms (
In this upwinding procedure we first define a normal advective
velocity on the face
(suppressing the
We now upwind
In 3D, we modify the intermediate transverse-face centered states to accounting for transverse corner coupling.
For example, for
where
If any of the four faces that contribute to the transverse derivatives for a particular
cell have zero area, all of the transverse and forcing terms are identically set to 0. For example,
when constructing
and use this in the upwinding step given by Eq. (11).
For cut faces (i.e. faces intersecting the EB),
The normal velocity at each face is then determined by an upwinding procedure
based on the states predicted from the cells on either side. The
procedure is similar to that described above, i.e.
(suppressing the (
We follow a similar
procedure to construct
Post-MAC (API ref. EBGondunov::ComputeEdgestate)
Here, the face-centered advective velocity field, which we will call
extrapolated from
and
extrapolated from
Here again
The transverse terms are computed exactly as described earlier for the Pre-MAC case, except for the upwinding process. Where we previously used the predicted states themselves to upwind, we now use the component of the advective velocity normal to the face in question.
We upwind
BDS Algorithm
The Bell-Dawson-Shubin (BDS) algorithm is a higher order Godunov method for scalar conservation laws in multiple dimensions. Satisfying the maximum principal for constant coefficient linear advection, the BDS routine provides accurate resolution for smooth problems while avoiding undershoot and overshoot for non-smooth profiles. Additional details and comparisons to other schemes can be found in [Nonaka et al., 2011] and references therein.
This implementation of BDS closely follows the Godunov approach and leverages some of the same code. The difference appears in the computation of edge states given face-centered velocities, i.e. the Post-MAC computation. Currently, periodic, Dirichlet, and outflow (extrapolation) boundary conditions are supported. Embedded boundaries are not supported within BDS at this time. If additional functionality is desired, or if questions remain after reading this guide, further help is available by submitting an issue through Github
Pre-MAC
The BDS routine follows the Godunov PLM method to extrapolate velocities to cell faces, see Godunov Methods: Pre-MAC.
Post-MAC
In the notation below,
Obtaining the edge states is a two step process:
Step 1: Construct a limited piecewise trilinear (bilinear in 2D) representation of the solution in each grid cell of the form,
Step 2: Construct edge states
, etc. by integrating the limited piecewise trilinear (bilinear in 2D) profiles over the space-time region determined by the characteristic domain of dependence of the face. We enforce no inflow at an outflow face as described in the post-MAC Boundary Conditions Section.