Currently, input filenames are specified on the command line. If nothing
is specified on the command line, the default rootname of
duns is used in
generating input filenames, and
dunsout is used for generating output
filenames. The command line options are:
duns.e [-g, --grid fname] [-c, --conn fname] [-ch, --chem fname] [rootname]
where the grid, connectivity, and chemistry files can be specified
separately from the rootname. The default names are given below.
In general, input files can be interspersed with comment lines.
All comment lines start with a number character (
#) after which
the text is ignored until the next line. This allows the user to
include comments if he/she does not easily remember what certain
The new DUNS scripting method operates by defining a number of modes.
There are currently 13 distinct modes. One enters each mode by a
predefined keyword. Each mode has a set of commands that can be
typed in order to set different variables or perform different actions.
The mode can be exited by an
end command or by entering a
different mode. For some modes, upon exiting the mode, certain
actions are taken (for instance, reading in the grid.) The 13 current
modes are stated below:
Each mode and its associated commands is described below. Most
of the commands are self-explanatory, however, some require additional
explanation. The action upon exiting the mode (either by an
end command or by entering another mode) is also described.
scale $num1 $num2 $num3
Reads in the grid file and connectivity file.
This mode is more complex than many of the other modes.
Typically, the gas model
is set first. Once that is set, various gas properties can be defined.
A brief description of what needs to be defined for the different models
is given below.
For the incompressible model, you need to specify the density of the
gas, as well as the viscosity and thermal conductivity. The incompressible
model is a single-species model.
For the compressible model, you need to specify either
the molecular weight or the gas-constant of the gas, the specific heat
ratio gamma, and the viscosity and thermal conductivity. This is a
If you select the multi-species model, you have to define the
thermodynamic properties (again either molecular weight or the gas-constant,
plus the specific heat ratio gamma) of each individual species separately.
specie $name command either selects
$name as the current
species, or adds a species to the species list and sets that species as the
The transport properties (viscosity and thermal conductivity) are
defined for the entire mixture.
If you select the variable-props model, you must select a filename
for reading in the thermal and transport properties. The format for this
file is discussed in more detail under the
If you select the chemkin model, you must select a filename
for reading in the thermal and transport properties. The files it reads in
are simply the
tran.bin files generated by the chemkin
interpreters, renamed to
$fname.tran where fname is
specified under the
filename $fname command.
If you are using adaptive chemistry model, you will need to set
the number of models and the last specie before specifying the filename.
Similar to the chemkin model, it reads in a
$fname-n.tran file for each model
n is from 1 to
the number of models. You should also select a last specie for the
models. This specie should exist in all the models and be a stable specie,
such as N2. After reading in the models (done by specifying the filename),
you should set the validity criteria. This is done by first selecting the
model number for which you want to specify the criteria, and then
giving maximum or minimum validity criteria as appropriate. The $name of
the criteria can either be
temperature or a species name. Specifying
epsilon selects a threshold value for considering species. Below this
level, species will be ignored when selecting the correct model for a cell.
maximum $name $num
minimum $name $num
You can also add reactions in this mode. The commands are:
forward-rate $A $n $Ea/R
backward-rate $Ab $nb $Eab/R
kof $kof1 $kof2 $kof3
coff $coff1 $coff2 $coff3
cofb $cofb1 $cofb2 $cofb3
You must first
specify the reaction number with the
reaction-number command, and
then specify the forward (and if it has a reverse reaction, the backward)
rate constants. Then you must specify the stoichiometry of the reaction.
For instance, for CH4 + 2O2 = 2H2O + CO2, the coefficients line would
kof -1 -2 2 1, but only if the species were ordered as
CH4, O2, H2O, and CO2. The actual exponents used in the rate calculation
is specified in
cofb. An example of this is given
forward-rate 8.3e5 0.0 -15098.138
kof -1.0 -2.0 2.0 1.0 0.0
coff 1.0 1.0
This describes the reaction CH4+2O2=2H2O+CO2. It is only a forward
reaction, with the rate given as wdot = 8.3e5*exp(-15098.138/temp)*cCH4*cO2.
You can either read in the initial flow field
from a data file, or you can specify uniform
Below are commands associated with
reading in the file.
Below are commands used to specify uniform conditions.
Read in data file if
$fname has been specified.
This mode is also relatively complex. First you need to specify
the surface (or surfaces) for which you want to specify boundary
conditions. This is down by
surface $n1 $n2 ...
Next, you want to specify the general boundary condition type and
then the actual boundary conditions. There are eight basic boundary
condition types as described below, with the possible specifications.
The first set of commands are for subsonic inflow. After specifying
subsonic-inflow, you must specify either
stagnation-temperature. If you have specified either
mass-flow, you must specify the
temperature also. If you have
stagnation-pressure, then you must specify a
stagnation-temperature. The rest of the options are optional.
$species will specify the mass-fraction for that particular specie.
The only supersonic boundary condition currently implemented is a specified
Mach number, temperature and pressure, all of which must be specified. Again,
the remaining options are optional and follow the subsonic inflow style.
The only subsonic outflow boundary currently implemented is a back pressure
boundary condition. Here you must specify the back pressure.
Supersonic outflow is fully specified from within the flow domain, so no
additional boundary conditions are required.
A viscous wall can either be adiabatic or at a constant temperature.
An inviscid wall can either be adiabatic or at a constant temperature.
The remaining boundary conditions are for symmetric flows. The non-sweep
boundary condition can be used if you want to simulate one-dimensional
flow with a two-dimensional grid. You must specify the cross-stream walls
as being non-sweep walls.
This mode selects the type of preconditioning desired. It also sets some
parameters related to the preconditioning.
This mode sets variables such as the time-step and the number of steps to
take. You can also specify when to print convergence data and restart
files. The commands for this mode are:
cfl $num1 $num2
vnn $num1 $num2
Will run the code for the specified steps.
Saves the restart file as $fname.rstrt.
Saves the plotting files (*.g, *.q, *.v and *.tec). $string
specifies a string of variables enclosed in quotes for plotting.
See the section on plot files.
Turns on or off movie-plotting, which saves a plotting file every $num
steps, as determined by the
time-steps-per-frame command. Same
variable choices as for the
Example of a script file.
# This is the input deck for the DUNS-2.6
# Generated by Douglas Schwer 4/30/00
surface 1 4 5 8
variables "p1 u v w t"
The grid file is written in unformatted multi-block plot3d format. Here is
a snip of FORTRAN code that will write out a multi-block plot3d unformatted
open(unit=11, file='duns.grid', form='unformatted')
do n = 1, nblocks
Regardless of the precision of the solution procedure, the grid can either
be single-precision or double-precision. This is controlled by the
parameter in the input deck. If
igrid=0, the program tries to read in a
double-precision grid, if
igrid=1, the program tries to read in a single-precision
grid. Formatted grids can also be read in if
igrid=2. The form of a formatted
grid file is as follows:
The connectivity file takes a somewhat different form. It is a plain ASCII
file, and for each block there is a corresponding line. For each block, you
have four (or six for three-dimensional) sets of numbers and a letter
corresponding to a particular boundary. Each boundary has 1 letter and 4 numbers
describing it, as for example
b 0 2 123
The first letter indicates whether the boundary coincides with a surface (denoted
s) or another block (denoted by a
b). If it is a surface, the next
number (0 for this case) is the number of the surface. If it is a block, the second
number is the number of the block that it is adjacent to (in this case block 2).
The next set of numbers (123) represent what's called an axis mapping. This is how
the axis for the present block maps onto block 2. The first number represents what
the i number maps to, the seocnd number represents what j maps to, and for
three-dimensional cases the third number represents what k maps to. A 1 means that
the given index maps to i on the other block, a 2 means j, a 4 means that the index
maps inversely to i; 5 means inversely to j, etc.
As I mentioned previously, there are 4 or 6 sets of these numbers for each block in
the grid. The first set of numbers represents the i=1 boundary, the second i=imax,
the third j=1, the fourth, j=jmax, etc. For example the line
B 4 b 0 1 243 s 4 0 000 b 0 11 243 b 0 5 453
represents the connectivity for block 4 for our cylinder example in Figure 1.
The first set of numbers
b 0 1 243 means that the i=1 boundary of the
block is connected to block 1. The axis mappings mean that the i direction for
block 4 corresponds to the j direction in block 1, and the j direction in block 4
corresponds to the inverse of the i direction in block 1. These, the point
x(1,5) in block 4 corresponds exactly to the point x(imax-4,1) in block 1. The
boundary for i=imax is the surface #4 (no axis mappings are needed to describe
this.) The j=1 boundary for block 4 corresponds to the i=imax surface of block
11. The rest is left as an excersize.
For most complex geometries, you will need some sort of a grid generator to
generate the grid for a given geometry. These grid generation techniques
should automatically write a connectivity file with the above information.
However, it is good to know the format for the connectivity if you need to
generate a simple grid without one of these multi-block grid generators.
There are several types of chemistry files that are used with the code.
Chemistry files are used for multi-species variable-properties,
and chemkin multi-species, with each chemistry file having a different
For variable-props gas model, the
DUNS code uses 5th-order polynomial curve
fits for the thermodynamic properties and transport properties.
It then determines the mixture transport properties using Wilke's
mixing rule. The two main formats can be seen in the
test/serial/rbcc/ subdirectory under
chem.iprop1. The difference between the two formats is how they
handle species diffusion.
For the chemkin gas model,
you need to run the chemkin interpreter (
on the initial input file
chem.inp. This will generate a file called
chem.bin. You also need to run the transport curve-fitting program,
tran.exe to generate a
tran.bin file. These files should
then be renamed to
$fname.tran which is then
read in by DUNS. Be sure you have a
in the current directory when running the interpreters, or else they will
choke on the program. Please refer to the CHEMKIN-II documentation for
information on specifying the initial
As noted previously, you can read in an initialization file instead of
starting with uniform flow if you generate a
The format is selected as either
formatted. If it is single or double-precision, the file is
in a plot3d style format, as follows.
open(unit=11, file='duns.qinit', form='unformatted')
do n = 1, nblocks
write(11) rtmp1, rtmp2, rtmp3, rtmp4
A formatted qinit file looks like:
t must always be specified in the
qinit file. If you specify
turbulence in the script file, the turbulent
om values are also read. If you specify
species in the
script file, the species mass-fractions will also be read for
Values can be given either at the cell centers or at the cell vertices. If
given at the cell centers, you must provide an offset number
$offset=0, you must specify values at all the cells including ghost
$offset=1, you must specify values only at the cell centers
within the domain.