IBAMR
An adaptive and distributed-memory parallel implementation of the immersed boundary (IB) method
|
BrinkmanAdvDiffBcHelper is an abstract class that provides an interface to implement Brinkman penalization body force in the advection-diffusion equation in order to enforce Dirichlet, Neumann and Robin boundary conditions on surfaces of rigid immersed bodies. A single instance of this class is meant to handle all of the Brinkman penalization zones for multiple transported quantities with various boundary conditions. More...
#include </home/runner/work/IBAMR/IBAMR/include/ibamr/BrinkmanAdvDiffBcHelper.h>
Public Types | |
using | BrinkmanInhomogeneousBCsFcnPtr = void(*)(int B_idx, SAMRAI::tbox::Pointer< SAMRAI::pdat::CellVariable< NDIM, double > > ls_var, SAMRAI::tbox::Pointer< IBTK::HierarchyMathOps > hier_math_ops, double time, void *ctx) |
Function specifying the optional forcing function for inhomogeneous boundary conditions . More... | |
Public Member Functions | |
BrinkmanAdvDiffBcHelper (std::string object_name, SAMRAI::tbox::Pointer< IBAMR::AdvDiffHierarchyIntegrator > adv_diff_solver) | |
Constructor of the class. | |
~BrinkmanAdvDiffBcHelper ()=default | |
Destructor of the class. | |
void | setTimeInterval (double current_time, double new_time) |
Set the time interval in which Brinkman forcing is computed. | |
void | preprocessBrinkmanAdvDiffBcHelper (double current_time, double new_time, int num_cycles) |
Preprocess routine before computing Brinkman penalization terms. | |
void | postprocessBrinkmanAdvDiffBcHelper (double current_time, double new_time, int num_cycles) |
Postprocess routine after computing Brinkman penalization terms. | |
void | setPenaltyCoefficient (double eta_penalty_coef) |
Set Brinkman penalization penalty factor for all level sets. | |
void | setNumInterfaceCells (double num_interface_cells) |
Set the number of interface cells for all level sets. | |
const std::string & | getName () const |
Get the name of the object. | |
std::pair< double, double > | getCurrentTimeInterval () const |
Get the current time interval in which Brinkman velocity is computed. | |
bool | hasBrinkmanBoundaryCondition (SAMRAI::tbox::Pointer< SAMRAI::pdat::CellVariable< NDIM, double > > Q_var) const |
Function to determine if a transported quantity has Brinkman boundary conditions associated with it. | |
void | registerHomogeneousBC (SAMRAI::tbox::Pointer< SAMRAI::pdat::CellVariable< NDIM, double > > Q_var, SAMRAI::tbox::Pointer< SAMRAI::pdat::CellVariable< NDIM, double > > ls_solid_var, std::string bc_type, std::string indicator_func_type="SMOOTH", double num_interface_cells=2.0, double eta_penalty_coef=1.0e-8) |
Register a transported quantity with this object, along with the solid level set variable for which to apply a homogeneous boundary condition. More... | |
void | registerInhomogeneousBC (SAMRAI::tbox::Pointer< SAMRAI::pdat::CellVariable< NDIM, double > > Q_var, SAMRAI::tbox::Pointer< SAMRAI::pdat::CellVariable< NDIM, double > > ls_solid_var, std::string bc_type, BrinkmanInhomogeneousBCsFcnPtr callback=nullptr, void *ctx=nullptr, std::string indicator_func_type="SMOOTH", double num_interface_cells=2.0, double eta_penalty_coef=1.0e-8, double bc_val=std::numeric_limits< double >::signaling_NaN()) |
Register a transported quantity with this object, along with the solid level set variable on which to apply inhomogeneous boundary conditions. More... | |
void | computeDampingCoefficient (int C_idx, SAMRAI::tbox::Pointer< SAMRAI::pdat::CellVariable< NDIM, double > > Q_var) |
Function to compute the cell-centered coefficient to the damping linear operator and RHS of the advection-diffusion equation for a specified transported quantity Q_var. More... | |
void | computeDiffusionCoefficient (int D_idx, SAMRAI::tbox::Pointer< SAMRAI::pdat::CellVariable< NDIM, double > > Q_var, int kappa_idx, double kappa) |
Function to compute the side-centered coefficient to the diffusion linear operator and RHS of the advection-diffusion equation for a specified transported quantity Q_var with diffusion coefficient kappa. More... | |
void | computeForcing (int F_idx, SAMRAI::tbox::Pointer< SAMRAI::pdat::CellVariable< NDIM, double > > Q_var) |
Function to compute the Brinkman forcing contribution to the RHS of the advection-diffusion solver for a specified transported quantity Q_var. More... | |
void | maskForcingTerm (int N_idx, SAMRAI::tbox::Pointer< SAMRAI::pdat::CellVariable< NDIM, double > > Q_var, const bool mask_smeared_region=false) |
Function to mask the additional forcing terms on the RHS of the advection-diffusion solver e.g. and body forces. More... | |
BrinkmanAdvDiffBcHelper is an abstract class that provides an interface to implement Brinkman penalization body force in the advection-diffusion equation in order to enforce Dirichlet, Neumann and Robin boundary conditions on surfaces of rigid immersed bodies. A single instance of this class is meant to handle all of the Brinkman penalization zones for multiple transported quantities with various boundary conditions.
BrinkmanAdvDiffBcHelper provides an implementation of a volume penalized body force and linear operator modifications required to impose Dirichlet, Neumann and Robin boundary conditions to scalar quantities maintained by BrinkmanSemiImplicitAdvDiffHierarchyIntegrator.
Boundary conditions can be applied to multiple interfaces, which are demarcated using level set variables. This class assumes that the penalized region coincides with negative values of the level set. The sign convention of the level set variable is specified by the user.
Reference Sakurai, T., Yoshimatsu, K., Okamoto N. and Schneider K.,Volume penalization for inhomogeneous Neumann boundary conditions modeling scalar flux in complicated geometry
using IBAMR::BrinkmanAdvDiffBcHelper::BrinkmanInhomogeneousBCsFcnPtr = void (*)(int B_idx, SAMRAI::tbox::Pointer<SAMRAI::pdat::CellVariable<NDIM, double> > ls_var, SAMRAI::tbox::Pointer<IBTK::HierarchyMathOps> hier_math_ops, double time, void* ctx) |
Function specifying the optional forcing function for inhomogeneous boundary conditions .
The user must set the patch data B_idx such that . The applied forcing term is then computed internally as . Note that B_idx contains side-centered patch data.
void IBAMR::BrinkmanAdvDiffBcHelper::computeDampingCoefficient | ( | int | C_idx, |
SAMRAI::tbox::Pointer< SAMRAI::pdat::CellVariable< NDIM, double > > | Q_var | ||
) |
Function to compute the cell-centered coefficient to the damping linear operator and RHS of the advection-diffusion equation for a specified transported quantity Q_var.
The functional form of the Brinkman damping coefficient is where the sum is taken over all level sets with Dirichlet and Robin BCs. Here . Note that Neumann BCs do not contribute anything to this term.
void IBAMR::BrinkmanAdvDiffBcHelper::computeDiffusionCoefficient | ( | int | D_idx, |
SAMRAI::tbox::Pointer< SAMRAI::pdat::CellVariable< NDIM, double > > | Q_var, | ||
int | kappa_idx, | ||
double | kappa | ||
) |
Function to compute the side-centered coefficient to the diffusion linear operator and RHS of the advection-diffusion equation for a specified transported quantity Q_var with diffusion coefficient kappa.
The functional form of the Brinkman diffusion coefficient is where and the sum is taken over all level sets with Neumann and Robin BCs . Note that Dirichlet BCs do not contribute anything to this term.
void IBAMR::BrinkmanAdvDiffBcHelper::computeForcing | ( | int | F_idx, |
SAMRAI::tbox::Pointer< SAMRAI::pdat::CellVariable< NDIM, double > > | Q_var | ||
) |
Function to compute the Brinkman forcing contribution to the RHS of the advection-diffusion solver for a specified transported quantity Q_var.
For Inhomogeneous Dirichlet BCs, where . For inhomogeneous Neumann and Robin BCs, , with a user defined . The overall functional form of the Brinkman body force is .
void IBAMR::BrinkmanAdvDiffBcHelper::maskForcingTerm | ( | int | N_idx, |
SAMRAI::tbox::Pointer< SAMRAI::pdat::CellVariable< NDIM, double > > | Q_var, | ||
const bool | mask_smeared_region = false |
||
) |
Function to mask the additional forcing terms on the RHS of the advection-diffusion solver e.g. and body forces.
The functional form of the Brinkman masking term is where and the sum is taken over all level sets with Neumann and Robin BCs. Note that Dirichlet BCs do not mask this term presently.
void IBAMR::BrinkmanAdvDiffBcHelper::registerHomogeneousBC | ( | SAMRAI::tbox::Pointer< SAMRAI::pdat::CellVariable< NDIM, double > > | Q_var, |
SAMRAI::tbox::Pointer< SAMRAI::pdat::CellVariable< NDIM, double > > | ls_solid_var, | ||
std::string | bc_type, | ||
std::string | indicator_func_type = "SMOOTH" , |
||
double | num_interface_cells = 2.0 , |
||
double | eta_penalty_coef = 1.0e-8 |
||
) |
Register a transported quantity with this object, along with the solid level set variable for which to apply a homogeneous boundary condition.
void IBAMR::BrinkmanAdvDiffBcHelper::registerInhomogeneousBC | ( | SAMRAI::tbox::Pointer< SAMRAI::pdat::CellVariable< NDIM, double > > | Q_var, |
SAMRAI::tbox::Pointer< SAMRAI::pdat::CellVariable< NDIM, double > > | ls_solid_var, | ||
std::string | bc_type, | ||
BrinkmanInhomogeneousBCsFcnPtr | callback = nullptr , |
||
void * | ctx = nullptr , |
||
std::string | indicator_func_type = "SMOOTH" , |
||
double | num_interface_cells = 2.0 , |
||
double | eta_penalty_coef = 1.0e-8 , |
||
double | bc_val = std::numeric_limits<double>::signaling_NaN() |
||
) |
Register a transported quantity with this object, along with the solid level set variable on which to apply inhomogeneous boundary conditions.