IBAMR
An adaptive and distributed-memory parallel implementation of the immersed boundary (IB) method
|
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>
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::string & | getName () 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 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 corresponding to a face-centered value and a MAC advection velocity . 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... | |
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,
where is a cell-centered quantity, is a specified face-centered advection velocity, and is an optional source term. These methods can also be used to solve the advection equation in conservation form,
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 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.
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).
IBAMR::AdvectorExplicitPredictorPatchOps::~AdvectorExplicitPredictorPatchOps | ( | ) |
The destructor for AdvectorExplicitPredictorPatchOps unregisters the predictor object with the restart manager when so registered.
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 corresponding to a face-centered value and a MAC advection velocity .
In three spatial dimensions, the face-centered advective fluxes are defined by
where is the MAC advection velocity. Analogous formulae hold in other spatial dimensions.
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.
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.
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. const std::string & IBAMR::AdvectorExplicitPredictorPatchOps::getName | ( | ) | const |
Return the name of the patch operations object.
int IBAMR::AdvectorExplicitPredictorPatchOps::getNumberCellGhosts | ( | ) | const |
Get the number of ghosts cells required by the limiter for cell-centered and face/side-centered variables.
int IBAMR::AdvectorExplicitPredictorPatchOps::getNumberFluxGhosts | ( | ) | const |
Get the number of ghosts cells required by the limiter for face-centered fluxes.
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 satisfies an equation of the form
i.e., that 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
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 satisfies an equation of the form
i.e., that 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
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 satisfies an equation of the form
i.e., that 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
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 satisfies an equation of the form
i.e., that 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
|
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.