Professional Documents
Culture Documents
u u +a =0 t x
Consider three discretization schemes:
n +1 ui n +1 ui n +1 ui n = ui n = ui n = ui n (ui n ui 1 )
= at/x
n n (ui +1 ui 1 ) / 2 n n (ui +1 ui )
Courant no
u t
f(x, 0.1)
Peak location predicted correctly, but the square pulse has been rounded
Decreasing amplitude with decreasing
leading term in the truncation error, e.g, FTCS ~ O (t, x2 ) non-uniform grids may reduce accuracy by an order cannot be eliminated but can be made as small as one wishes higher order schemes reduce error only on sufficiently fine grids higher accuracy does not mean a better solution; in fact, second and higher order schemes usually lead to unphysical oscillations for the general case, order of accuracy can be obtained by successively refining grid and expressing error as ~ tp, xq in FV method, overall accuracy depends on the approximation of derivatives and on the accuracy of surface and volume integrals
Conservation property: conservation law upheld at global as well as at discrete level desirable to eliminate spurious source terms can be ensured by consistent evaluation of face fluxes so that the total flux leaving a surface of a control volume is equal to the total flux entering through the same surface into the neighbouring cells which have the face as a common boundary consistent and inconsistent evaluation of diffusive flux at face I:
Boundedness: solution remains within physical bounds, e.g., turbulent kinetic energy is always 0 0 mass fraction 0
for steady flows without source terms, interior values should be bound between minimum and maximum occurring on the boundaries, e.g. temperature inside a conducting rod cannot be colder than T at the cold end and it cannot be hotter than T at the hot end, unless there is heat source/ sink inside the rod boundedness can be ensured by having the same sign for all the coefficients in a discretized equation
Consistency: ensures that the discretized equation tends to partial differential equation as x and t tend to zero a consistent scheme means that we are solving the correct equation in the limit of fine grid spacing consistency can be verified by formal Taylor series expansion e.g., FTFS scheme for the linear convection equation:
n +1 n ui ui n n ui +1 ui
+a
n (ut + aux )i
Stability: Error between computed solution and exact solution of the discretized equation should not be amplified as we march forward in time stability guarantees that the scheme produces a bounded solution if the exact solution itself is bounded
Consider
D = exact solution of the discretized eqn N = computed solution using the num scheme = error = D - N in = (x,t ) = (ix, nt) = Din - Nin
Stability Analysis
Stability of a linear equation with constant coefficients is wellunderstood and lends itself to simple analysis if the effect of boundary conditions can be neglected. Under these conditions, von Neumann stability analysis can be used When the effect of boundary conditions has to be taken into account, a matrix method of stability analysis can be used although this is difficult to implement in practice as it requires the evaluation of eigenvalues of large matrices For the general non-linear or non-constant coefficient problem, local stability analysis can be performed on a linearized set of equations Only the von Neumann stability analysis is described here. For other methods, see Hirsch (1988)
Rearranging
[(Din+1 -Din)]/ t + u0[(Din - Di-1n )/x + [( in+1- in)]/ t + u0[(in - i-1n )]/x = 0
Since Din satisfies eqn (1) exactly, error eqn is of the same form:
( in+1 - in ) / t + u0 ( in - i-1n ) / x = 0 (4)
(x,t) = m( bm ejkmx)
km = wave no = m/L, m = 0, 1, 2, ., M bm = amplitude of each wave component
j = (-1)
M = L/x
Since error equation is linear, investigate behaviour of each component and get overall solution by superposition We seek a solution of the form m(x,t) = bm ejkmx = eat ejkmx Write min = eant ejkmix and substitute in error eqn (4) to get
= at / x
For | G | 1, 0 1 Scheme stable if 0 = at / x 1 Courant-Friedrichs-Lewy (CFL) condition FTBS scheme conditionally stable
G Re
FTCS Scheme
FTCS scheme for linear convection equation:
(uin+1 - uin ) / t + u0 (ui+1n - ui-1n ) / 2 x = 0
Error equation
(in+1 - in ) / t + u0 (i+1n - i-1n ) / 2x = 0
Similarly FTFS scheme can be shown to be unconditionally unstable Stability behaviour reflected in the Case Study
FTCS Implicit
FTCS-Implicit scheme for linear convection equation:
(uin+1 - uin ) / t + u0 (ui+1n+1 - ui-1n+1 ) / 2 x = 0
Error equation
(in+1 - in+1 ) / t + u0 (i+1n+1 - i-1n+1 ) / 2x = 0
Amplification factor G - 1 +/2 (ej - e-j ) = 0 or G = 1/ [1 + j sin ] Stability: | G|2 = 1/ [1+ 2 sin2] < 1
FTCS Implicit scheme unconditionally stable
= (+/2) i-1 +
n
Im
G Re
or, in+1
Stable, oscillation-free solution if (2 + ) < 1 Stability analysis becomes more complicated in 2- and 3-d, nonconstant coefficients, non-uniform grids etc.
(1) - (4)
Et = e + V2/2
E = [u u2+p-xx uv-xy (Et+p) -uxx - vxy + qx ]T F = [v uv-xy v2+p-yy (Et+p) -uxy - vyy + qy ]T
a = speed of sound Re = min (u x/, v y/) For nearly incompressible flows, speed of sound (t)CFL0 Even for implicit methods, (t)max ~ 10 (t)CFL Special methods necessary for nearly incompressible flows
Pressure correction method most popular; extension to compressible flow exists but not discussed today (see Ferziger & Peric, 1999)
N P E W P S E W
Discretize x-mom eqn to yield aeue = nb(anbunb) + b + Ae(pP-pE) Discretize y-mom eqn to yield anvn = nb (anbvnb) + b + An(pP-pN) These can be solved if pressure is known (1) (2)
ae(ue - ue*) = nb (anb(unb - unb*) + Ae[(pP-pP*)-(pE-pE*)] or aeue = nb (anbunb) + Ae[(pP- pE)] Ae(pP- pE)
Ae(pP- pE)/ae
and vn
An(pP- pN)/an
(5)
(6)
Substitute ue = ue* + u etc and substitute eqn (5) for u and rearrange to get the pressure correction equation
aPpP = aEpE + aWpW + aNpN + aSpS + b (7)
where
SIMPLE Algorithm
1. 2. 3. 4. 5. 6. 7.
Guess p*, u* and v* Solve disc. x-mom eqn for u* Solve disc. y-mom eqn for v* Solve pressure correction eqn for p Calculate velocity corrections u and v Calculate other scalars, e.g., T, k .. Update p, u and v and return to 1 if not converged
Has proved very popular since first proposed by Patankar & Spalding (1968) Number of variants exist to improve convergence rate: SIMPLEC, SIMPLER, SIMPLEST, PISO Adapted for collocated grids Adapted for compressible flow Used in many commercial CFD codes