Skip to main content
The four-roll-mill (frm) example is the primary validation case for AMR Multiphase. It simulates a two-phase Newtonian fluid driven by a body force that produces four counter-rotating vortices on the periodic domain [−0.5,0.5]2[-0.5, 0.5]^2. The network-phase volume fraction is initialized as a smooth radial blob at the center of the domain.
Complete the build and install steps before continuing. You need a compiled frm executable in your build/frm/ directory.

Running the four-roll-mill simulation

1

Navigate to the frm directory

The input file and executable are both located in the frm/ subdirectory of your build tree.
2

Run the executable

Launch frm with input2d as the input file and pass solver options on the command line:
These flags configure the PETSc Krylov solver used for the coupled saddle-point system at each time step:
3

Monitor progress via log files

While the simulation runs, progress is written to the log file named output in the working directory. You can tail it in a separate terminal:
Each time step prints the current simulation time, time step size, and linear solver convergence information. Logging is controlled by ENABLE_LOGGING = TRUE in input2d.
4

Visualize results with VisIt

Visualization dumps are written to the viz2d_four_roll_mill/ directory at the interval set by VIZ_DUMP_TIME_INTERVAL. Open VisIt and load the dumps.visit file from that directory:
  1. Launch VisIt.
  2. Select File → Open and navigate to build/frm/viz2d_four_roll_mill/dumps.visit.
  3. Add a Pseudocolor plot on the variable Thn_n to see the network-phase volume fraction.
  4. Use the time slider to step through the simulation.
Hierarchy data for restart and post-processing is written to hier_data_four_roll_mill/.

Key input file parameters

The simulation is fully controlled by frm/input2d. The parameters below are the most important ones to understand and tune.

Grid and time stepping

Fluid parameters

Initial condition for the volume fraction

DELTA = 0.175 sets the radius of the initial volume-fraction blob. The function evaluates to a smooth radially symmetric bump of amplitude 0.25 centered at the origin, on top of a background value of 0.25.

Convective discretization

Viscoelastic model

The USE_CF flag enables the Oldroyd-B conformation tensor model for viscoelastic simulations. It is disabled in the default four-roll-mill configuration, which uses a purely Newtonian model. Set USE_CF = TRUE to activate it and configure the CFMultiphaseOldroydB parameters.

Visualization and output

Next steps

Convergence testing

Run frm_convergence to verify second-order accuracy across grid refinements

Physical boundary conditions

Explore the channel flow example with non-periodic boundary conditions

Input parameters reference

Full reference for every parameter in the input file

Multiphase model

Understand the two-fluid mixture equations and physical parameters