The preferred way to set up the Parameter File is to use the
scriptit,
however the Parameter File is a normal text file that may be
written "by hand" with any text editor.
The following parameters are read from the parameter file
(e.g. sod2.p) and are set at run time.
For a simulation with nblock blocks
(numbered 0..nblock-1),
the parameter file will consist of one section with global data
followed by a further nblock sections, describing the
parameters for each block.
Check the functions read_global_parameters() and
read_block_parameters() in file mb_init.c
for the coding details.
To make life fairly easy, you may like to use
ScriptIt to generate the this file.
However, the details on each of the parameters is documented below.
Note that, although the items on each line are separated by commas here,
only white-space separators are expected by the code.
Also, since lines are read from the parameter file with fgets(),
you can add comments to the end of each line.
The global parameters are...
- Line G.1: title string
- A one-line title (less than 72 characters long)
- Line G.2: ident
- (Integer) Case identifier.
The default value is 0.
However, if running a case requiring special coding at some point in
the simulation (e.g. a drag force calculation), this identifier
may be used within the code to activate the specific code.
Check mb_cns.h for a list of available cases.
- Line G.3: gas_index
- This integer sets the type of gas to be used.
Some of the options are:
0 perfect-gas model of air with gamma=1.4
1 low temperature air with viscosity adjusted for comparison with experiment
2 perfect-gas model of air with gamma=1.3
3 perfect-gas model of helium
4 air in chemical equilibrium
5 perfect-gas model of air with gamma=1.667
(to match DSMC simulations)
6 perfect-gas model of argon
7 nitrogen in chemical equilibrium
8 perfect-gas model of nitrogen
9 carbon-dioxide in chemical equilibrium
10 perfect-gas model of carbon-dioxide
11 perfect-gas mixture of helium and nitrogen
12 perfect-gas mixture of helium and air
13 nitrogen with vibrational equilibrium
14 mixture of helium and nitrogen with vibrational equilibrium
15 mixture of argon and air (perfect gases)
16 mixture of ionising argon and inert nitrogen (vib. eq.)
17 mixture of gamma=1.4 and gamma=1.2 perfect gases
Further options can be found in the header file gas.h.
- Line G.4: ivisc, vtdelay, iaxi, ireac
- Include viscous terms if ivisc == 1 but suppress their application
until sim_time is greater than vtdelay.
Use axisymmetric geometry if iaxi == 1
Use Rowan's finite-rate chemistry if ireac == 1
(alternate values are 0 0)
- Line G.5: max_time, max_step
- max_time is the solution time at which the integrator
will stop (if it has not been stopped for another reason).
A final solution will be written to the output file if any steps
have been taken since last writing a solution.
max_step is the maximum number of time-steps allowed.
If this limit is reached, integration will be stopped and
a final solution written to the output file.
- Line G.6: dt_global, cfl_target, iLTS
- dt_global is the initial size of the time-step
(is seconds) that will be used for the first 5 steps.
It is probably safer to choose a small value than trying
for the largest stable time step because no CFL check will be
done during the first few steps.
cfl_target regulates the size of the time step.
Since an explicit time-stepping scheme is used,
a value of 0.5 seems to be a good all-round value.
However, for some well behaved problems
(such as the boundary-layer along a cylinder test case),
values as high as 0.8 seem to be OK.
If a viscous calculation with high aspect ratio cells gives
trouble, try reducing the value significantly and,
if that doesn't help, activate the STRINGENT_CFL check.
iLTS = 1 allows local time-stepping so that each cell's
time-step is as large as the local CFL limit allows.
This is only useful to accelerate to steady-state solutions
as the transient solution is no longer time accurate.
- Line G.7: iXord, iTord, iFlux
- iXord is set to 2 to activate the high-order
interpolation/reconstruction scheme.
A value of 1 will result in cell-average values
being used without interpolation.
iTord is set to 2 to activate predictor-corrector
time stepping.
A value of 1 activates the Euler time-stepping scheme.
As well as being of higher order,
the predictor-corrector scheme seems to be more robust than
the Euler scheme (but it costs twice as much computationally).
iFlux selects the flux calculation scheme
0 Riemann solver
1 AUSM (adapted from Liou and Steffen JCP paper)
2 EFM (from Michael Macrossan and Paul Petrie)
3 AUSMDV (adapted from Wada and Liou AIAA-94-0083)
4 ADAPTIVE (EFM at shocks, AUSMDV otherwise)
The Riemann solver seems to have low dissipation and works
well for viscous calculations.
EFM is more dissipative and so produces inviscid solutions with
lower noise levels.
However, it seems to be too diffusive for boundary layer
calculations.
AUSMDV is the ant's pants according to Ian Johnston (and so it
seems to be).
- Line G.8: dt_plot, dt_his
- A solution will be written periodically,
every dt_plot simulation seconds.
If only one solution is required, set dt_plot
to be larger than max_time.
Every dt_his seconds, the flow data for the specified
history cells will be written to the history file.
History cells are specified for each block (see below).
Again, if this data is not required, set dt_his
larger than max_time.
- Line G.9: n_gas_state
- The following gas states (indexed 0..n_gas_state-1) will be
used for filling the blocks with initial gas conditions and
will be used for inflow conditions on specified block boundaries.
- The fill_gas_state (to be specified later for each block)
is used by mb_prep to initialise the flow state
in each block prior to running the simulation.
On starting mb_cns, the flow data throughout the
block is read from the starting solution file.
Thus, at t = 0, this data will appear throughout the interior
of the block but, on a restart from an old solution,
the cell-averaged data throughout the block may be different.
- Inflow gas states are applied at all boundaries that are
specified as SUP_IN (1) or SUBSONIC_IN (6)
inflow boundaries.
An inflow gas state may be the same as the initial gas state.
For the SUBSONIC_IN boundary the pressure and temperature are
taken as stagnation values while the specified velocities are ignored.
- Line G.10: p, u, v, T
- Each gas state is defined as
- pressure (in Pa),
- x-velocity (in m/s),
- y-velocity (in m/s) and
- temperature (in degrees K)
- Line G.11: f[0]..f[nsp-1]
- Species mass fractions, 0.0 <= f[is] <= 1.0.
This information is required even for a single-species gas model
(when f[0] = 1.0).
- Line G.12 maybe...
- If there is more than one gas state to be defined, the data will
continue in the same format as for Lines G.11 and G.12.
- Line G.xx: nblock
- Number of blocks.
Blocks are numbered 0 through nblock - 1.
- Lines G.xx+1 to G.xx+nblock:
N_id, N_bdy, E_id, E_bdy, S_id, S_bdy, W_id, W_bdy
- These 8 integers (one set for each block) specify the
neighbouring block and its connecting boundary
for each boundary on the current block.
For the North boundary of the current block,
- N_id is the identifying index of the adjacent block.
If there is no adjacent block N_id = -1.
- N_bdy identifies which boundary on the adjacent block
is connected to the North boundary of the current block.
Values are
0=North boundary,
1=East boundary,
2=South boundary and
3=West boundary.
If there is no adjacent block, a value of -1 can be used.
Connectivity is a two-way affair.
If the East boundary of block 0 is connected to the West
boundary of block 1, then the data must also specify that
the West boundary of block 1 is connected to the East
boundary of block 0.
The parameters for the individual blocks follow immediately after
the global parameters.
For each block, they are...
- Line B.1: block title
- A single-line title (or label) for the block.
- Line B.2: nnx, nny
- Number of cells in the ix and iy index directions
respectively.
ix varies along the North and South boundaries.
iy varies along the West and East boundaries.
Note that
(a) both values must be less that NDIM-4
set in mb_cns.h and
(b) since the exchange of flow information between blocks
is a direct copy from source cell to target cell,
the numbers of cells along adjacent boundaries need
to be consistent.
- Line B.3: fill_gas_state_NE _SE _SW _NW
- Indices to the fill gas states that are to be used by mb_prep
prior to running the simulation.
A bi-linear interpolation is used.
Specify all indices the same to get uniform conditions.
Note that real gas states are specified with non-negative indices.
Values of -1 indicate that you want the block to be filled with conditions
specified in the static profile file.
- Line B.4: bc_N, gs_index_N, TwallN
-
- bc_N is the boundary-condition flag for the boundary.
-1 : SPECIAL, conditions are coded directly into the
routines in the code module cns_bc.c.
0 : ADJACENT (or COMMON),
indicates that another block is adjacent to this boundary.
1 : SUP_IN, supersonic inflow using the free-stream values.
2 : SUP_OUT, supersonic outflow using extrapolation.
This boundary condition will also work for an initially static
gas if a (sufficiently strong) shock wave propagates
through the block and exits via this boundary.
3 : SLIP, solid wall with tangential velocity (reflecting BC).
4 : ADIABATIC, solid wall with zero velocity and no heat transfer.
5 : FIXED_T, solid wall with zero velocity and specified temperature.
6 : SUBSONIC_IN, subsonic inflow using specified stagnation conditions.
7 : SUBSONIC_OUT, subsonic outflow (reserved but not implemented).
8 : TRANSIENT_UNI, transient inflow (presumably), uniformly applied across
the block boundary.
9 : TRANSIENT_PROF, transient inflow with specified profile in space
(reserved but not implemented).
10: STATIC_PROF, static, user-specified profile.
- gs_index is the index to the gas_state that should be used if
the boundary in an inflow boundary.
- TwallN is the wall temperature (in degrees K) for use with
the FIXED_T boundary condition
- Line B.5: bc_E, gs_index_E, TwallE
- East boundary;as for the North boundary.
- Line B.6: bc_S, gs_index_S, TwallS
- South boundary; as for the North boundary.
- Line B.7: bc_W, gs_index_W, TwallW
- West boundary; as for the North boundary.
- Line B.8: iturb
- Use the turbulence model if iturb = 1 and the calculation
is viscous.
- Line B.9: hncell
- Number of history cells for this block.
Every dt_his seconds (simulation time), the data for all history
cells, in all blocks, are written to the history file.
- Lines B.10 to B.9+hncell: hxcell, hycell
- Indices of the history cells, one cell per line
1 <= hxcell <= nnx,
1 <= hycell <= nny
Here is an old version of the sod2.p input parameter file
as an example.
This particular file was generated by Scriptit and slightly edited to
make it more presentable.
(Spaces were added to align the comments.)
SOD SHOCK TUBE WITH HELIUM DRIVING AIR.
42 # Case_Id
12 # gas_index
0 0 # ivisc, iaxi
4.000000e-04 300 # max_time, max_step
1.000000e-06 0.500000 0 # dt, CFL, iLTS
2 2 3 # iXord, iTord, iFlux
1.000000e+00 1.000000e-05 # dt_plot, dt_his
2 # n_gas_state
1.000000e+05 0.000000e+00 0.000000e+00 3.484000e+02 # gas_state[0]
0.000000e+00 1.000000e+00 # species mass fractions
1.000000e+04 0.000000e+00 0.000000e+00 2.787000e+02 # gas_state[1]
1.000000e+00 0.000000e+00 # species mass fractions
2 # nblock
-1 -1 1 3 -1 -1 -1 -1 # block[0] neighbours
-1 -1 -1 -1 -1 -1 0 1 # block[1] neighbours
LEFT_BLOCK # block label
50 2 # nnx, nny
0 0 0 0 # fill_gas_states
3 0 3.000000e+02 # bc_North, gas_state_index, Twall
0 0 3.000000e+02 # bc_East, gas_state_index, Twall
3 0 3.000000e+02 # bc_South, gas_state_index, Twall
3 0 3.000000e+02 # bc_West, gas_state_index, Twall
0 # iturb
0 # hncell
RIGHT_BLOCK # block label
50 2 # nnx, nny
1 1 1 1 # fill_gas_states
3 0 3.000000e+02 # bc_North, gas_state_index, Twall
3 0 3.000000e+02 # bc_East, gas_state_index, Twall
3 0 3.000000e+02 # bc_South, gas_state_index, Twall
0 0 3.000000e+02 # bc_West, gas_state_index, Twall
0 # iturb
2 # hncell
20 1 # history cell 0, hxcell, hycell
40 1 # history cell 1, hxcell, hycell
MB_CNS (C) P. A. Jacobs
Last Updated 19-Nov-1997, 27-Jan-1999, 14-Feb-01, 22-Oct-01, 23-Jul-02,
29-Sep-02, 05-Mar-03, 19-May-03.