0% found this document useful (0 votes)
76 views95 pages

ACFD-Lecture-4 Part-2

This document discusses several numerical methods for solving partial differential equations (PDEs), including: - The second-order upwind method for solving hyperbolic PDEs, which has predominantly leading or lagging phase errors depending on the flow regime. - The Warming-Kutler-Lomax (WKL) method, a third-order method that uses MacCormack's method for the first two steps and the Rusanov method for the third step. - Runge-Kutta methods, which can be applied to solve PDEs by converting them to "pseudo-ODEs" through time differencing, then spatially differencing the remaining terms. Examples include
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
76 views95 pages

ACFD-Lecture-4 Part-2

This document discusses several numerical methods for solving partial differential equations (PDEs), including: - The second-order upwind method for solving hyperbolic PDEs, which has predominantly leading or lagging phase errors depending on the flow regime. - The Warming-Kutler-Lomax (WKL) method, a third-order method that uses MacCormack's method for the first two steps and the Rusanov method for the third step. - Runge-Kutta methods, which can be applied to solve PDEs by converting them to "pseudo-ODEs" through time differencing, then spatially differencing the remaining terms. Examples include
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 95

Second-Order Upwind method

„ The 2nd order upwind method (Warming & Beam,


1975) is a variation of the MacCormack method, which
uses backward (upwind) differences in both the
predictor and corrector step for c>0:
„ The 2nd upwind method has a predominantly leading
phase error for 0<Q<1 and predominantly lagging phase
error for 1<Q<2.
„ We observe that the 2nd order upwind method and the
Lax-Wendroff method have opposite phase errors for
0<Q<1. This suggests that a considerable reduction in
dispersive error would occur if a linear combination of the
two methods were used.
„ Fromm’s method of zero-average phase error (Fromm,
1968) is based on this observation.
Warming-Kutler-Lomax Method
„ Warming et al. (1973) developed a 3rd order
method that uses MacCormack’s method for the
first two steps and has the same third step as
the Rusanov method.
„ This so-called WKL method is given by
„ This method has the same stability bounds
as the Rusanov method.
„ The modified equation is identical to Eq.
(4.66) for the present linear wave
equation.
„ The WKL method has the same advantage
over the Rusanov method that the
MacCormack method has over the two-
step Lax Wendroff method.
Runge-Kutta Methods
„ Runge-Kutta methods are frequently employed
to solve ODEs.
„ They can also be applied to solve PDEs (Lomax
et al., 1970; Jameson et al., 1981,1983).
„ The first step in using Runge-Kutta
methodology is to convert the PDE into a
“pseudo-ODE.”
„ This is accomplished by separating out a partial
derivative with respect to a single independent
variable in the marching direction and placing
the remaining partial derivatives into a term
that is a function of the dependent variable.
„ The linear wave equation can be written
as ut=R(u) where R(u)=-cux.
„ This pseudo-ODE is time-continuous
equation, and any integration scheme
applicable to ODEs, including Runge-Kutta
methods, may be used.
„ Once the time differencing is completed,
the partial derivatives contained in R(u)
can be differenced using appropriate
spatial differences.
Euler Method
„ yn+1=yn+hf(xn,yn)
2nd order Runge-Kutta method (improved
Euler’s method, Carnahan et al., 1969)
„ k1=hf(xn,yn)
k2=hf(xn+1/2h,yn+1/2k1)
yn+1=yn+k2+O(h3)
4th order Runge-Kutta method
„ k1=hf(xn,yn)
k2=hf(xn+1/2h,yn+1/2k1)
k3=hf(xn+1/2h,yn+1/2k2)
k4=hf(xn+h,yn+k3)
yn+1=yn+k1/6+k2/3+k3/3+k4/6+O(h5)
Heat Equation: ut=Duxx
„ The 1-D heat equation (diffusion equation) is a
parabolic PDE. It is the governing equation for
heat conduction in a 1-D isotropic medium. It can
be used to “model” in a rudimentary fashion the
parabolic boundary-layer equations.
„ The exact solution of the heat equation for the
initial condition u(x,0)=f(x) and BCs:

¦A e
u(0,t)=u(1,t)=0 is
f
Dk 2 t
u(x, t) sin(kx)

2 ³ f (x)sin(kx)dx, k
n

nS
n 1
1
where A n
0
Simple Explicit Method
„ There is no imaginary part and hence no phase
shift.
„ The exact amplification factor is obtained by
substituting the elemental solution
„ The present simple explicit scheme marches the solution
outward from the initial data line in much the same
manner as the explicit schemes of the previous section.
„ We see that the unknown u can be calculated at point P
without any knowledge of the BCs along AB and CD,
since the parabolic heat equation has the characteristic
t=const.
„ From this we conclude that the present explicit
scheme does not properly model the physical
behavior of the parabolic PDE.
„ It would appear that an implicit method would
be the more appropriate method for solving a
parabolic PDE, since an implicit method normally
assimilates information from all grid points
located on or below the characteristic t=const.
„ On the other hand, explicit schemes seem to
provide a more natural finite-difference
approximation for hyperbolic PDEs that possess
limited zones of influence.
Simple Implicit (Laasonen) Method
Crank-Nicolson Method
ADI Methods
Splitting or Fractional-Step Methods
„ The ADI methods are closely related and in some cases
identical to the method of fractional steps, which were
developed by Soviet mathematicians at about the same
time as the ADI methods were developed in the United
States.
„ The basic idea of these methods is to split a finite-
difference algorithm into a sequence of 1-D operations.
„ Simple implicit scheme:
ADE Methods
„ Unlike the ADI methods, the alternating-direction explicit (ADE)
methods do not require tridiagonal matrices to be “inverted.”
„ Since the ADE methods can also be used to solve the 1-D heat equation,
we will apply the ADE algorithms to this equation, for simplicity.
Laplace Equation: uxx+uyy=0
„ Laplace’s equation is the model form for elliptic
PDEs.
„ Some of the important practical problems
governed by a single elliptic equation include the
steady-state temperature distribution in a solid
and the incompressible irrotational (potential)
flow of a fluid.
„ The steady incompressible N-S equations are
elliptic but in a coupled and complicated fashion,
since the pressure derivatives as well as velocity
derivatives are sources of elliptic behavior.
„ The elliptic equation arising in many physical
problem is a Poisson equation: uxx+uyy=f(x,y).
Burgers’ Equation (Inviscid)
„ A single equation that could serve as a nonlinear analog of
the fluid mechanics equations would be very useful. This
single equation must have terms that closely duplicate the
physical properties of the fluid equation, i.e., the model
equation should have a convective term, a diffusive or
dissipative term, and a time dependent term. Burgers (1948)
introduced a simple nonlinear equation that meets these
requirements:

„ Equation (4.140) is parabolic when the viscous term is


included. If the viscous term is neglected, the remaining
equation is composed of the unsteady term and a nonlinear
convection term. The resulting hyperbolic equation

may be viewed as a simple analog of the Euler equations


for the flow of an inviscid fluid.
„ Equation (4.141) may be view as a nonlinear wave equation,
where each point on the wave front can propagate with a
different speed. In contrast, the speed of propagation of all
waves was constant for the linear, 1-D convection equation
(ut+cux=0).
„ A consequence of the changing wave speed is the coalescence
of characteristics and the formation of discontinuous solutions
similar to shock waves in fluid mechanics. This means the class
of solutions that include discontinuities can be studied with this
simple 1-D model.
„ Nonlinear hyperbolic PDEs exhibit two types of solutions
according to Lax (1954). We consider a simple scalar equation
A=A(u) is the Jacobian matrix wFi/wuj for the general case and is
ut+F(u)x=0. We may write the equation as ut+Aux=0 where
dF/du for our simple equation.
„ Our equation or system of equations is hyperbolic, which means
that the eigenvalues of the matrix A are all real. A genuine
solution of Eq. (4.143) is one in which u is continuous but
bounded discontinuities in the derivatives of u may occur. A
weak solution of Eq. (4.143) is a solution that is genuine except
along a surface in (x, t) space, across which the function u may
be discontinuous. A constraint is placed upon the jump in u
across the discontinuity in the domain of interest.
„ If w is a test vector that is continuous and has
continuous first derivatives but vanishes outside some
bounded set, then u is termed a weak solution of
ut+Fx=0 if

where I(x)=u(x,0).
„ The existence of shock waves in inviscid supersonic
flow is an example of a weak solution.
„ The requirements necessary for the existence of a
solution with a discontinuity such as that shown in Fig.
4.30.
„ Let w(x,t) be an arbitrary test function that is continuous
and has continuous first derivatives. Let w(x,t) vanish on
the boundary B of the domain D and everywhere outside
D. D is an arbitrary rectangular domain in the (x,t) plane.
We may write

„ Equation (4.145) and (4.146) are equivalent when both


u and F are continuous and have continuous first
derivatives. The second integral of Eq. (4.144) does not
appear, since the function W vanishes on the boundary.
„ Function u(x,t) which satisfy E1. (4.146) for all test
functions w, are called weak solutions of the inviscid
Burgers equation. We do not require that u be
differentiable in order to satisfy Eq. (4.146).
„
the (x,t) plane, which is separated by a curve W(x,t)=0,
Suppose our domain D is now a rectangular region in

across which u is discontinuous. We assume that u is

W(D1) and to the right of W(D2). Let the test function


continuous and has continuous derivatives to the left of

vanish on the boundary of D and outside of D.


„ With these restriction, Eq. (4.146) can be integrated by
parts to yield

The square brackets denote the jump in the quantity

cosines of the angles between the normal to W(x,t)=0


across the discontinuity, and cosD1, cosD2 are the

and the t and x directions, respectively.


„ The integrals in Eq. (4.147) over D1 and D2 are zero by Eq.
(4.145). We conclude that since the last integral vanishes
for all test functions w with the required properties, we
must have
„ This is the condition that u be a weak solution for Burgers’
equation. Let us apply this condition to a moving
discontinuity. Suppose initial data are prescribed for u(x,)
as shown in Fig. 4.30, where u1 and u2 denote the values to
may write the equation of the surface W(x,t)=0 as t-t1(x)=0.
the left and to the right of the discontinuity. In 1-D, we
The direction cosines as required in Eq. (4.148) become

which shows that the discontinuity travels at the average


value of the u function across the wave front.
„ Rarefactions are as prevalent in high-speed flows as shock
waves, and the exact solution of Burgers’ equation for a
rarefaction is known. Consider initial data u(x,0) as shown in
Fig. 4.32. The characteristic for Burgers’ equation is given by
dt/dx=1/u. Fig. 4.33 shows the characteristic diagram plotted
simply vertical lines, while they are lines at an angle of S/4
in the (x,t) plane. In the left plane, the characteristics are
radians to the right of the characteristic that bounds the
expansion. This particular problem is similar to a centered
expansion wave in compressible flow.
„ Here the expansion is bounded by the x=0 axis
and the characteristic originating at the origin
denoted by the dashed line. The solution for this
problem may be written

„ The initial distribution of u forms a centered


expansion, where the width of the expansion
grows linearly with time.
„ Armed with simple analytic solutions for these
two important cases (shocks & rarefactions), let
us examine the application of some numerical
algorithms to the nonlinear, inviscid Burgers
equation.
Lax-Wendroff Method
„ The Lax-Wendroff method (1960) was one of the
first second-order finite-difference methods for
hyperbolic PDEs.
„ The development of this method for nonlinear
equations follows from a Taylor series:
„ The right-moving discontinuity is correctly positioned and
is sharply defined.
„ The dispersive nature of this method is evidenced through
the presence of oscillations near the discontinuity. Even
though the method uses central differences, some
asymmetry will occur, since the wave is moving.
„ The solution shows more oscillations when a Courant
number of 0.6 is used than for a Courant number of 1.0.
In general, as the Courant number is reduced, the quality
of the solution will be degraded.
MacCormack Method
„ This method is a predictor-corrector version of
the Lax-Wendroff scheme and is much easier to
apply than the Lax-Wendroff scheme because the
Jacobian does not appear. When applied to the
inviscid Burgers equation, the MacCormack
method becomes

„ The amplification factor and stability requirement


are the same as presented for the Lax-Wendroff
method.
„ The right-moving wave is well defined. We note that the
solutions obtained for the same problem at the same Courant
number are different from those obtained using the Lax-
Wendroff scheme. This is due both to the switched
differencing in the predictor and the corrector and the
nonlinear nature of the governing PDE. One should expect
results that show some differences, even though both
methods are equivalent for linear problem.
„ It should be noted in passing that reversing the differencing in
the predictor and corrector steps leads to quit different results.
The best resolution of discontinuities occurs when the
difference in the predictors is in the direction of propagation of
the discontinuity.
Rusanov (Burstein-Mirin) Method
„ The third-order Rusanov method uses central
differencing and , when applied to ut+Fx=0
becomes
„ The magnitude and position of the discontinuity
are correctly produced, but the results show an
overshoot on both sides of the shock front.
Godunov Scheme
Higher-Order Upwind Schemes
TVD Schemes
„ The results of the previous section showed that
even though upwind schemes appear to account
for physics in a more appropriate way, as
compared to central-difference schemes, higher-
order methods share the same deficiencies when
discontinuities are encountered.
„ The problem can be demonstrated computationally
by starting with a monotone profile (linear between
the left and right boundary values of 1 and -1) for
a compression wave. As the compression front
steepens, higher-order methods produce numerical
solutions with new extrema. Consequently,
oscillations are introduced that are undersirable.
„ This numerical experiment is a computational
verification of Godunov’s theorem given in Section
4.4.1.
BACK
„ uxx+uyy=0, 0dxd1, 0dyd1 B.C. u(0,y)=u(1,y)=0,
u(x,0)=0, u(x,1)=f(x)
„ Let u(x,y)=X(x)Y(y) and substitute into above equation,
We get X”Y+XY”=0
„ X”/X=-Y”/Y=OŸX”-OX=0, Y”+OY=0.
BCs u(0,y)=X(0)Y(y)=0ŸX(0)=0
u(1,y)=X(1)Y(y)=0ŸX(1)=0
u(x,0)=X(x)Y(0)=0ŸY(0)=0
„ X”-OX=0, X(0)=x(1)=0ŸOn=-(nS)2 n=1,2,…. and
Xn=sin(nSx)
„ Yn”-(nS)2Yn=0ŸYn=d1cosh(nSy)+d2sinh(nSy)
„ Yn(0)=0Ÿd1=0, Yn= d2sinh(nSy)
„ un(x,y)=An[sinh(nSy)/sinh(nS)]sin(nSx) n=1,2,…

u(x, y) ¦ A n
f
sinh(nSy)
„ Superposition theorem:
sin(nSx)
sinh(nS)

¦A 2 ³ f (x)sin(nSx)dx
f
sin(nSx), A n
n 1
1
u(x,1) n BACK
0
n 1
BACK
„ Multiply the first equation by a21/a11 and subtract it from the second
equation to eliminate u1 form the second equation.
„ Multiplying the pivot equation by a31/a11 and subtracting it form the
third equation eliminates the first term for the third equation.
„ This procedure can be continued to eliminate the u1 form equations 2
through n.
„ Next, the second equation is used as the pivot equation
to eliminate u2 from all equations below it.

„ The third equation in the altered system is then used as


the next pivot equation and the process continues until
only an upper triangular form remains:
„ At this point, only one unknown appears in the
last equation, two in the next to last equation,
etc., so a solution can be obtained by back
substitution.

BACK
Unstructured Grid
Structured Grid

BACK
 

BACK
BACK

You might also like