IBAMR
An adaptive and distributed-memory parallel implementation of the immersed boundary (IB) method
Public Member Functions | List of all members
IBAMR::STSMassFluxIntegrator Class Referenceabstract

Class STSMassFluxIntegrator is an abstract class which integrates the density field. More...

#include </home/runner/work/IBAMR/IBAMR/include/ibamr/STSMassFluxIntegrator.h>

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

Public Member Functions

 STSMassFluxIntegrator (std::string object_name, SAMRAI::tbox::Pointer< SAMRAI::tbox::Database > input_db)
 Class constructor.
 
virtual ~STSMassFluxIntegrator ()=default
 Destructor.
 
virtual void integrate (double dt)=0
 Integrate density and compute the convective operator of the momentum and/or energy.
 

General time stepping functionality.

std::string d_object_name
 
SAMRAI::tbox::Pointer< StaggeredStokesPhysicalBoundaryHelperd_bc_helper
 
std::vector< SAMRAI::solv::RobinBcCoefStrategy< NDIM > * > d_bc_coefs
 
std::string d_density_bdry_extrap_type = "CONSTANT"
 
std::vector< IBTK::HierarchyGhostCellInterpolation::InterpolationTransactionComponentd_rho_transaction_comps
 
SAMRAI::tbox::Pointer< IBTK::HierarchyGhostCellInterpolationd_hier_rho_bdry_fill
 
SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > > d_hierarchy
 
int d_coarsest_ln = IBTK::invalid_level_number
 
int d_finest_ln = IBTK::invalid_level_number
 
std::vector< SAMRAI::solv::RobinBcCoefStrategy< NDIM > * > d_u_bc_coefs
 
std::vector< SAMRAI::solv::RobinBcCoefStrategy< NDIM > * > d_rho_bc_coefs
 
SAMRAI::tbox::Pointer< SAMRAI::math::HierarchyFaceDataOpsReal< NDIM, double > > d_hier_fc_data_ops
 
SAMRAI::tbox::Pointer< SAMRAI::math::HierarchySideDataOpsReal< NDIM, double > > d_hier_sc_data_ops
 
SAMRAI::tbox::Pointer< SAMRAI::math::HierarchyCellDataOpsReal< NDIM, double > > d_hier_cc_data_ops
 
SAMRAI::tbox::Pointer< SAMRAI::hier::Variable< NDIM > > d_V_var
 
int d_V_scratch_idx = IBTK::invalid_index
 
int d_V_old_idx = IBTK::invalid_index
 
int d_V_current_idx = IBTK::invalid_index
 
int d_V_new_idx = IBTK::invalid_index
 
int d_V_composite_idx = IBTK::invalid_index
 
SAMRAI::tbox::Pointer< SAMRAI::hier::Variable< NDIM > > d_rho_var
 
int d_rho_current_idx = IBTK::invalid_index
 
int d_rho_scratch_idx = IBTK::invalid_index
 
int d_rho_new_idx = IBTK::invalid_index
 
int d_rho_composite_idx = IBTK::invalid_index
 
int d_N_idx = IBTK::invalid_index
 
SAMRAI::tbox::Pointer< SAMRAI::hier::Variable< NDIM > > d_S_var
 
int d_S_scratch_idx = IBTK::invalid_index
 
SAMRAI::tbox::Pointer< IBTK::CartGridFunctiond_S_fcn
 
SAMRAI::tbox::Pointer< SAMRAI::hier::Variable< NDIM > > d_E_var
 
int d_E_scratch_idx = IBTK::invalid_index
 
SAMRAI::tbox::Pointer< IBTK::HierarchyMathOpsd_hier_math_ops
 
bool d_hier_math_ops_external = false
 
bool d_is_initialized = false
 
bool d_enable_logging = false
 
LimiterType d_density_convective_limiter = CUI
 
int d_density_limiter_gcw = 1
 
TimeSteppingType d_density_time_stepping_type = FORWARD_EULER
 
int d_cycle_num = -1
 
double d_current_time = std::numeric_limits<double>::quiet_NaN()
 
double d_new_time = std::numeric_limits<double>::quiet_NaN()
 
double d_solution_time = std::numeric_limits<double>::quiet_NaN()
 
double d_dt = std::numeric_limits<double>::quiet_NaN()
 
double d_dt_prev = -1.0
 
std::vector< SAMRAI::hier::CoarseFineBoundary< NDIM > > d_cf_boundary
 
virtual void initializeSTSIntegrator (SAMRAI::tbox::Pointer< SAMRAI::hier::BasePatchHierarchy< NDIM > > base_hierarchy)=0
 Compute hierarchy dependent data required for time integrating variables.
 
virtual void deallocateSTSIntegrator ()=0
 Remove all hierarchy dependent data allocated by initializeSTSIntegrator(). More...
 
void setDensityPatchDataIndex (int rho_idx)
 Set the current cell-centered density patch data index.
 
void setConvectiveDerivativePatchDataIndex (int N_idx)
 Set the new convective derivative patch data index.
 
void setDensityBoundaryConditions (const std::vector< SAMRAI::solv::RobinBcCoefStrategy< NDIM > * > &rho_sc_bc_coefs)
 Set the boundary condition object for the density.
 
int getUpdatedDensityPatchDataIndex ()
 Get the newly constructed density patch data index.
 
void setFluidVelocityPatchDataIndices (int V_old_idx, int V_current_idx, int V_new_idx)
 Set the patch data indices corresponding to the velocity at the previous time step to be used when computing the density update. More...
 
void setCycleNumber (int cycle_num)
 Set the cycle number currently being executed by the INS integrator. This will determine the rho advection velocity.
 
void setSolutionTime (double solution_time)
 Set solution time.
 
void setTimeInterval (double current_time, double new_time)
 Set the current time interval.
 
std::pair< double, double > getTimeInterval () const
 Get the current time interval.
 
double getTimeStepSize () const
 Get the current time step size.
 
void setPreviousTimeStepSize (double dt_prev)
 Set the previous time step value between times n - 1 (old) and n (current). This is used during velocity extrapolation.
 
void setHierarchyMathOps (SAMRAI::tbox::Pointer< IBTK::HierarchyMathOps > hier_math_ops)
 Set the HierarchyMathOps object used by the operator.
 
SAMRAI::tbox::Pointer< IBTK::HierarchyMathOpsgetHierarchyMathOps () const
 Get the HierarchyMathOps object used by the operator.
 

Detailed Description

Class STSMassFluxIntegrator is an abstract class which integrates the density field.

$ \frac{\partial \rho}{\partial t} + \nabla \cdot (\rho \mathbf{u}) = S(x,t) $

and computes the conservative form of the convective operator $ \nabla \cdot (\rho \mathbf{u} \otimes \mathbf{u})$ for the momentum and $ \nabla \cdot (\rho \mathbf{u} Q)$ for the energy equation where $ Q = C_\textrm{p} T$ or $ Q = h$ based on the form of the energy equation.

Note
STSMassFluxIntegrator is an intermediate or a lightweight integrator that is used within one or a single time step (STS) to get a consistent mass flux $ m_\rho = \rho \mathbf{u} $ for advecting either momentum $ \mathbf{u} $ through $ \nabla \cdot (\rho \mathbf{u} \otimes \mathbf{u}) = \nabla \cdot (m_\rho \otimes \mathbf{u} ) $ or a scalar $ Q $ through $ \nabla \cdot (\rho \mathbf{u} Q) = \nabla \cdot (m_\rho Q) $. It does not maintain any hierarchy data, child or parent integrator, as done in implementations of HierarchyIntegrator.

The core concept behind STSMassFluxIntegrator is to obtain a consistent mass flux $\mathbf{m_\rho} = \rho \mathbf{u}$ for stabilizing high density ratio flows. It also ensures a consistency condition that:

  1. When there are no viscous, pressure forces or any other body forces in the domain, the momentum equation becomes discretely equal to the mass equation.
  2. Under isothermal/isenthalpic conditions, with no additional heat source, the energy/enthalpy equation reverts to mass balance equation.

To achieve these conditions, the time integrator scheme of STSMassFluxIntegrator is tightly coupled to how INSVCStaggeredHierarchyIntegrator or PhaseChangeHierarchyIntegrator integrate their respective variables. Note that when flow is incompressible, one does not need to solve mass balance equation. Here, we are solving a redundant mass balance equation through STSMassFluxIntegrator class in order to achieve consistency and stability.

Reference Nangia et. al, A robust incompressible Navier-Stokes solver for high density ratio multiphase flows

Thirumalaisamy and Bhalla, A low Mach enthalpy method to model non-isothermal gas-liquid-solid flows with melting and solidification

Member Function Documentation

◆ deallocateSTSIntegrator()

virtual void IBAMR::STSMassFluxIntegrator::deallocateSTSIntegrator ( )
pure virtual

Remove all hierarchy dependent data allocated by initializeSTSIntegrator().

Note
It is safe to call deallocateSTSIntegrator() when the time integrator is already deallocated.
See also
initializeSTSIntegrator

Implemented in IBAMR::INSVCStaggeredConservativeMassMomentumRKIntegrator, and IBAMR::AdvDiffConservativeMassScalarTransportRKIntegrator.

◆ setFluidVelocityPatchDataIndices()

void IBAMR::STSMassFluxIntegrator::setFluidVelocityPatchDataIndices ( int  V_old_idx,
int  V_current_idx,
int  V_new_idx 
)

Set the patch data indices corresponding to the velocity at the previous time step to be used when computing the density update.

Note
This velocities will be used to compute an approximation to velocities required for time integrator. For example, SSPRK updates V_old_idx = n-1, V_current_idx = n, V_new_idx = n+1,k (after an INS cycle). If V_old_idx or V_new_idx are not set, then they will degenerate to V_current automatically, for the very first simulation time step and cases where an INS cycle has not been executed, respectively.

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