Foundation of Computational Fluid Dynamics Dr. S. Vengadesan Department of Applied Mechanics Indian Institute of Technology, Madras Lecture - 13
Foundation of Computational Fluid Dynamics Dr. S. Vengadesan Department of Applied Mechanics Indian Institute of Technology, Madras Lecture - 13
Dr. S. Vengadesan
Department of Applied Mechanics
Indian Institute of Technology, Madras
Lecture - 13
It is my pleasure to welcome you all for this course on CFD. We are now into the
module three of this week. So, far, we have done different approximation method,
introduction about finite volume, finite difference, finite element methods, then we
talked about properties associated with numerical schemes, mainly three properties
conservativeness, transportiveness, boundedness. Today’s class, we will particularly talk
about analysis of numerical scheme, there are again three aspects – consistency,
convergence and stability, particular theorem called Lax equivalent theorem that relates
or connects all the three aspects while doing the numerical analysis. We will talk about
these aspects in detail with example. Then it will be followed by explanation by taking
different model equations.
Now, let us get explanation of these two types of errors with some illustration. So, in this
figure, what you see, there is a there are three curves; now there is a black line which is
going like a step function and that is the expected solution or exact solution obtained by
analytical way. Then if you are solve that equation with leading neglecting term as odd
order, and you mentioned it is a dissipative error and you get a solution, which is
represented by the red line here, so you see here it is smoothens, and you are not able to
get the peak here, or you are not able to get the peak here. It connects very smoothly
without any problem.
Of course, you can increase the leading term, for example, instead of first term, you can
take the second term or third term then you may have a slightly improved solution, but
still it never captures the peak that is the property associated with the dissipative error.
The second error is the dispersive error and that is due to leading even order term, and
the solution obtain will exhibit vigils that is overshoots and undershoots, so you can see
here light blue color and that is the type of solution you will get. So, you can see up and
down then and so on. So, you have a problem either because of the dissipative error or
because of the dispersive error.
Now, we will try to get the explanation of this from finite difference formula. So, we
already did how to obtain forward differences scheme for the first derivative. And
∂f
without going to the steps in details, we write down the final expression here, so
∂x
is given like this. Now, you have consider only the first term, the remaining terms are not
Δ x1 ∂2 f
consider. So, this is the neglected term
( )
2! ∂ x 2
and so on and followed by many
other terms. So, this is the leading term that is not consider and this is of odd order and
we mentioned, this is the dissipative error.
We also learned how to write the same first derivative by central difference formula, and
∂f
you get after a simplification, we are interested only in the , so we rewrite so
∂x
∂f
equal to like this. And you observe this is the leading term which you
∂x
2
are not consider, and this leading term is of even order Δx is of even order and that
results is what is known as a dispersive error. So, the leading term if it is odd order, it
will be dissipative error; leading term if it is off even order, it will results in dispersive
error. You will get smooth solution, but you will not capture the peak. In the second
case, we will get a vigils, but it may be accurate. So, there is a though why not we
combine both that is you take advantage of forward difference or backward difference
and central difference. So, such a scheme combination of both is what is known as
hybrid scheme, and we will use that also to get solution.
There is a particular theorem called Lax equivalence theorem, which connects or relates
all these three aspects consistency, stability and convergence. The theorem reads like
this; for a well-posed initial value problem and a consistent discretization scheme,
stability is the necessary and sufficient condition for convergence. To get some more
explanation on this theorem, for a time-dependent initial value problem, if you analyze
the consistency and if you analyze the stability then convergences need not be analyzed,
it is satisfied automatically. So, when you are analyzing consistency, this leads to the
determination of order of this scheme as well as the truncation error. Similarly, when
you analyze the stability this tells on the frequency distribution of the error. So, if these
two are satisfied or analyzed properly then convergence need not be checked and it is
automatically satisfied by this theorem. The one point that is to be noted all these are
applicable particularly the stability is applicable for a linear problem, but in any practical
situation, all the problems are of non-linear, hence to do analysis on stability of a
particular scheme for a non-linear problem, one can locally linearize and carry out the
stability analysis. Similarly, stability analysis cannot be applied near boundaries.
∂T
temperature diffusion equation and it is given here , where T here refers to
∂t
2
∂ T
temperature equal to α ( )
∂x
2
. Now, we know by Taylor series expansion, we can
separately write for time derivative and second order spatial derivative. Any scheme we
can write, we start off with forward in time and central scheme, so which is otherwise
shortly referred as FTCS – forward in time central in space. And for simplification
∂T ∂2 T
purpose, we will take the coefficient α to be one, so it will be only = .
∂t ∂ x 2
So, if you substitute forward in time on left hand side, you get finite difference equation
n+ 1 n
Ti –Ti
as , this is forward in time. And as I mentioned yesterday’s class, subscript i
Δt
or j stands for spatial and superscript n stands for time, so when you say n+1, it is
forward in
time minus n, so you get forward in time. Now, on the right hand side, we said central in
space, but times is at n level, so you can seen in the expression superscript n appears,
n n n
T i−1−2 T i +T i+1
whereas, subscript it is central in space so you get 2
So, this
Δx
expression we know already; independently we have learned by Taylor series expansion,
now we are substituting them together. Now, what we do, we perform Taylor series
expansion for each of these terms that is T in+1 ,T ni−1 , T ni+1 .
So, if you write the Taylor series expansion for each of the term, I am showing here for
n+1
each of the term up to certain terms for each term. For example, Ti , you can expand
in time – forward in time that is why it is n+1, and I have written up to four terms,
remaining terms are not written; similarly for all other terms that is T in+1 ,T ni−1 . So, all
we have to do, we substitute this expansion in the finite difference equation, in this
equation and we will see how to do that.
∂T ∂2 T
which is given = and there are so many other terms and these terms are
∂t ∂ x 2
coming from, this additional term what we have considered, because of the expansion.
Now, while writing this also, we have consider only two terms; one corresponds to time,
other corresponds to space, and whatever terms are not consider that decides the leading
error term, so this is of order Δ T square and of order four in space Δ x .
Now, I put all the things together, so original PDE considered is given here. Discretized
equation is forward in time and central in space is also given here. Then upon Taylor
series expansion for each of the term substituting and rearranging, you get equation like
this. Now, what do we do to understand consistency, consistency definition if ΔT
and Δx goes to zero, then original PDE should be recovered. So, we can understand
that from this. If you make ΔT going to 0 and Δx going to 0, then original PDE
∂T ∂2 T
that is appearing here itself = . We get back the original PDE from the finite
∂t ∂ x 2
difference equation, hence this particular scheme that is forward in time central in space
for this PDE said to be consistent. So, one can analyze any PDE by this way, this is the
very straight-forward procedure.
Now, we will take the next criteria, what is known as the convergence, so this is a
essential condition for any iterative procedure where to quit the calculation. Let say
usually end up in a algebraic equation, which is given here as A Φ=b , this is set of
equation that we will be solved. A is a coefficient matrix; and Φ is the variable,
which you are interested, and b is the known coefficient, which is on the right hand side.
Let say you are doing iteration then, you get Φ value pervious level, you get Φ
value from the present level. The difference between the two is what is referred here as
epsilon and this is evaluated for the current level, so ϵ n is what for the current level
and based on this, we decide whether to quit the particular iterative procedure. So, one
can setup a equation for residual; if you substitute ϵ into the solution matrix that we
have put, we replace Φ by ϵ n and then you get residue,
residue mean equation is not satisfied some is remaining and that is given by ρ ,
because it is evaluated at nth level superscript n is given.
There are many ways where you can use ϵ this to decide terminating a calculation. So,
if you take a absolute, so that is what is given here as modulus of ΔΦ which is
evaluated for the case of two-dimensional nodal location that is why it is subscript here
i,j and for the current level superscript n+1 is given. If the modulus of it is less than
specified value, so one can specify error limit, say 10
−5
or −7
10 , some particular
value for ϵ can be said, whenever you are doing such calculations. And once that
difference Δ Φ at the current level n+1 and at all i ,j location is less than convergence
limit of epsilon then you can say we can terminate calculation at that step and proceed
the next stage.
There also other methods, for example, the first one I written here, it is also possible to
write based on summation all the errors absolute errors and you say it is less than some
value prescribed value and such as called L1 norm or you take summation, you take a
summation of the square all the error, so when you do square, there is no minus sign,
automatically everything goes to positive and you take a summation over the entire
domain and then you take a square root of it. And that also can be used as a criteria is
less than prescribed value ϵ and such is called L2 norm. And we will talk about
these convergence criteria later classes also with different explanation. So, convergence
is also decided based on previous value and present value.
So, in today’s class, we talked about numerical analysis, particularly consistency and
convergence with some example. We will see you again with another important aspect of
this numerical scheme.
Thank you.