So we will look at a demo.
Before I start the demo we will try to figure
out what is the actual problem that we are
going to solve right.
So I think I maybe suggested some boundary
conditions and so on to you but we will make
it little more explicit right now.
So I have a program that I have written which
has 2 different flavors of solvers.
Both of them require and I add second order
and fourth order dissipation.
So I am not doing any of the more modern techniques
that add dissipation in a regulated fashion
you understand because we have not covered
that material in this class and I am not proposing
to cover that material in this course.
I have just given you enough, I have brought
you just up to that point where you should
be able to comfortably read the material that
is out there, the literature that is out there
okay.
And maybe in some other advance class you
are able to get that high resolution schemes
and so on.
So one of course is FTCS because we have been
looking at FTCS right through okay.
The other is four-step Runge-Kutta method
as it turns out that the time step that I
can take is much larger.
I will start with that because the time step
that I can take with it is much larger, things
move a little faster right.
So the demo moves a little faster and just
for completion maybe I will do FTCS.
The things that you have to observe from this
is we have looked at linear wave equation,
we have seen certain behaviour especially
in the previous demo’s we have seen certain
behaviour.
The one dimensional equation we have already
seen is a combination of right the combination
of these kinds of wave equations.
So there are consequences the fact that the
3 propagations means there are consequences.
So I want you to pay attention to this right,
what are the propagation speeds?
Can you figure out what is moving?
How is it moving okay?
So the actual problem so it is one-dimensional
flow so it is going to be just a pipe right,
it has a reservoir at one end and it is opened
to possibly to atmosphere or some other reservoir
in the other side and we will decide on boundary
condition.
The problem that I am going to run is going
to be a relatively easy problem.
I want to run the demo for a Mach number of
0.5.
So the steady state solution will be 0.5 and
you will understand as we do the demo as to
why I pick 0.5 right and I will let you play
around, once you get a code working I will
let you play around with various other possibilities
that you can run.
Is that fine?
Okay.
So let me start off and this code is written
completely in python that is one of the reasons
why I am running Runge Kutta because python
there is a penalty that you pay but anyway
and I am using grace plot like I did last
time.
The particular flavor that I am going to use
for you today is called has a subscript p.
It does not matter why right.
So I will create a solver.
So there should be an RK4.
So there is Runge-Kutta 4-step flow manager
so I will create this flow manager then it
is going to prompt me for various and sundry
things right.
So how many grid points do you want to run?
I want to choose something reasonably large
okay so I am going to pick like 1001 that
is simply because most of the time I ask students
to do some assignment and they run 5 grid
points, 10 grid points, 12 grid points you
understand right so 1001 grid points.
You could make it larger but then it will
take too much time 1001 grid points.
So if I take the inlet total pressure to be
atmospheric pressure for no particular reason
and the inlet total temperature to be 300
kelvin simply in my mind I am thinking reservoir
has been sitting there it is an equilibrium
with the right atmosphere outside though 300
is really not the temperature in Chennai but
anyway we will live with that we will go with
that.
Outlet ambient pressure, now we have to be
careful.
Now we are defining the problem here, so outlet
ambient pressure I want it to be what?
I want it to be so that I know the solution
right just like we did for Laplace equation.
It is nice to know the solution.
So I have already pre-calculated it.
If you sit down and think about it, it is
around 84,000 or some 85,000 so I am going
to run for 84,000.
Is that fine?
Right and this should give me a Mach number
around 0.5 okay.
I am not actually calculating the exact Mach
number that the steady state solution should
have and we are looking for a steady state
solution that is what we decided.
We are looking for a steady state solution.
I have told you before that ambient temperature
is not relevant parameter.
Why am I prompting for ambient temperature?
Changing the ambient temperature does not
change the solution right but this is for
the initial condition, this is not for a boundary
condition.
I am asking for the ambient temperature here
so that I can set the initial condition because
as we have decided my valve is at the left
reservoir the P0 end okay.
So the inside of the pipe is completely at
84,000 pascals and 300 kelvin okay.
So that is done, so this should start something
off, yes it does, I will quickly so that your
eyes do not get zap by that intense white.
I will change it to a more pleasant color
okay.
So the other scales do not matter.
It is a little difficult actually.
This demo took me a little time to get right
simply because of the fonts and so on.
So for the people in the video world do not
worry about this now I will read out the numbers
okay.
You are in the class can most probably see
them.
I will read out the numbers as they are relevant
okay fine.
It is just not worth trying to make the letters
so large that they are visible out there okay.
So what do we have?
What I can do now is this solver which I called
o for whatever reason has various things built
into it.
You can see the one that is actually of interest
to us is this item called step and what step
does?
What step allows you do?
Step takes the number of steps that you take
and L it is not lambda, it is L, it is delta
T/delta x okay.
It is not sigma okay.
This is not the CFL, this is delta T/delta
x so I want you to remember this.
In this case, I am prescribing delta T/delta
x okay.
So we need to have a discussion as to how
come I am not prescribing the CFL.
How did I decide to pick this delta T/delta
x?
And I seem to have taken 005 delta T/delta
x is 005.
What is my delta T?
If my pipe length happens to be 1 meter I
have taken 1000 intervals each interval is
10 power -3 meters which is 1 millimeter and
this is basically a 5 microseconds okay.
So I am going to be advancing my solution
in 5 microsecond time steps fine.
Is that okay?
That is what we are planning to do.
So what I will do is I will again remember
this for loop just to remind you basically
says that do this 100 times.
What we want to do 100 times?
I want to take steps and I will do 10 steps
at a time right because it is going to trudge
along at 5 microseconds or whatever it is.
I will take 10 steps at a time.
We will see where this goes okay and we will
see what happens with this.
Is that fine?
Let me get my graph backup so that the graph
is clear and if I do enter and one more enter
oh very noisy curve, this is not a sanitized
simulation in the sense that I have not cleaned
it up and all of that kinds of stuff.
Am I making sense?
So you have to figure out what is happening
here.
So question is what happened?
Actually, I should have taken may be 50 time
steps and I should have looped to 50 may be
instead of 100 but it is okay.
May be I will run that through again one more
time, you have seen it once, second time you
can actually observe.
So I want you to observe certain features
what you saw okay.
We will run through that again and instead
of doing a 100 I will do 50 okay.
I think confuse my FTCS part which I am going
to do later with my Runge-Kutta part which
I did now.
So what you saw was some feature travel left
to right seem to possibly reflect off.
I do not know what is happening and something
coming back and then there is this one solitary
step here that is propagating left to right
okay.
So we will try to do the following.
We will try to estimate what speeds are these
things propagating at and what are these?
What do we expect?
What is that we expect okay?
What are we expecting here?
So let me just I will just kill this.
I do not want to run that so maybe I will
just create another o1=onedflow_p.RK4.
I will just quickly create another one.
Okay there we go, centered up again, that
is fine done and this time I am going to be
little more sensible and instead of doing
100, I will do 20.
I am getting conservative yeah I will do about
20 that is fine.
What happened how did I disconnect the pipe?
Here you go.
At this point you can most probably hear we
think fine here we go.
Let us try it one more time, good show okay.
So for i in range may be because I am taking
sufficiently large time steps, I will do 100
and just do o.step, I will change that later
and taking a 100 time steps.
There you go, taking one time step as the
time as I indicated is separately painful
thing.
All those little sharp features that you see
are the solution oscillating.
We saw this in the demo for linear wave equation.
So one of the problems is it is possible for
me to tune it so that I eliminate those sharp
peaks whatever right when the control that
we have on some parts in fact I could have
tuned the parameter.
I could have hunted around, look for a parameter
to find that I will eliminate these okay right
but I actually want you to see even at this
screwed I actually want you to see what was
the.
Let me take 100 more time steps because the
step here has not traveled that far.
This has travelled quite far so in a 100 time
steps where has this come can you give me
an estimate about 185 or something or that
is what 180, 185.
So if I take a 100 more time steps, I expected
to come to about 360 this step and these 3
seem to be aligned.
So that is some feature that is traveling
forward.
This is going at a slower speed okay.
This is moving at a slower speed.
So there it goes again.
Now as I said the value that is out here I
hope this flickering is not too uncomfortable.
The value that is out there the magnitude
of the step get you an idea as to what is
happening the magnitude of the step.
Yeah it will stop now right so they are propagating
at seemingly a constant speed right.
They are propagating at a constant speed.
This lower part the floor here is 84,000 that
is the right hand boundary condition.
That was our initial condition.
This here is one atmosphere 101325 so that
101325 from the left hand side is now propagating
towards the right that is basically what is
happening.
This air at 101325 and that is propagating
from left to right and as that pressure is
the question as what is propagating I said
pressure propagates so along with this so
you have this feature that is propagating
that is sort of a pressure is sort of like
an acoustic wave if you think about it.
So I would expect that this corresponds to
u+A and traveling in the right direction.
And there are 2 features traveling left to
right, 2 traveling left to right what is this
other one correspond to?
Most probably corresponds to the characteristic
u.
This speed here is about 44 or 45 meters per
second.
This reading if I stick it here you cannot
make out, I can see on the scale there are
numbers on the top that tell me.
So this reading it could be anywhere but if
I stick it in the middle right this is around
44 or 45.
So this distance that it has traveled you
have to look at the x coordinate, the distance
that this has traveled right corresponds to
that speed times how much what is the time
we are taking 5 micro seconds*200 right which
is one millisecond.
Am I making sense?
So the numbers sort of workout so this is
basically propagating.
This entity here is propagating at this speed
okay.
So this is most probably the contact surface.
Am I making sense?
Is that fine?
Okay that is most probably so the pressure
is gone and the fluid is coming along great,
the actual molecules that were inside the
stagnation chamber right inside the reservoir
the actual material that is inside the reservoir
is now traveling through but that is traveling
only at 44 meters per second.
It is traveling at a slower speed.
Is that fine?
Okay so that is coming along.
This is actual material that was inside the
reservoir that is traveling okay.
All of these are occurring because of the
compression wave because there was compression
fine okay.
So you have already seen this.
What do you expect when this goes to the other
end?
When this pressure pulse reaches this end
you are going to come to this end and it says
and there is a declaration that it should
be a 101325 but it is not it is at 84,000
right.
So the pipe is completely at 101325, the boundary
condition there is 84,000, that expansion
where is going to start propagating back,
it is an expansion wave okay that is what
we are looking for.
So let me get back here.
Now we will run it maybe what you say if I
run this 50 time steps 10 at a time so I do
not want to pain you know.
Now we already know where we are going right.
Let me get back there.
We have our picture back.
Yeah so 10 at a time it really moves fast,
50 time steps 10 at a time is 500*5 micro
seconds.
Now I want you to pay attention to this slope.
What is happening to this slope as it propagates
right to left?
The slope it starts to tip, the curve starts
to tip right because it is an expansion fan.
Am I making sense?
It is an expansion fan right so that the slope
starts to right.
Does it make sense to you?
And what is the speed you expected to be propagating
at?
Well we will find out okay.
We will run it a little longer and we will
find out.
Now remember it is very easy to look at this
feature propagating right to left and think
that things are happening right to left.
No, the flow itself is still left to right,
do not forget.
This 44 or whatever 45 meters per second is
left to right.
What I see here is 90 meters per second is
left to right, which is why this is propagating
to the right faster than the bottom is propagating
to the right which is why it starts to tip
okay.
That is why it is starting to tip it is an
expansion fan okay.
I hit an extra enter last time so just to
make sure let me get back, sorry about that.
We are likely to cross this, it is not quite
a step right.
This expansion fan is likely to cross, this
should be a sharp step, it is not a sharp
step right.
We are likely to cross this.
Do you think anything will happen when they
cross each other?
Any predictions?
You think anything will happen when they cross
each other?
Do you think this will get destroyed, its
magnitude will change, the step size will
change?
They correspond to different characteristics
remember.
This definitely corresponds to a characteristic
of its own right okay let us see.
I do that, it is propagating, some tiny oscillations
here and there.
So this is another 500 time step so we have
so far run 1200 time steps.
There it goes and what happened?
It is like the water level you know the water
level going up or coming down that is it.
That step did not go away because remember
that is physically still the air that is from
the reservoir that is traveling and it is
traveling at its own speed.
But when the expansion fan came something
interesting happen now.
Now the speed at which it is going to be traveling
is 90 meters per second.
You expect it to travel faster, u has increased,
I expect it to travel faster right.
The expectation is that it will travel faster
okay and from this point onwards it will get
a little noisy, we cannot really track because
of all these characteristics.
See now what is going to happen is imagine
the expansion fan consists of lot of characteristics
and each individual characteristic is going
to go hit the right hand boundary and bounce
off it.
If your pipe is long enough they may again
coalesce into a shock.
Our pipe is not long enough okay right.
So we are not going to see, we are going to
see some funny sloshing kind of a motion that
is what we are going to see right.
But I want you to think that at this point
what I want you to pay attention to is propagation
speeds.
How fast is something going left to right
and how fast is it going right to left okay?
Any feature how fast is it going left to right,
how fast is it going right to left okay?
I am constantly rescaling which is why if
you had it on because I want it to squeeze
3 graphs in my scales are changing okay that
is why there is some peculiar behaviour.
Look at this, look how fast this thing fellow
came back here.
How come it came back so fast?
It is traveling at u+A and u is increasing
right, left to right it is traveling u+A and
u is increasing, the magnitude of u is increasing,
it is traveling at something that is similar
to u+A at least and u is increasing okay and
look at this right, this was something like
pottering around right at a very slow speed.
And if you make a calculation if you are keeping
track right if you want you can note down
the times or whatever it is the time stamps
or you can run it yourself right.
This is about 550 millimeters okay.
Note the propagation time right to left now
here we go one more interaction, that step
sinks, the step identity is not lost.
That is it, it did not even make it across
to the end of the pipe okay.
Because the return line is that u-A and if
you are going to be coming down once you get
down to 150, 170 see as you get closer and
closer to the solution, the expansion waves
coming from the other side are going to take
more and more time okay and if you want the
steady state, you already have an issue here
that is seemingly a problem where we have
a potential problem here right.
What is the issue?
So if I want the steady state, I want basically
the right hand boundary condition and the
left hand boundary condition to be in equilibrium
and there you go.
So now you should have a compression wave
coming from the other side and watch how fast
that travels, that compression wave of course
will be it is not a compression wave, it is
a series of waves that are reflecting off
okay.
So we took 2 500 time steps to go to one end,
I will just do this one last time and then
maybe will either choose a larger time step
or will either choose a larger number of time
steps before visualization or will switch
okay.
So the leading edge is already here, the leading
edge of that compression wave is already here
and it is already at the right boundary right.
So already at the right boundary and there
you go.
So now the expansion fan is going to again
and here now I am using these terms loosely
because you have to actually a mess off characteristics
right like characteristics going in 2 different
directions.
But just to give you an idea the right hand
end is about 165 meters per second, the left
hand end is about 155 meters per second okay.
So it is traveling quite fast.
Please remember left to right, it is traveling
quite fast left to right.
This pressure here is about 88,000 right.
This is a static pressure.
The total pressure here of course taken the
155 into account will be 101325.
This pressure here is still at 84,000 fine.
And the process that you have seen is what
is going to happen is these waves are going
to keep traveling back and forth but critically
the 84,000 is something is going to travel
up stream causing the flow to speed up and
it is going to keep happening.
Right now it looks like it is going to keep
happening till left hand side and right hand
side are both 84,000.
So we have a pipe that is communicating is
84,000 up stream right.
That is basically what is happening and the
difficulty that we have with this is as you
get closer and closer to the solution, this
communication up stream becomes more and more
difficult, it becomes slower and slower okay.
This communication actually gets, is that
fine?
Okay look at this we are running the same
500 time steps right and it is not even made
it.
So you can imagine.
Now you understand why I ran the condition
Mach 0.5 right.
So if I am running 0.9 right if I am running
transonic speeds, we have a problem.
Transonic speeds we have a problem right,
u-A is almost 0, low subsonic speeds we have
a problem because u is almost 0 okay right.
There are 2 situations, u+A is not a bother,
u+A is never a bother right so we have 2 situations
where the u-A characteristic can turn out
to be a problem that is transonic flow.
And if you think about either from your experimental
aerodynamics or any other course that you
had transonic flow is difficult to compute,
is difficult to handle, is difficult to perform
experiments and so on right okay.
The other extreme low subsonic flow is an
issue here okay.
This class of schemes if you say I want to
compute Mach number 0.01, we need to do something
special fine okay.
So what I will do maybe just for the fun of
it, I will make that 50, I do not know anybody
has been keeping track of the amount of time
that we have spent on this.
But let me see so of course I am spending
50 time units before I graph right.
So it seems to move relatively better but
it is not running any faster really except
that I am not wasting time graphing.
The return as expected is a lot faster in
fact it will just go through.
So I just want to show you where this goes
okay.
This is fine may be what I will do is just
for the fun of it instead of doing this maybe
what I will do is I will run a coarser grid
right.
Then we can rush to steady state quickly instead
of doing this.
I will run a coarser grid after this.
Do you have any feeling for how much the residue
is going to drop or release the delta Q?
See right now if you look at this, the speeds
range between 174 and 173 right, 175 and this
is little over Mach 0.5, it is about 175 and
the pressures range from 84,000 to 84,500
so you could say to do if you are only looking
for 2 decimal places is converged to 2 decimal
places.
If you look at the residue right the residue
may not be that bad.
Is that fine?
May be instead of trying to drive this to
what I would call convergence right.
Now there is an issue that you have to remember,
you have an existing code, you have tested
it right.
It has been tested, you are running it in
the flow regimes for which you have tested,
it is well tested, it is a mature code then
you can look at it and say for engineering
analysis if I have one part and 1000 it is
okay.
Am I making sense?
But when you are developing the code, when
you are actually developing the code, you
would like to know that if I give the code
you know derive it in terms of floats if I
write it in terms of floats that it will converge
to whatever machine position that you have
with floats and if you give a doubles it is
going to converge to whatever that is code
converges you understand.
You would like to know while you are in the
development process.
When you are making production runs it is
a different story.
Once the code is tested right, it has been
verified, somebody have certified that this
is the code that right it works then it is
a different story as to how you use it right
but when you are doing the development, so
just to emphasize that and not so you do not
get the impression that this guy is just talking
and let me just show you.
So I do not take too much of your time I am
going to restart this because I do not trust
right now.
I import I forgot one thing that I should
have done, it does not matter.
I should have done the convergence plots it
is okay I will do it for this right.
I mean having done all of that stuff I have
the convergence plot could have been plotted.
I will use 101 grid points so that will be
10 times faster.
I will run the same case, 300 kelvin.
I would suggest that 
different temperatures they all have an effect,
temperature will affect the speed or sound,
they all have an effect right.
So I would suggest that you look at that,
let me just quickly okay it is fine.
So 101 time steps for i in range 100, 10 time
steps at a time, we will just see what it
does, that is a 1000 time steps whether that
is enough or not I doubt if it is enough but
this is going to move fast.
There you go, so it is definitely faster maybe
10 was too fast.
This is going to move fast but I want you
to note in this animation I want you to note
that the waves coming back are slower than
the waves go.
See that is it, it just goes slow almost instantaneous,
slow almost instantaneous.
You understand what I am saying.
It is very clear that left to right okay so
that was a 1000 time steps.
It is already at 84,000, the pressure is at
84,500.
The speeds are at 177, all of these will soon,
see this density in fact is to 5 digits it
is a same number, it has not changed.
So it looks very noisy but remember the magnitude
of that noise is the order of 10 power -7,
10 power -6 is that fine okay?
So those of you that cannot see this all of
this read 10275 on the scale because I am
not going to add any.
I can add more digits I am not going to add
any more digits, it just messes up the display.
All of these read 177.47 right meters and
all of these read 84,000 pascals.
So you can say at this point why do you persist
on running this?
But as I said if you are in development mode,
you want to make sure that it actually goes
right all the way.
So let us push it.
See what it does and you can still see there
is this propagation back and forth, it gets
noisy, some high frequency seem to appear
and disappear right.
It seems a lot worse than it actually is because
I am not dynamically rescaling the y axis,
so these wiggles are not really as large.
If you were to plot them on the actual scale,
these wiggles are not really as large.
What do you think will happen now?
Look at the top graph, now we are at quantization
error, we are at the last bit, we have a single
bit left.
You can only discriminate one bit.
We are making sense +- epsilon.
We are there.
We cannot calculate this, we cannot calculate
it any more accurately right.
So if I run one last, just for the heck of
it, if I just run that is it, nothing (()) (35:39)
they are flashing right, it may not show off,
is going to just sit there flashing.
We do not have sufficient bits, so now I feel
good.
Whether there are better schemes, I need not
have added this dissipation the way I have
added it whatever right but the code converge
and if I give it quad position the code will
converge okay and if I tested over range of
temperatures, range of pressures, range of
Mach numbers then I will turn around and say
in this range this code works if you want
to use 10 power -3 use 10 power -3 right.
If you want 10 power -3 you have a reasonable
solution.
So let us just look at let me import let me
just plot that error.
I will create another grace plot plotting
and I will quickly excuse the color, I will
quickly change that I think I had something
called demo is not it last time which will
fix that okay.
So it is now relatively pleasant colors, g.plot
and I have just to remind you I have something
called error.
I am going to plot that g.plot o.error.
As usual before you look at it you should
try to imagine what I will get and maybe that
is not what you expected right.
So remember the other thing that I told you.
Let me get this so that you can see that scale
there.
The other thing that remember that I told
you is that the y axis you plot on log scale,
so will make this log logarithmic 1e-16 and
I will show only every 1000 and it looks a
lot better okay and there are 100 grid points
and if I had actually integrate it.
Here I am not integrating, I am adding up
the residues right.
But actually what I should do is I should
integrate which means that I multiply by 0.01.
So this is at about 10 power -12, 10 power
-13, that whole curve would have shifted down.
You understand what I am saying whole curve
would have shifted down and if I run it longer
at this point it will just be flat right.
In fact, I stopped it quite early normally
when I am developing code, I let it continue
run.
I let it continue to run.
Am I making sense?
I not only want to see that slope dropping
and look at this is really neat right.
You can see, I would like it to be steeper
right, look at that.
We will talk about that later.
I would like it to be steeper and as I said
I really wish I would have shown you that
1001 anyway it does not matter.
So it is straight and then after that I would
like to see the horizontal part extending
out maybe the same amount I want it extending
out right because fluid mechanics is a very
funny thing right.
I will give you an example of a computation
that we have done.
A student of mine was doing 1-D flow premix
combustion of hydrogen and oxygen and basically
what happened was so you have this flame front
that is traveling through this mixture right
and it is possible that let me remember, let
me get this right so it is possible that if
hydrogen uses up all the oxygen and it depends
on the mixture ratio right.
If it is stoichiometric, it is a different
story but it is possible that the hydrogen
has used up all the oxygen in the neighborhood.
So you run it and the reaction rates are all
in picoseconds, nanoseconds, the fluid mechanics
is running in milliseconds right.
So we take picosecond time steps and we march
through and we say it is converged and we
say okay just for some more time why do not
we run it for twice the amount of time and
see what happens.
And in twice the amount of time what was happening
is the species were propagating down right
at all over sudden the hydrogen encounters
oxygen again and then again there is a rise.
Am I making sense?
There is again so you cannot just basically
so what is all settle down, everything is
fine, I have converged to a steady state solution
may not be a fact.
So you should run it for a little more time
to see what is happening.
Is that fine?
Okay right, so any questions?
Okay so the things that we take from this
right now are the propagations speeds are
important.
We need to do something therefore for convergence
okay.
We need to do something for convergences as
far as these propagations speeds are concerned.
The fact that the propagation speeds are disparate
as headache, one way travels very fast, the
other way it is very slow.
The faster travels this way, the slower it
is going to travel the other way right.
So we have to get some balance, ideally we
like the propagation speeds all to be identical
okay.
So in the next class I will derive an expression
for that.
Why do not we just for the fun of it look
at FTCS because that is likely where you will
start your implementation to see.
And the reason why I am doing this is I want
to give you confidence okay this is what I
am getting this is what he got so at least
I am on the right track.
As I said this is not a fully, I have not
sat down and think out with this code but
it is enough to okay so I will create a onedflow
and in this case the generic flow manager
which uses FTCS.
It is not particularly surprising.
I use this, I have the same interface.
Should I do 1001?
Yeah I will do 1001, 101325, 300 kelvin, 84,000,
300 is the temperature, quickly change that
screen to oned, that is done.
For i in range what you want me to run?
100 okay and how often do you want me to show
that?
Every 10 and maybe I will take and look at
this that is what I had 0.0005 last time,
0.0004 okay and we go back there see what
it does.
Now in this case may be the 10 was in that
grid.
In this case for this demo I deliberately
added the dissipation added was a little stronger,
so you will notice that it is oscillating
very close to that step it is oscillating
but they die out very rapidly okay and you
also notice that this looks a lot smoother
right.
We will run it for little more time and you
will see that I am not joking.
And in anyway at this rate it is going to
take some time.
So we may be instead of doing 10 time steps
at a time, we will make it a little larger
right okay because we do not have that kind
of time.
How much larger shall I make this?
50 time steps at a time well 50 may jump we
will try it out.
Let us try out 50 to see what it does?
That is not too bad, so just like in our earlier
wave equation thing it is clear near the step
where the high frequencies are, there is dispersion
and there is a problem but really look at
that contact surface I mean it is nowhere
near a sharp jump right.
It is nearly smoothing out that is because
I have added so much artificial dissipation
that I have just smeared out the solution
okay.
So the key getting a high resolution solution
is determined where to add that dissipation
and how much to add the dissipation right.
There has to be a mechanism by which you can
do it.
The earlier one I told you had an underscore
p right, one way by people do it is you detect
the pressure, there is a pressure switch,
you detect the pressure and you say the gradient
to the pressure the pressure is varying very
rapidly here and most probably in the vicinity
of a shock.
And you add large dissipation there and the
most probably in the way right you understand,
you add second order this is not large dissipation,
you are at the appropriate dissipation.
I have added just arbitrarily as I told you
right but you add the appropriate dissipation
there and you can actually get a reasonably
sharp shock.
Is that fine? but you will notice that here
it is smoother, there are some fine wiggles
right.
But those artifacts are also because the line
thickness is very large so even my graphics
cannot catch, so the graphics basically here
will show these artifacts are not real.
The wiggles that you see there are not real
okay.
The compression wave is going to reflect off,
expansion seems reasonably sharp.
You can see it rotating now.
It is going through the rotation process.
This is smooth right.
This is like there are really no wiggles.
As I said on the ramp, these wiggles are because
it is drawing, we made up of horizontal lines
which have a certain thickness that is only
reason why it is there.
This is really smooth.
You want me to take larger time steps as well
may be we have time and I will do 1 in a 100,
1 in a 100 may be large you know that is going
to take 10,000 time steps.
Your wave should not just let me.
There it goes and it is like the ocean level
rises and falls, so it is just the step that
comes down.
The step survives, the step is smearing because
of dissipation, the extra viscosity that I
have added is my fault and then the reflected
fan they do get steeper but it is not long
enough for it to coalesce.
It reflects off the wall, is that supposed
to be 10,000 time steps right because remember
the individual time steps are extremely small
okay.
It turns out the reason why I took Runge-Kutta
is Runge-Kutta will allow me to take CFL that
is close to 2.8 right, it allows me to go
to a CFL that is quite large and that is the
reason why I do not remember if I did up arrow
yeah all I want you to see is that yes FTCS
behaves the same way, so it did not have to
do the scheme, the return wave is slower than
the forward wave, the contact surface travels
at the speed at which the fluid is moving.
If you add too much dissipation, the contact
surface is not going to be a contact surface
it is going to be a contact something region
right.
So it is not contact you think about it, very
often you think of contact, you think of something
that is sharp, so it is sort of a smeared
overlap region kind of a thing.
So you have to be a bit careful right.
So even if you use what you detect, where
you detect right so they have to be there
are as I said please remember.
There are whole host of schemes.
I will stop this here.
Is that okay?
Okay then we will just talk after this.
The whole host of schemes that are high resolution
schemes.
If you want let me just show you the convergence
plot for this and see if it looks any different
FTCS okay.
So from grace plot I import grace plot again,
I create the plot, I will get rid of that
glare from your eyes, something that I have
started doing in my sequence that have started
doing in my sleep now.
So then you have o.error plot oops, I am not
accumulating error here okay fine, my mistake,
I did not keep track of the error and I did
not update the error anyway you can try it
out.
The behaviour is essentially the same right.
I do not think we have enough time for me
to run the 1001 for the other one.
The behaviour is essentially the same.
The thing is that I want you to take away
from this for this course right that we need
to do something about disparate speeds.
The propagation speeds are different and that
is a problem especially at transonic speeds
and low subsonic speeds okay.
So we are going to I will suggest on Monday
something to do so that convergence is faster
right.
At low subsonic speeds you can even get wrong
answers because your problem is said to be
ill-conditioned right such problems where
you have disparate rates.
You may have seen in your differential equations
course, they are called stiff problems is
very ill-conditioned right.
So if you take a system in which you want
everybody is now hollering about.
If you take a system in which it takes a million
years for trees to collapse, beaker crushed
and form coal or form oil and it takes you
a few days to take that oil out and burn it.
Then this differential equation is very stiff
if you are trying to do an energy balance,
one is at time scale is in million years and
the other is the time scale of days right
and if you do it in days that million years
will take forever and if you try to capture
the million years the days you do not capture
at all so there is a problem.
These are stiff problems okay.
So we will look at some way by which we can
fix the stiff problem.
The other thing is here I have taken delta
T/delta x fixed.
I want you to think about that, Monday I will
tell you which means at each point the CFL
was different because the propagation speeds
are different right so what does it mean to
keep CFL fixed right.
So in the next class, we will look at these
issues.
Is that fine okay?
Thank you.
