|
IBAMR
IBAMR version 0.19.
|
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 <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 \( \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. More... | |
| 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... | |
Private Member Functions | |
| AdvectorExplicitPredictorPatchOps ()=delete | |
| Default constructor. More... | |
| AdvectorExplicitPredictorPatchOps (const AdvectorExplicitPredictorPatchOps &from)=delete | |
| Copy constructor. More... | |
| AdvectorExplicitPredictorPatchOps & | operator= (const AdvectorExplicitPredictorPatchOps &that)=delete |
| Assignment operator. More... | |
| void | predict (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 |
| void | predictWithSourceTerm (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 |
| void | getFromInput (SAMRAI::tbox::Pointer< SAMRAI::tbox::Database > db, bool is_from_restart) |
| void | getFromRestart () |
Private Attributes | |
| std::string | d_object_name |
| bool | d_registered_for_restart |
| LimiterType | d_limiter_type = MC_LIMITED |
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.
| 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.
|
privatedelete |
|
privatedelete |
| from | The value to copy to this object. |
| const std::string& IBAMR::AdvectorExplicitPredictorPatchOps::getName | ( | ) | const |
Return the name of the patch operations object.
| double IBAMR::AdvectorExplicitPredictorPatchOps::computeStableDtOnPatch | ( | const SAMRAI::pdat::FaceData< NDIM, double > & | u_ADV, |
| const SAMRAI::hier::Patch< NDIM > & | patch | ||
| ) | const |
| void IBAMR::AdvectorExplicitPredictorPatchOps::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 |
| 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 |
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.
| 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 |
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
| 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 |
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
| 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 |
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
| 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 |
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
| 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 |
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. | int IBAMR::AdvectorExplicitPredictorPatchOps::getNumberCellGhosts | ( | ) | const |
| int IBAMR::AdvectorExplicitPredictorPatchOps::getNumberFluxGhosts | ( | ) | const |
|
overridevirtual |
This routine is a concrete implementation of the function declared in the SAMRAI::tbox::Serializable abstract base class.
Implements SAMRAI::tbox::Serializable.
|
privatedelete |
| that | The value to assign to this object. |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
1.8.17