Appendix: Initial Conditions
The run control file variables that are used to specify initial conditions for a simulation are discussed in the following subsections.
Uniform Initial Conditions
The most basic method of assigning initial conditions is to assign uniform conditions throughout the
entire domain using the initialCondition
variable in the run control file. An example of this is
shown below for an incompressible, turbulent flow. Such a problem requires the specification of the
initial state for the density, pressure, velocity and turbulence quantities. Here we assume that a k-omega
turbulence model is in use. We note that for any given flow problem, additional variables that are specified
beyond what is necessary will be ignored.
initialCondition:<rho=1.0 kg/m/m/m, p=10.0 atm, v=0.0 m/s, k=0.001, omega=1000.0>
The table below summarizes all variables for the main code that can be specified, as well as their definitions and default units. Additional variables for the various Stream modules are described in their respective chapters of this document.
Variable |
Description |
Default Units |
---|---|---|
|
Density |
\(\frac{kg}{m^{3}}\) |
|
Pressure |
\(Pa\) |
|
Temperature |
\(K\) |
|
Species mass fractions |
|
|
Velocity |
\(\frac{m}{s}\) |
|
Turbulent kinetic energy |
\(\frac{m^{2}}{s^{2}}\) |
|
Specific turbulent dissipation rate |
\(s^{-1}\) |
|
Turbulent Dissipation rate |
\(\frac{m^{2}}{s^{3}}\) |
For compressible flows of a pure substance, two thermodynamic properties must be specified to establish the thermodynamic state for an initial condition. In Stream, this is done exclusively using the pressure and temperature. Given these two quantities, the initial conditions for other derived thermodynamic quantities such as density and specific internal energy are determined from the equation of state that is being employed in the simulation. Shown below is a typical uniform initial condition specification for a turbulent, compressible flow of a pure substance.
initialCondition: <p=10.0 atm, T=1000.0 K, v=1.0 m/s, k=0.001, omega=1000.0>
An initial condition for compressible, turbulent flow of a mixture material is similar specified, however one must now also provide an initial condition for the composition, which in Stream is given by the mixture species mass fractions, as shown below.
initialCondition: <p=10.0 atm, T=1000.0 K, v=1.0 m/s, k=0.001, omega=1000.0,
mixture=[H2=0.1, O2=0.1, H2O=0.8]>
The names of the species provided in the mixture specification must
match those given in the .mdl
file which specifies the mixture material.
Species in the mixture material that are not explicitly assigned in the
initial condition are given a default value of zero.
Left and Right State Initial Conditions
An initial condition with uniform left and right states may be needed
for some problems. The run control file variables ql
and qr
are used to
specify these states. The specification for ql
and qr
is identical to
that shown above for initialCondition
. The left and right initial
condition states are separated by a plane whose location is
specified at a midpoint by using either the variable xmid
, ymid
or zmid
.
If a midpoint is not specified in the vars
file, the default specification
is xmid
with a value of zero in which case the y-z plane through the origin is the surface separating
the left and right uniform initial condition states. If ymid
is specified, then the cutting plane
is an x-z plane located at the ymid
value, while if zmid
is specified, the cutting plane is an x-y
plane located at the zmid
value.
With the location of the cutting plane specified, the left state, ql
, is used for all cells
with a cell-center coordinate less than the specified midpoint coordinate value.
The right state, qr
, is used for cells with a cell-center coordinate
greater than the specified midpoint coordinate value. The following example shows a typical specification
for a laminar compressible flow of a mixture material.
ql: <p=10.0 atm,T=1000.0 K,v=0.0 m/s,mixture=[H2=1.0]>
qr: <p=1.0 atm,T=300.0 K,v=0.0 m/s,mixture=[O2=1.0]>
xmid: 0.5
Initial Condition Regions
It may be desirable to assign different initial condition values to
different regions of the computational domain. For example, one may have
a pipe with a 90-degree bend. In this case, if one wished to assign an
initial condition for velocity that is parallel to the walls of the
pipe, one would need to be able to independently specify two different
conditions. Stream provides a general capability based on geometric
primitives (shapes) that allows the user to specify an arbitrary number
of initial condition states over various regions of the entire domain.
This specification is accomplished with the run control file variable
initialConditionRegions
. To illustrate the use of this feature, consider
the example specification below for a compressible flow of a mixture
material:
initialConditionRegions:<
default=state(u=0.0m/s, p=1atm, T=298K, mixture=[N2=1.0]),
hydrogen=state(u=0.0m/s, p=1atm, T=400K, mixture=[H2=1.0]),
oxygen=state(u=0.0m/s, p=1atm, T=200K, mixture=[O2=1.0]),
regions=[inBox(p1=[0,0,0], p2=[1,1,1], composition=hydrogen),
inSphere(radius=0.1m, center=[0.5,0.5,0.5], composition=oxygen)] >
In this example, the default state is first used to assign values to
every cell in the computational domain. The regions that are
subsequently defined are processed in order of appearance, each
overwriting the state of the cells contained inside the region. Thus,
for this example, the default
state is replaced by the hydrogen
state
for cells inside the defined box and then the cells contained inside the
defined sphere are assigned the oxygen
state.
The table below contains a complete listing of the variables for the main code that can specified
inside initialConditionRegions
. As with the other initial condition specifications above,
consistent units other than the default units may be specified, in which case numeric values are
converted internally to the default units for use in the code. If units are not
specified for a quantity, the default units for that quantity are assumed.
Variable |
Description |
Default Units |
---|---|---|
|
Density |
\(\frac{kg}{m^{3}}\) |
|
Pressure |
\(Pa\) |
|
Temperature |
\(K\) |
|
Species mass fractions |
|
|
Velocity |
\(\frac{m}{s}\) |
|
Mach Number |
|
|
Turbulent kinetic energy |
\(\frac{m^{2}}{s^{2}}\) |
|
Specific turbulent dissipation rate |
\(s^{-1}\) |
|
Turbulent Dissipation rate |
\(\frac{m^{2}}{s^{3}}\) |
The geometric primitives that are currently supported for initialConditionRegions
are shown in the table below.
Primitive |
Description |
---|---|
|
Takes two arguments p1 and p2, which define two diagonally opposing corners of the box. |
|
Takes two arguments, radius, and center, which define respectively the size and location of the sphere. |
|
Takes three arguments, radius which defines the cylinder radius, and the points p1 and p2, which define the endpoints of the axis of the cylinder. |
|
Takes four arguments, p1 and p2 which define the endpoints of the axis of the cone, and r1 and r2 which define the radius of the cone at the locations p1 and p2, respectively. |
|
Takes two arguments, point, which defines a point on the plane, and normal, which defines a vector normal to the plane. The region included in this primitive is the semi-infinite region on the side of the plane away from the direction of the specified normal. |
Interpolated Initial Conditions
Often after running a simulation for a particular geometry, one decides
that a refined mesh is required. In this case, one can use the solution
obtained from the old simulation as an initial guess for the new
simulation by using the interpolateInitialConditions
variable in the run
control file as follows:
interpolateInitialConditions: put.1000_cavity
When running a simulation, if the user has included the variable put
in the
plot_output
line of the run control file, Stream writes out what is known as the puT
file in the output directory along with other output files according to
the value of the run control file variable plot_freq
. In the above
example, the value 1000
indicates the time-step number at which data was
written in the previous simulation, and the name cavity
is the case name
of the previous simulation. The puT
file (the name is an acronym for
pressure(p), velocity(u), and temperature(T)) contains all the basic
flow variable information associated with the run, including velocity,
pressure, temperature, species, and turbulence data if the simulation is
employing a turbulence model.
If one is running a new case in which the type of simulation remains constant but the grid has changed, then
one simply needs to select any puT
file from a previous run and use it
in the above manner. Note that the name of the puT
file specified in the
new run must include the complete path to the file. However, if the simulation type changes between
runs, there are a few special cases of interest which require additional input, the details of which follow:
Consider the case of using a
puT
file (compressible or incompressible) to restart to an incompressible simulation. The density is not stored in apuT
file, and there is no equation of state for an incompressible flow; therefore, the variableinitialCondition
must be used to provide the value for density. All required values for an incompressible flow simulation (density, velocity, and pressure) must be specified ininitialCondition
, but only the value of density will be taken from this variable. All other values will be obtained from the file specified byinterpolateInitialConditions
.For using an incompressible
puT
file as an initial condition to a new compressible run, one must use the variableinitialCondition
to provide the value for the initial temperature. This is because the value for temperature in any incompressiblepuT
files is zero, which is non-physical for compressible flow. A complete specification forinitialCondition
appropriate for compressible flow must be given, but only the temperature value will be used.