Skip to main content
The solver reads configuration from a plain-text input file passed as the first command-line argument. The format uses a key-value syntax with support for arithmetic expressions and named sub-blocks. Values defined earlier in the file can be referenced by name in later expressions.

Complete annotated example

The following snippet covers a typical 2D periodic simulation. See the sub-sections below for a full description of each parameter.
input2d

Simulation parameters

Top-level scalars that control the overall simulation run.
number
required
Fluid density shared by both phases. Used directly by INSVCTwoFluidStaggeredHierarchyIntegrator.
integer
required
Number of grid cells along each axis on the coarsest level. The actual mesh spacing is DX = L / N where L is the domain side length.
integer
default:"6"
Maximum number of multigrid levels used by the FAC preconditioner. Referenced inside precond_db. Values of 5–7 are typical; larger values reduce cost on fine grids but require more setup.
number
default:"0.0"
Simulation start time passed to the integrator and advection–diffusion solver.
number
required
Simulation end time. The main loop advances until loop_time reaches this value.
integer
default:"1"
Number of predictor–corrector cycles per time step. Increasing this improves temporal accuracy at extra cost per step.
number
default:"0.1"
Maximum CFL number. Used together with U_MAX and DX to derive DT_MAX = CFL_MAX * DX / U_MAX.
number
required
Maximum allowed time step size. Can be set directly or derived from CFL_MAX, DX, and U_MAX. The integrator may take smaller steps to satisfy stability constraints.
number
Expected maximum velocity magnitude. Used only for computing DT_MAX via the CFL condition. Set conservatively to avoid excessively large time steps.
boolean
default:"TRUE"
Enable solver logging output. Passed to both the fluid integrator and the advection–diffusion integrator.
number
default:"0.75"
Relaxation weight for the box-relaxation smoother inside the FAC preconditioner. Values between 0.5 and 1.0 are typical. Tune this together with num_pre_sweeps and num_post_sweeps if convergence is slow.
boolean
default:"TRUE"
Enable the FAC multigrid preconditioner. Disabling this falls back to an unpreconditioned Krylov solve, which is significantly slower for large problems.
number
Physical time interval between visualization output files. VisIt dump files are written whenever loop_time reaches the next multiple of this interval.
integer
default:"1"
Number of buffer cells added around tagged regions when generating refined patches. Increasing this produces larger refined patches and reduces regridding frequency.
integer
default:"10"
Number of time steps between regridding operations. Lower values track moving interfaces more closely; higher values reduce overhead.

Fluid parameters

Physical coefficients for the network (n) and solvent (s) phases.
number
required
Dynamic viscosity of the solvent phase. Appears in the viscous stress term for the solvent momentum equation.
number
required
Dynamic viscosity of the network phase. Appears in the viscous stress term for the network momentum equation.
number
default:"1.0"
Drag scaling factor for the network phase. Scales the drag force on the network: f_drag = xi * nu_n * (us - un).
number
default:"1.0"
Drag scaling factor for the solvent phase. Scales the drag force on the solvent: f_drag = xi * nu_s * (un - us).
number
required
Drag coefficient controlling momentum exchange between the two phases. Larger values enforce tighter velocity coupling. A common choice is 250.0 * ETA_S.
boolean
default:"FALSE"
Enable the viscoelastic (complex fluid) Oldroyd-B model. When TRUE, a CFINSForcing block must also be present to configure the conformation tensor evolution. See the input2d.cf.relax example for a complete viscoelastic setup.
XI can also be provided as a spatially varying field by calling setDragCoefficientFunction in C++ code rather than setting the scalar in the input file.

Initial condition functions

The blocks un, us, p, and thn specify initial data using muParser expression strings. Variables X_0 and X_1 represent the spatial coordinates; t represents the current simulation time.
object
required
Initial network-phase velocity. Each component is a separate key:
  • function_0 — x-component
  • function_1 — y-component (2D) or y-component (3D)
  • function_2 — z-component (3D only)
object
required
Initial solvent-phase velocity. Same structure as un.
object
required
Initial pressure field. Uses a single function key.
object
required
Initial network volume fraction field. Uses a single function key. The value must remain in [0, 1].An optional delta sub-key can be referenced inside the expression string and is set as a local variable before parsing:
muParser supports standard math functions (sin, cos, sqrt, exp, log), the constant PI, arithmetic operators, and the ternary operator (condition ? a : b). Use ^ for exponentiation. Spatial coordinates are accessed as X_0, X_1, and (in 3D) X_2.
The forcing function blocks FN_FCN and FS_FCN follow the same component-based syntax and are optionally time-dependent:

INSVCTwoFluidStaggeredHierarchyIntegrator block

This sub-block configures the main fluid integrator. The block name must be INSVCTwoFluidStaggeredHierarchyIntegrator and is passed verbatim to MultiphaseStaggeredHierarchyIntegrator during construction.
number
required
Fluid density. Should match the top-level RHO scalar.
string
default:"TRAPEZOIDAL_RULE"
Time-stepping scheme for the viscous terms. TRAPEZOIDAL_RULE (Crank–Nicolson) is required for second-order accuracy.
boolean
default:"TRUE"
Enable gradient-based cell tagging for AMR refinement. When TRUE, cells where the volume-fraction gradient exceeds grad_abs_thresh are tagged for refinement.
number
Absolute gradient threshold for tagging cells. Can be a single scalar or a comma-separated list of per-level thresholds, e.g. 1.0, 4.0, 6.0.
string
Convective limiter for the momentum equations. Supported values: UPWIND, CUI, FBICS, MGAMMA. Defaults to the scheme configured in AdvDiffIntegrator if not set here.

CartesianGeometry block

Defines the computational domain on a uniform Cartesian background mesh.
string
required
Index space extents of the coarsest-level domain, e.g. [(0,0), (N-1, N-1)] for a 2D N×N grid.
number[]
required
Lower corner of the physical domain in each coordinate direction, e.g. -0.5, -0.5.
number[]
required
Upper corner of the physical domain in each coordinate direction, e.g. 0.5, 0.5.
integer[]
required
Periodicity flag for each spatial dimension. Use 1 for periodic and 0 for non-periodic. Example: periodic_dimension = 1, 1 makes the domain doubly periodic.
When non-periodic boundaries are used (periodic_dimension = 0, 0), you must register muParserRobinBcCoefs objects via registerPhysicalBoundaryConditions. See Boundary conditions for details.

GriddingAlgorithm block

Controls the AMR patch hierarchy structure.
integer
required
Total number of levels in the hierarchy, including the coarsest level. Level 0 is the coarsest; level max_levels - 1 is the finest.
object
required
Refinement ratio from each level to the level below it. Each entry is named level_N and takes a comma-separated pair, e.g. level_1 = 2, 2 for 2× refinement in both directions.
number
default:"0.70"
Minimum fraction of tagged cells that must fall inside a newly created patch. Lower values allow looser patches that cover more untagged cells.
number
default:"0.85"
Controls patch merging: if the total volume of smaller boxes is less than this fraction of the merged box volume, the boxes are combined.
object
Maximum patch dimensions at each level, e.g. level_0 = 512, 512. Finer levels inherit the level-0 value unless overridden.
object
Minimum patch dimensions at each level, e.g. level_0 = 4, 4. Patches smaller than this are prevented from being created.