Lecture 30 : Dissipation/Dispersion Error II

IIT Kanpur July 201
20 followers
Sep 6, 2024
[Music]
hello everyone welcome
back so we have been looking uh at the
for stability analysis in the last
couple of classes okay and uh we found
that uh for the diffusion problem
uh the scheme like ftcs is stable when
Alpha is less than half basically the
diffusion number is less than half new
delta T by delx squ is less than half
and for the convection problem what we
observed is
that the explicit scheme if you use the
ftcs it is unconditionally unstable so
the central defening scheme uh with an
explicit approach is unstable for the
linear contion problem okay because
amplification factor is always greater
than one regardless of what is the Quant
number or the CFL number uh that is uh C
Delta DX that we are using okay on the
other hand when we uh use the implicit
scheme what the scheme told us is that
uh uh it is unconditionally stable for
the linear problem of course when you
try solving it uh uh for a nonlinear
problem or problem like n equation you
will have some more practical
consideration uh first of all the
implicit is scheme
uh is not uh always preferable
especially when you are trying to solve
a Time accurate uh problem
okay and uh so those con will come but
what one stability tells you that if you
use an implicity scheme it is
unconditionally stable whether the
problem is diffusion or the conviction
okay now we'll look at uh the FBS scheme
okay so this is our they uh convection
equation d by DT plus c d by DX equal
to0 and uh if C is greater than Z okay
what I've seen from our experience is
that we use the ftvs scheme okay forward
in time and backward in space then it is
stable
for C delta T by DX less than one so
this we have seen from our experience
right and similarly if C is less than
zero okay then we have to use this
ftfs okay forward in time and forwarding
step I mean this is just to honor the
speed of sound so if it is C is greater
than zero then we have what you have to
do the grid point that you select is I
minus one and I to calculate the
gradient okay because the wave is going
in the right direction when the C is
less than zero then you select I and I +
1 and uh to calculate your gradient delx
because the wave is going in the left
Direction okay so both these cases are
called
upwinding okay upwind
scheme
okay because it is one-sided we are not
doing Cal defensing and we are using the
information uh from the wave to
basically find your gradient
okay so we'll use the mon stability
analysis and see for C greater than Z if
our whatever observations we had uh that
it is stable for C Delta X less than one
is basically valid or not okay then we
find out from the one stability indes
okay so let's WR the discretized form
this is u i n +1 minus UI n by Delta
t+
c u i + 1 n minus UI minus one n sorry
what I'm using is the first uh FBS right
so this will
be u i n u IUS n by Delta xal to Z
right so use this rearrange it u in +
one will become u
n
minus C delta T by DX okay which we
denote
by Lambda
okay and and then it will be u i n - u i
-1 n = to Z
okay so just rewrite this as
Lambda
okay not equal to zero we have already
put it on the right hand side
okay uh we use our expression u y n will
be G to the power n uh e to the power I
I and 5 okay u i + 1 n similarly power n
power I + 1
i5 and u i n + 1 for example power n the
power I I5 so basically uh like uh we
have this separation variables so when
we trying to solve the differential
equation we have basically separated our
time and the
space
okay uh put these things here okay what
we'll get is this is g^ n +
1 will Beal to g^ n I'm taking this E
power I I5 common everywhere minus
Lambda is 1 - e^ -
I5
right you can rearrange it this is n is
here also n 1 - Lambda
1us cos 5 and then minus minus become
plus plus I sin
5
right so that will so now write the
amplification
Factor g to^ n + 1 by g^ n
okay so that you can do 1us
Lambda okay and plus Lambda cos
5 and minus Lambda I sin 5 okay just
rearrange
it so 1us Lambda + Lambda cos
5 okay that's one part minus I Lambda
sin
5 okay so this is the value of
G
okay now it's a again a complex uh uh
expression okay so you have this the
real part of
G and then you have imaginary part of
G
okay and we want to find out uh for what
condition of Lambda uh it will be stable
or whether it is stable or not okay that
is our task okay so what we'll do what
uh we will use the you might have used
the complex plots okay uh in your under
graduate course okay or in any math
course so let's say if you have
uh so let's say you have I5 so that is
cos 5+ I sin 5 and you can represent it
in a complex uh plane
okay so you can have
this uh real plan okay let's say this is
my G so this is my real G and this is
imaginary G okay so this has got a
radius of equal to 1 okay and five will
go all the way from 0 to 2 pi so you can
basically this is a circle not made a
very good Circle
okay just
okay so something like this so my radius
is equal to one so this is a
representation of e^ I 5 okay or is
equivalent to cos 5 + I sin
5
okay so if you have let's say e^ 2 II
okay so accordingly you can have this uh
2 power5 so it will have radius of two
right so basically R cos Theta and R sin
Theta these are the two terms okay so
now let's look at what term you have so
G equal to 1 - Lambda + Lambda cos 5
minus
I Lambda sin
5 okay so we use the complex plan so
this kind of plot Cal Call ar
diagram okay so what we'll do uh we'll
take first Lambda equal to
1 okay if you take Lambda equal to 1
this will become G this will become this
term will become zero this will be cos 5
- I sin
5 right so when if it is uh uh minus you
will uh if you plot from 0 to 2 pi you
will have the same thing okay let me
just plot it
okay so uh the radius is equal to 1 okay
so let's say this is
my.
five this is
1 this is. five this is
one this
is5 this is
one this is. five and this is one okay
so
uhal to cos 5 plus I sin 5 so we'll have
a plot which will
connect this origin is at zero right and
it will go like
this and connect like this okay so this
is a circle okay with
radius
uh is equal to 1 and you can see that
its amplitude is one everywhere right so
if you take the amplitude of
G so this z bar is equal to one okay
because this is our amplitude you can
take it anywhere this will be equal to
1 okay now let's take Lambda = to 1x
2 okay so then G will become 1X
2 plus 1X 2 cos
5 and then minus I 1X 2 sin
5 okay now here you can see that real
axis has shifted by 1X two right so this
is uh where our origin will be okay let
me use some other color maybe I'll use
this color
okay and the radius is 1x 2 right so it
will have another Circle okay which will
go like
this will be like this
right so this is going
uh5 and you can
see that uh you can you can take the
amplitude anywhere okay the radius is
0.5 but if you take the amplitude
anywhere okay so that will be less than
one so this is the maximum amplitude is
the this which is G is equal to 1 all
other places it is less than one
right so this is basically stable so one
is also stable because that g is just
exactly equal to 1 if you take5 then
also it will be stable you can take
different values of Lambda let's say 75
okay or whatever values you want and you
see that it will always be uh inside
this circle one Circle unit circle and
it will always the magnitude will be
always less than equal to one okay so
all these are basically G less than one
okay now let's go to Lambda equal to
greater than one okay let's take Lambda
= to
3x2 okay so if you take Lambda = 3x2
then G will
become - 1
by2 and plus 3x2 cos half - I 3x2 sin
half okay so the origin for this plot
also Circle the origin will be - 1 by 2
and 0 right so that is uh basically if I
can use another color maybe this one
this is my origin I fixed the origin and
the
radius is basically
3x2 right so now I have to
start
uh uh make a circle from here and it
should go to 3x2 on either side so this
is 3x2 okay this is fine -.5 + 1 3x2
here also this is .5 and it has to go
uh to min-2 here okay so that will be 1
- 1.5 okay and this is my
-2 okay -.5 -1
-2 okay so let's make a circle fixing
the origin here and uh use the color
that we are using okay so it has to go
on either side 1.5 so this may 1
.5 and somewhere here my
1.5 so connect it like
this
okay
okay so this is my circle that will be
getting you can easily write a simple
matlb code and plot this okay and you
can see that uh uh
the amplitude of this is always greater
than equal to one right it will always
be greater than one okay this is
basically this is
uh uh okay from here we'll connect so
this is one and here it is greater than
one here greater than one everywhere you
will see this is basically greater than
one okay so in this case the G is always
greater than
one
right so you see that as you increase
the value Lambda greater than one it
goes into the Zone where your amplitude
factor is always greater than one okay
and this is precisely the reason why we
find that when we use this value of
Lambda equal to C delta T by
delx uh greater than one your scheme
becomes unstable because your
amplification Factor becomes greater
than one okay that means any wave uh if
you have Lambda greater than one is
going to basically
uh uh this amplitude will increase in
time and finally it will become
unstable right so this FBS okay let me
write it
here
ftvs
for
convection
scheme
is conditionally stable
stable
with Lambda = to C Delta d by DX less
than equal to 1 okay this is what we
have observed earlier also uh while
trying
to uh basically Solve IT numerically the
convection equation that when the Lambda
was greater than one it was uh you start
seeing vles initially and it will
quickly uh basically uh become unstable
it will explode okay so this we observed
I'll just show you what I have done
through this uh plot okay so this is
what I was trying to show you okay so
this is Lambda equal
to.5 okay and you can take this
amplitude anywhere okay this will be
less than one this is Lambda equal to 1
okay
uh and it will be one everywhere and
then we have limal to
1.5 okay if you can use this
color okay this is uh greater
than uh one okay and because of that it
becomes unstable so you can uh when you
go back please uh uh work it out and see
plot for different lambdas and find out
when becomes stable and it becomes
unstable okay
so similarly you can uh try this uh uh
uh this one stability analysis for many
different problems okay and I'll not go
through all of these but I would uh uh
basically uh request you or basically
ask you to try this as a practice
assignment okay so you can take
different schemes that we have discussed
in the class so you have this uh uh ctcs
scheme Li frog scheme okay so which is
uh uh like the uh Central defensing in
space as well as Central defensing in
time so both has got Central defensing
uh space in time and see whether this
scheme is stable or not okay using the
volum stability analysis similarly look
for The Lex fedc scheme which is
basically ftcs but now we have the UI
term is taken as the half of the I +1
and IUS
one okay and then you have the LAX vand
of scheme which has additional diffusion
on the central defening scheme so use
your for okay U equal to uh u n is equal
to ^ n e to the^ I i5 and
C what stability characteristic you find
for these equations are there any
conditions where it become stable and
try it for conviction problem okay this
is for conviction problem similarly you
can try so this are already tried
implicits we have already done that okay
uh try for the crank also we have
discuss the SCH also and find out the
stability conditions for all these
schemes okay so this is the homework for
you and we'll uh uh continue discussing
it uh uh as in when necessary but
uh this is something we should be very
very uh basically you should be
convenient with the stability conditions
okay uh it should not uh uh be appearing
that uh uh you are using uh the central
defening scheme without knowledge uh to
a contion problem okay so if it gets in
Grand uh basically shd knowledge that uh
if uh the if the Lambda or Alpha what
are the conditions uh when it can be
stable when it can not be stable what
the schemes which are stable or not
stable it will become very useful for
you okay uh while choosing your scheme
for a particular problem okay so what
I'll do in the next class so we have
done the stability analysis now we have
to go for something called error
analysis
okay so what is error
analysis so right now we have only
talked about whether the scheme is
stable or not and from the L from you we
know that if the scheme is consistent
and stable the convergence is guaranteed
but when if it is conversed okay
depending on what scheme you're using
you will have uh basically uh certain
error okay so the errors can be of two
types okay one is the dissipation
error okay and other is dis disperson
error okay it also sometimes called
diffusion error although there are some
differences uh between the dissipation
and uh diffusion okay but they are both
related to similar terms okay so we will
be alternately be using uh this disp
error the disp error the disp error is
also called the phase
error okay and this can also be called
an amplitude
error
okay so uh we will look at uh these two
errors uh because that will tell us the
information about uh which method is
more accurate
okay we have already discussed about the
the order of accuracy earlier okay so
the dissipation error will basically we
can figure out from our order of
accuracy so this is basically
order okay and this disperson error
which is also very very important if you
are particularly interested in uh
basically High fidil flows okay so uh
we'll discuss what is this person error
uh so this is related to the resolution
of the scheme
okay so dis eror is related to the order
of the scheme and dis error is the
related to the resolution of the scheme
so what does it mean so dissipation
error so let's say you are trying to
solve a
problem which is like this okay and if
the scheme has got dissipation error so
what will happen with time okay as you
solve it so let's say you're trying to
uh use your convection equation
okay plus c equal to0 okay so it should
basically ideally just propagate like
this
okay and then go like
this okay with the speed which is C okay
but what happens actually is that it
propagates but also you will see that
the
magnitude comes like
this even it can with time it can even
go lower okay so for
example it is going like
this okay we have already seen that
right and further if you go down then it
will probably go like this okay so you
can see that the amplitude is started
going down so what started with this uh
big amplitude now it has become like
this okay so if there is a uh change in
the amplitude okay uh particularly DK of
amplitude that is called the dissipation
error okay so this is our dissipation
error
okay now what is disperson error okay
let's look at the
same wave and we are trying to solve it
uh uh using uh let's say the central
differencing scheme okay so this let's
say we're solving
ftps scheme okay now let's say we trying
to solve this using ftcs scheme okay
Central differing which we know that it
is unstable right
so so the exact solution will be
something like
this
okay okay but you'll see that if you're
using the central differing scheme okay
so you will start seeing Wiles like this
okay the amplitude may not go down much
but we will have Wiles let's say here
and here you may have Wiles here also
here also okay similarly uh it may you
may see start seeing wiggles at the
discontinous region okay and ultimately
what will happen if you continue running
it then it will blow up okay the scheme
will blow okay so what you are seeing
here in this compared to the disp error
so in the dissipation error it is
propagating uh but it is basically the
magnitude is going down okay or maybe it
is smearing out okay but in this case uh
the amplitude or magnitude is not going
down but you start seeing some
oscillations here okay like
here okay so what is exactly happening
is that let's say we we discuss that
this Square wave in this particular case
consists
of many waves okay many let's say s or
cosine
waves okay we have already discussed the
for representation okay now when you
have the disperson error so
uh so different
waves which
means different frequencies
okay
start moving at different
speeds okay and that basically depends
on the it starts depending on the wave
number okay so if you have a square wave
I if you're just solving this problem d
by DT plus c d by DX you expected that
all the waves let's say this Square wave
or any wave that any input wave that you
have consist of many different waves so
all those waves will travel at the speed
of
C right that is our expectation okay but
what if some waves is start moving at a
speed greater than C and some W start
moving at a speed less than C okay and
what if they depend on the wave number
so the representation will be uh
basically let's say sin KX okay k1x k2x
k3x that's so many different waves right
so what if the speed starts depending on
this
K okay so that is basically completely
numerical okay it is because of your
choice choice of scheme your different
waves are traveling at different speeds
some are basically becoming greater than
your expected speed and some are lower
than the expected speed okay so when the
wapes are not traveling at the expected
speed that is called
dispersion okay so this phenomenon is
called dispersion
okay and the error due to that is called
the disperson error okay so this is a
very very dangerous error okay uh
because if you do not control the
disperson error what will happen is that
your scheme will eventually blow up okay
at the same time so if you take use any
disc scheme it will have error okay
because you trating the T Series okay so
it can have the disp error or it can
have the dispers error right now if you
want a scheme uh which is uh very good
for solving a problem you want to
minimize both these errors right so if
you have the displac an error as the
leading order term okay what will happen
is that your you will not get unstable
solution uh you'll get some solution but
it will be your amplitude will be
basically modified on the other hand if
you use a uh equation which has got a
disperson error in the leading order
term your wave number will be uh
basically modified
okay so now our art uh in cfd is to find
out a scheme which has got minimum of
these errors okay and at the same time
you should uh basically ensure that your
dissipation error is slightly or maybe
in in such a way that it basically uh
mitigates your dis disperson error okay
so basically it smears out and it gives
you a stable solution if the disperson
error is in the leading order term okay
then and it is quite possible that your
solution will go up okay so we'll have a
more systematic discussion on both these
errors in the next few classes and we'll
understand like we have used the one
stability analysis and understood the
stability we'll do error analysis and
find out the errors in different schemes
okay uh we have discussed about the
modified PD and that will come into
picture when we start discussing uh
these errors okay so with that we'll
stop today's class and'll meet in the
next class class thank you very much
[Music]
[Music]
[Music]
