IBAMR  IBAMR version 0.19.
Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
IBAMR::BrinkmanAdvDiffBcHelper Class Reference

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 <ibamr/BrinkmanAdvDiffBcHelper.h>

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

Classes

struct  BCProperties
 

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 \( \zeta q + \kappa n \dot \nabla q = \g \). More...
 

Public Member Functions

 BrinkmanAdvDiffBcHelper (std::string object_name, SAMRAI::tbox::Pointer< IBAMR::AdvDiffHierarchyIntegrator > adv_diff_solver)
 Constructor of the class. More...
 
 ~BrinkmanAdvDiffBcHelper ()=default
 Destructor of the class. More...
 
void setTimeInterval (double current_time, double new_time)
 Set the time interval in which Brinkman forcing is computed. More...
 
void preprocessBrinkmanAdvDiffBcHelper (double current_time, double new_time, int num_cycles)
 Preprocess routine before computing Brinkman penalization terms. More...
 
void postprocessBrinkmanAdvDiffBcHelper (double current_time, double new_time, int num_cycles)
 Postprocess routine after computing Brinkman penalization terms. More...
 
void setPenaltyCoefficient (double eta_penalty_coef)
 Set Brinkman penalization penalty factor for all level sets. More...
 
void setNumInterfaceCells (double num_interface_cells)
 Set the number of interface cells for all level sets. More...
 
const std::string & getName () const
 Get the name of the object. More...
 
std::pair< double, doublegetCurrentTimeInterval () const
 Get the current time interval \( [t^{n+1}, t^n] \) in which Brinkman velocity is computed. More...
 
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. More...
 
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. \( u \dot \grad Q\) and body forces. More...
 

Private Member Functions

 BrinkmanAdvDiffBcHelper (const BrinkmanAdvDiffBcHelper &from)=delete
 Copy constructor. More...
 
BrinkmanAdvDiffBcHelperoperator= (const BrinkmanAdvDiffBcHelper &that)=delete
 Assignment operator. More...
 

Private Attributes

std::string d_object_name
 
SAMRAI::tbox::Pointer< IBAMR::AdvDiffHierarchyIntegratord_adv_diff_solver
 
double d_current_time = std::numeric_limits<double>::quiet_NaN()
 
double d_new_time = std::numeric_limits<double>::quiet_NaN()
 
std::map< SAMRAI::tbox::Pointer< SAMRAI::pdat::CellVariable< NDIM, double > >, std::vector< BCProperties > > d_Q_bc
 
SAMRAI::tbox::Pointer< SAMRAI::pdat::SideVariable< NDIM, double > > d_B_var
 
int d_B_scratch_idx = IBTK::invalid_index
 
int d_B_chi_scratch_idx = IBTK::invalid_index
 
SAMRAI::tbox::Pointer< SAMRAI::pdat::CellVariable< NDIM, double > > d_div_var
 
int d_div_B_scratch_idx = IBTK::invalid_index
 
int d_div_B_chi_scratch_idx = IBTK::invalid_index
 
int d_chi_scratch_idx = IBTK::invalid_index
 
SAMRAI::tbox::Pointer< SAMRAI::pdat::SideVariable< NDIM, double > > d_n_var
 
int d_n_scratch_idx = IBTK::invalid_index
 
int d_n_chi_scratch_idx = IBTK::invalid_index
 
int d_div_n_scratch_idx = IBTK::invalid_index
 
int d_div_n_chi_scratch_idx = IBTK::invalid_index
 
int d_variable_g_scratch_idx = IBTK::invalid_index
 

Detailed Description

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

Member Typedef Documentation

◆ BrinkmanInhomogeneousBCsFcnPtr

The user must set the patch data B_idx such that \( n \dot B = g \). The applied forcing term is then computed internally as \( \nabla \dot (\chi B) - \chi \nabla \dot B \). Note that B_idx contains side-centered patch data.

Constructor & Destructor Documentation

◆ BrinkmanAdvDiffBcHelper() [1/2]

IBAMR::BrinkmanAdvDiffBcHelper::BrinkmanAdvDiffBcHelper ( std::string  object_name,
SAMRAI::tbox::Pointer< IBAMR::AdvDiffHierarchyIntegrator adv_diff_solver 
)

◆ ~BrinkmanAdvDiffBcHelper()

IBAMR::BrinkmanAdvDiffBcHelper::~BrinkmanAdvDiffBcHelper ( )
default

◆ BrinkmanAdvDiffBcHelper() [2/2]

IBAMR::BrinkmanAdvDiffBcHelper::BrinkmanAdvDiffBcHelper ( const BrinkmanAdvDiffBcHelper from)
privatedelete
Note
This constructor is not implemented and should not be used.
Parameters
fromThe value to copy to this object.

Member Function Documentation

◆ setTimeInterval()

void IBAMR::BrinkmanAdvDiffBcHelper::setTimeInterval ( double  current_time,
double  new_time 
)

◆ preprocessBrinkmanAdvDiffBcHelper()

void IBAMR::BrinkmanAdvDiffBcHelper::preprocessBrinkmanAdvDiffBcHelper ( double  current_time,
double  new_time,
int  num_cycles 
)

◆ postprocessBrinkmanAdvDiffBcHelper()

void IBAMR::BrinkmanAdvDiffBcHelper::postprocessBrinkmanAdvDiffBcHelper ( double  current_time,
double  new_time,
int  num_cycles 
)

◆ setPenaltyCoefficient()

void IBAMR::BrinkmanAdvDiffBcHelper::setPenaltyCoefficient ( double  eta_penalty_coef)

◆ setNumInterfaceCells()

void IBAMR::BrinkmanAdvDiffBcHelper::setNumInterfaceCells ( double  num_interface_cells)

◆ getName()

const std::string& IBAMR::BrinkmanAdvDiffBcHelper::getName ( ) const
inline

◆ getCurrentTimeInterval()

std::pair<double, double> IBAMR::BrinkmanAdvDiffBcHelper::getCurrentTimeInterval ( ) const
inline

◆ hasBrinkmanBoundaryCondition()

bool IBAMR::BrinkmanAdvDiffBcHelper::hasBrinkmanBoundaryCondition ( SAMRAI::tbox::Pointer< SAMRAI::pdat::CellVariable< NDIM, double > >  Q_var) const
inline

◆ registerHomogeneousBC()

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 
)
Note
This function can only be used to register homogeneous Dirichlet, Neumann and Robin BCs.

◆ registerInhomogeneousBC()

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() 
)
Note
Inhomogeneous BCs are treated uniquely within this class and require additional user callback inputs.

◆ computeDampingCoefficient()

void IBAMR::BrinkmanAdvDiffBcHelper::computeDampingCoefficient ( int  C_idx,
SAMRAI::tbox::Pointer< SAMRAI::pdat::CellVariable< NDIM, double > >  Q_var 
)
Note
It is assumed that the physical damping coefficient \(\lambda\) is zero.

The functional form of the Brinkman damping coefficient is \( C = \sum_{Dirichlet} \chi_i/\eta + \sum_{Robin} \nabla \dot (\chi_i n_i) - \chi_i \nabla \dot n_i\) where the sum is taken over all level sets with Dirichlet and Robin BCs. Here \(\chi_i = 1-H_i\). Note that Neumann BCs do not contribute anything to this term.

◆ computeDiffusionCoefficient()

void IBAMR::BrinkmanAdvDiffBcHelper::computeDiffusionCoefficient ( int  D_idx,
SAMRAI::tbox::Pointer< SAMRAI::pdat::CellVariable< NDIM, double > >  Q_var,
int  kappa_idx,
double  kappa 
)
Note
This function is able to handle both constant and variable kappa.

The functional form of the Brinkman diffusion coefficient is \( D = \kappa + \sum_{Neumann} (-\chi_i + \eta \chi_i) + \sum_{Robin} (-\chi_i + \eta \chi_i)\) where \(\chi_i = 1-H_i\) 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.

◆ computeForcing()

void IBAMR::BrinkmanAdvDiffBcHelper::computeForcing ( int  F_idx,
SAMRAI::tbox::Pointer< SAMRAI::pdat::CellVariable< NDIM, double > >  Q_var 
)

For Inhomogeneous Dirichlet BCs, \( F_i = \chi_i/\eta Q_{bc}\) where \(\chi_i = 1-H_i\). For inhomogeneous Neumann and Robin BCs, \( F_i = \nabla \dot (\chi_i B) - \chi_i \nabla \dot B_i \), with a user defined \(B_i\). The overall functional form of the Brinkman body force is \(F = \sum_{i} F_i\).

◆ maskForcingTerm()

void IBAMR::BrinkmanAdvDiffBcHelper::maskForcingTerm ( int  N_idx,
SAMRAI::tbox::Pointer< SAMRAI::pdat::CellVariable< NDIM, double > >  Q_var,
const bool  mask_smeared_region = false 
)

The functional form of the Brinkman masking term is \( N = (1-\sum_{Neumann and Robin} \chi_i) N\) where \(\chi_i = 1-H_i\) and the sum is taken over all level sets with Neumann and Robin BCs. Note that Dirichlet BCs do not mask this term presently.

◆ operator=()

BrinkmanAdvDiffBcHelper& IBAMR::BrinkmanAdvDiffBcHelper::operator= ( const BrinkmanAdvDiffBcHelper that)
privatedelete
Note
This operator is not implemented and should not be used.
Parameters
thatThe value to assign to this object.
Returns
A reference to this object.

Member Data Documentation

◆ d_object_name

std::string IBAMR::BrinkmanAdvDiffBcHelper::d_object_name
private

Object name.

◆ d_adv_diff_solver

SAMRAI::tbox::Pointer<IBAMR::AdvDiffHierarchyIntegrator> IBAMR::BrinkmanAdvDiffBcHelper::d_adv_diff_solver
private

Pointer to the adv-diff solver.

◆ d_current_time

double IBAMR::BrinkmanAdvDiffBcHelper::d_current_time = std::numeric_limits<double>::quiet_NaN()
private

Time interval

◆ d_new_time

double IBAMR::BrinkmanAdvDiffBcHelper::d_new_time = std::numeric_limits<double>::quiet_NaN()
private

◆ d_Q_bc

std::map<SAMRAI::tbox::Pointer<SAMRAI::pdat::CellVariable<NDIM, double> >, std::vector<BCProperties> > IBAMR::BrinkmanAdvDiffBcHelper::d_Q_bc
private

Map for storing transported variables and various registered BCs

◆ d_B_var

SAMRAI::tbox::Pointer<SAMRAI::pdat::SideVariable<NDIM, double> > IBAMR::BrinkmanAdvDiffBcHelper::d_B_var
private

Patch data required for computing additional forcing for inhomogeneous Neumann and Robin BCs

◆ d_B_scratch_idx

int IBAMR::BrinkmanAdvDiffBcHelper::d_B_scratch_idx = IBTK::invalid_index
private

◆ d_B_chi_scratch_idx

int IBAMR::BrinkmanAdvDiffBcHelper::d_B_chi_scratch_idx = IBTK::invalid_index
private

◆ d_div_var

SAMRAI::tbox::Pointer<SAMRAI::pdat::CellVariable<NDIM, double> > IBAMR::BrinkmanAdvDiffBcHelper::d_div_var
private

◆ d_div_B_scratch_idx

int IBAMR::BrinkmanAdvDiffBcHelper::d_div_B_scratch_idx = IBTK::invalid_index
private

◆ d_div_B_chi_scratch_idx

int IBAMR::BrinkmanAdvDiffBcHelper::d_div_B_chi_scratch_idx = IBTK::invalid_index
private

◆ d_chi_scratch_idx

int IBAMR::BrinkmanAdvDiffBcHelper::d_chi_scratch_idx = IBTK::invalid_index
private

◆ d_n_var

SAMRAI::tbox::Pointer<SAMRAI::pdat::SideVariable<NDIM, double> > IBAMR::BrinkmanAdvDiffBcHelper::d_n_var
private

◆ d_n_scratch_idx

int IBAMR::BrinkmanAdvDiffBcHelper::d_n_scratch_idx = IBTK::invalid_index
private

◆ d_n_chi_scratch_idx

int IBAMR::BrinkmanAdvDiffBcHelper::d_n_chi_scratch_idx = IBTK::invalid_index
private

◆ d_div_n_scratch_idx

int IBAMR::BrinkmanAdvDiffBcHelper::d_div_n_scratch_idx = IBTK::invalid_index
private

◆ d_div_n_chi_scratch_idx

int IBAMR::BrinkmanAdvDiffBcHelper::d_div_n_chi_scratch_idx = IBTK::invalid_index
private

◆ d_variable_g_scratch_idx

int IBAMR::BrinkmanAdvDiffBcHelper::d_variable_g_scratch_idx = IBTK::invalid_index
private

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