Upload
others
View
2
Download
0
Embed Size (px)
Citation preview
Chapter 8: Finite Volume Method for
Unsteady Flows
Ibrahim Sezai Department of Mechanical Engineering
Eastern Mediterranean University
Spring 2013-2014
I. Sezai – Eastern Mediterranean University ME555 : Computational Fluid Dynamics 2
8.1 Introduction
The conservation law for the transport of a scalar in an
unsteady flow has the general form
by replacing the volume integrals of the convective and
diffusive terms with surface integrals as before (see section
2.5) and changing the order of integration in the rate of
change term we obtain:
( ) ( ) ( )div div grad St
u (8.1)
( ) ( )
( )
t t t t
CV t t At t t t
t A t CV
dt dV n dA dtt
n grad dA dt S dVdt
u
(8.2)
I. Sezai – Eastern Mediterranean University ME555 : Computational Fluid Dynamics 3
Introduction
Unsteady one-dimensional heat conduction is governed by the equation
In addition to usual variables we have c, the specific heat of material
(J/kg/K).
Consider the one-dimensional control volume in Figure 8.1. Integration of
equation (8.3) over the control volume and over a time interval from t to
t+Δt gives
This may be written as
T Tc k S
t x x
(8.3)
t t t t t t
t CV t CV t CV
T Tc dVdt k dVdt sdVdt
t x x
(8.4)
e t t t t t t
e ww t t t
T T Tc dt dV kA kA dt S Vdt
t x x
(8.5)
I. Sezai – Eastern Mediterranean University ME555 : Computational Fluid Dynamics 4
The left hand side can be written as
In equation(8.6) superscript ‘o’ refers to temperatures at time t.
Temperatures at time level t+Δt are not superscripted.
Eqn(8.6) could also be obtained by substituting
So, first order (backward) differencing scheme has been used. If we
apply central differencing to rhs of eqn (8.5),
0
t t
P P
CV t
Tc dt dV c T T V
t
(8.6)
0
P PT TT
t t
(8.7)
0
t t t t
P WE PP P e w
PE WPt t
T TT Tc T T V k A k A dt S Vdt
x x
I. Sezai – Eastern Mediterranean University ME555 : Computational Fluid Dynamics 5
To calculate the integrals we have to make an assumption about the variation of TP, TE and TW with time, we could use temperatures
at time t, or
at time t+Δt
or combination of both.
Integral of temperature TP with respect to time can be written as;
Hence
θ = a weighting parameter between zero and one.
0(1 )
t t
T P P P
t
I T dt T T t
(8.8)
0 0
0 1/ 2 1
1
2T P P P PI T t T T t T t
I. Sezai – Eastern Mediterranean University ME555 : Computational Fluid Dynamics 6
Using formula (8.8) for TW and TE in equation (8.7), and
dividing by AΔt throughout, we have
which may be re-arranged to give
(8.9)
(8.10)
0
0 0 0 0
1
e E P w P WP P
PE WP
e E P w P W
PE WP
k T T k T TT Tc x
t x x
k T T k T TS x
x x
0 0
0
1 1
1 1
e w e wP E E W W
PE WP PE WP
e wP
PE WP
k k k kxc T T T T T
t x x x x
k kxc T S x
t x x
I. Sezai – Eastern Mediterranean University ME555 : Computational Fluid Dynamics 7
The source term is linearized as b=Su+SPTP. Now we identify the coefficients of TW and TE as aW and aE and write equation (8.10) in familiar standard form:
where
and
with
For θ = 0 explicit scheme
0 < θ < 1 implicit scheme, for θ = 0.5 Crank-Nicolson scheme
θ = 1 Fully implicit scheme
(8.11)
0
P W E P Pa a a a S
0
P
xa c
t
0(1 )
W E
w eu P P
WP PE
a a b
k kS S T
x x
0 0
0 0
(1 ) (1 )
(1 ) (1 )p P W W E E W W E E
P W E P
a T a T a T a T a T
a a a T b
I. Sezai – Eastern Mediterranean University ME555 : Computational Fluid Dynamics 8
8.2.1 Explicit scheme
In the explicit scheme the source term is linearized as b=Su+SpTp0.
Now the substitution of θ = 0 into (8.11) gives the explicit discretisation of the unsteady conductive heat transfer equation:
where
and
The right hand side of eqn (8.12) only contains values at the old time step so the left hand side can be calculated by forward marching in time. The scheme is based on backward differencing, and is of first order accurate.
(8.12) 0 0 0 0
P P W W E E P W E P P ua T a T a T a a a S T S
0
P Pa a
0
P
xa c
t
W E
w e
WP PE
a a
k k
x x
I. Sezai – Eastern Mediterranean University ME555 : Computational Fluid Dynamics 9
All coefficients should be positive aP0- aW - aE >0
or if k = const. and δxPE= δxWP=Δx, this condition can
be written as
Or
This inequality sets a stringent maximum limit to the
time step size and represents a serious limitation for
the explicit scheme.
Not recommended for the explicit scheme problems.
2x kc
t x
(8.13a)
(8.13b)
2
2
xt c
k
I. Sezai – Eastern Mediterranean University ME555 : Computational Fluid Dynamics 10
8.2.2 Crank – Nicolson scheme
The Crank – Nicolson method results from setting θ = ½ in eqn.
(8.11). Now the discretised unsteady heat conduction equation is
where
and
01 1
2 2P W E P Pa a a a S
0
P
xa c
t
01
2
W E
w eu P P
WP PE
a a b
k kS S T
x x
(8.14) 0 0 0 01 1 1 1
2 2 2 2 2 2
W Ep P W W E E W W E E P P
a aa T a T a T a T a T a T b
I. Sezai – Eastern Mediterranean University ME555 : Computational Fluid Dynamics 11
Schemes with ½ ≤ θ ≤ 1 are unconditionally stable for all values of time step Δt.
However, for physically realistic results all coefficients should be positive. Then, coefficients of TP
0 should be positive, or
which leads to
This time step limitation is only slightly less restrictive than (8.13) associated with the explicit method
The method is based on central differencing Second order accurate in time
Is more accurate than explicit method
2xt c
k
0
2
W EP
a aa
(8.15)
I. Sezai – Eastern Mediterranean University ME555 : Computational Fluid Dynamics 12
The fully implicit scheme When θ =1 we obtain the fully implicit scheme. The source term is linearized as b=Su+SPTP. The discretised equation is
where
and
with
Both sides of the equation contains temperatures at the new time step, and a system of algebraic equations must be solved at each time level
is unconditionally stable for any Δt
is only first order accurate in time
small time steps are needed to ensure accuracy of results
0 0
p P W W E E P P ua T a T a T a T S
0
P P W E Pa a a a S
0
P
xa c
t
W E
w e
WP PE
a a
k k
x x
(8.16)
I. Sezai – Eastern Mediterranean University ME555 : Computational Fluid Dynamics 13
8.3 Illustrative examples Example 8.1
A thin plate is initially at a uniform temperature of 200 ºC. At a certain time t=0 the temperature of the east side of the plate is suddenly reduced to 0ºC. The other surface is insulated. Use the explicit finite volume method in conjunction with a suitable time step size to calculate the transient temperature distribution of the slab and compare it with the analytical solution at time (i) t = 40s, (ii) t = 80s and (iii) t = 120s. Recalculate the numerical solution using a time step size equal to the limit given by (8.13) for t = 40s and compare the results with the analytical solution. The data are: plate thickness L=2cm, thermal conductivity k = 10 W/m/K and ρc = 10 × 106 J/m3/K.
Solution: the one–dimensional transient heat conduction eqn is
The initial and boundary conditions:
T Tc k S
t x x
(8.17)
200 at 0
0 at 0, 0
0 at , 0
T t
Tx t
t
T x L t
I. Sezai – Eastern Mediterranean University ME555 : Computational Fluid Dynamics 14
The analytical solution is given in Ozisik (1985) as
The numerical solution with the explicit method is generated
by dividing the domain width L into five equal control
volumes with Δx = 0.004m. The resulting one-dimensional
grid is shown in Figure 8.2.
1
2
1
( , ) 4 ( 1)exp cos
200 2 1
(2 1)where and /
2
n
n n
n
n
T x tt x
n
nk c
L
(8.18)
I. Sezai – Eastern Mediterranean University ME555 : Computational Fluid Dynamics 15
The time step for the explicit method is subject to the condition that
2
26
2
10 10 0.004
2 10
8
c xt
k
t
t s
I. Sezai – Eastern Mediterranean University ME555 : Computational Fluid Dynamics 16
I. Sezai – Eastern Mediterranean University ME555 : Computational Fluid Dynamics 17
I. Sezai – Eastern Mediterranean University ME555 : Computational Fluid Dynamics 18
Example 8.2 solve the problem of Example 8.1
again, using the fully implicit method and compare
the explicit and implicit method solutions for a time
step of 8 s.
I. Sezai – Eastern Mediterranean University ME555 : Computational Fluid Dynamics 19
I. Sezai – Eastern Mediterranean University ME555 : Computational Fluid Dynamics 20
I. Sezai – Eastern Mediterranean University ME555 : Computational Fluid Dynamics 21
8.4 Implicit Method for Two-and Three- dimensional Problems
Transient diffusion equation in three-dimensions is governed by
A three dimensional control volume is considered for the
discretisation. The resulting equation is
where
S = (Su + SPP) is the linearized source
c k k k St x x y y z z
(8.27)
0 0
P P W W E E S S N N B B T T
P P u
a a a a a a a
a S
(8.28)
0
P W E S N B T P Pa a a a a a a a S
0
P
Va c
t
I. Sezai – Eastern Mediterranean University ME555 : Computational Fluid Dynamics 22
A summary of the relevant neighbour coefficients is given below
The following values for the volume and cell face areas apply in three
cases:
1
2
3
W E S N B T
w w e e
WP PE
w w e e s s n n
WP PE SP PN
w w e e s s n n b b t t
WP PE SP PN BP PT
a a a a a a
A AD
x x
A A A AD
x x y y
A A A A A AD
x x y y z z
1 2 3
1w e
n s
b t
D D D
V x x y x y z
A A y y z
A A x x z
A A x y
I. Sezai – Eastern Mediterranean University ME555 : Computational Fluid Dynamics 23
8.5 Discretisation of transient convection-diffusion equation
The unsteady transport of a property is given by
Here, we quote the implicit/hybrid difference form of the
transient convection-diffusion equations.
Transient three-dimensional convection-diffusion of a general
property in a velocity field u is governed by
( ) ( ) ( )div div grad St
u (8.29)
u v w
t x y z
Sx x y y z z
(8.30)
I. Sezai – Eastern Mediterranean University ME555 : Computational Fluid Dynamics 24
The discretised equation at location P with degree of implicitness θ is
0 0 0 0
0
(1 ) (1 ) (1 ) (1 )
(1 ) (1 ) (1 ) (1 )
p P W W E E S S N N W W E E S S N N
W E S N P
a a a a a a a a a
a a a a S
0
0
(1 ) ,
, (transient terms), = + (body forces per unit volume in the differential equation)
max , 0 ,
body trans dc pres body
C P P P
trans o o o body body bodyP PP P P C P P
eE e
e
S s V S S S s
VS a a s s s
t
ya F
x
max , 0 , max , 0 , max , 0
( ) ,
,
[( ) / ] ( ) for x-momentum eq
w n sW w N n S s
w n s
bodyP PP E W N S P
e w n s
e w e w
pres
y x xa F a F a F
x y y
Va a a a a s x y F
t
F F F F F
pV p p x V p p y
xS
uation
[( ) / ] ( ) for y-momentum equation
max , 0 max , 0
n s n s
dc
e e P e e E
pV p p y V p p x
y
S F F
max , 0 max , 0
max , 0 max , 0
max , 0 max , 0
, , , , ( , , , are found by MIM method)
, , ,
w w P w w W
n n P n n N
s s P s s S
e w n s e w n se w n s
e w n
F F
F F
F F
F u y F u y F v x F v x u u v v
= face values found from a high order (higher than 1st order) convection scheme such as QUICK or CDs
I. Sezai – Eastern Mediterranean University ME555 : Computational Fluid Dynamics 25
8.6 Worked example of transient convection-diffusion using QUICK differencing
Example 8.3 consider convection and diffusion in the one-dimensional domain sketched in Figure 8.7. Calculate the transient temperature field if the initial temperature is zero everywhere and the boundary conditions are =0 at x=0 and ∂ /∂x=0 at x=L. the data are L=1.5m, u=2m/s, ρ=1.0kg/m3 and Γ=0.03kg/m/s.
the source distribution defined by Figure 8.8 applies at times t>0 with a=-200, b=100, x1= 0.6m, x2= 0.2m. Write a computer program to calculate the transient temperature distribution until it reaches a steady state using the implicit method for time integration and the Hayase et al variant of the QUICK scheme for the convective and diffusive terms and compare this result with the analytical steady state solution
I. Sezai – Eastern Mediterranean University ME555 : Computational Fluid Dynamics 26
Solution convection-diffusion of a property subjected to a distributed source term is governed by
We use a 45 point grid to subdivide the domain and perform all calculations with a computer program. It is convenient to use the Hayase et al formulation of QUICK (see section 5.9.3)since it gives a tri-diagonal system of equations which can be solved iteratively with the TDMA (see section 7.2).
uS
t x x x
(8.32)
I. Sezai – Eastern Mediterranean University ME555 : Computational Fluid Dynamics 27
The velocity is u=2.0m/s and the cell width is Δx=0.0333 so F=ρu=2.0 and D=Γ/δx=0.9 everywhere. The Hayase et al formulation gives φ at cell faces by means of the following formulae:
13 2
81
3 28
e P E P W
w W P W WW
(8.33)
(8.34)
(8.35)
I. Sezai – Eastern Mediterranean University ME555 : Computational Fluid Dynamics 28
A time step Δt = 0.01 is selected, which is well within stability limit for explicit schemes
Start with an initial field of P0 =0 at all nodes.
Solve iteratively for values until a converged solution is obtained
Set P0 P and proceed to the next time level
To monitor whether steady state reached:
if P – P0 < ε steady state . (ε may be 10-9)
I. Sezai – Eastern Mediterranean University ME555 : Computational Fluid Dynamics 29
The Analytical Solution
Under the given boundary conditions the solution to the problem is as
follows:
with
and
and
(8.41) 01 2 2
2
2
1
( ) 1
sin cos
Px
n
n
ax C C e Px
P
L n x n n x na P P
L L L Ln
2
202 2
1
; cosn
PLPLn
au a nP C n P
e LP e
2
201 2 2
1
n
n
a nC C a P
LP
1 2 1 1
0
1 2 1 21 1
2 2
2 2
2
2cos cosn
x x ax b bxa
L
a x x b n x xn x ax bLa a
n x L x L
I. Sezai – Eastern Mediterranean University ME555 : Computational Fluid Dynamics 30
The analytical and numerical steady state solutions are compared
in Figure 8.9. as can be seen the use of the QUICK scheme and a
fine grid for spatial discretisation ensure near-perfect agreement
I. Sezai – Eastern Mediterranean University ME555 : Computational Fluid Dynamics 31
8.7 Solution procedures for unsteady flow calculations
8.7.1 Transient SIMPLE
The continuity equation in a transient two-dimensional flow is given by
The integrated form of this eqn over a two-dimensional scalar CV is
The equivalent of pressure correction equation (5.32) for a two-dimensional transient flow will take the form
(8.42)
(8.43)
(8.44)
0
u v
t x y
0
0P P
e w n sV uA uA uA uA
t
P P W W E E S S N Na p a p a p a p a p b
* * * *
( ) ( ) ( ) ( )
( )
E e W w N n S s
P w e s n
o
P P
w e s n
a Ad a Ad a Ad a Ad
a a a a a
Vb u A u A v A v A
t
I. Sezai – Eastern Mediterranean University ME555 : Computational Fluid Dynamics 32
A higher order differencing scheme may also be used for time
derivative
A second order accurate scheme with respect to time is
Tn and Tn-1 are known from previous time steps they are
treated as source terms and are placed on the rhs of the
equation.
1 113 4
2
n n nTT T T
t t
(8.45)
I. Sezai – Eastern Mediterranean University ME555 : Computational Fluid Dynamics 33
I. Sezai – Eastern Mediterranean University ME555 : Computational Fluid Dynamics 34
8.8 Steady state calculations using the pseudo-transient
approach
It was mentioned in chapter 6 that under-relaxation is
necessary to stabilize the iterative process of obtaining
steady state solutions. The under-relaxed form of the two-
dimensional u-momentum equation, for example, takes the
form
Compare this with the transient (implicit) u-momentum
equation
(8.46)
(8.47)
, , ( 1)
, 1, , , , ,1i J i J n
i J nb nb I J I J i J i J u i J
u u
a au a u p p A b u
0 0
, , 0
, , 1, , , , ,
i J i J
i J i J nb nb I J I J i J i J i J
V Va u a u p p A b u
t t
I. Sezai – Eastern Mediterranean University ME555 : Computational Fluid Dynamics 35
In equation (8.46) the superscript n-1 indicates the previous
iteration and in equation(8.47) superscript 0 represents the
previous time level. We immediately note a clear analogy
between transient calculations and under-relaxation in
steady state calculations. It can be easily deduced that
This formula shows that it is possible to achieve the effects
of under-relaxed iterative steady state calculations from a
given initial field by means of a pseudo-transient
computation starting from the same initial field by taking a
step size that satisfies (8.48).
(8.48) 0
, ,1
i J i J
u
u
a V
t