Вы находитесь на странице: 1из 29

1

In computing unsteady flows, we have a fourth


coordinate direction to consider: time
Just as with the space coordinates, time must be
discretized
Essentially all unsteady solution methods advance
in time in a step-by-step or marching manner
These methods are very similar to ones applied to
initial value problems for ordinary differential
equations (ODEs)
A brief review of such methods is given here
D
R
. AJMAL SHAH, PIEAS
CH-06: METHODS FOR UNSTEADY PROBLEMS
2
Method involving the values of unknown at only two times
Explicit or forward Euler method
Implicit or backward Euler method
Midpoint rule
Trapezoid rule
Richardson extrapolation
Two-Level Methods
Predictor-Corrector and Multipoint Methods
The predictor-corrector method
Runge-Kutta methods
Adams-Bashforth methods
Adams-Moulton methods
Leapfrog method
Crank-Nicolson method
D
R
. AJMAL SHAH, PIEAS
METHODS FOR INITIAL VALUE PROBLEMS IN ODES
3
)} ( , {
) (
t t f
dt
t d
|
|
=
Consider the first order ordinary differential equation
with an initial condition:
t t t
t t t
t t t
n n
o
A + =
A + =
A + =
1
1 2
1
.......
We have to find the solution a short time t after
the initial point at t
o
} }
+ +
= =
+
1 1
)} ( , {
1
n
n
n
n
t
t
n n
t
t
dt t t f dt
dt
d
| | |
|
o
o
t | | = ) (
n
|
|
|
.......
2
1
D
R
. AJMAL SHAH, PIEAS
TWO-LEVEL METHODS
4
rule) Trapezoid (
Midpoint rule provides the basis for Leapfrog
method and
Trapezoid rule provide the basis for Crank-
Nicolson method
D
R
. AJMAL SHAH, PIEAS
TWO-LEVEL METHODS
t t f
n
n
n n
A + =
+
) , (
1
| | |
method) Euler forward or Explicit (
t t f
n
n
n n
A + =
+
+
+
) , (
1
1
1
| | |
method) Euler backward or Implicit (
t t f
n
n
n n
A + =
+
+
+
) , (
2
1
2
1
1
| | |
rule) Midpoint (
t t f t f
n
n
n
n
n n
A + + =
+
+
+
)] , ( ) , ( [
2
1
1
1
1
| | | |
5
There is a wide variety of predictor-corrector
methods available
One, which is so well-known that it is called the
predictor-corrector method (2
nd
order accurate)
In this method, the solution at the new time step
is predicted using the explicit Euler method
The solution is then corrected by applying the
trapezoid rule
D
R
. AJMAL SHAH, PIEAS
PREDICTOR-CORRECTOR METHOD
Corrector) ( ; )] , ( ) , ( [
2
1
Predictor) ( ; ) , (
1
*
1
1
1
*
t t f t f
t t f
n
n
n
n
n n
n
n
n
n
A + + =
A + =
+
+
+
+
| | | |
| | |
6
The second order Runge-Kutta method consists of
two steps
The first may be regarded as a half-step predictor
based on the explicit Euler method
It is followed by a midpoint rule corrector which
makes the method second order
Corrector) ( ); , ( .
Predictor) ( ); , (
2
2
1
*
2
1
1
2
1
*
+
+
+
+
A + =
A
+ =
n
n
n n
n
n
n
n
t f t
t f
t
| | |
| | |
D
R
. AJMAL SHAH, PIEAS
RUNGE-KUTTA METHODS
7
Runge-Kutta methods of higher order (fourth
order) have been developed
The first two steps of this method use an explicit
Euler predictor and an implicit Euler corrector
This is followed by a midpoint rule predictor for
the full step and a Simpson's rule final corrector
corrector) Euler Implicit ( ); , (
2
predictor) Euler Explicit ( ); , (
2
2
1
*
2
1
2
1
* *
2
1
*
+
+
+
+
A
+ =
A
+ =
n
n
n
n
n
n
n
n
t f
t
t f
t
| | |
| | |
D
R
. AJMAL SHAH, PIEAS
RUNGE-KUTTA METHODS
8
corrector) rule s Simpson' ( )]; , ( ) , ( 2
) , ( 2 ) , ( [
6
predictor) rule Midpoint ( ); , ( .
corrector) Euler Implicit ( ); , (
2
predictor) Euler Explicit ( ); , (
2
1
*
1
2
1
* *
2
1
2
1
*
2
1
1
2
1
* *
2
1
1
*
2
1
*
2
1
2
1
* *
2
1
*
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
A
+ =
A + =
A
+ =
A
+ =
n
n
n
n
n
n
n
n
n n
n
n
n
n
n
n
n
n
n
n
n
n
t f t f
t f t f
t
t f t
t f
t
t f
t
| |
| | | |
| | |
| | |
| | |
D
R
. AJMAL SHAH, PIEAS
RUNGE-KUTTA METHODS
9
|
| |
|
q grad div u div
t
+ I + =
c
c
) ( ) (
) (
} }
+ +
= =
+
1 1
)} ( , {
1
n
n
n
n
t
t
n n
t
t
dt t t f dt
dt
d
| | |
|
)} ( , {
2
2
t t f
x x
u
t
|
|

| |
=
c
c I
+
c
c
=
c
c
D
R
. AJMAL SHAH, PIEAS
APPLICATION TO THE GENERIC TRANSPORT EQUATION
)} ( , {
) (
t t f
dt
t d
|
|
=
In order to study properties of the explicit Euler and other
simple schemes, we consider the 1D case of above Eq.
with constant velocity, constant fluid properties, and no
source terms
10
x
t u
c
x
t
d
Where
c
d
c
d d
t
x x
u
n
i
n
i
n
i
n
i
n
i
n
i
n
i
n
i
n
i
n
i
n
i
A
A
=
A
IA
=
+ + + =
A
A
+ I
+
A

+ =
+
+
+ +
+
;
) (
,
)
2
( )
2
( ) 2 1 (
)]
) (
2
( )
2
( [
2
1 1
1
2
1 1 1 1
1

| | | |
| | |

| |
| |
method) Euler forward or Explicit ( ; ) , (
)} ( , {
1
1
1 1
t t f
dt t t f dt
dt
d
n
n
n n
t
t
n n
t
t
n
n
n
n
A + =
= =
+
+
} }
+ +
| | |
| | |
|
D
R
. AJMAL SHAH, PIEAS
EXPLICIT EULER METHOD
)} ( , {
2
2
t t f
x x
u
t
|
|

| |
=
c
c I
+
c
c
=
c
c
11
x
t u
c
x
t
d
A
A
=
A
IA
= ;
) (
2

The parameter d is the ratio of time step to the


characteristic diffusion time
Which is roughly the time required for a
disturbance to be transmitted by diffusion over a
distance x
n
i
n
i
n
i
n
i
c
d
c
d d
1 1
1
)
2
( )
2
( ) 2 1 (
+
+
+ + + = | | | |
D
R
. AJMAL SHAH, PIEAS
EXPLICIT EULER METHOD
12
x
t u
c
x
t
d
A
A
=
A
IA
= ;
) (
2

The second quantity c is the ratio of time step to


the characteristic convection time, x/u,
The time required for a disturbance to be
convected through a distance x
This ratio is called Courant number and is one of
the key parameters in computational fluid dynamics
n
i
n
i
n
i
n
i
c
d
c
d d
1 1
1
)
2
( )
2
( ) 2 1 (
+
+
+ + + = | | | |
D
R
. AJMAL SHAH, PIEAS
EXPLICIT EULER METHOD
13
The above Eqt. gives after a short time t
n
i
n
i
n
i
n
i
c
d
c
d d
1 1
1
)
2
( )
2
( ) 2 1 (
+
+
+ + + = | | | |
D
R
. AJMAL SHAH, PIEAS
EXPLICIT EULER METHOD
n n
A| | =
+1
This equation gives the solution at the new time step
in terms of the solution at the previous time step
14
n
i
n
i
n
i
n
i
n
i
n
i
n
i
n
i
n
i
n
i
n
i
c
d d
c
d
t
x x
u
| | | |
| | |

| |
| |
= + + +
A
A
+ I
+
A

+ =
+

+
+
+
+ +

+
+
+

+
+
+
1
1
1
1
1
2
1 1
1
1
1
1
1
1
1
1
)
2
( )
2
( ) 2 1 (
)]
) (
2
( )
2
( [
} }
+ +
= =
+
1 1
)} ( , {
1
n
n
n
n
t
t
n n
t
t
dt t t f dt
dt
d
| | |
|
In this method, all of the fluxes and source terms are
evaluated in terms of the unknown variable values
at the new time level
The result is a system of algebraic equations very
similar to the one obtained for steady problems
D
R
. AJMAL SHAH, PIEAS
IMPLICIT EULER METHOD
15
n
i P W E P
W E
P
n
i W
n
i E
n
i P
t
Q
t
A A A
x x
u
A
x x
u
A
Where
Q A A A
|


| | |
A
=
A
+ + =
A
I

A
=
A
I

A
=
= + +
+

+
+
+
; ) (
) ( 2
;
) ( 2
,
2 2
1
1
1
1
1
The only difference lies in an additional contribution
to the coefficient A
P
and to the source term Q
P

The above equation may be written as;
D
R
. AJMAL SHAH, PIEAS
IMPLICIT EULER METHOD
16
So far we deal with generic conservation equation
The discretization principles described there also
apply to the similar terms in the Navier-Stokes
equations
We shall now describe the treatment of the terms
in the momentum equations which differ from
those in the generic conservation equation
The unsteady and advection (convection) terms in
the momentum equations have the same form as
in the generic conservation equation
D
R
. AJMAL SHAH, PIEAS
CH-07: SOLUTION OF THE NAVIER-STOKES EQUATIONS



i
i j
ij
j
i j
i
g
x
p
x x
u u
t
u

+
c
c

c
c
=
c
c
+
c
c
) (
) (
17
The diffusive (viscous) terms are similar to their
counterparts in the generic equation but, because the
momentum equations are vector equations, these
contributions become a bit more complex
The momentum equations also contain a contribution
from the pressure, which has no analog in the generic
equation
It may be regarded either as a source term or as a
surface force
But, due to the close connection of the pressure and the
continuity equation, it requires special attention
D
R
. AJMAL SHAH, PIEAS
SOLUTION OF THE NAVIER-STOKES EQUATIONS



i
i j
ij
j
i j
i
g
x
p
x x
u u
t
u

+
c
c

c
c
=
c
c
+
c
c
) (
) (
18
The treatment of the convective term in the
momentum equations follows that of the
convective term in the generic equation
Any of the previous methods (Ch:04) can be used
j
i j
x
u u
c
c ) (
The convective term in the momentum equation is
non-linear; its differential and integral forms are:
i
i j
ij
j
i j
i
g
x
p
x x
u u
t
u

+
c
c

c
c
=
c
c
+
c
c
) (
) (
D
R
. AJMAL SHAH, PIEAS
DISCRETIZATION OF CONVECTIVE AND VISCOUS
TERMS

}
S
i
ndS v u .
19
j
ij
x c
ct
The viscous terms in the momentum equations
correspond to the diffusive term in the generic
equation
Their differential and integral forms are:
i
i j
ij
j
i j
i
g
x
p
x x
u u
t
u

+
c
c

c
c
=
c
c
+
c
c
) (
) (
D
R
. AJMAL SHAH, PIEAS
DISCRETIZATION OF CONVECTIVE AND VISCOUS
TERMS

}
S
j ij
ndS i ). (t
20
) (
j
i
j
x
u
x c
c
c
c

For Newtonian incompressible flows the viscous
stresses become;
) (
i
j
j
i
ij
x
u
x
u
c
c
+
c
c
= t
This term can be discretized using any of the
approaches described previously for generic equation
D
R
. AJMAL SHAH, PIEAS
DISCRETIZATION OF CONVECTIVE AND VISCOUS
TERMS
The viscous term is complicated than the generic
diffusive term
The part of the viscous term in the momentum
equations (Vector) which corresponds to the diffusive
term in the generic conservation equation is
}
S
i
ndS gradu ). (
21
But it is only one contribution of viscous effects to the
i
th
component of momentum
The contributions due to the bulk viscosity are non-
zero only in compressible flows
) The contributions due to the spatial variability of the
viscosity are zero for incompressible flows with
constant properties
D
R
. AJMAL SHAH, PIEAS
DISCRETIZATION OF CONVECTIVE AND VISCOUS
TERMS
) (
j
i
j
x
u
x c
c
c
c

) (
i
j
j
i
ij
x
u
x
u
c
c
+
c
c
= t
}
S
i
ndS gradu ). (
) (
i
j
j
x
u
x c
c
c
c

}
c
c
S
j
i
j
ndS i
x
u
). (
22
In FV methods, the pressure term is usually treated as a
surface force (conservative approach), i.e. in the
equation for u
i
the following integral is used
i
i j
ij
j
i j
i
g
x
p
x x
u u
t
u

+
c
c

c
c
=
c
c
+
c
c
) (
) (
}

S
i
ndS pi .
Alternatively, the pressure can be treated non-
conservatively, by retaining the above integral in its
volumetric form:
}
O
O d i gradp
i
.
D
R
. AJMAL SHAH, PIEAS
DISCRETIZATION OF CONVECTIVE AND VISCOUS
TERMS
}
O
O d i gradp
i
.
23
Solution of the Navier-Stokes equations is
complicated due to unavailability of independent
pressure equation
But, pressure gradient contributes to each of the
three momentum equations
On the other hand, the continuity equation does
not have a dominant variable in incompressible
flows
Mass conservation is a kinematic constraint on
the velocity field rather than a dynamic equation
D
R
. AJMAL SHAH, PIEAS
CALCULATION OF THE PRESSURE
24
One way out of this difficulty is to construct pressure
field based on satisfying the continuity equation
The absolute pressure is of no significance in an
incompressible flow
Only the gradient of the pressure is important
In compressible flows the continuity equation is used to
calculate density
Pressure is calculated from equation of state
D
R
. AJMAL SHAH, PIEAS
CALCULATION OF THE PRESSURE
i
i j
ij
j
i j
i
g
x
p
x x
u u
t
u

+
c
c

c
c
=
c
c
+
c
c
) (
) (
25
The above equation can be written as given below, the
spatial derivatives are not important here so we have
lumped them in to a single term H



Now apply the explicit Euler method
|
|
.
|

\
|
c
c
A =
+
i
n
n
i
n
i
n
i
x
p
H t u u ) ( ) (
1

D
R
. AJMAL SHAH, PIEAS
A SIMPLE EXPLICIT TIME ADVANCE SCHEME
i
i
j
ij
i j
i j
i
x
p
H
x x
p
x
u u
t
u
c
c
=
c
c
+
c
c

c
c
=
c
c
t

) (
) (
i
i j
ij
j
i j
i
g
x
p
x x
u u
t
u

+
c
c

c
c
=
c
c
+
c
c
) (
) (
26
The above equation can be used to calculate the
velocity at new time step, but this will need the
pressure gradient
But this pressure gradient must satisfy continuity
To find such pressure gradient, let us take the gradient
of the above equation
|
|
.
|

\
|
c
c
A =
+
i
n
n
i
n
i
n
i
x
p
H t u u ) ( ) (
1

D
R
. AJMAL SHAH, PIEAS
A SIMPLE EXPLICIT TIME ADVANCE SCHEME
|
|
.
|

\
|
|
|
.
|

\
|
c
c

c
c
A =
c
c

c
c
+
i
n
n
i
i i
n
i
i
n
i
x
p
H
x
t
x
u
x
u ) ( ) (
1

27
The above equations must enforce the continuity, and
the equation obtained will be the required pressure
equation (Poisson equation)



The velocity obtained with this pressure will satisfy
continuity
If pressure is treated implicitly, we will have p
n+1
,
instead of p
n

D
R
. AJMAL SHAH, PIEAS
A SIMPLE EXPLICIT TIME ADVANCE SCHEME
i
n
i
i
n
i
x
H
x
p
x c
c
=
|
|
.
|

\
|
c
c
c
c
0
) (
1
=
c
c
+
i
n
i
x
u
0
) (
=
c
c
i
n
i
x
u
28
This provides the following algorithm for time-
advancing the Navier-Stokes equations
i. Start with a velocity field u
i
n
at time t
n
which is
assumed divergence free (if it is not divergence
free this can be corrected)
ii. Compute the combination, H
i
n
, of the advective
and viscous terms and its divergence
iii. Solve the Poisson equation for the pressure p
n
iv. Compute the velocity field at the new time step
(it will be divergence free)
v. The stage is now set for the next time step
D
R
. AJMAL SHAH, PIEAS
A SIMPLE EXPLICIT TIME ADVANCE SCHEME
29
Semi-Implicit Method for Pressure-Linked Equations.
1. Guess the pressure field P*.
2. Solve the u, v and w momentum equations to calculate u*,
v* and w*.
3. Solve the pressure correction equation for
4. Calculate P from;
5. Calculate u, v and w from u*, v* and w* using their
correction formulas.
6. Solve the discretized equations of other s if they
influence the flow field through fluid properties, source
terms etc.
7. Treat the corrected pressure P as a new guessed P*, return
to step 2 and repeat the whole procedure till convergence.
P
'
P P P
'
+ =
*
D
R
. AJMAL SHAH, PIEAS
THE SIMPLE ALGORITHM

Вам также может понравиться