Sie sind auf Seite 1von 10

Flowsquare 4.

0: Theory and Computation


Yuki Minamoto (http://flowsquare.com)

12th December 2013

Flowsquare is a two-dimensional Computational Fluid Dynamics (CFD) software for unsteady, non-
reactive, reactive and subsonic/supersonic flows. The aim of this software is to provide a handy CFD
environment so that more people can get to know what CFD is like and simulate flows for their
educational and/or academic interests. This documentation includes theoretical and numerical
aspects of the software, which are basis of the parameters in grid.txt. Although flow simulations can
be carried out without understanding them, the users are recommended to read this documentation.

1. Non-reactive flows equation is solved assuming a constant


density, although Eqs. (1) and (2) are written
First, numerical method for non-reactive flow in conservative form. Equation (2) is solved
simulation is explained. (integrated in time) in two steps. In the first
1.1. Governing equations step, the equation is solved for u j
*

without the pressure term as:


In Flowsquare, the incompressible governing
equations are solved. They consist of the ij
continuity equation (mass conservation, and t

u j *

x i
u i u j x i (4)
g j ,
also Einstein notation is used):


u i 0, (1) In the second step (time integration), the
t x i
pressure term is included so that the mass
and the equation for momentum: conservation is taken into account in the
second time integration:

u j uiu j p *
t xi
(2) t

u j
x j
. (5)
p ij
g j ,
x j xi By calculating divergence of Eq. (5), the
Poissons equation for the correction pressure
where u i is the velocity component in i-
p * is as:
direction (m/s), is the mixture density
(kg/m3), p is the pressure (Pa), g i is the 2 p 1
external force in i-direction due to buoyancy
x j

u j *

t
d . ,
t
(6)
x i2
(m/s2). The viscous term ij is written as:
where t is the time step and d , a user
2 u k u u j defined parameter, is typically unity. Once the
ij ij i , (3)
x k
3 x j x i corrected pressure field in obtained by solving
Eq. (6), the corrected velocity in the next time
where is the dynamic viscosity (kg/(m s)) step is computed from Eq. (5) as:
and ij is the Kronecker delta. Note that the
Flowsquare 4.0 Users Guide (2013)

p * the total number of equations for Eqs. (8) and


u j u j
*
t. (7)
(9) is four.
x j

In Flowsquare, in order to reduce the number


The corrected velocity field satisfying the
of equations to be solved, a progress variable
continuity equation (Eq. 1) is obtained. Note
and a mixture fraction are introduced. The
that in this numerical method, the continuity
progress variable is used for reactive flows
equation is not explicitly solved.
with premixed mixtures, while the mixture
2. Reactive flows fraction is used for reactive systems with non-
premixed mixtures. These two modes of
In the simulation of reactive flows, Eqs. (1) reactions and the reduced governing equation
(7) are solved to obtain a velocity field. This are explained in the next subsections.
means the flow field is solved based on the
low-Mach number assumption (the flow has 2.1 Premixed reacting flows
to be slow compared to the speed of sound).
A chemical reaction is called premixed
Also, changes of species and internal energy
reaction when a fuel and oxidiser are fully
per unit mass need to be considered by
mixed before the reaction take place. For
solving the transport equations, due to the
example, premixed reaction (combustion) can
chemical reactions and heat release. The
be observed in traditional gas stove and
transport equations for mass fraction species i,
heater burners.
Yi and temperature T maybe written under
appropriate assumptions as: One of the important features of this reaction
mode is that a reaction front (a flame in
Yi
Di Yi

t

x j

u j Yi
x j
x j
i ,

combustion) can freely propagate toward
unburnt mixture (see Fig. 1a), or mixture can
(8) ignite at any locations if there is enough
activation energy. This is not the case in non-
T T T
t

x j

u jT
x j c p x j c p
,
premixed systems as explained in the next
subsection.
(9)
For premixed mixture, reaction can be
where the energy conservation is written in expressed by using reaction progress variables.
terms of temperature. The molecular A progress variable, often denoted by c , is a
diffusivity of species i, thermal conductivity normalised scalar which shows the extent of
and specific heat capacity at constant reaction progress in premixed reactive
pressure are respectively denoted by Di , systems. Although there are several
and c p . Species and heat production rate per definitions for progress variables, following
definitions are frequently used:
unit volume are denoted by i and T . For
the simplest reaction system, where the fuel YF / O Y
cYF / O 1 , cYP P , and
F and oxidiser O react to produce products YF / O, u YP , b
P as:
cT
T Tu , (11)
F O P, (10) Tb Tu
where the subscripts, u and b denote
unburnt and burnt mixtures, and F , O and

2 / 10
Flowsquare 4.0 Users Guide (2013)

P denote fuel, oxidiser and product,


respectively. As clearly seen from Eq. (11), a
progress variable is 0 in the unburnt mixture
and 1 in the fully burnt mixture. Figure 1b
shows a typical progress variable variation for
one-dimensional premixed flame. Flame front
(reaction front) is often defined using a iso-
contour of c 0.3 ~ 0.6 .

Lewis number Le is defined as the ratio of


thermal diffusivity to mass diffusivity. If unity
Lewis number, constant pressure, adiabatic
conditions and c cYF / O cYP cT are
assumed, Eqs (8) and (9) are reduced to one Figure 1: Schematic illustrations of (a) a premixed
transport equation of progress variable as: flame and (b) one-dimensional variation of
progress variable.
c c
t

x j

u j c
x j
D
x j
c , (12)

where c is the reaction rate of c , and D is


the diffusivity of the progress variable (under
the above assumptions, it can be either
thermal diffusivity or mass diffusivity of
species). Therefore, once a progress variable
field is given, temperature and species mass
fraction field can be obtained using Eq. (11).
The reaction rate c is modelled in the
software as follows:

Ta n
c k exp T (1 c) c , (13)
T

where k , Ta and n are mixture specific and


Figure 2: Schematic illustrations of (a) a non-
constant for the single step reaction explained
premixed flame, (b) one-dimensional variations of
in Eq. (10). In Eq. (13), c is the mixture mixture fraction, and (c) temperature and mass
fraction between a fuel-oxidiser mixture and fraction variations in a mixture fraction space.
air (inert gas). Although the mixture fraction is
explained in the next subsection, this may be
used to represent surrounding air in premixed premixed combustion in surrounding air
combustion. In c 1 regions, the local (pure-air stream) can be considered. When no
mixture consists of only the fuel-oxidiser pure-air stream is set in the computational
mixture, while only the air exists in c 0 . By domain, c is automatically set as unity. The
multiplying c to the reaction rate as in Eq. scalar transport equation, Eq. (12) may be
(13), partially premixed reaction such as solved for non-reactive cases without source

3 / 10
Flowsquare 4.0 Users Guide (2013)

term c when local scalar boundary 8 and 9); for above F ,O , the transport
condition is used (see Sec. 4.5.4). equations of sY F and YO are written as:

2.2 Non-premixed reacting flows sY F


t

x j

u j sY F
In contrast to premixed reacting flows, non-
(20)

D sY F
premixed reactive systems do not require
s F ,
premixing of fuel and oxidiser before x j x j

reactions. A schematic illustration of a typical
YO

non-premixed flame is shown in Fig. 2a. There
u j YO
are fuel and oxidiser streams and reaction t x j
takes place only at the location where the fuel (21)

and oxidiser meet.
D YO O .
x j x j

Using the given chemical reaction model in Eq.
(10), the mass production rate of fuel, oxidiser, By combining Eqs. (20) and (21) using the
product and heat release are related as: relation in Eq. (14), it is clear that the source
terms are cancelled out and following is
O P T obtained:
F , (14)
s 1 s Q
F ,O
where Q is the heating value of fuel and s is t

x j

u j F ,O
x j
D F ,O
x j



the mass of oxidiser required per unit mass of
(22)
fuel, defined as s WO / WF . Here, Wi is the
molar mass of species i. Under the unity Lewis Once a conserved scalar is defined, a
number assumption, the conserved scalar normalised conserved scalar is obtained.
is defined from any pair of variables as: This normalised conserved scalar is generally
called mixture fraction, and written as:
F ,O sY F YO , (15)
OX
, (23)
YP FU OX
F , P YF , (16)
1 s
where the subscripts FU and OX denote
Y fuel and oxidiser streams, respectively. Figure
O , P YO P , (17)
1 s 2b shows a one-dimensional mixture fraction
variation for a non-premixed flame shown in
c pT
F ,T YF , (18) Fig. 2a. With the above definition of mixture
Q
fraction, 1 corresponds to the fuel stream

sc p T and 0 corresponds to the oxidiser stream.


F ,O YO . (19) As shown in Fig. 2b, the flame location in non-
Q
premixed systems is often assumed as the
is called conserved scalar because no location where st . Here, st is the
source term appears in the transport stoichiometric mixture fraction, at which
equations of these conserved scalars (such there is the exact amount of oxidiser to
transport equation can be obtained from Eqs. convert unit quantity of fuel into product. The
stoichiometric mixture fraction is written as:

4 / 10
Flowsquare 4.0 Users Guide (2013)

OX oxidiser mass fraction at each stream, and T F0


st . (24)
FU OX and TO0 are temperatures at fuel and oxidiser

The mixture fraction also satisfies Eq. (22). stream, respectively.


Therefore, for the simulations of reactive non- 2.3 Equation of state and density
premixed systems, the equations of energy
and species can be reduced to one equation In premixed reaction mode, Flowsquare
using mixture fraction as: solves Eqs. (1), (2) and (12), and Eq. (25) is
solved for c, air only if pure-air streams are

t

x j

u j
x j
D
x j
. (25) set. In non-premixed mode, Eqs. (1), (2) and
(25) are solved. Temperature is calculated
from either the progress variable or mixture
Once the mixture fraction field is obtained, fraction field. Density field is obtained based
temperature and species mass fraction fields on the standard thermal equation of state for
can be reconstructed using the relations in Fig. the mixture:
2c. These relations are directly obtained from
Eq. (25) by assuming infinite chemistry, but p RT . (27)
only results are shown here.
Here, R is the specific gas constant (J/kg K)
For st calculated as R 8.31/ W , where W is the
molar mass of the mixture. For instance,
YF 0 , R 287.058 (J/kg K) for dry air. In Flowsquare,
all thermodynamic and transport properties

YO YO0 1 ,

are assumed as constant for reacting flow
st simulations.

YP (1 s)YF0 , For non-premixed mode, temperature is just


mapped onto computational domain based on
. Therefore, the change of density (Eq. 27)
T (Tb TO0 ) TO0 .
st can be much larger than that captured with
t initially set. In order to avoid such
For st (26) situations and keep simulation stable,
following relaxation operation can be used for
st
YF YF0 , density:
1 st
n1 n 1 (1 ) n , (28)
YO 0 ,
where is the relaxation parameter for
1 density, and n 1 .is the density calculated
YP (1 s)YF0
1 st
using Eq. (27). Clearly, 1 yields right
solution (but tends to be unstable under low
Tb TF0 T 0 T
T F st b , resolution conditions).
st 1 st 1

where Tb is the adiabatic flame temperature,


Y F0 and YO0 are respectively the fuel and

5 / 10
Flowsquare 4.0 Users Guide (2013)

3. Subsonic/supersonic flows u v
2
u u p uv
In high speed flows, the viscous term in the q , F ,G 2 .
v uv v p
momentum transport equation (Eq. 2) may be
E ( E p)u ( E p )v
negligible:
(33)
p
t

u j
xi

u i u j
x j
. (29) They are solved (also with Eq 31) for fully-
compressible subsonic/ supersonic (inviscid)
This equation is a nonlinear hyperbolic flows.
equation, which is often used for simulations
4. Numerical methods
of waves. Also, since a fluid velocity is so large,
incompressible flow assumption is no longer In Flowsquare ver 4, there are a variety of
valid; energy conservation needs to be taken choices of numerical methods. Each method
into account. Assuming inviscid fluids (or has pros and cons, and they need to be
conditions), the energy conservation equation considered for the choice. In this section,
is written as: these methods are summarised.

E
( E p)u i 0 , (30) 4.1. Differentiations
t x i
Spatial differentiations are computed on a
where E is the total energy per unit volume uniform mesh (cell). The 1st derivative of f
(J/m3). The total energy is related with the in i direction at a location j is computed using
kinetic energy as: one of following methods ( 1 i N , N is the
number of grid points in i direction).
E e 0.5u i u i . (31)
4.1.1. 2nd order central finite difference
Here, e is the internal energy per unit mass
(J/kg) expressed as e p /( 1) for ideal f

gas, where ( c p / c v ) is the adiabatic index x ( f j 1 f j 1 ) /( 2xi ) , (34)
i j
(heat capacity ratio; approx. 1.4 for most of
gases, and this value is used in the software). f
( f 1 f 2 ) / x i , (35)
The static pressure is calculated in every time x
i 1
step as: p E 0.5u i u i . The set of Eqs.
R
cv f
( f N f N 1 ) / x i . (36)
(1), (2) and (3) is called Euler equations and x
i N
often written in vector form as:
4.1.2. 4th order central finite difference
q F G
0, (32)
t x y f

x ( f j 2 8 f j 1 8 f j 1 fi 2 ) /(12xi )
i j
where
(36)

f 25 f1 48 f 2 36 f3 16 f 4 3 f5

x 12xi
i 1
(37)

6 / 10
Flowsquare 4.0 Users Guide (2013)

f 3 f1 10 f 2 18 f3 6 f 4 f5 4.2.3. 3rd order Runge-Kutta (low-storage)



x 12xi
(38)
i 2 In 3rd order Runge-Kutta method, each time
integration is achieved in following three sub
f 3 f 10 f N 1 18 f N 2 6 f N 3 f N 4
N steps.
x 12xi
i N 1
(39) 1 f n
f n t , (44)
3 t
f

x f n f n f n , (45)
i N
25 f N 48 f N 1 36 f N 2 16 f N 3 3 f N 4 f
15 5
12xi f n t f n n , (46)
16 9 t
(40)
f n f n f n , (47)
4.2. Time integration

In this section, formulations to obtain a 8 153 f


f n t f n n , (48)
solution in the next time step (n+1) from the 15 128 t
current time step (n) are explained.
f n1 f n f n . (49)
4.2.1. Euler method (1st order)
4.3. Poissons equation
The easiest way to integrate the governing
equations in time is to use Euler method Poissons equation is solved iteratively to
which is explicit 1st order scheme: obtain pressure variation in Eq. (6). Poissons
equation is written as
f n
f n 1 f n t . (41)
2 f , (50)
t

This is first order forward method and is where 2 denotes the Laplace operator. If
numerically unstable. second order central differentiation is applied
to above equation, the discrete form is:
4.2.2. Lax-Wendroff method (=2nd order
midpoint method) i 1, j 2 i , j i 1, j

Lax-Wendroff method is a numerical solution x 2


. (51)
i , j 1 2 i , j i , j 1
often used for hyperbolic partial differential f i, j
equation. In this software, the midpoint y 2
method similar to Lax-Wendroffs time
Therefore, the Poissons equation can be
integration part can be used. This method
reduced to n linear equations with unknown
compensates the lack of the Euler method by
. In Flowsquare, the Poissons equation is
integrating in two steps.
iteratively solved using Successive Over-
f n t Relaxation (SOR) method. The (n+1)-th
f n f n , (42)
t 2 iterative solution is calculated from n-th
iterative solution as:
f n
f n 1 f n t . (43)
t

7 / 10
Flowsquare 4.0 Users Guide (2013)

in, j 1 (1 ) in, j two types of BC are used appropriately


depending on the physical quantities.
in1, j in11,j in, j 1 in, j 11
f ij (52)
x 2
y 2 4.5.1. Inflow boundary

x 2 y 2 On the inflow boundary, P is set using
,
2(x 2 y 2 ) Neumann BC. Other quantities such as , u ,
v , T , c , and E are specified according to
where is the relaxation parameter. Values
Dirichlet BC depending on the simulation
of >1 are used to accelerate convergence
mode. Some of these values are explicitly set
speed, while <1 are used to help
by users, while the others are computed
convergence solutions of an unstable iterative
appropriately during the simulation. Inflow
process. Typically, =1.61.8 is used for
boundaries can be set only on the boundaries
both better results and fast convergence. The
of the computational domain ( i 1 , i N x ,
iteration calculation is continued until
j 1 and j N y ).
n 1 n p , where p is tolerance and
specified by users. 4.5.2. Outflow boundary

4.4. Spatial filtering The minimum pressure P on the outflow


boundaries is always set to be a reference
Spatial filtering is sometimes required to
pressure P0 (Dirichlet BC) which is explicitly
stabilise the calculations. In Flowsquare, the
second order explicit filter can be used with a set by users. On other outflow boundary
relaxation parameter as follows: locations, P is set according to Neumann BC.
Other quantities such as , u , v , T , c and
fi (1 fil ) f i fil ( f i 1 2 f ij f i 1 ) / 4 . are specified according to Neumann BC.
(53)

The relaxation parameter fil ranges


4.5.3. Periodic boundary
from 0 to 1. Minimum possible fil is
One or both of two directions can be set as
recommended.
periodic boundaries. On the periodic
4.5. Boundary conditions boundaries, derivatives are simply computed
(shown only for 2nd order scheme in Eq. 34,
Various boundary conditions can be used in but equally applied to other schemes as well)
Flowsquare. Boundary conditions are roughly as:
classified into two types: Dirichlet boundary
condition and Neumann boundary condition. f

Dirichlet BC is also called fixed BC, because it x ( f 2 f N ) /( 2xi ) , (54)
i 1
specifies the values that a solution takes on
the boundary of the computational domain. In f
( f 1 f N 1 ) /(2x i ) . (55)
contrast, Neumann BC specifies values that x
i N
the derivative of a solution is to take on the
boundary of the domain. The value is
determined to make the derivative zero
( f 1 f 2 and f N f N 1 ). In Flowsquare, these

8 / 10
Flowsquare 4.0 Users Guide (2013)

4.5.4. Local scalar boundary 4.6 Initial velocity perturbation

Sometimes, users want to set source of scalar, In Flowsquare, velocity perturbation, (u p , v p ) ,


c or , for Eq. (12) or (25) inside the domain. can be added to the initial global velocity field.
Such boundaries can be used as tracer in the There are three mode of perturbation.
case of non-reactive flows, or as non-reactive
area for a convenience in the case of reactive Mode 1: single mode
case. For this type of boundary, the user-
i 1
defined scalar value is set on the boundary. u p u mag sin 2 n wave
Flow velocity and other quantities are Nx 1
computed by solving the transport equations j 1
cos 2 n wave
as usual. Nx 1 , (56)
i 1
4.5.5. Wall boundary u mag cos 2 n wave
Nx 1
Wall boundaries can be set at any locations in j 1
the domain. On the wall boundary, the sin 2 n wave
Nx 1
velocity is set as zero. All other quantities are
solved using the transport equations, i 1
although temperature can be fixed on the wall v p u mag cos 2 n wave
Nx 1
(optional).
j 1
sin 2 n wave
4.5.6. Moving boundary Nx 1 , (57)
i 1
Moving boundary is basically moving wall u mag sin 2 n wave
Nx 1
boundary. The displacement velocity of the
wall can be specified by users and the j 1
cos 2 n wave
movement can be transient (if the moving Nx 1
wall has gone, its gone) or periodic (when
moving wall left the domain it comes back Mode 2: multi modes
from the other side of the domain). The
i 1 n wave
velocity on the moving wall is fixed to the u mag sin
velocity of displacement. All other quantities N x 1 2 n 1

are solved using the transport equations, j 1 n wave
cos
although temperature can be fixed on the wall M
N x 1 2 n 1
(optional).
up
n 0 i 1 n wave
,(58)
u mag cos
N x 1 2 n 1
4.5.7. Air-flow boundary
j 1 n wave
sin
Only for the simulation of premixed reacting N x 1 2 n 1
flows, pure-air stream can be set on the
boundary of the numerical domain. The
velocity and temperature are set (Dirichlet BC)
explicitly by users. The mixture fraction
between progress variable and air, c , for Eqs.
(13) and (25) is set as 0 in the pure-air stream.

9 / 10
Flowsquare 4.0 Users Guide (2013)

i 1 n wave 5. Literatures to consult with would be:


u mag cos
N x 1 2 n 1
Poinsot, T. and Veynante, D. (2005)

j 1 n wave Theoretical and numerical combustion. R.T.
sin
M
N x 1 2 n 1 Edwards, Inc.
vp
n 0 i 1 n wave
,(59)
u mag sin Cant, R. S. and Mastorakos, E. (2008) An
N x 1 2 n 1
introduction to turbulent reacting flow.
j 1 n wave
cos Imperial College Press.
N x 1 2 n 1
Sana, O. and Kara, K. (2013) Numerical
Mode 3: multi modes (random amplitudes) assessments of high-order accurate shock
capturing schemes: Kelvin-Helmholtz type
i 1 n wave vertical structures in high-resolutions.
u rnd sin
N x 1 2 n 1 Computers and Fluids.

j 1 n wave
cos
M
N x 1 2 n 1
up
n 0 i 1 n wave
,(60)
u rnd cos
N x 1 2 n 1
j 1 n wave
sin
N x 1 2 n 1

i 1 n wave
v rnd cos
N x 1 2 n 1

j 1 n wave
sin
M
N x 1 2 n 1
up
n 0 i 1 n wave
,(61)
v rnd sin
N x 1 2 n 1
j 1 n wave
cos
N x 1 2 n 1

where u mag and n wave are user defined


parameters, and M log 2 nwave . The
perturbation amplitudes, u rnd and v rnd are

u rnd u mag R1 (n) , vrnd u mag R2 (n) , (62)

where R1 (n) and R2 (n) are random numbers


ranging from 0 to 1, generated for each n.
Note these random numbers for u p and v p
are different in general. A Bunsen flame simulated using Flowsquare.

10 / 10

Das könnte Ihnen auch gefallen