Skip to main content

Overview

MultiphaseStaggeredStokesOperator is a concrete IBTK::LinearOperator implementing a staggered-grid (MAC) discretisation of the two-fluid incompressible Stokes operator. It is designed for use inside an iterative Krylov or Newton–Krylov solver. Namespace: multiphase Header: multiphase/MultiphaseStaggeredStokesOperator.h

Operator matrix

The operator applies the following block system to the vector [u_n, u_s, p]^T:
where the viscous stress blocks are:
The scalars C, D_u, D_p, and D_div are set by the time-stepping scheme via setCandDCoefficients. Default values of D_p = -1.0 and D_div = 1.0 are appropriate for a standard linear system solve. The variable drag coefficient case is also handled by this class.

Constructor

string
required
Unique name for this operator, used in logging.
bool
required
When true, homogeneous (zero) boundary conditions are enforced. Typically true when the operator is used as a preconditioner component, false for the full system solve.
const MultiphaseParameters&
required
Physical parameters struct containing viscosity coefficients (eta_n, eta_s) and drag parameters (xi, nu_n, nu_s).

Configuration methods

setCandDCoefficients

Sets the scaling coefficients for the operator blocks. These are typically determined by the time-stepping scheme (e.g., C = 1/dt, D_u = 0.5 for Crank–Nicolson).
double
required
Coefficient multiplying the mass-like diagonal block.
double
required
Coefficient scaling the viscous and drag terms in the momentum equations.
double
default:"-1.0"
Coefficient scaling the pressure gradient terms. Negative by convention for a saddle-point system.
double
default:"1.0"
Coefficient scaling the divergence constraint row.

setThnIdx

Provides the cell-centred patch data index for the network volume fraction θ_n. This must be set before calling apply.
int
required
SAMRAI variable–context index for the cell-centred volume fraction field.

setPhysicalBcCoefs

Registers the physical boundary condition objects for all solution components. Any pointer may be nullptr, in which case homogeneous Dirichlet (velocities) or homogeneous Neumann (pressure) conditions are applied.
std::vector<SAMRAI::solv::RobinBcCoefStrategy<NDIM>*>
required
Robin BC coefficients for the network velocity, one entry per spatial dimension.
std::vector<SAMRAI::solv::RobinBcCoefStrategy<NDIM>*>
required
Robin BC coefficients for the solvent velocity, one entry per spatial dimension.
SAMRAI::solv::RobinBcCoefStrategy<NDIM>*
required
Robin BC coefficient for the pressure. Pass nullptr for homogeneous Neumann conditions.
SAMRAI::solv::RobinBcCoefStrategy<NDIM>*
required
Robin BC coefficient for the volume fraction. Pass nullptr for linear extrapolation.

setPhysicalBoundaryHelper

Sets the physical boundary condition helper object used during the operator application to enforce velocity boundary values on the staggered grid.
SAMRAI::tbox::Pointer<IBAMR::StaggeredStokesPhysicalBoundaryHelper>
required
Boundary helper that handles staggered-grid velocity BC enforcement.

Operator application

apply

Computes y = A*x. Both vectors must have the same hierarchy and compatible variable structure. The input vector x must have sufficient ghost cells for the stencil computation. You must call initializeOperatorState before calling apply.
SAMRAI::solv::SAMRAIVectorReal<NDIM, double>&
required
Input vector [u_n, u_s, p]^T. Must have ghost cells filled.
SAMRAI::solv::SAMRAIVectorReal<NDIM, double>&
required
Output vector. Receives the result A*x on return.

initializeOperatorState

Computes and caches all hierarchy-dependent data (communication schedules, scratch allocations) needed for apply. Safe to call when state is already initialised; the existing state is deallocated and reinitialised. Call deallocateOperatorState to free the allocated data.
const SAMRAI::solv::SAMRAIVectorReal<NDIM, double>&
required
Representative input vector defining the hierarchy and variable structure.
const SAMRAI::solv::SAMRAIVectorReal<NDIM, double>&
required
Representative output vector. Must match in in hierarchy and structure.

deallocateOperatorState

Releases all hierarchy-dependent data allocated by initializeOperatorState. Safe to call when already deallocated. Call this before destroying the operator or after the hierarchy changes.

modifyRhsForBcs

Modifies the right-hand-side vector to incorporate non-homogeneous physical boundary conditions, moving the BC contribution from the solution side to the RHS.
SAMRAI::solv::SAMRAIVectorReal<NDIM, double>&
required
Right-hand-side vector to be modified in place.

imposeSolBcs

Directly enforces physical boundary conditions on the solution vector.
SAMRAI::solv::SAMRAIVectorReal<NDIM, double>&
required
Solution vector on which boundary conditions are imposed in place.