Starting point:
fluid mechanics equations in conservative form
Mass conservation equation:
0
div u t
Momentum conservation
equation:
div
gradu
Sxx u p
u t div
u
div
gradv
Syy u p
v t div
v
div
gradw
Szz u p
w t div
w
J. Szantyr – Lecture No. 10 – Computations of Viscous Flows – Finite Difference Method
Internal (molecular) energy equation:
div i u pdiv u div kgradT S
it
i
Equation of state:
T
p p ,
T
i
i ,
E.g. for a perfect gas:
RT p
T c i
vGeneral transport equation:
div u div grad S
t
Φ – dissipation function Si – energy sources
2
2 2 2 2
2 2
2 divu
y w z
v x
w z
u x
v y
u z
w y
v x
u
Differential equations of fluid mechanics must be transformed into their algebraic equivalents. Three ways of action are possible:
1. Finite Difference Method (FDM) 2. Finite Element Method (FEM) 3. Finite Volume Method (FVM)
Each of the above methods requires so called
discretization of the flow domain, i.e. creation of the
grid dividing this domain into a large number of small
elements.
Boundary conditions are required for solution of the system of algebraic equations (in unsteady flows initial conditions are required as well).
Initial conditions require determination of the values of fluid
density, flow velocity and temperature in the entire flow domain for time t=0.
Boundary conditions require determination of:
-on rigid walls – the values of velocity and temperature (or stream of heat)
-at inlet – the values of density of fluid, velocity of flow and temperature (or stream of heat)
-at outlet – the values of pressure and zero gradients of velocity and temperature in normal direction
Scheme of the boundary conditions for an internal flow.
Scheme of the boundary conditions for an external flow.
Finite Difference Method Finite Difference Method is based on
transformation of the differential equations into
their finite difference equivalents. It was devised by Brook Taylor. In practice three finite difference
schemes are used. If the derivative of a function is defined as:
Brook Taylor 1685 - 1731
h
x f h x f dx
df dh
df
h
lim0
then it may be approximated as:
h
x f h
x f h
f
h
h x f x
f h
f
h
h x
f h
x f h
f
2
1 2
1
Forward difference Backward difference
Central difference
With the following
approximation errors:
hdx O df h
f
h2dx O df h
f
One-dimensional finite difference scheme based on 5 equally spaced points has the form:
h
h x
f h
x h
x h
x f dx
df
12
2 8
8
2
Two-dimensional finite difference scheme may be presented for example for a stream function ψ:
y u x
x
y
From stream function definition:
The first derivative of ψ in direction x may be approximated as:
x
y x y
x x
x
, ,
The second derivative in direction x may be approximated as:
x
y x x
y x x
y x y
x x
x x
, ,
, ,
1
2
2
In the indexed notation we have:
i j i j
x
x 1, ,
1
i j i j i j
x2 x 2 1, , 1,
2
1 2
Correspondingly for the y direction:
i j i j
y
y , 1 ,
1
2 2
1 2
, 1 2 , , 1
j i j
i j
y i
y
If the analysed flow is potential (i.e. it is an irrotational flow of an ideal fluid), then the stream function must fulfil the Laplace equation just as the potential function:
2 0
2 2
2
y x
Suitable substitution leads to:
1
, 1, 1,
, 1 , 1
2
i j
i j
i j
i j
i jwhere:
2
y
x
Example of FDM calculation
Compute the two-dimensional flow through the divergent nozzle
shown in the drawing, using the grid of points with step of 0.2 [m] in both directions of the system of co-ordinates.
For convenience we assume that the stream function is equal zero for the bottom side of the nozzle. From the volumetric intensity of flow it follows that the stream function should be equal to 10 at the top side of the nozzle.
As the inflow and outflow from the nozzle are both uniform, the stream function at inflow and at outflow should vary linearly with elevation. For the points inside the fluid domain arbitrary initial values of the stream function may be assumed. Then the
interpolation formula is used, starting for example from the left upper corner of the nozzle. After several passages along the nozzle the differences of stream function values in the corresponding points between consecutive approximations are reduced below the assumed allowable error. The final solution is marked in the picture below:
The velocity values
may be obtained as:
m sV y 10,45
2 , 0
00 , 0 09 , 2 6
, 3 7
, 6 3
,
3
2
2
1 2
1
W W W
P V
V V
p C p
Pressure may be computed from the Bernoulli equation:
One-dimensional approximation, based upon the continuity equation and Bernoulli equation gives:
x A xV A
VW W
2