Skip to main content
The four roll mill example drives two-phase flow with an imposed body force that generates four counter-rotating vortices. A compact blob of network fluid (tracked by the volume fraction thn) is initialized at the center and advected by the resulting velocity field. This example demonstrates AMR grid refinement driven by gradient detection, and optionally adds a viscoelastic (Oldroyd-B) stress model via the conformation tensor forcing.

CMake targets

Build

From your build directory (see Building):

Run

Run from the frm/ source directory, passing input2d and PETSc solver flags:
Visualization output is written to viz2d_four_roll_mill/. Open this directory in VisIt to inspect the results.

Key input parameters

The following parameters are set in input2d and control the physical setup and time integration.

Fluid properties

Grid and time stepping

Network volume fraction initial condition

The network blob thn is initialized with a smooth, compactly supported bump function centered at the origin:
This produces a background volume fraction of 0.25 everywhere, with a smooth bump that raises thn to 0.50 at the center. The support radius is DELTA = 0.175.

Forcing functions

The four-roll mill body force applied to both phases:
The same expression is applied to FS_FCN (the solvent phase). In the viscoelastic variant (input2d.cf.relax) the forcing is active only for t < 0.34, then switched off to let the conformation tensor relax.

AMR settings

The hierarchy uses up to 3 levels with a refinement ratio of 2 in each direction. Cells are tagged for refinement based on the gradient of the solution variables:
The gradient threshold and regridding interval are controlled in the integrator block:
The viscoelastic variant (input2d.cf.relax) uses 4 AMR levels with per-level thresholds grad_abs_thresh = 1.0, 4.0, 6.0 and a larger base refinement ratio of 4.

Visualization output

The simulation writes a new visualization frame every VIZ_DUMP_TIME_INTERVAL = 0.005 time units. In addition to the standard velocity, pressure, and thn fields, the strain rate tensor EE is computed and written at each visualization step.

Viscoelastic variant parameters

When USE_CF = TRUE (enabled in input2d.cf.relax), the CFINSForcing block configures the Oldroyd-B conformation tensor evolution:
Set LOG_DETERMINANT = TRUE to monitor the determinant of the conformation tensor during the run. A determinant that drifts far from 1 may indicate numerical issues with the conformation tensor evolution.