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:
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
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.Physical parameters struct containing viscosity coefficients (
eta_n, eta_s) and drag parameters (xi, nu_n, nu_s).Configuration methods
setCandDCoefficients
C = 1/dt, D_u = 0.5 for Crank–Nicolson).
Coefficient scaling the pressure gradient terms. Negative by convention for a saddle-point system.
setThnIdx
apply.
setPhysicalBcCoefs
nullptr, in which case homogeneous Dirichlet (velocities) or homogeneous Neumann (pressure) conditions are applied.
Robin BC coefficients for the network velocity, one entry per spatial dimension.
Robin BC coefficients for the solvent velocity, one entry per spatial dimension.
Robin BC coefficient for the pressure. Pass
nullptr for homogeneous Neumann conditions.Robin BC coefficient for the volume fraction. Pass
nullptr for linear extrapolation.setPhysicalBoundaryHelper
Boundary helper that handles staggered-grid velocity BC enforcement.
Operator application
apply
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.
Input vector
[u_n, u_s, p]^T. Must have ghost cells filled.Output vector. Receives the result
A*x on return.initializeOperatorState
apply. Safe to call when state is already initialised; the existing state is deallocated and reinitialised. Call deallocateOperatorState to free the allocated data.
Representative input vector defining the hierarchy and variable structure.
Representative output vector. Must match
in in hierarchy and structure.deallocateOperatorState
initializeOperatorState. Safe to call when already deallocated. Call this before destroying the operator or after the hierarchy changes.
modifyRhsForBcs
Right-hand-side vector to be modified in place.