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
- Newtonian (default)
- Viscoelastic (Oldroyd-B)
Run from the Visualization output is written to
frm/ source directory, passing input2d and PETSc solver flags:viz2d_four_roll_mill/. Open this directory in VisIt to inspect the results.Key input parameters
The following parameters are set ininput2d and control the physical setup and time integration.
Fluid properties
Grid and time stepping
Network volume fraction initial condition
The network blobthn is initialized with a smooth, compactly supported bump function centered at the origin:
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: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 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
WhenUSE_CF = TRUE (enabled in input2d.cf.relax), the CFINSForcing block configures the Oldroyd-B conformation tensor evolution: