IBAMR
An adaptive and distributed-memory parallel implementation of the immersed boundary (IB) method
Classes | Functions
IBAMR::LevelSetUtilities Namespace Reference

Class LevelSetUtilities provides implementation of some helper functions to enforce mass/volume conservation of phases. More...

Classes

class  LevelSetContainer
 A lightweight class to hold the level set variable and the associated hierarchy integrator (AdvDiffHierarchyIntegrator). More...
 
class  TagLSRefinementCells
 A lightweight class to tag grid cells containing the level set variable for grid refinement. More...
 
class  LevelSetMassLossFixer
 A lightweight class that stores the current value of the Lagrange multiplier for the level set variable. More...
 
class  SetLSProperties
 Class SetLSProperties is a utility class which sets (or resets after reinitialization) level set values on the patch hierarchy. More...
 

Functions

void tagLSCells (SAMRAI::tbox::Pointer< SAMRAI::hier::BasePatchHierarchy< NDIM > > hierarchy, const int level_number, const double error_data_time, const int tag_index, const bool initial_time, const bool uses_richardson_extrapolation_too, void *ctx)
 Preprocessing call back function to be hooked into IBAMR::HierarchyIntegrator class to tag the cells for grid refinement based on the given tagging criteria. More...
 
void fixMassLoss2PhaseFlows (double current_time, double new_time, bool skip_synchronize_new_state_data, int num_cycles, void *ctx)
 Compute the value of the Lagrange multiplier $ q $ and use that to adjust the flow level set variable $ \tilde{\phi} $ to satisfy the constraint: $ f(q) = \int_{\Omega} H(\tilde{\phi} + q) \text{d}\Omega - V^0 = 0 $. where, $ \tilde{\phi} $ is the level set field obtained from the reinitialization procedure, $ V^0 $ is the volume of the fluid at $ t = 0 $ s which needs to be conserved. Here, $ q $ is computed using the Newton's method till required tolerance. In practice the level set mass loss would be fixed during the postprocess integrate hierarchy stage. Hence the application time would be the new time and the variable context would be the new context. More...
 
void fixMassLoss3PhaseFlows (double current_time, double new_time, bool skip_synchronize_new_state_data, int num_cycles, void *ctx)
 Compute the value of the Lagrange multiplier $ q $ and use that to adjust the flow level set $ \tilde{\phi $ when there is a solid phase in the domain with level set $ \psi < 0 $. Satisfies the constraint: $ f(q) = \int_{\Omega} H(\tilde{\phi} + q) H(\psi) \text{d}\Omega - V^0 = 0 $. where, $ \tilde{\phi} $ is the level set field obtained from the reinitialization procedure, $ V^0 $ is the volume of the fluid at $ t = 0 $ s which needs to be conserved. Here, $ q $ is computed using the Newton's method till required tolerance. In practice the level set mass loss would be fixed during the postprocess integrate hierarchy stage. Hence the application time would be the new time and the variable context would be the new context. More...
 
std::vector< double > computeHeavisideIntegrals2PhaseFlows (const LevelSetContainer &lsc)
 
std::vector< double > computeHeavisideIntegrals3PhaseFlows (const LevelSetContainer &lsc)
 
void setLSDataPatchHierarchy (int ls_idx, SAMRAI::tbox::Pointer< IBTK::HierarchyMathOps > hier_math_ops, const int integrator_step, const double current_time, const bool initial_time, const bool regrid_time, void *ctx)
 A function that sets or resets the level set data on the patch hierarchy.
 

Detailed Description

Class LevelSetUtilities provides implementation of some helper functions to enforce mass/volume conservation of phases.

Function Documentation

◆ computeHeavisideIntegrals2PhaseFlows()

std::vector< double > IBAMR::LevelSetUtilities::computeHeavisideIntegrals2PhaseFlows ( const LevelSetContainer lsc)
Returns
Integrals of $ 1- H(\phi)$, $ H(\phi)$, and $ \delta(\phi) $ over the entire domain.

Here, $ H(\phi) $ is the Heaviside function demarcating liquid and gas domains.

$ \phi $ is taken to be positive in the liquid domain and negative in the gas domain.

Physically, these three integrals represent volume of the gas region, liquid region, and surface area of the interface, respectively.

◆ computeHeavisideIntegrals3PhaseFlows()

std::vector< double > IBAMR::LevelSetUtilities::computeHeavisideIntegrals3PhaseFlows ( const LevelSetContainer lsc)
Returns
Integrals of $ [1- H(\phi)] H(\Psi) $, $ H(\phi) H(\Psi)$, $ 1 - H(\Psi)$, and $ \delta(\phi)H(\Psi)$ over the entire domain.

Here, $ H(\phi) $ is the Heaviside function demarcating liquid and gas domains, and $ H(\Psi) $ is the Heaviside function demarcating solid and fluid (fluid = liquid and gas) domains.

Physically, these four integrals represents volume of the gas region, liquid region, solid region, and surface area of the fluid interface, respectively.

$ \phi $ is taken to be positive in the liquid domain and negative in the gas domain.

$ \Psi $ is taken to be positive outside the solid and negative inside the solid.

◆ fixMassLoss2PhaseFlows()

void IBAMR::LevelSetUtilities::fixMassLoss2PhaseFlows ( double  current_time,
double  new_time,
bool  skip_synchronize_new_state_data,
int  num_cycles,
void *  ctx 
)

Compute the value of the Lagrange multiplier $ q $ and use that to adjust the flow level set variable $ \tilde{\phi} $ to satisfy the constraint: $ f(q) = \int_{\Omega} H(\tilde{\phi} + q) \text{d}\Omega - V^0 = 0 $. where, $ \tilde{\phi} $ is the level set field obtained from the reinitialization procedure, $ V^0 $ is the volume of the fluid at $ t = 0 $ s which needs to be conserved. Here, $ q $ is computed using the Newton's method till required tolerance. In practice the level set mass loss would be fixed during the postprocess integrate hierarchy stage. Hence the application time would be the new time and the variable context would be the new context.

Parameters
ctxis the pointer to the LevelSetMassLossFixer class object.

◆ fixMassLoss3PhaseFlows()

void IBAMR::LevelSetUtilities::fixMassLoss3PhaseFlows ( double  current_time,
double  new_time,
bool  skip_synchronize_new_state_data,
int  num_cycles,
void *  ctx 
)

Compute the value of the Lagrange multiplier $ q $ and use that to adjust the flow level set $ \tilde{\phi $ when there is a solid phase in the domain with level set $ \psi < 0 $. Satisfies the constraint: $ f(q) = \int_{\Omega} H(\tilde{\phi} + q) H(\psi) \text{d}\Omega - V^0 = 0 $. where, $ \tilde{\phi} $ is the level set field obtained from the reinitialization procedure, $ V^0 $ is the volume of the fluid at $ t = 0 $ s which needs to be conserved. Here, $ q $ is computed using the Newton's method till required tolerance. In practice the level set mass loss would be fixed during the postprocess integrate hierarchy stage. Hence the application time would be the new time and the variable context would be the new context.

Parameters
ctxis the pointer to the LevelSetMassLossFixer class object.

◆ tagLSCells()

void IBAMR::LevelSetUtilities::tagLSCells ( SAMRAI::tbox::Pointer< SAMRAI::hier::BasePatchHierarchy< NDIM > >  hierarchy,
const int  level_number,
const double  error_data_time,
const int  tag_index,
const bool  initial_time,
const bool  uses_richardson_extrapolation_too,
void *  ctx 
)

Preprocessing call back function to be hooked into IBAMR::HierarchyIntegrator class to tag the cells for grid refinement based on the given tagging criteria.

This static member should be registered with an appropriate hierarchy integrator via registerApplyGradientDetectorCallback().

Parameters
ctxis the pointer to the TagLSRefinementCells class object.