0% found this document useful (0 votes)
66 views51 pages

ACFD Lecture 3

The document discusses various types of errors that can occur when numerically solving partial differential equations (PDEs) using finite difference methods, including: 1. Round-off errors due to finite precision arithmetic operations and discretization errors due to replacing continuous problems with discrete approximations. 2. Consistency deals with how well finite difference equations (FDEs) approximate the original PDEs as the grid is refined, while stability determines whether errors grow or diminish over successive time steps. 3. For marching problems governed by linear PDEs, the Lax equivalence theorem states stability is both necessary and sufficient for numerical solutions to converge to the true solution as the grid is refined.
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)
66 views51 pages

ACFD Lecture 3

The document discusses various types of errors that can occur when numerically solving partial differential equations (PDEs) using finite difference methods, including: 1. Round-off errors due to finite precision arithmetic operations and discretization errors due to replacing continuous problems with discrete approximations. 2. Consistency deals with how well finite difference equations (FDEs) approximate the original PDEs as the grid is refined, while stability determines whether errors grow or diminish over successive time steps. 3. For marching problems governed by linear PDEs, the Lax equivalence theorem states stability is both necessary and sufficient for numerical solutions to converge to the true solution as the grid is refined.
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/ 51

Round-off Errors

„ Round-off errors: any computed solution may be


affected by rounding to a finite number of digits
in the arithmetic operations.
„ In some types of calculations, the magnitude of
the round-off error is proportional to the number
of grid points in the problem domain.
„ In these case, refining the grid may decrease
the T.E. but increase the round-off error.
Discretization Errors
„ Discretization error is the error in the
solution to the PDE caused by replacing the
continuous problem by a discrete one :
Exact solution of the PDE (round-off free) -
Exact solution of the FDEs (round-off free)
„ The error in the solution that is caused by
the T.E. in the difference representation of
the PDE plus any errors introduced by the
treatment of BCs.
„ Difference between exact solution of the
PDE and the Computer solution of the
FDEs: sum of the discretization error and
round-off error associated with the finite-
difference calculation.
Consistency
„ Consistency deals with the extent to which
the FDEs approximate the PDEs.
„ A finite difference representation of a PDE is
said to be consistent if we can show that the
difference between the PDE and its
difference representation vanishes as the
mesh is refined:
limmesho0(PDE-FDE)=limmesho0(T.E.)=0
Stability
„ Numerical stability is a concept applicable in
the strict sense only to marching problems.
„ A stable numerical scheme is one for which
errors from any source (round-off,
truncation, mistakes) are not permitted to
grow in the sequence of numerical
procedures as the calculation proceeds from
one marching step to the next.
„ Generally, concern over stability occupies
much more of our time and energy than
does concern over consistency.
„ Consistency is relatively easy to check, and
most schemes that are conceived will be
consistent just owing to the methodology
employed in their development.
„ Stability is much more subtle, and usually a
bit of hard work is required in order to
establish analytically that a scheme is stable.
„ DuFort-Frankel scheme: unconditionally stable,
O['t/'x]

„ Simple explicit scheme: stable only if


r=[D't/('x)2]d1/2, O['t, ('x)2]

„ A scheme using a CD and having a favorable T.E.


of O[('t)2, ('x)2]: unconditionally unstable
„ Sometimes instability can be identified with a
physical implausibility.
„ That is, conditions that would result in an
unstable numerical procedure would also
imply unacceptable modeling of physical
process.
„ Ex: Simple explicit scheme (r=[D't/('x)2] =1)
Convergence for Marching Problem
„ Generally, we find that a consistent, stable scheme
is convergent.
„ Convergence (truncation convergence) means that
the solution to the FDE approaches the true
solution to the PDE having the same ICs and BCs
as the mesh is refined.
„ For IVP governed by linear PDEs:
Lax equivalence theorem: Given a properly posed initial
value problem and a finite-difference approximation to it
that satisfies the consistency condition, stability is the
necessary and sufficient condition for convergence.
„ Most computational work proceeds as though this
theorem applies also to nonlinear PDEs, although
the theorem has never been proven for this more
general category of equations.
A Comment on Equilibrium Problem
„ Concept of consistency and convergence applies
to difference representations of PDEs of all classes.
„ The solution to equilibrium problems leads us to a
system of simultaneous algebraic equations that
needs to be solved only once.
„ To achieve truncation convergence for equilibrium
problems, it would seem that it is only necessary
to devise a solution scheme in which the error in
solving the simultaneous algebraic equations can
be controlled as the mesh size is refined without
limit.
„ Many common schemes are iterative in nature,
and for these we want to ensure that the iterative
process converges.
„ Iteration convergence: here convergence means
that the iterative process is repeated until the
magnitude of the difference between the function

wish for each grid point, i.e. ~ui,jk+1-ui,jk~<H.


at the k+1 and k iteration levels is as small as we

„ It would appear that truncation convergence will


be assumed for a consistent representation to an
equilibrium problem if it can be shown that the
iterative method of solution converges even for
arbitrarily small choices of mesh size.
„ For direct (non-iterative) methods we would want
to be sure that the errors inherent in the method,
especially round-off errors, do not get out of
control as the mesh is refined and the number of
points tends toward infinity.
„ There are aspects to the iterative solution
of equilibrium problems that resemble the
marching process in initial value problems
and a sense in which stability concerns in
the marching problems correspond to
iterative convergence concerns in the
solution to equilibrium problems.
Finite-volume Approach
„ In the Taylor-series and integral methods, we accepted
the PDE as the correct and appropriate form of the
conservation principle governing our problem and merely
turned to mathematical tools to develop algebraic
approximations to derivatives. We never again
considered the physical law represented by the PDE.
„ In the finite-volume method the conservation statement
is applied in a form applicable to region in space (control
volume).
„ 2-D heat conduction Eq.: The appropriate form of the
conservation statement for the control volume can be
represented mathematically as
„ First term: the time rate of increase of energy
stored in the volume.
„ Second term: the net rate at which energy is
conducted out through the surface of volume.
„ This is the integral form of the conservation law
that we are applying in this case and is the usual
starting point for the derivation of the
conservation law in partial differential form.
„ If the PDE form of the conservation law is
available to us, we can usually work backward
with the aid of the divergence theorem to obtain
the appropriate integral form.
Internal points: CV labeled A
„ It should be noted that Eq. (3.93) is valid for volumes of
any shape. No assumption was necessary about the shape
of the volume in order to obtain Eq. (3.93).
„ The term on the left containing the time derivative can be
evaluated by assuming that the temperature at point (i,j)
is the mean value for the volume and then using a
forward time difference to obtain

„ The time level at which the term on the right is evaluated


determines whether the scheme will be explicit or implicit.
„ Fourier’s law can be used to represent the heat flux
components in terms of the temperature:
„ The integral over the surface of the volume:

„ Approximating the spatial derivatives by central


differences at time level n and combining with
the time-derivative representation using a
forward time difference.
Boundary Points: CV labeled B
„ Assume the BCs are convective:
h(Tf-Ti,j)=-NwT/wx)i,j
„ Taylor-series approach:

„ Control-volume approach:
„ Eq. (3.96) is somewhat different from Eq. (3.95),
which followed from the most obvious application
of the Taylor-series method to approximate the
mathematical statement of the BC.
Methodology
„ Taylor-series method: provided difference
approximations to derivatives and the
representation for the complete PDE was mad up
from the addition of serval such representations.
„ Finite-volume method: employs the conservation
statement corresponding to the entire PDE. The
distinctive characteristic of the FV approach is
that a “ balance” of some physical quantity is
made on the CV in the neighborhood of a grid
point.
„ It would appear that the discretization developed
by the FV approach would almost certainly have
the conservative property.
Notes
„ It is difficult to appreciate the subtle differences
that may occur in the difference representations
obtained by the same PDE by using the four
different methods discussed without working a
large number of examples.
„ In many cases, and especially for simple, linear
equations, the resulting difference equations can
be identical.
„ There is no guarantee that difference equations
developed by any of the methods will be
numerically stable, so that the same difference
scheme developed by all four methods could turn
out to be worthless.
Stability Considerations
„ A finite-difference approximation to a PDE may
be consistent, but the solution will not
necessarily converge to the solution of the PDE.
„ The Lax equivalence theorem states that a
stable numerical method must also be used.
„ Consider a marching problem in which initial
values at time level n are known and values of
the unknown at time level n+1 are required.
1-D Heat Equation: simple explicit scheme

„ The question of stability of numerical method


examines the error growth while computations
are being performed. O’Brien et al. (1950) pose
the question of stability in the following manner.
„ The second question is the one most
frequently answered because it can be
treated much more easily form a practical
point of view.
„ The question of weak stability is usually
answered by using a Fourier (von
Neumann ) analysis.
„ It is assumed that proof of weak stability
using this method implies strong stability.
Fourier (von Neumann) Analysis
„ N=D+H where N is the numerical solution of Eq. (3.101)

H is the error in the numerical solution due to round-off


and D is the exact solution (round-off free) of Eq. (3.101),

errors.

„ The exact solution D and the error H must both satisfy the
same difference equation.
„ This means that the numerical error and the exact
numerical solution both possess the same growth property
in time and either could be used to examine stability.
We assume the error H(x,t) can be written as a
¦
„
series of the form: H (x, t) b m (t)e
m ik x
(3.104)
m
where the period of the fundamental frequency
(m=1) is assumed to be 2L.
„ The wave number km=2Sm/(2L)=S/'x
m=0,1,2,…M(=L/'x)
„ If M=2 (interval of length 2L is subdivided using
five points) the corresponding frequencies are
fm=km/(2S)=m/(2L) m=0,1,2
f0=0 m=0, f1=1/2L m=1, f2=1/L m=2
„ Since the difference equation is linear, superposition

a single term of the series. H (x, t) b (t)e ik m x


may be used, and we may examine the behavior of
m m
„ We seek solutions of the form zneikmx and let z=ea't.
H nj 1 ea t  't eik x , H nj eat eikm x
Since Hjn+1=ea'tHjn, it is clear if _ea't_ is less than or
m

„
equal to 1, a general component of the error will
not grow form one time step to the next.

„ The factor 1-4rsin2E/2 (representing Hjn+1/Hjn) is


called the amplification factor and will be denoted
by G.
„ The influence of BCs is not included in this
analysis. In general, the Fourier stability analysis
assumes that we have imposed periodic BCs.
„ For simple explicit scheme: Two possible cases must be
considered:

„ The first condition is satisfied if rt0. The second inequality


is satisfied only if rd1/2, which is the stability requirement
for this method.
„ This numerically places a constraint on the size of the time
step relative to the size of the mesh spacing.
„ The reason for the physically implausible temperatures
calculated in the example at the end of Section 3.3.4 is
now very clear.
„ It should be noted that the amplification factor given by
Eq. (3.106) could have been deduced by substituting a
general form given by Eq. (3.104) into the difference
equation.
Simple implicit scheme: ut=Duxx
Application of von Neumann analysis for
hyperbolic Eq.: ut=cux (1st order wave Eq.)
„ Lax scheme (1954): first order method

„ If a term of the form is substituted


into the difference equation, the amplification
factor becomes
„ A conditional stability requirement must be placed
on the time step and the spatial mesh spacing.
This is called the Courant-Friedrichs-Lewy (CFL)
condition (1928). Some authorities consider this
paper to be the starting point for the
development of modern numerical methods for
PDEs.
„ For Lax scheme:

where I is the phase angle. Clearly, the


magnitude of G changes with Courant number Q
and frequency parameter E, which varies between
0 and S.
„ A physical interpretation of the results provided
by Eq. (3.110) for hyperbolic equations is
important. Consider the 2nd order wave
equation: utt-c2uxx=0.
„ This equation has characteristics:
x+ct=const=c1
x-ct=const=c2
„ A solution at point (x,t) depends upon data
contained between the characteristics that
intersect that point. The analytic solution at (x,t)
is influenced only by information contained
between c1 and c2.
„ The numerical stability requirement for many
explicit numerical methods for solving hyperbolic
PDEs is the CFL condition, which, for the wave
equation, is
or

„ The CFL condition require that the analytic


domain of influence lie within the numerical
domain of influence. The numerical domain may
include more than, but not less than, the
analytical zone.
„ The slope of the lines connecting (jr1,n) and
(j,n+1) must be smaller in absolute value (flatter)
than the characteristics.
Application of von Neumann analysis to higher
dimensional problem: ut=Duxx+Duyy (2-D heat Eq.)
„ For simple explicit scheme:
Notes
„ This is similar to the analysis of the same
method for the 1-D case but shows that
the effective time step in 2-D is reduced.
„ This example was easily completed, but in
general, a stability analysis in more than a
single space dimension and time is difficult.
Stability Analysis for Systems of Equations
„ The basic idea used in the technique for a single
equation also provides a useful method of viewing
stability for systems of equations.
„ We locally linearize the system by holding [A] constant
while the E vector is advanced through a single time step.
„ For Lax scheme:

„ The [G] matrix is called the amplification matrix. This matrix


is dependent upon step size and frequency or wave number,
i.e., [G]=[G('t,k)].
„
eigenvalue of [G], Vmax, must obey _Vmax_d1. This leads to
For a stable finite-difference calculation, the largest

the requirement that _Omax't/'x_d1 where Omax is the largest


eigenvalue of the [A] matrix, i.e., the Jacobian matrix of the
system.
Ex. A system of 1st order equations:
ut+cvx=0, vt+cux=0
„ For Lax scheme:

„ The maximum eigenvalue of [A] is c, and the

_c't/'x_d1.
stability requirement is the usual CFL condition:
Notes
„ It should be noted that the stability analysis
presented above does not include the effect of BCs
even though a matrix notation for the system is used.
The influence of BCs is easily included for systems of
difference equations.
„ Equation (3.116) shows that the stability of a finite-
difference operator is related to the amplification
matrix. We may also write Eq. (3.116) as

„
requires that for some positive W, the matrices
The stability condition (Richtmyer & Morton, 1967)

[G('t,k)]n be uniformly bounded for 0<'t<W,


0<n't<T for all k, where T is the maximum time.
„ This leads to the von Neumann necessary
condition for stability, which is

for each eigenvalue and wave number, where Vi


represents the eigenvalues of [G('t,k)].
„ The stability requirement _Vmax_d1 is more
stringent than eq. (3.121). The von Neumann
necessary condition provides that local growth
c't can be acceptable and, in fact, must be
possible in many physical problems.
Ex. Heat equation with a source term:
ut=Duxx+cu
„ For simple explicit scheme:

„ This shows that the solution of the difference


equation may grow with time and still satisfy the
von Neumann necessary condition.
„ One must recognize that for hyperbolic systems
the strict condition less than or equal to 1 should
be used.
„ Hyperbolic equations are wave-like and do not
possess solutions that increase exponentially with
time.
Matrix Method
„ If the influence of BCs on stability is desired, we
must use the matrix method.
„ Lax scheme: 1-D linear wave equation (ut+cux=0)
„ Assume that an array of m points is used to solve
this problem and that the BCs are periodic, i.e.,
um+1n=u1n
„ A system of algebraic equations is generated that
has the form un+1=[X]un (3.123) where
un=[u1,u2,…um]T and
„ The stability of the finite-difference calculation in
equation 3.123) is governed by the eigenvalue
structure of [X].
„ For matrices of the form
the eigenvalues are given by
„ The numerical method is stable if _Q_d1,
i.e., if the CFL condition is satisfied.
„ This shows that an analysis based upon
the matrix operator associated with the
Lax method yields the same stability
requirement as previously derived for the
simple wave equation.
„ For periodic BCs, the Fourier and matrix
method yield virtually identical results.
Ex. Lax scheme: 1-D linear wave equation
(ut+cux=0) with u1n+1=u1n, u4n+1=n3n
Notes
„ It is clear that the BCs on the mesh are included
in the matrix method. This means that the
influence of BCs on stability is automatically
included if the matrix analysis is used.
„ Unfortunately, a closed-form solution for the
eigenvalues is usually not available for arbitrary
end BCs.
„ The Fourier method and the matrix method are
probably the most widely used to determine the
stability of numerical schemes.
Cell-Vertex Method
„ Faces located midway between the grid points: when
mesh spacing varies, the points will not be in the
geometric center of the CV.
Cell-Centered Method
„ Grid points placed at the centers of the control volume:
when mesh spacing varies, the boundaries do not lie
midway between the grid points.

BACK

You might also like