The Case Input File (<case>.inp) and points.dat

A Rocflu case is described by <case>.inp (this page), <case>.bc (Boundary Conditions), the grid (<case>.hyb.asc) and, with particles, points.dat. Before a run, ./rocflu.sh validate checks the input file, the .bc file and points.dat; ./rocflu.sh run does this first and stops before building anything if it finds a problem.

The template used by the regression tests, tests/templates/rectshktb.inp, is a complete, working example.

How Rocflu Reads the File

# PICL
USED             1 ! comment
QSFORCE          3
#

The validator reports all of these (with the line number), so they need not be remembered.

Gas-Side Sections

Only the keys in the test template are listed; the readers (libfloflu/Read*Section.F90) accept more.

Section Key Values Meaning
# FORMATS GRID, SOLUTION 0 ASCII, 1 binary, 2 HDF Rocflu's own grid files; SOLUTION: the old-style solution files (OLD_OUTPUT_WRT 1 only)
GRIDSRC 0 CENTAUR ASCII, 1 VGRIDNS, 2 MESH3D grid read by the pre-processing (<case>.hyb.asc for 0)
# FLOWMODEL MODEL 0 Euler, 1 Navier-Stokes
MOVEGRID 0 static, 1 moving
# NUMERICS CFL > 0 CFL number
DISCR 1 Roe, 3 HLLC, 4 AUSM+, 5 AUSM+up flux scheme; for very strong shocks see Strong-Shock Numerics
ORDER 1, 2 order of accuracy in space
ENTROPY entropy correction (Roe)
DIMENS 1, 2, 3 dimension of the computation; particles need 2 or 3. DIMENS 2: see Running in 2D
AXIFLAG 0, 1 axisymmetric; not available with particles
SIGMA, KP, KU, MINF AUSM+up parameters (defaults 1.0, 0.25, 0.75, 0.1)
RECONST 0 none, 1 WENO simple, 2 WENO XYZ, 10 Barth-Jespersen, 11 Venkatakrishnan gradient reconstruction (limiter)
CRECONSTC 0 (default), 1 wall constraints on fluid cell gradients. In cells with a wall-type boundary face in their stencil (BC_SLIPW, BC_NOSLIP_HFLUX, BC_NOSLIP_TEMP, BC_INJECT; about three cell layers at each wall), known wall values are added to the least-squares fit: normal velocity at axis-aligned slip walls and injection faces; all velocity components at no-slip walls; temperature at BC_NOSLIP_TEMP; temperature and density at inflowing injection. Other variables keep the plain least-squares gradient. Particles feel this through the fluid gradients they read (e.g. ∇p); ∇ρ_g and ∇F are never constrained. No effect without wall-type patches
CRECONSTF 0 (default), 1 the same for interior-face gradients of velocity and temperature near walls. Used only by the viscous fluxes, so no effect with MODEL 0. With MODEL 1, gradients of variables with no known wall value are currently set to zero on these faces
CRECONSTCW, CRECONSTFW ≥ 0 (default 1) weight of the wall values in the cell / face fit (the sign is ignored). A weight, not a switch: to turn the constraint off, set CRECONSTC / CRECONSTF to 0
# TIMESTEP FLOWTYPE 0 steady, 1 unsteady
SOLVERTYPE 1 dissipative, 3 non-dissipative
MAXTIME, RUNTIME s end time; run time of this job
WRITIME, PRNTIME, FOMWRITIME s intervals for solution files, printing, FOM files
TIMESTEP s largest time step
DTMINLIMIT s smallest time step, overrides the CFL limit
STARTTIME s
WALLTIME, SAFEWRTIME s wall time; write a restart this long before it
RKSCHEME 1 RK4 (default), 2 RK3 must be 2 with particles
START_STEP 0 (default), -1, N 0: a new run from rfluinit's step 0, replacing the results of an earlier run in the directory; -1: restart from the latest dump in restart_data/; N: restart from the dump of step N. Dumps newer than the start step are removed. A restart needs the same number of ranks (regions) and the same particle physics as the run that wrote the dump, and continues it exactly: it gives the same results, to the last bit, as a run that never stopped
# INITFLOW FLAG 1 from scratch, 2 from file, 3 hard-coded, 4-6 combinations initial gas state
RVAL1…, IVAL1… parameters of the initial state; with FLAG 3 their meaning depends on the case name (utilities/init/RFLU_InitFlowHardCode.F90; for rectshktb: shock position, post- and pre-shock state)
# REFERENCE GAMMA, CP ratio of specific heats; specific heat at constant pressure [J/(kg K)]
# MIXTURE GASMODEL 1 calorically perfect gas; 3-7 mixtures (7 JWL) 3-7 need species transport, disabled for now (rejected)
# SPECIES USED 0 species transport, disabled for now: USED 1 is rejected, and so are # MATERIAL sections, which only species use
# VISCMODEL MODEL 0 Sutherland, 1 fixed
VISCOSITY Pa s reference viscosity; required with particles
REFTEMP, SUTHCOEF K Sutherland's law
# POST DENSITY_WRT, VELOCITY_WRT, PRESSURE_WRT, PHI_WRT 0, 1 (default 1) fluid fields the post program writes: gas density, velocity, pressure, particle volume fraction (with particles)
TEMPERATURE_WRT, SOUNDSPEED_WRT, ENERGY_WRT, GRADRHO_WRT, PT_WRT 0, 1 (default 0) also temperature, speed of sound, total energy per mass, gas-density gradient, pseudo-turbulence fields DivPhiRsg and FCell (with PSEUDOTURB)
OLD_OUTPUT_WRT 0 (default), 1 also the old-style output (SOL_*, PARAVIEW_*, par*.vtu, bin*.vtu, patch coefficients); needed with MOVEGRID 1 or SOLVERTYPE 3, which write into SOL_*
other keys settings of the old-style ParaView output, as in the template
# MISC miscellaneous settings, as in the template

# PICL: The Particles

Defaults are those of libflu/RFLU_InitGlobal.F90. A key that belongs to a model that is off (e.g. KSP without collisions) is not read and may stay in the file with any value.

Key Values Default Meaning
USED 0, 1 0 particles on; needs a build with ppiclF (not --no-picl)
VELOCITYMODEL 0, 1 1 1: particles move under the forces. 0: they keep their position, velocity, temperature and spin; the forces are still computed, so with FEEDBACK 1 the gas still feels them (a fixed bed)
QSFORCE 0-3 0 quasi-steady drag: 0 none, 1 Gidaspow, 2 Parmar, 3 Osnes
QSFLUCT 0-2 0 fluctuation of the quasi-steady force: 0 none, 1 Lattanzi, 2 Osnes
QSFLUCTFILT 0, 1 0 filter for the fluctuation: 0 box, 1 Gaussian (not validated, rejected)
QSFLUCTFILTADAPT 0, 1 0 adaptive filter width
AMFORCE 0-2 0 added mass: 0 none, 1 Parmar, 2 Briney (binary; not validated, rejected)
PGFORCE 0, 1 0 pressure-gradient (undisturbed-flow) force. This force and the added mass read gas gradients from their own least-squares fit, not the smoothed gradients of the flux reconstruction (Gradients for Particle Forces)
VISCOUSUNSTEADY 0-4 0 viscous-unsteady (history) force: 1 trapezoidal for uniform dt, 2 trapezoidal for variable dt, 3 modified trapezoidal, 4 Hinsberg
VUSTEPS ≥ 1 50 time steps of history kept for VISCOUSUNSTEADY
COLLISIONS 0-4 0 1 normal contact force; 2 + tangential force and collision torque (particles spin); 3 + rolling torque and hydrodynamic torques; 4 + Saffman and Magnus lift
KSP > 0 (none) collisions: a contact lasts KSP time steps (sets the spring stiffness); needed with COLLISIONS ≥ 1
EREST 0 < e ≤ 1 (none) collisions: coefficient of restitution; needed with COLLISIONS ≥ 1
HEATTRANSFER 0-5 0 quasi-steady heat transfer (Nusselt number): 1 Stokes, 2 Ranz-Marshall, 3 Gunn, 4 Fox, 5 Sun
DU HEATTRANSFER 0, 1 0 diffusive-unsteady heat transfer (computed with the viscous-unsteady history)
FEEDBACK 0, 1 0 two-way coupling: the particles' forces and heat act on the gas
PSEUDOTURB 0, 1 0 pseudo-turbulence model: Reynolds stress, kinetic energy and heat flux the particles induce in the gas
TEMP > 0 0 initial temperature of every particle [K]; required
DENSITY > 0 0 density of every particle [kg/m³]; required
SPECIFICHEAT > 0 0 specific heat of every particle [J/(kg K)]; required
NEIGHBORWIDTH ≥ 0 0 neighbour search distance; the code uses max(4 × largest diameter, NEIGHBORWIDTH)
PERIODICX, PERIODICY, PERIODICZ 0, 1 0 particles periodic in x, y, z; should match the periodic patches of the fluid in <case>.bc (not checked yet)
SUBBIN 0, 1 0 neighbour-search method: 0 Zwick, 1 Avery sub-bins
PARTICLE_WRT 0, 1 0 particle files also hold temperature, spin, density, volume
GAS_WRT 0, 1 0 … and the gas density, velocity, sound speed and temperature at each particle
GRADGAS_WRT 0, 1 0 … and the gas gradients at each particle
MODEL_WRT 0, 1 0 … and the states and diagnostics of the models that are on

The filter width of the particle projection is not an input: it is twice the largest cell length around the particles. ./rocflu.sh run builds only the particle data the models that are on need (libpicl/user_files/ppiclf_slots.txt, see Getting Started).

Models That Need Other Models

With USED 1, these combinations are rejected:

Setting Needs Why
QSFLUCT ≥ 1 QSFORCE ≥ 1 the fluctuation is added to the quasi-steady force
PSEUDOTURB 1 QSFORCE ≥ 1 the model uses the drag
PSEUDOTURB 1 QSFLUCT 2
PSEUDOTURB 1 HEATTRANSFER ≥ 1 for now: its heat flux divides by the Nusselt number. To be lifted when the pseudo-turbulence model gets its own switch for the heat flux
DU HEATTRANSFER 1 VISCOUSUNSTEADY ≥ 1 they share the history
COLLISIONS ≥ 1 VELOCITYMODEL 1 particles that keep their position cannot collide
AMFORCE 2 not validated yet
QSFLUCTFILT 1 QSFLUCT ≥ 1 not validated yet

Other sections, with USED 1: RKSCHEME 2 in # TIMESTEP, VISCOSITY in # VISCMODEL, no AXIFLAG 1 in # NUMERICS.

points.dat: The Particles' Initial State

points.dat (this name, in the case directory) lists the particles:

! optional comment lines, at the top only
3
1.0e-3  2.0e-3  3.0e-3    0.0  0.0  0.0    1.0e-4
4.0e-3  5.0e-3  6.0e-3   10.0  0.0  0.0    1.0e-4
...

The first line after the comments is the number of particles; then one line per particle: position x y z [m], initial velocity vx vy vz [m/s] (0 0 0 for a particle at rest) and diameter dp [m], all seven on every line. Density, specific heat and initial temperature are the same for every particle (DENSITY, SPECIFICHEAT, TEMP in # PICL).

Older forms are no longer read: a material name in the first column (removed with # MATERIAL for particles), and x y z dp [u v w] (diameter before the velocity). The validator and rflump both stop on them.

Output and Restarts

rflump writes its results as raw dumps in restart_data/, at step 0 (the particles), every WRITIME and the end of the run:

Layouts: modflu/RFLU_ModRestartData.F90. A file is written as .tmp and renamed when it is complete. The same files are what a restart reads and what the post program converts (./rocflu.sh post, see Running a Simulation), so results can be looked at during a run or after it stopped.

Starting a run (START_STEP in # TIMESTEP): 0 (default) is a new run from rfluinit's step 0; it removes what an earlier run in the directory left (dumps after step 0, the old-style output). -1 restarts from the latest step with every dump, N from step N; dumps after the start step are removed. A restart needs the same number of ranks and the same particle physics as the run that wrote the dump, and continues it exactly: the results are the same, to the last bit, as a run that never stopped (checked by the suite's restart test).

The old-style output (SOL_*, PARAVIEW_*, par*.vtu, bin*.vtu, patch coefficients) is written only with OLD_OUTPUT_WRT 1 in # POST; the suite keeps it on in a few cases to check that it agrees with the dumps and the post program. Without particles its Velocity and Energy fields hold the momentum and the energy per volume; the post program writes velocity and energy per mass.

The Case Validator

./rocflu.sh validate /path/to/case/<case>.inp
python3 utilities/scripts/case_validator.py /path/to/case/<case>.inp      # the same

utilities/scripts/case_validator.py reads the input file the way Rocflu does and prints every problem at once, with the file and line, then exits with status 1 (0 when the case is fine). ./rocflu.sh run runs it before building, and the regression suite runs it on every case. It checks:

Without particles (USED 0 or no # PICL), only the keys of # PICL are checked.

The validator mirrors rocpicl/PICL_ReadPiclSection.F90 (keys and their order), libflu/RFLU_InitGlobal.F90 (defaults) and modflu/RFLU_ModReadBcInputFile.F90 (the .bc sections and keys): change it with them. Its tests need no cluster: python3 tests/test_case_validator.py.

Removed Keys

Key Instead
STATIONARY VELOCITYMODEL (STATIONARY 1 is VELOCITYMODEL 0)
FILTERWIDTH nothing: the filter width is set from the grid
REACTIVE nothing: the particle burn-rate model was removed
PICLDEBUG nothing
ANGULARPERIODIC, ANGLE, XANGLE, RIN, ROUT nothing: angular periodicity is not available
OUTPARTICLE, OUTGAS, OUTGRADGAS, OUTMODEL renamed PARTICLE_WRT, GAS_WRT, GRADGAS_WRT, MODEL_WRT
PRNTENDTIME (# TIMESTEP) nothing: the end of every run is written
# MATERIAL for particles DENSITY and SPECIFICHEAT in # PICL (# MATERIAL is rejected while species transport is disabled)