Skip to main content

Overview

MultiphaseStaggeredHierarchyIntegrator is the top-level time integrator for the two-fluid (network + solvent) Stokes system. It extends IBAMR::INSHierarchyIntegrator and manages the full AMR hierarchy lifecycle: variable registration, solver setup, time advancement, regridding, and visualization output. Namespace: multiphase Header: multiphase/MultiphaseStaggeredHierarchyIntegrator.h The integrator drives a staggered MAC (marker-and-cell) discretisation. It owns a MultiphaseStaggeredStokesOperator applied inside a PETSc Krylov solver, optionally preconditioned by a FullFACPreconditioner.

Constructor

string
required
Unique name for this integrator object, used in logging and restart files.
SAMRAI::tbox::Pointer<SAMRAI::tbox::Database>
required
Input database containing solver configuration (e.g. time stepping type, preconditioner settings, convective limiter).
SAMRAI::tbox::Pointer<SAMRAI::geom::CartesianGridGeometry<NDIM>>
required
Cartesian grid geometry describing the physical domain.
bool
default:"true"
Whether to register this object with the SAMRAI restart manager. Set to false when restarts are not needed.

Variable accessors

getSolventVariable

Returns the side-centered variable representing the solvent (fluid) velocity u_s.

getNetworkVariable

Returns the side-centered variable representing the network velocity u_n.

getPressureVariable

Returns the cell-centered pressure variable p.

getNetworkVolumeFractionVariable

Returns the cell-centered variable for the network volume fraction θ_n.

Boundary conditions

registerPhysicalBoundaryConditions

Registers physical boundary condition objects for both velocity fields. Only periodic and Dirichlet conditions are currently supported.
This class does not take ownership of the boundary condition objects. You must manage their lifetime and delete them when finished.
std::vector<SAMRAI::solv::RobinBcCoefStrategy<NDIM>*>
required
Robin BC coefficients for the network velocity, one per spatial dimension.
std::vector<SAMRAI::solv::RobinBcCoefStrategy<NDIM>*>
required
Robin BC coefficients for the solvent velocity, one per spatial dimension.

registerVolumeFractionBoundaryConditions

Optionally registers boundary conditions for the network volume fraction. Only used when the volume fraction is not an advected quantity. These conditions are ignored at periodic boundaries. If not set, linear extrapolation is used at physical boundaries.
SAMRAI::solv::RobinBcCoefStrategy<NDIM>*
required
Robin BC coefficient object for the volume fraction.

Physical parameters

setViscosityCoefficient

Sets the viscosity coefficients appearing in the viscous stress terms for both phases.
double
required
Dynamic viscosity of the network phase.
double
required
Dynamic viscosity of the solvent phase.

setDragCoefficient

Sets constant drag coupling coefficients between the two phases.
double
required
Drag coefficient controlling interphase momentum exchange.
double
required
Normalisation factor for the network phase drag term.
double
required
Normalisation factor for the solvent phase drag term.

setDragCoefficientFunction

Sets a spatially variable drag coefficient function. Must be called before initializeHierarchyIntegrator.
SAMRAI::tbox::Pointer<IBTK::CartGridFunction>
required
Grid function that evaluates the drag coefficient at each grid point.

Initial conditions

setInitialData

Sets initial conditions for the network velocity, solvent velocity, and pressure. Each pointer is set to nullptr after it is consumed.
SAMRAI::tbox::Pointer<IBTK::CartGridFunction>
required
Initial condition function for the network velocity u_n.
SAMRAI::tbox::Pointer<IBTK::CartGridFunction>
required
Initial condition function for the solvent velocity u_s.
SAMRAI::tbox::Pointer<IBTK::CartGridFunction>
required
Initial condition function for the pressure p.

setInitialNetworkVolumeFraction

Sets the initial condition for the network volume fraction θ_n.
SAMRAI::tbox::Pointer<IBTK::CartGridFunction>
required
Grid function providing the initial volume fraction field.

Forcing functions

setForcingFunctions

Registers body force functions for both phases and optionally a pressure forcing term. These functions are not scaled by the volume fraction. Any argument may be nullptr.
SAMRAI::tbox::Pointer<IBTK::CartGridFunction>
required
Body force function for the network phase.
SAMRAI::tbox::Pointer<IBTK::CartGridFunction>
required
Body force function for the solvent phase.
SAMRAI::tbox::Pointer<IBTK::CartGridFunction>
default:"nullptr"
Forcing term added to the pressure (divergence) equation.

setForcingFunctionsScaled

Registers body force functions that are scaled by the volume fraction before being applied. Use this when the supplied forcing already represents a per-phase quantity that must be weighted by θ_n or θ_s = 1 - θ_n.
SAMRAI::tbox::Pointer<IBTK::CartGridFunction>
required
Volume-fraction-scaled body force for the network phase.
SAMRAI::tbox::Pointer<IBTK::CartGridFunction>
required
Volume-fraction-scaled body force for the solvent phase.

Volume fraction

setNetworkVolumeFractionFunction

Registers a prescribed (non-advected) function for the network volume fraction. If a function is not registered, the volume fraction is advected with the fluid.
SAMRAI::tbox::Pointer<IBTK::CartGridFunction>
required
Analytic function defining θ_n at any point in space and time.
bool
default:"true"
When true, this function also provides the initial condition for θ_n. Set to false and call setInitialNetworkVolumeFraction separately if a different initial field is required.

advectNetworkVolumeFraction

Configures the integrator to transport θ_n with the specified advection–diffusion integrator. Also registers that integrator with the hierarchy.
SAMRAI::tbox::Pointer<IBAMR::AdvDiffHierarchyIntegrator>
required
Advection–diffusion integrator responsible for evolving the volume fraction.
bool
default:"true"
Set to false when the transport scheme (e.g. semi-Lagrangian) does not produce a meaningful intermediate-time value after one evolution step. This affects how the midpoint volume fraction is evaluated during time stepping.

Initialization

initializeHierarchyIntegrator

Initialises variables, communication algorithms, solvers, and all other hierarchy-dependent data structures. This method is called automatically by initializePatchHierarchy but may also be invoked explicitly before hierarchy construction.
SAMRAI::tbox::Pointer<SAMRAI::hier::PatchHierarchy<NDIM>>
required
The AMR patch hierarchy on which the integrator will operate.
SAMRAI::tbox::Pointer<SAMRAI::mesh::GriddingAlgorithm<NDIM>>
required
Gridding algorithm used for AMR refinement and coarsening.

Usage example

The following is taken from frm/four_roll_mill.cpp and shows a complete setup sequence.