IBAMR  IBAMR version 0.19.
Public Member Functions | List of all members
IBAMR::SurfaceTensionForceFunction Class Reference

Class SurfaceTensionForceFunction provides surface tension forcing using the continuum surface tension force model of Brackbill, Kothe, and Zemach. More...

#include <ibamr/SurfaceTensionForceFunction.h>

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

Public Member Functions

 SurfaceTensionForceFunction (const std::string &object_name, SAMRAI::tbox::Pointer< SAMRAI::tbox::Database > input_db, const AdvDiffHierarchyIntegrator *adv_diff_solver, const SAMRAI::tbox::Pointer< SAMRAI::hier::Variable< NDIM > > level_set_var)
 Constructor. More...
 
virtual ~SurfaceTensionForceFunction ()=default
 Destructor. More...
 
virtual void setSmoother (const std::string &kernel_fcn)
 Set the smoother (kernel function) to mollify the Heaviside function. More...
 
virtual void setSurfaceTensionCoef (double sigma)
 Set the constant surface tension coefficient. More...
 
virtual void setNumberOfInterfaceCells (double m)
 Set the number of interface cells m over which the surface tension force will be applied. The surface tension will take effect in the band -m*h to m*h around the interface, where h = (dx*dy)^(1/2) in 2D and h = (dx*dy*dz)^(1/3) in 3D. More...
 
std::string getSmoother () const
 Get the smoother (kernel function) to mollify the Heaviside function. More...
 
double getSurfaceTensionCoef () const
 Get the constant surface tension coefficient. More...
 
double getNumberOfInterfaceCells () const
 Get the number of interface cells over which the surface tension force will be applied. More...
 

Methods to set the data.

using MaskSurfaceTensionForcePtr = void(*)(int F_idx, SAMRAI::tbox::Pointer< IBTK::HierarchyMathOps > hier_math_ops, int cycle_num, double time, double current_time, double new_time, void *ctx)
 Function to Mask surface tension force to act only on the liquid-gas interface. More...
 
using ComputeSurfaceTensionCoefficientPtr = void(*)(int F_idx, SAMRAI::tbox::Pointer< IBTK::HierarchyMathOps > hier_math_ops, int cycle_num, double time, double current_time, double new_time, void *ctx)
 Function to compute the variable surface tension coefficient. More...
 
const AdvDiffHierarchyIntegrator *const d_adv_diff_solver
 
const SAMRAI::tbox::Pointer< SAMRAI::hier::Variable< NDIM > > d_ls_var
 
TimeSteppingType d_ts_type
 
int d_C_idx = IBTK::invalid_index
 
int d_phi_idx = IBTK::invalid_index
 
std::string d_kernel_fcn
 
double d_sigma = std::numeric_limits<double>::signaling_NaN()
 
double d_num_interface_cells = std::numeric_limits<double>::signaling_NaN()
 
SAMRAI::tbox::Pointer< IBTK::HierarchyMathOpsd_hier_math_ops
 
SAMRAI::tbox::Pointer< SAMRAI::math::HierarchySideDataOpsReal< NDIM, double > > d_hier_sc_data_ops
 
MaskSurfaceTensionForcePtr d_mask_surface_tension_force = nullptr
 
void * d_mask_surface_tension_force_ctx = nullptr
 
ComputeSurfaceTensionCoefficientPtr d_compute_surface_tension_coef = nullptr
 
void * d_compute_surface_tension_coef_ctx = nullptr
 
bool isTimeDependent () const override
 
void setDataOnPatchHierarchy (int data_idx, SAMRAI::tbox::Pointer< SAMRAI::hier::Variable< NDIM > > var, SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > > hierarchy, double data_time, bool initial_time=false, int coarsest_ln=IBTK::invalid_level_number, int finest_ln=IBTK::invalid_level_number) override
 Evaluate the function on the patch interiors on the specified levels of the patch hierarchy using the virtual function setDataOnPatch(). More...
 
void setDataOnPatch (int data_idx, SAMRAI::tbox::Pointer< SAMRAI::hier::Variable< NDIM > > var, SAMRAI::tbox::Pointer< SAMRAI::hier::Patch< NDIM > > patch, double data_time, bool initial_time=false, SAMRAI::tbox::Pointer< SAMRAI::hier::PatchLevel< NDIM > > level=SAMRAI::tbox::Pointer< SAMRAI::hier::PatchLevel< NDIM > >(nullptr)) override
 
void registerSurfaceTensionForceMasking (MaskSurfaceTensionForcePtr callback, void *ctx)
 Register function to limit the surface tension force. More...
 
void registerSurfaceTensionCoefficientFunction (ComputeSurfaceTensionCoefficientPtr callback, void *ctx)
 Register function to compute the variable surface tension coefficient. More...
 
int getMinimumGhostWidth (const std::string &kernel_fcn)
 
 SurfaceTensionForceFunction ()=delete
 Default constructor. More...
 
 SurfaceTensionForceFunction (const SurfaceTensionForceFunction &from)=delete
 Copy constructor. More...
 
SurfaceTensionForceFunctionoperator= (const SurfaceTensionForceFunction &that)=delete
 Assignment operator. More...
 
void convertToHeaviside (int phi_idx, int coarsest_ln, int finest_ln, SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > > patch_hierarchy)
 
void mollifyData (int phi_idx, int coarsest_ln, int finest_ln, double data_time, SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > > hierarchy, SAMRAI::tbox::Pointer< IBTK::HierarchyGhostCellInterpolation > fill_op)
 
void setDataOnPatchCell (SAMRAI::tbox::Pointer< SAMRAI::pdat::CellData< NDIM, double > > F_data, SAMRAI::tbox::Pointer< SAMRAI::hier::Patch< NDIM > > patch, const double data_time, const bool initial_time, SAMRAI::tbox::Pointer< SAMRAI::hier::PatchLevel< NDIM > > level)
 
void setDataOnPatchSide (SAMRAI::tbox::Pointer< SAMRAI::pdat::SideData< NDIM, double > > F_data, SAMRAI::tbox::Pointer< SAMRAI::hier::Patch< NDIM > > patch, const double data_time, const bool initial_time, SAMRAI::tbox::Pointer< SAMRAI::hier::PatchLevel< NDIM > > level)
 
int getStencilSize (const std::string &kernel_fcn)
 

Methods to set patch interior data.

std::string d_object_name
 
virtual void setDataOnPatchLevel (int data_idx, SAMRAI::tbox::Pointer< SAMRAI::hier::Variable< NDIM > > var, SAMRAI::tbox::Pointer< SAMRAI::hier::PatchLevel< NDIM > > patch_level, double data_time, bool initial_time=false)
 Evaluate the function on the patch interiors on the specified level of the patch hierarchy using the virtual function setDataOnPatch(). More...
 

Detailed Description

Note
Presently, this class assumes that the indicator function is a cell centered level-set variable that is maintained by the advection-diffusion integrator. In general, the indicator variable can either be a level set function, a volume fraction function, or a phase field function.

Reference Brackbill et. al, A continuum method for modeling surface tension

Member Typedef Documentation

◆ MaskSurfaceTensionForcePtr

using IBAMR::SurfaceTensionForceFunction::MaskSurfaceTensionForcePtr = void (*)(int F_idx, SAMRAI::tbox::Pointer<IBTK::HierarchyMathOps> hier_math_ops, int cycle_num, double time, double current_time, double new_time, void* ctx)

◆ ComputeSurfaceTensionCoefficientPtr

using IBAMR::SurfaceTensionForceFunction::ComputeSurfaceTensionCoefficientPtr = void (*)(int F_idx, SAMRAI::tbox::Pointer<IBTK::HierarchyMathOps> hier_math_ops, int cycle_num, double time, double current_time, double new_time, void* ctx)

Constructor & Destructor Documentation

◆ SurfaceTensionForceFunction() [1/3]

IBAMR::SurfaceTensionForceFunction::SurfaceTensionForceFunction ( const std::string &  object_name,
SAMRAI::tbox::Pointer< SAMRAI::tbox::Database input_db,
const AdvDiffHierarchyIntegrator adv_diff_solver,
const SAMRAI::tbox::Pointer< SAMRAI::hier::Variable< NDIM > >  level_set_var 
)

◆ ~SurfaceTensionForceFunction()

virtual IBAMR::SurfaceTensionForceFunction::~SurfaceTensionForceFunction ( )
virtualdefault

◆ SurfaceTensionForceFunction() [2/3]

IBAMR::SurfaceTensionForceFunction::SurfaceTensionForceFunction ( )
privatedelete
Note
This constructor is not implemented and should not be used.

◆ SurfaceTensionForceFunction() [3/3]

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

Member Function Documentation

◆ setSmoother()

virtual void IBAMR::SurfaceTensionForceFunction::setSmoother ( const std::string &  kernel_fcn)
virtual

◆ setSurfaceTensionCoef()

virtual void IBAMR::SurfaceTensionForceFunction::setSurfaceTensionCoef ( double  sigma)
virtual

◆ setNumberOfInterfaceCells()

virtual void IBAMR::SurfaceTensionForceFunction::setNumberOfInterfaceCells ( double  m)
virtual

◆ getSmoother()

std::string IBAMR::SurfaceTensionForceFunction::getSmoother ( ) const
inline

◆ getSurfaceTensionCoef()

double IBAMR::SurfaceTensionForceFunction::getSurfaceTensionCoef ( ) const
inline

◆ getNumberOfInterfaceCells()

double IBAMR::SurfaceTensionForceFunction::getNumberOfInterfaceCells ( ) const
inline

◆ isTimeDependent()

bool IBAMR::SurfaceTensionForceFunction::isTimeDependent ( ) const
overridevirtual
Note
This concrete IBTK::CartGridFunction is time-dependent.

Implements IBTK::CartGridFunction.

◆ setDataOnPatchHierarchy()

void IBAMR::SurfaceTensionForceFunction::setDataOnPatchHierarchy ( int  data_idx,
SAMRAI::tbox::Pointer< SAMRAI::hier::Variable< NDIM > >  var,
SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > >  hierarchy,
double  data_time,
bool  initial_time = false,
int  coarsest_ln = IBTK::invalid_level_number,
int  finest_ln = IBTK::invalid_level_number 
)
overridevirtual
See also
setDataOnPatch

Reimplemented from IBTK::CartGridFunction.

◆ setDataOnPatch()

void IBAMR::SurfaceTensionForceFunction::setDataOnPatch ( int  data_idx,
SAMRAI::tbox::Pointer< SAMRAI::hier::Variable< NDIM > >  var,
SAMRAI::tbox::Pointer< SAMRAI::hier::Patch< NDIM > >  patch,
double  data_time,
bool  initial_time = false,
SAMRAI::tbox::Pointer< SAMRAI::hier::PatchLevel< NDIM > >  level = SAMRAI::tbox::PointerSAMRAI::hier::PatchLevel< NDIM > >(nullptr) 
)
overridevirtual

Set the data on the patch interior.

Implements IBTK::CartGridFunction.

◆ registerSurfaceTensionForceMasking()

void IBAMR::SurfaceTensionForceFunction::registerSurfaceTensionForceMasking ( MaskSurfaceTensionForcePtr  callback,
void *  ctx 
)

◆ registerSurfaceTensionCoefficientFunction()

void IBAMR::SurfaceTensionForceFunction::registerSurfaceTensionCoefficientFunction ( ComputeSurfaceTensionCoefficientPtr  callback,
void *  ctx 
)

◆ getMinimumGhostWidth()

int IBAMR::SurfaceTensionForceFunction::getMinimumGhostWidth ( const std::string &  kernel_fcn)
protected

Get the ghost cell width of scratch data.

◆ operator=()

SurfaceTensionForceFunction& IBAMR::SurfaceTensionForceFunction::operator= ( const SurfaceTensionForceFunction 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.

◆ convertToHeaviside()

void IBAMR::SurfaceTensionForceFunction::convertToHeaviside ( int  phi_idx,
int  coarsest_ln,
int  finest_ln,
SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > >  patch_hierarchy 
)
private

Convert the level set variable to a smoothed heaviside function.

◆ mollifyData()

void IBAMR::SurfaceTensionForceFunction::mollifyData ( int  phi_idx,
int  coarsest_ln,
int  finest_ln,
double  data_time,
SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > >  hierarchy,
SAMRAI::tbox::Pointer< IBTK::HierarchyGhostCellInterpolation fill_op 
)
private

Mollify data.

◆ setDataOnPatchCell()

void IBAMR::SurfaceTensionForceFunction::setDataOnPatchCell ( SAMRAI::tbox::Pointer< SAMRAI::pdat::CellData< NDIM, double > >  F_data,
SAMRAI::tbox::Pointer< SAMRAI::hier::Patch< NDIM > >  patch,
const double  data_time,
const bool  initial_time,
SAMRAI::tbox::Pointer< SAMRAI::hier::PatchLevel< NDIM > >  level 
)
private

Set the data on the patch interior.

◆ setDataOnPatchSide()

void IBAMR::SurfaceTensionForceFunction::setDataOnPatchSide ( SAMRAI::tbox::Pointer< SAMRAI::pdat::SideData< NDIM, double > >  F_data,
SAMRAI::tbox::Pointer< SAMRAI::hier::Patch< NDIM > >  patch,
const double  data_time,
const bool  initial_time,
SAMRAI::tbox::Pointer< SAMRAI::hier::PatchLevel< NDIM > >  level 
)
private

Set the data on the patch interior.

◆ getStencilSize()

int IBAMR::SurfaceTensionForceFunction::getStencilSize ( const std::string &  kernel_fcn)
private

Get the stencil size for the kernel.

◆ setDataOnPatchLevel()

virtual void IBTK::CartGridFunction::setDataOnPatchLevel ( int  data_idx,
SAMRAI::tbox::Pointer< SAMRAI::hier::Variable< NDIM > >  var,
SAMRAI::tbox::Pointer< SAMRAI::hier::PatchLevel< NDIM > >  patch_level,
double  data_time,
bool  initial_time = false 
)
virtualinherited

Member Data Documentation

◆ d_adv_diff_solver

const AdvDiffHierarchyIntegrator* const IBAMR::SurfaceTensionForceFunction::d_adv_diff_solver
protected

◆ d_ls_var

const SAMRAI::tbox::Pointer<SAMRAI::hier::Variable<NDIM> > IBAMR::SurfaceTensionForceFunction::d_ls_var
protected

◆ d_ts_type

TimeSteppingType IBAMR::SurfaceTensionForceFunction::d_ts_type
protected

◆ d_C_idx

int IBAMR::SurfaceTensionForceFunction::d_C_idx = IBTK::invalid_index
protected

◆ d_phi_idx

int IBAMR::SurfaceTensionForceFunction::d_phi_idx = IBTK::invalid_index
protected

◆ d_kernel_fcn

std::string IBAMR::SurfaceTensionForceFunction::d_kernel_fcn
protected

◆ d_sigma

double IBAMR::SurfaceTensionForceFunction::d_sigma = std::numeric_limits<double>::signaling_NaN()
protected

◆ d_num_interface_cells

double IBAMR::SurfaceTensionForceFunction::d_num_interface_cells = std::numeric_limits<double>::signaling_NaN()
protected

◆ d_hier_math_ops

SAMRAI::tbox::Pointer<IBTK::HierarchyMathOps> IBAMR::SurfaceTensionForceFunction::d_hier_math_ops
protected

◆ d_hier_sc_data_ops

SAMRAI::tbox::Pointer<SAMRAI::math::HierarchySideDataOpsReal<NDIM, double> > IBAMR::SurfaceTensionForceFunction::d_hier_sc_data_ops
protected

◆ d_mask_surface_tension_force

MaskSurfaceTensionForcePtr IBAMR::SurfaceTensionForceFunction::d_mask_surface_tension_force = nullptr
private

◆ d_mask_surface_tension_force_ctx

void* IBAMR::SurfaceTensionForceFunction::d_mask_surface_tension_force_ctx = nullptr
private

◆ d_compute_surface_tension_coef

ComputeSurfaceTensionCoefficientPtr IBAMR::SurfaceTensionForceFunction::d_compute_surface_tension_coef = nullptr
private

◆ d_compute_surface_tension_coef_ctx

void* IBAMR::SurfaceTensionForceFunction::d_compute_surface_tension_coef_ctx = nullptr
private

◆ d_object_name

std::string IBTK::CartGridFunction::d_object_name
protectedinherited

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