methods for unsteady problem
DESCRIPTION
methods for unsteady problemTRANSCRIPT
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
DR. AJMAL SHAH, PIEAS
CH-06: METHODS FOR UNSTEADY PROBLEMS
2
Method involving the values of unknown at only two timesExplicit or forward Euler methodImplicit or backward Euler methodMidpoint ruleTrapezoid ruleRichardson extrapolation
Two-Level Methods
Predictor-Corrector and Multipoint MethodsThe predictor-corrector methodRunge-Kutta methodsAdams-Bashforth methodsAdams-Moulton methodsLeapfrog methodCrank-Nicolson method
DR. AJMAL SHAH, PIEAS
METHODS FOR INITIAL VALUE PROBLEMS IN ODES
3
)}(,{)( ttfdttd
Consider the first order ordinary differential equation with an initial condition:
ttt
tttttt
nn
o
1
12
1
.......
We have to find the solution ϕ a short time Δt after the initial point at to
11
)}(,{1n
n
n
n
t
t
nnt
t
dtttfdtdtd
oot )(
n
.......
2
1
DR. 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
DR. AJMAL SHAH, PIEAS
TWO-LEVEL METHODSttf n
nnn ),(1 method)Euler forwardor Explicit (
ttf nn
nn
),( 11
1 method)Euler backwardor Implicit (
ttfn
n
nn
),( 21
21
1 rule)Midpoint (
ttftf nn
nn
nn
)],(),([21 1
11
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 (2nd 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
DR. AJMAL SHAH, PIEAS
PREDICTOR-CORRECTOR METHOD
Corrector)(;)],(),([21
Predictor)(;),(
1*
11
1*
ttftf
ttf
nnn
nnn
nn
nn
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
21*
21
1
21*
nn
nn
nn
nn
tft
tft
DR. 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
21*
212
1**
21*
nn
nn
nn
nn
tft
tft
DR. AJMAL SHAH, PIEAS
RUNGE-KUTTA METHODS
8
corrector) rule sSimpson'()];,(),(2
),(2),([6
predictor) ruleMidpoint ();,(.
corrector)Euler Implicit ();,(2
predictor)Euler Explicit ();,(2
1*
121**
21
21*
21
1
21**
211
*
21*
212
1**
21*
nnnn
nn
nn
nn
nn
nn
nn
nn
nn
nn
tftf
tftft
tft
tft
tft
DR. AJMAL SHAH, PIEAS
RUNGE-KUTTA METHODS
9
qgraddivudivt
)()()(
11
)}(,{1n
n
n
n
t
t
nnt
t
dtttfdtdtd
)}(,{2
2
ttfxx
ut
DR. AJMAL SHAH, PIEAS
APPLICATION TO THE GENERIC TRANSPORT EQUATION
)}(,{)( ttfdttd
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
xtuc
xtd
Where
cdcdd
txx
u
ni
ni
ni
ni
ni
ni
ni
ni
nin
ini
;)(
,
)2
()2
()21(
)])(
2()2
([
2
111
211111
method)Euler forwardor Explicit (;),(
)}(,{
1
111
ttf
dtttfdtdtd
nn
nn
t
t
nnt
t
n
n
n
n
DR. AJMAL SHAH, PIEAS
EXPLICIT EULER METHOD
)}(,{2
2
ttfxx
ut
11
xtuc
xtd
;
)( 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
ni
ni
ni
ni
cdcdd 111 )
2()
2()21(
DR. AJMAL SHAH, PIEAS
EXPLICIT EULER METHOD
12
xtuc
xtd
;
)( 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
ni
ni
ni
ni
cdcdd 111 )
2()
2()21(
DR. AJMAL SHAH, PIEAS
EXPLICIT EULER METHOD
13
The above Eqt. gives ϕ after a short time Δt
ni
ni
ni
ni
cdcdd 111 )
2()
2()21(
DR. AJMAL SHAH, PIEAS
EXPLICIT EULER METHOD
nn A 1
This equation gives the solution at the new time step in terms of the solution at the previous time step
14
ni
ni
ni
ni
ni
ni
ni
ni
nin
ini
cddcd
txx
u
11
11
1
2
111
11
11
111
)2
()2
()21(
)])(
2()2
([
11
)}(,{1n
n
n
n
t
t
nnt
t
dtttfdtdtd
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
DR. AJMAL SHAH, PIEAS
IMPLICIT EULER METHOD
15
niPWEP
WE
PniW
niE
niP
tQ
tAAA
xxuA
xxuA
WhereQAAA
;)(
)(2;
)(2
,
22
11
11
1
The only difference lies in an additional contribution to the coefficient AP and to the source term QP
The above equation may be written as;
DR. AJMAL SHAH, PIEAS
IMPLICIT EULER METHOD
16
So far we deal with generic conservation equationThe 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
DR. AJMAL SHAH, PIEAS
CH-07: SOLUTION OF THE NAVIER-STOKES EQUATIONS
iij
ij
j
iji gxp
xxuu
tu
)()(
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
DR. AJMAL SHAH, PIEAS
SOLUTION OF THE NAVIER-STOKES EQUATIONS
iij
ij
j
iji gxp
xxuu
tu
)()(
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
ij
xuu
)(
The convective term in the momentum equation is non-linear; its differential and integral forms are:
iij
ij
j
iji gxp
xxuu
tu
)()(
DR. AJMAL SHAH, PIEAS
DISCRETIZATION OF CONVECTIVE AND VISCOUS TERMS
S
i ndSvu .
19
j
ij
x
The viscous terms in the momentum equations correspond to the diffusive term in the generic equation
Their differential and integral forms are:
iij
ij
j
iji gxp
xxuu
tu
)()(
DR. AJMAL SHAH, PIEAS
DISCRETIZATION OF CONVECTIVE AND VISCOUS TERMS
S
jij ndSi ).(
20
)(j
i
j xu
x
For Newtonian incompressible flows the viscous stresses become;
)(i
j
j
iij x
uxu
This term can be discretized using any of the approaches described previously for generic equation
DR. 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 ndSgradu ).(
21
But it is only one contribution of viscous effects to the ith 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
DR. AJMAL SHAH, PIEAS
DISCRETIZATION OF CONVECTIVE AND VISCOUS TERMS
)(j
i
j xu
x
)(
i
j
j
iij x
uxu
S
i ndSgradu ).(
)(i
j
j xu
x
Sj
i
j ndSixu
).(
22
In FV methods, the pressure term is usually treated as a surface force (conservative approach), i.e. in the equation for ui the following integral is used
iij
ij
j
iji gxp
xxuu
tu
)()(
S
i ndSpi .
Alternatively, the pressure can be treated non-conservatively, by retaining the above integral in its volumetric form:
digradp i.
DR. AJMAL SHAH, PIEAS
DISCRETIZATION OF CONVECTIVE AND VISCOUS TERMS
digradp 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
DR. 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 importantIn compressible flows the continuity equation is used to
calculate densityPressure is calculated from equation of state
DR. AJMAL SHAH, PIEAS
CALCULATION OF THE PRESSURE
iij
ij
j
iji gxp
xxuu
tu
)()(
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
i
nni
ni
ni x
pHtuu )()( 1
DR. AJMAL SHAH, PIEAS
A SIMPLE EXPLICIT TIME ADVANCE SCHEME
ii
j
ij
ij
iji
xpH
xxp
xuu
tu
)()(
iij
ij
j
iji gxp
xxuu
tu
)()(
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 continuityTo find such pressure gradient, let us take the gradient
of the above equation
i
nni
ni
ni x
pHtuu )()( 1
DR. AJMAL SHAH, PIEAS
A SIMPLE EXPLICIT TIME ADVANCE SCHEME
i
nni
ii
ni
i
ni
xpH
xt
xu
xu )()( 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 pn+1, instead of pn
DR. AJMAL SHAH, PIEAS
A SIMPLE EXPLICIT TIME ADVANCE SCHEME
i
ni
i
n
i xH
xp
x
0)( 1
i
ni
xu 0)(
i
ni
xu
28
This provides the following algorithm for time-advancing the Navier-Stokes equationsi. Start with a velocity field ui
n at time tn which is assumed divergence free (if it is not divergence free this can be corrected)
ii. Compute the combination, Hin , of the advective
and viscous terms and its divergenceiii. Solve the Poisson equation for the pressure pn
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
DR. 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.
PPPP *
DR. AJMAL SHAH, PIEAS
THE SIMPLE ALGORITHM