IBAMR
An adaptive and distributed-memory parallel implementation of the immersed boundary (IB) method
Public Member Functions | List of all members
IBAMR::AdvectorExplicitPredictorPatchOps Class Reference

Class AdvectorExplicitPredictorPatchOps provides patch-based operations required to implement a second-order Godunov method for the linear advection equation in conservative and non-conservative forms. More...

#include </home/runner/work/IBAMR/IBAMR/include/ibamr/AdvectorExplicitPredictorPatchOps.h>

Inheritance diagram for IBAMR::AdvectorExplicitPredictorPatchOps:
Inheritance graph
[legend]

Public Member Functions

 AdvectorExplicitPredictorPatchOps (const std::string &object_name, SAMRAI::tbox::Pointer< SAMRAI::tbox::Database > input_db, bool register_for_restart=true)
 
 ~AdvectorExplicitPredictorPatchOps ()
 
const std::stringgetName () const
 
double computeStableDtOnPatch (const SAMRAI::pdat::FaceData< NDIM, double > &u_ADV, const SAMRAI::hier::Patch< NDIM > &patch) const
 Compute the maximum stable time increment for the patch. More...
 
void computeAdvectiveDerivative (SAMRAI::pdat::CellData< NDIM, double > &N, const SAMRAI::pdat::FaceData< NDIM, double > &u_ADV, const SAMRAI::pdat::FaceData< NDIM, double > &q_half, const SAMRAI::hier::Patch< NDIM > &patch) const
 Compute the advective derivative $ \vec{N}^{n+\frac{1}{2}} = \vec{u}^{\mbox{\scriptsize ADV},n+\frac{1}{2}} \cdot \nabla q^{n+\frac{1}{2}} $ using the specified advection velocity and predicted face-centered values.
 
void computeFlux (SAMRAI::pdat::FaceData< NDIM, double > &flux, const SAMRAI::pdat::FaceData< NDIM, double > &u_ADV, const SAMRAI::pdat::FaceData< NDIM, double > &q_half, const SAMRAI::hier::Patch< NDIM > &patch, double dt) const
 Compute the time integral of the advective fluxes $ \vec{f} $ corresponding to a face-centered value $ q $ and a MAC advection velocity $ \vec{u}^{\mbox{\scriptsize ADV}} $. More...
 
void predictValue (SAMRAI::pdat::FaceData< NDIM, double > &q_half, const SAMRAI::pdat::FaceData< NDIM, double > &u_ADV, const SAMRAI::pdat::CellData< NDIM, double > &Q, const SAMRAI::hier::Patch< NDIM > &patch, double dt) const
 Compute predicted time- and face-centered values from cell-centered values using a second-order Godunov method (non-forced version). More...
 
void predictValueWithSourceTerm (SAMRAI::pdat::FaceData< NDIM, double > &q_half, const SAMRAI::pdat::FaceData< NDIM, double > &u_ADV, const SAMRAI::pdat::CellData< NDIM, double > &Q, const SAMRAI::pdat::CellData< NDIM, double > &F, const SAMRAI::hier::Patch< NDIM > &patch, double dt) const
 Compute predicted time- and face-centered values from cell-centered values using a second-order Godunov method (forced version). More...
 
void predictNormalVelocity (SAMRAI::pdat::FaceData< NDIM, double > &v_half, const SAMRAI::pdat::FaceData< NDIM, double > &u_ADV, const SAMRAI::pdat::CellData< NDIM, double > &V, const SAMRAI::hier::Patch< NDIM > &patch, double dt) const
 Compute predicted time- and face-centered MAC velocities from a cell-centered velocity field using a second-order Godunov method (non-forced version). More...
 
void predictNormalVelocityWithSourceTerm (SAMRAI::pdat::FaceData< NDIM, double > &v_half, const SAMRAI::pdat::FaceData< NDIM, double > &u_ADV, const SAMRAI::pdat::CellData< NDIM, double > &V, const SAMRAI::pdat::CellData< NDIM, double > &F, const SAMRAI::hier::Patch< NDIM > &patch, double dt) const
 Compute predicted time- and face-centered MAC velocities from a cell-centered velocity using a second-order Godunov method (forced version). More...
 
void enforceIncompressibility (SAMRAI::pdat::FaceData< NDIM, double > &v_half, const SAMRAI::pdat::FaceData< NDIM, double > &u_ADV, const SAMRAI::pdat::FaceData< NDIM, double > &grad_phi, const SAMRAI::hier::Patch< NDIM > &patch) const
 Subtract the face-centered gradient of a scalar from a predicted face-centered velocity field to enforce incompressibility approximately. More...
 
int getNumberCellGhosts () const
 Get the number of ghosts cells required by the limiter for cell-centered and face/side-centered variables. More...
 
int getNumberFluxGhosts () const
 Get the number of ghosts cells required by the limiter for face-centered fluxes. More...
 
void putToDatabase (SAMRAI::tbox::Pointer< SAMRAI::tbox::Database > db) override
 Write state of AdvectorExplicitPredictorPatchOps object to the given database for restart. More...
 

Detailed Description

Class AdvectorExplicitPredictorPatchOps provides patch-based operations required to implement a second-order Godunov method for the linear advection equation in conservative and non-conservative forms.

Class AdvectorExplicitPredictorPatchOps implements the predictors required to use an explicit predictor-corrector method to solve the non-conservative advection equation,

\[ \frac{dQ}{dt} + (\vec{u}^{\mbox{\scriptsize ADV}} \cdot \nabla)Q = F, \]

where $Q$ is a cell-centered quantity, $\vec{u}^{\mbox{\scriptsize ADV}}$ is a specified face-centered advection velocity, and $F$ is an optional source term. These methods can also be used to solve the advection equation in conservation form,

\[ \frac{dQ}{dt} + \nabla \cdot (\vec{u}^{\mbox{\scriptsize ADV}} Q) = F. \]

The class employs an upwind (Godunov) explicit predictor which can be used to generate time and face centered values or fluxes. These predicted values can be used in a second-order accurate predictor-corrector method for solving the advection equation, as well as related problems such as the advection-diffusion equation and the equations of incompressible flow.

Note that the predicted fluxes are computed using the non-conservative form of the advection equation. Consequently, when the advection velocity $\vec{u}$ is not discretely divergence free, the appropriate non-conservative form of the source term must be supplied to the predictor in-order to obtain a formally consistent method.

See also
IBAMR::AdvectorPredictorCorrectorHyperbolicPatchOps

Constructor & Destructor Documentation

◆ AdvectorExplicitPredictorPatchOps()

IBAMR::AdvectorExplicitPredictorPatchOps::AdvectorExplicitPredictorPatchOps ( const std::string object_name,
SAMRAI::tbox::Pointer< SAMRAI::tbox::Database input_db,
bool  register_for_restart = true 
)

The constructor for AdvectorExplicitPredictorPatchOps sets default parameters for the advection predictor. The constructor also registers this object for restart with the restart manager using the object name.

After default values are set, this routine calls getFromRestart() if execution from a restart file is specified. Finally, getFromInput() is called to read values from the given input database (potentially overriding those found in the restart file).

◆ ~AdvectorExplicitPredictorPatchOps()

IBAMR::AdvectorExplicitPredictorPatchOps::~AdvectorExplicitPredictorPatchOps ( )

The destructor for AdvectorExplicitPredictorPatchOps unregisters the predictor object with the restart manager when so registered.

Member Function Documentation

◆ computeFlux()

void IBAMR::AdvectorExplicitPredictorPatchOps::computeFlux ( SAMRAI::pdat::FaceData< NDIM, double > &  flux,
const SAMRAI::pdat::FaceData< NDIM, double > &  u_ADV,
const SAMRAI::pdat::FaceData< NDIM, double > &  q_half,
const SAMRAI::hier::Patch< NDIM > &  patch,
double  dt 
) const

Compute the time integral of the advective fluxes $ \vec{f} $ corresponding to a face-centered value $ q $ and a MAC advection velocity $ \vec{u}^{\mbox{\scriptsize ADV}} $.

In three spatial dimensions, the face-centered advective fluxes $ \vec{f} $ are defined by

\begin{eqnarray*} f_{i+\frac{1}{2},j,k}^{n+\frac{1}{2}} &=& \Delta t \, *u_{i+\frac{1}{2},j,k}^{\mbox{\scriptsize ADV},n+\frac{1}{2}} \, *q_{i+\frac{1}{2},j,k}^{n+\frac{1}{2}} \\ f_{i,j+\frac{1}{2},k}^{n+\frac{1}{2}} &=& \Delta t \, *v_{i,j+\frac{1}{2},k}^{\mbox{\scriptsize ADV},n+\frac{1}{2}} \, *q_{i,j+\frac{1}{2},k}^{n+\frac{1}{2}} \\ f_{i,j,k+\frac{1}{2}}^{n+\frac{1}{2}} &=& \Delta t \, *w_{i,j,k+\frac{1}{2}}^{\mbox{\scriptsize ADV},n+\frac{1}{2}} \, *q_{i,j,k+\frac{1}{2}}^{n+\frac{1}{2}} \end{eqnarray*}

where $ \vec{u}^{\mbox{\scriptsize ADV}} = (u^{\mbox{\scriptsize ADV}},v^{\mbox{\scriptsize ADV}},w^{\mbox{\scriptsize ADV}}) $ is the MAC advection velocity. Analogous formulae hold in other spatial dimensions.

◆ computeStableDtOnPatch()

double IBAMR::AdvectorExplicitPredictorPatchOps::computeStableDtOnPatch ( const SAMRAI::pdat::FaceData< NDIM, double > &  u_ADV,
const SAMRAI::hier::Patch< NDIM > &  patch 
) const

Compute the maximum stable time increment for the patch.

Returns
The maximum stable timestep.

◆ enforceIncompressibility()

void IBAMR::AdvectorExplicitPredictorPatchOps::enforceIncompressibility ( SAMRAI::pdat::FaceData< NDIM, double > &  v_half,
const SAMRAI::pdat::FaceData< NDIM, double > &  u_ADV,
const SAMRAI::pdat::FaceData< NDIM, double > &  grad_phi,
const SAMRAI::hier::Patch< NDIM > &  patch 
) const

Subtract the face-centered gradient of a scalar from a predicted face-centered velocity field to enforce incompressibility approximately.

Note
The face-centered velocity field v_half must provide both normal and transverse velocity components at each cell face, i.e., v_half must NOT be a MAC velocity field.

◆ getName()

const std::string & IBAMR::AdvectorExplicitPredictorPatchOps::getName ( ) const

Return the name of the patch operations object.

◆ getNumberCellGhosts()

int IBAMR::AdvectorExplicitPredictorPatchOps::getNumberCellGhosts ( ) const

Get the number of ghosts cells required by the limiter for cell-centered and face/side-centered variables.

See also
getNumberFluxGhosts.

◆ getNumberFluxGhosts()

int IBAMR::AdvectorExplicitPredictorPatchOps::getNumberFluxGhosts ( ) const

Get the number of ghosts cells required by the limiter for face-centered fluxes.

See also
getNumberCellGhosts.

◆ predictNormalVelocity()

void IBAMR::AdvectorExplicitPredictorPatchOps::predictNormalVelocity ( SAMRAI::pdat::FaceData< NDIM, double > &  v_half,
const SAMRAI::pdat::FaceData< NDIM, double > &  u_ADV,
const SAMRAI::pdat::CellData< NDIM, double > &  V,
const SAMRAI::hier::Patch< NDIM > &  patch,
double  dt 
) const

Compute predicted time- and face-centered MAC velocities from a cell-centered velocity field using a second-order Godunov method (non-forced version).

The predictor assumes that $ \vec{V} $ satisfies an equation of the form

\[ \frac{d\vec{V}}{dt} + (\vec{u}^{\mbox{\scriptsize ADV}} \cdot \nabla)\vec{V} = 0, \]

i.e., that $ \vec{V} $ satisfies the advection equation in non-conservative form.

Note that if the advection velocity is not discretely divergence free, and if the predicted velocities are to be conservatively differenced (i.e. used in a discretization of the conservative form of the equation), a consistent method is obtained only when the proper source terms are included

See also
predictNormalVelocityWithSourceTerm

◆ predictNormalVelocityWithSourceTerm()

void IBAMR::AdvectorExplicitPredictorPatchOps::predictNormalVelocityWithSourceTerm ( SAMRAI::pdat::FaceData< NDIM, double > &  v_half,
const SAMRAI::pdat::FaceData< NDIM, double > &  u_ADV,
const SAMRAI::pdat::CellData< NDIM, double > &  V,
const SAMRAI::pdat::CellData< NDIM, double > &  F,
const SAMRAI::hier::Patch< NDIM > &  patch,
double  dt 
) const

Compute predicted time- and face-centered MAC velocities from a cell-centered velocity using a second-order Godunov method (forced version).

The predictor assumes that $ \vec{V} $ satisfies an equation of the form

\[ \frac{d\vec{V}}{dt} + (\vec{u}^{\mbox{\scriptsize ADV}} \cdot \nabla)\vec{V} = *\vec{F}, \]

i.e., that $ \vec{V} $ satisfies the forced advection equation in non-conservative form.

Note that if the advection velocity is not discretely divergence free, and if the predicted velocities are to be conservatively differenced (i.e. used in a discretization of the conservative form of the equation), a consistent method is obtained only when the proper source terms are included

See also
predictNormalVelocity

◆ predictValue()

void IBAMR::AdvectorExplicitPredictorPatchOps::predictValue ( SAMRAI::pdat::FaceData< NDIM, double > &  q_half,
const SAMRAI::pdat::FaceData< NDIM, double > &  u_ADV,
const SAMRAI::pdat::CellData< NDIM, double > &  Q,
const SAMRAI::hier::Patch< NDIM > &  patch,
double  dt 
) const

Compute predicted time- and face-centered values from cell-centered values using a second-order Godunov method (non-forced version).

The predictor assumes that $ Q $ satisfies an equation of the form

\[ \frac{dQ}{dt} + (\vec{u}^{\mbox{\scriptsize ADV}} \cdot \nabla)Q = 0, \]

i.e., that $ Q $ satisfies the advection equation in non-conservative form.

Note that if the advection velocity is not discretely divergence free, and if the predicted velocities are to be conservatively differenced (i.e. used in a discretization of the conservative form of the equation), a consistent method is obtained only when the proper source terms are included

See also
predictValueWithSourceTerm

◆ predictValueWithSourceTerm()

void IBAMR::AdvectorExplicitPredictorPatchOps::predictValueWithSourceTerm ( SAMRAI::pdat::FaceData< NDIM, double > &  q_half,
const SAMRAI::pdat::FaceData< NDIM, double > &  u_ADV,
const SAMRAI::pdat::CellData< NDIM, double > &  Q,
const SAMRAI::pdat::CellData< NDIM, double > &  F,
const SAMRAI::hier::Patch< NDIM > &  patch,
double  dt 
) const

Compute predicted time- and face-centered values from cell-centered values using a second-order Godunov method (forced version).

The predictor assumes that $ Q $ satisfies an equation of the form

\[ \frac{dQ}{dt} + (\vec{u}^{\mbox{\scriptsize ADV}} \cdot \nabla)Q = F, \]

i.e., that $ Q $ satisfies the forced advection equation in non-conservative form.

Note that if the advection velocity is not discretely divergence free, and if the predicted velocities are to be conservatively differenced (i.e. used in a discretization of the conservative form of the equation), a consistent method is obtained only when the proper source terms are included

See also
predictValue

◆ putToDatabase()

void IBAMR::AdvectorExplicitPredictorPatchOps::putToDatabase ( SAMRAI::tbox::Pointer< SAMRAI::tbox::Database db)
overridevirtual

Write state of AdvectorExplicitPredictorPatchOps object to the given database for restart.

This routine is a concrete implementation of the function declared in the SAMRAI::tbox::Serializable abstract base class.

Implements SAMRAI::tbox::Serializable.


The documentation for this class was generated from the following files: