Okay, so we have been looking so far at the
last class at least, we have looked at some
acceleration techniques; we have looked at
preconditioning the unsteady term for 1D Euler
equations okay. There are some more acceleration
techniques that we need to look at, some of
them are relatively straightforward ideas
that come from things that we have seen so
far, ideas that we have talked, discussed
so far.
Okay, I will just use that to introduce at
least 2 other techniques, fine and maybe I
will suggest a problem that you can try out
for yourself for one dimensional flow, maybe
right out the quasi 1D equations, I just write
it okay, I am not going to derive them, you
can derive them, you already seen them derived
in gas dynamics but still you can derive them
and then if time permits, we will get into
a larger class right.
A larger algorithm, which will take me multiple
classes to at least 2 classes or 3 classes,
right to talk about acceleration schemes of
other need of another nature okay, fine okay.
So, first let us look at; we will just go
back; I will write the equation in delta form.
And I will write the equation in delta form
simply because always, I forget the delta
T there, I write the equation in delta form
simply because I know that if this term were
not there it will become the explicit scheme
okay, I write the equation in delta form and
I am going to use this to just mention to
point out 2 ways by which we can accelerate
convergence okay and the reason why I am talking
about this is I want you to get a flavour
of the kinds of things that you should look
for when you are writing your code, right.
You say, yes last class, I said I want the
wall clock time, the time that it takes for
the answer to come back to be as quick as
possible, as short as possible, the duration
to be as short as possible. So, towards that
there may be effort that you make, various
kinds of things that you do, when I write
this delta form simply because we use this
argument saying that when I get to the solution,
R the residue will be 0, okay.
So, I will repeat that argument, so as a consequence
as long as this is not similar, delta Q will
be 0 okay and therefore it really does not
matter, when I get to convergence, if I am
interested only in the steady state, no longer
talking about the transient, if I am interested
only in the steady state, then I can pick
this matrix in some form, so that it is easy
to compute, is that fine, right.
And we have used this argument before we came
up with the LU approximate factorization,
there are other schemes that we have talked
about, where you can actually replace this
by something that is going to get you to the
solution faster, let me just put it that way,
okay, is that fine. Now, R goes to 0, delta
t times R is 0, okay, so one obvious thing
that you can do right and think back to the
demo, what did I do in the demo?
In the demo, I took; I set delta t by; I pick
delta t/ delta x, I did not pick the CFL,
my delta x is not changing therefore, my delta
t is not changing okay, already when I do
this you know that if my delta x the intervals
are not equal in size, you already know that
the delta t will also change from point to
point but I have picked a fixed delta t, I
did not pick a CFL but you could pick a CFL,
you could pick a sigma value okay, could pick
a sigma value.
So, that it will turn out that the delta t
is not same from point to point in fact, you
can ask yourself the question, so this is
at some point, this is at some, this is of
course the system of equations but at some
point for any point, if you were to take a
delta t, right so if you had, let us just
pick a bunch of grid points here, so you could
pick a delta t here, which is different from
the delta t at the adjacent.
So, you could have a delta tp and the delta
t p +1, is that fine, so the time can be changing
from point to point, this is called local
time stepping. So, what could be the potential
issues, what could be the potential problems?
Well, we do not know if it converge to the
right solution, right, again I would expect
that anybody who studied mathematics uniform
convergence, you have a problem you already
know that we are not; we do not have uniform
convergence.
And we are starting to do funny things like
this, we are saying well, if there is a spot
where the solution converges more very quickly
to a steady state solution, let it go, why
should it be held up by something that is
going at a small rate, am I making sense,
anywhere where I can take large time steps,
let me take large time steps where I am constrained
to take small time steps, I will take small
time steps at those points, is that fine.
So, basically what we are doing is by doing
local time stepping, we are saying geographically
point to point in the domain my solution is;
so, it is no longer if I say first time solution
at first time step, solution at second time
step, solution at third time step, are not
really a solution? It is not; I mean, I cannot
even imagine it as a candidate solution, it
is basically well some state vector cube at
the first time step whatever that means, right.
But I say first time step, I do not say at
delta t, my language is already changed, I
say first time step, I do not say at delta
t, it is not a delta t, 2 delta t, 3 delta
t because I am not anyway bothered in the
transient, so I do not care and if it gets
to a steady state solution that I want faster
my experience has been that you do get to
the steady state solution faster, so if I
am looking for the steady state solution,
I am likely to do local time stepping right.
In my experience you get there faster, so
I am going to do local time step, am I making
sense okay, so this is one possibility, so
what I did in the demo, now say once you will
introduce language, we have to make sure that
the vocabulary is complete, so this is local
time stepping what I did in the demo is called
global time stepping, right just as a contrast,
so global time stepping.
You have to be careful because if you switch
from one to the other or you are making a
presentation where both are there, you have
clarity, this is local time stepping, this
is global times, right okay, is that fine
and obviously, there are things that you can
do in between, there can be places where you
say get to the steady states quickly, there
may be places where you are interested in
transient, I do not know, right.
There could be combinations that you could
use, it could be a script where you use, global
time stepping and the script where you use
local times, all sorts of possibilities, is
that fine okay that is one possibility. The
other thing, remember I want to get only 2;
I only want to get to the steady state solution,
so we talked about fancy things that we could
do to this, the approximate factorization
and so on but there are simpler things that
you can do, okay.
How many terms is the flux Jacobian has? Flux
Jacobian is A, it is a 3/3 matrix, you can
imagine if the problem was in 3 dimensions,
if you are solving the 3 dimensional Euler
equations, it is a 5/5 system, the expressions
are; I mean they are okay but they are not
that great right, pretty expensive to calculate,
so then I ask the question, do I need to calculate
it at every time step?
I only care for the steady state, do I really
have to recalculate this A at every time step,
would really hurt if I kept at constant for
few time steps, am I making sense, okay. So,
I can take the attitude I am only looking
for the steady state, it is pretty close to
the original system, I will just keep A constant
and this can clearly be done, this can be
clearly done whether you are doing LU approximate
factorization, whether you are doing local
time stepping.
They can all be done together, it is not the
one or the other, so one of the things that
you can do of course, remember that the first
3 elements are 0, 1, 0, I mean there it does
not cost you anything, right, so I am not
saying it is 9 but still in the case of a
3 dimensional flow, I make the sale, right
I am telling you that I am pushing the 3 dimensional;
3 dimensional flow you will have 3 flux jacobians,
each of them are 5 / 5 matrices.
At every time step, at every grid point you
have to calculate 25 * 3, right, 75 minimum,
am I making sense, so the question is do I
need to do it at every time step, you do not,
you can keep A constant okay, so you can keep
A constant, then the issue is; for how long
can you keep it constant, we have typically
found well, it depends on the flow conditions,
you know about 10 time steps, it depends on
how rapid the transients are.
But you are looking for the steady state solution,
so in 3 dimensional flow, I am not really
talking about 1 dimensional flow, you can
try it out for 1 dimensional flow and see
if it makes the difference that you keep it
constant for about 10 time steps, 15 time
steps that the savings are quite large, okay,
the savings are quite large. So, you could
keep A constant, remember that means the A
is not varying in time, A still varies in
space, okay.
A is not varying in time, A held constant,
where this N is something that you determined,
is that fine and very obviously, this N may
be small, if you now see a little wrinkled
on that very obviously then maybe small when
you are starting off but as you get closer
and closer to the solution, Q is not changing
much, so A is not changing much, right. So,
it can actually be kept constant for a longer
and longer period, right.
And as Q converges, A will converge, is that
fine okay, so and remember all of these can
be done, whether you do a LU approximate factorization,
all of these can be done simultaneously okay.
So, I think see, this is the deal, the argument
started with just the simple idea R goes to
0, I have my solution and my objective is
to drive our R to 0, now we are just using
that one fact, right.
And then trying to see what is the other degrees
of freedom that we have, the minute I say
oh, this can be anything, the minute I say
this can be anything, see that is a degree
of freedom, then you can say it can be an
optimal thing, then you can start hunting
for optimal okay, is that fine, is that fine
okay. This is as far as I want to go with
respect to obviously these arguments go on
if you want to do a transient, dual time stepping
and all.
You know all of these arguments take place
go on to that only thing is in dual time stepping
case, the delta tau will change from point
to point okay, so all of these arguments whatever
we have done here will go on to that case
also. Again as I said, you could also do preconditioning
the unsteady term, right it does not; you
can do local time stepping, the whole host;
you can use a whole host of these tools, right
to make your code run faster.
To get the solution, I would not say to make
your code run faster, so that is a very straight;
to get your solution back quickly okay, which
is your object to get that solution back quickly,
is that fine okay, right. So, what I want
you to take from here is not just this but
that the process the logic that I gave you,
okay that is what that is the important thing
that I want you to get out of this, the process
that I want okay that is the important thing.
So, I preserve the R and then I do not really
care about the others as much and I use that
to get my speed up, fine okay. Now, what I
will do is; I have talked about a whole bunch
of mechanisms by which we can solve one dimensional
flow, let me suggest a test case for you,
I will just; in case on when I did the demo,
I did not really point out the details of
everything that I was running.
Let me give you the specific details of what
I was running, so that you can try it out
yourself. So, the length of the pipe that
I used, you can take it unit length if you
want to start with, so it can be 1 meter start
with, ask yourself the question whether the
dimensions matter under what circumstances
do the dimensions matter, okay, it is a critical
question that and they help you ask this question,
I am going to post an auxiliary problem.
Because we prescribed P0 and T0 there, do
you remember the conditions that I prescribed
at the stagnation condition; stagnation point,
P0 was 101325 Pascal’s, T0 is 300 Kelvin,
you 
can start this off this way, here of course
we have 84,000 was what I had picked Pascal's
and to set the initial conditions, so I am
not going to write it here as a boundary condition,
remember the problem that we picked the valve,
you decide in the valve was a deep, the valve
that is open does at the inlet.
So, this condition I gave it as 300 Kelvin,
right so the condition in here is whatever
is here, so the initial condition, so this
is initial condition T equals 0, 300 Kelvin
Pa and then you can decide how difficult or
how easy a problem you want to start with,
you can take u equals 0 indicating that the
flow is stationary, so in fact when you open
this suddenly, what you get is not; you will
get a shock.
And you have to apply to find to actually
calculate the propagation speed, you have
to use the; I think, you know condition that
we are talking about the other day, likely
get a shock okay, so there are various things
that you can do, you could set this, you can
raise, I have taken a ratio of about 1.2,
right, if you can keep the ratio at about
that value and raise the whole datum up, so
this could be at one atmosphere, this could
be at 2 atmospheres, see what happens, right.
This is at 300 Kelvin, do you think it will
make a difference, if I change it to 500 Kelvin,
right, this is a problem more difficult to
solve, if it is a 1000 Kelvin, ignore real
gas effects, I am not telling you to take
into account real gas effects, there are once
you start getting to 1000 Kelvin, your CP
value changes, CV value, gamma changes all
of these things change, so we do not want
to go there, you can still keep it at Euler
equations.
But the question is; is there a change; is
it more difficult to solve, is it easier to
solve, okay because I have already pointed
out why did I pick this ratio 1.2 because
this gives me an answer that is close to 0.5,
Mach number 0.5, so this gives me an answer
that is close to Mach number of the flow,
it is close to 0.5, so that my eigenvalues
are all in a nearby range, okay the problem
is well behaved, so this is the other thing.
So, this process that I have gone through
to set up the problem, it is important, that
is the reason why I am explaining this to
you, so you may not; you may solve some other
problem at a later date, you may be working
on some right, research problem and an industrial
problem, somebody gives you something, you
are doing the analysis, you want to develop
code to work on that problem, you want to
test your code while you are going through
the developmental process pick an easy problem.
Pick a problem to which you know the solution,
right pick a problem to which you know the
solution, you anticipate the nature of the
solution what are the difficulties that are
there, so you think about it a little, then
say okay, this is going to give me a problem,
let me pick something that is near Mach 0.5,
okay right, we could have done supersonic
flow also, I could have done Mach 2.
So, you have to ask the question, why I did
not do Mach 2, why did he not do Mach 2, why
did he do the same Mach 0.5, okay, is that
fine, so there are; then you can fiddle around
with this just to figure out how the code
behaves and see what happens, am I making
sense for various values of; normally, your
experience, my suggestion you may do this
everything is in dimensional form.
Normally, what you should do is; you should
non dimensionalize the equation okay, so normally,
whether you do it now, whether you implement
it this way and then later non dimensionalize
the equations is up to, so use the non dimensional
form of the equations okay, in your fluid
mechanics you would have studied non dimensionalization
and why you should look at the non dimensional
form of the equation.
My suggestion is to look at the non dimensional
form of the equations but we can come back
here, you can ask yourself the question if
I take 1 meter or if I take 0.1 meters, does
it make a difference, when does it make a
difference, what is the, when is it the same,
when is it different okay? We are dealing
with Euler equations and that can create some
element of confusion, fine, once you have
this, this is a relatively see, I have shown
you all the features that you can get right
in the demo not much that you can get beyond
that, right.
You can get into trouble you can try out various
things combinations that I have told you and
you can get into trouble, really in gas dynamics
this is not what we study right, you do only
1D equations, you set up the 1D equations
but the interesting stuff when you go to,
comes when you go to quasi 1D, 2 dimensions
is tough, you have got quasi 1D, how you go
to 2 dimensions steady state, right okay.
Quasi 1D steady state, so I am going to draw,
I will draw half which, shall I draw the other
half also something like that, this is a typical
nozzle that you are used to dealing with,
how did quasi 1D flow go? So, you have some
area variation, so the area variation, this
could be the x direction, the area variation
could be some s of x; s as a function of x
and the corresponding governing equations;
the equations corresponding governing equations
corresponding to this would be; I will write
it out, you can verify it right.
You can go back and check whether, so dou
/ dou t of Q times s, just make sure I am
using the same s; + dou/y dou x of E times
s equals; so the right hand side is not 0,
okay simply because I have taken this s inside
the brackets, then I get an extra term. On
the right hand side, I can place an H, the
H is 0, p ds/ dx, 0, you can do a simple sanity
check right now, I would suggest that you
make sure that you are able to remember what
I told you earlier, right.
Make sure you are able to derive the equations,
I may have made a mistake but when someone
is writing this you should be sitting there
doing a simple sanity check, so when s is
a constant that goes to 0 and it can be factored
out, you get back your 1D, so in that sense,
yes it is a superset right but as to whether
the actual terms, individual terms are okay
right, there is something that you have to
look at.
So, this is not really that much of a change
from your 1 dimensional; from a 1 dimensional
solver right, it is really not that much of
a change but now interesting things can happen.
the flow field is more interesting, more interesting
things can happen, the flow field is much
more interesting, so you could choose again
prescribe P0 and T0 here and prescribe a P
ambient here and try out different things,
try out different combinations, right.
You could have subsonic, subsonic throat choked,
throat not choked, right, so I would start
with subsonic subsonic throat not choked that
is where I would start and then slowly build
it up to where it is choked, are you able
to get the supersonic flow right, are you
able to get the supersonic branch, this is
all for a small s and I said for any given
s of x, then you can try if I change the s
of x, right, fine.
If you want to keep it simple remember what
I said always try to keep it simple, so I
would not even do this first, what would you
do first, I would just use a; I would just
do a small converging duct, right, it is the
constant area duct I would actually do a small
converging duct, so the s of x is known, s
of x is simple right, so s of x is a linearly
decreasing function, s of x is known, prescribe
the P0 and T0 here, prescribe the P ambient
here.
In fact, you can take the same values that
are there, see what happens, okay, is it fine
right, you can then do; I would most probably
do then a diverging section and then maybe
a CD nozzle at that time right, always good
to go through a hierarchy of problems, instead
of jumping into the big problem directly,
is that fine okay, are there any questions?
Okay, I think this is as I said you spent
quite a bit of time in gas dynamics on quasi
1D flow.
So, I am not going to go through all the assumptions
right, you would expect that if s was varying
very rapidly, you would expect that there
would be issues, there should be problems
right, so because it is quasi 1 dimensional,
the assumption is the area variations are
very rapid right otherwise, the other 2 dimensional
3 dimensional effects will come to play okay,
fine. So, I will now, what I do is; I go back
to that equation.
I am going to rewrite this, I get back to;
I am going to get back to accelerating convergence
and there is a whole class of schemes that
we are going to look at okay. If I look at
this this looks like some matrix multiplying
some vector equals right hand side residue
instead of using this to start with I am going
to start; I will start with Laplace's equation
okay, let us start with Laplace's equation.
So, I am going to start with Laplace equation
as an example and we will try to reason out,
I am going to follow a certain path but I
want to recollect some of the things that
I have done in the previous classes; the previous
demos more important and conclusions that
we have drawn the demos which are going to;
which I am going to use to rationalize or
base right, this acceleration scheme, fine.
So, first think back to representing functions
using hat functions, right we tried representing
sin x, sin and x and we have drew the following
conclusions, so the conclusions were there
is a highest frequency that can be represented
on a given grid, so there is a; and remember
we are always talking about a uniform grid
for these discussions are always talking about
uniform grid, I do not want to even get to
non uniform grid right now.
There is a highest frequency that can be represented
on a given grid, right, what else, is there
anything else? So a variation of that I turned
the statement around, so whether a given wave
number; highest frequency wave number normally,
when we say frequency when you are talking
about time right okay, wave numbers okay.
I turned it around for a given wave number
whether it is a high wave number or low wave
number.
High frequency or low frequency depends on
the grid on which you are representing, taking
the same thing and right which is also important
for you, so whether a given wave number is
high or low depends on the underlying grid,
I want both this right, though there are variations
of each other, I want both of these. What
else do we know? Now, that I have defined
what is high and low, we go to a different
demo that we did, you go to a different demo
that we did.
And we basically said that if you have these,
if the scheme is dissipative in some sense,
it seems to show that high frequency is Dk
faster than low frequencies fine. So, certain
schemes; high wave number, I am saying frequencies
again, with the quote on high, so now I have
mentioned, I have told you what are high and
low that was the reason why I needed that
okay. So, high is with respect to the grid,
low is with respect to the grid.
So, the grid does now become going to become
important, the underlying grid is very important,
so if you say high wave numbers Dk fast the
low wave numbers which means that by changing
the grid, it is possible for me to change
whether a frequency is high or low that is
the clue okay that is the clue, so we come
up with this idea that we will use multiple
grids, scheme is called the multi grid scheme.
It is not a scheme to solve a problem; it
is a scheme to accelerate a solution technique,
okay multi grid scheme. The idea is to use
multiple grids right, so will I just take;
if I think about one dimensional Laplace’s
equation which is look something like that
right, which you basically know on 3 grid
points, I am not even going to bother to derive
it, you already know, these are p, p + 1,
p – 1.
Then you know that given those 2, right you
already know that up at iteration level n
+ 1 or q + 1 is the average of the adjacent
points, so just a quick example as to how
this happens? So, if I have; if this is what
I am plotting now is the; what I am plotting
now is an error okay, what I am plotting now
is an error, if I have; so I want r, if the
end points are 0, then the solution should
go to 0 either way right.
If I have my initial guess as something that
is this way, we have seen this, I am only
reproducing what we did in the demo but I
want to do it in a very specific fashion,
so if you have a grid point at this trough,
you have a grid point at this peak, you have
a grid point at this trough and if these correspond
to p - 1 and p + 1, you can see looking at
these 3 that the average will give me something
that is going to go that way.
That is basically what the averaging is going
to do, is that fine, everyone, so these 3
grid points are indeed effective and eliminating
that; little high frequency and if you iterate
once or twice that high frequency will go
away and what you will be left with; the high
frequency will go away and what will you be
left with; you will be left with the low frequency.
Let us look at those 3 grid points again.
That is p, p – 1, p +1 and if you look at
it, this, this and this, the average is very
close; the changes that you are going to get
with this grid are going to be very small
okay. On the other hand, if instead of that
you had a grid point here, a grid point here
and a grid point there, now you can see that
if you take the average the change is much
larger, right or even go make it even more,
even make it even more coarser, if you had
a grid point here a grid point here and the
grid point there.
You understand that is where the change is
extremely drastic but the tragedy is that
though the change is drastic, the grid on
which that you are able to do that is a very
coarse grid right, so somehow we have to come
up with a mechanism by which we use, we get
the solution on the fine grid but we use the
coarse grids to eliminate the error; the low
frequency error, the error that is low frequency
on the fine grid, you want to use a coarse
grid to eliminate it.
The error which has low frequency on the fine
grid, you want to use a coarse grid on which
that error will be a high frequency, we want
to use that coarse grid to eliminate that
error, is that fine okay that is the motivation
that is what we are trying to do, this is
called a multi grid scheme. So, we will see
how we would do it, okay, so back here Laplace's
equation; Laplace's equation we know if you
were to discretize Laplace's equation, get
a similar set up.
I am not going to deal with this right, so
I know A is a flux jacobians but you humor
me and allow A to be the coefficient matrix,
so Laplace’s equation, this is for Laplace's
equation, this is not the flux jacobians,
right; A times phi of H equals f of h, I will
put h there, where h is the; h represents
the grid size. See I have already write the
thing a little differently because I am saying
that I am going to use multiple grids.
I am aware that I am going to use multiple
grids right, so now I am being very careful,
right up front I am going to be careful, I
am going to say, wait a minute, if I am going
to use multiple grids, I am liable to get
confused, so let me stick h is up there, so
that I get the; I can keep track of where
I am okay, go back; if you go back to the
part that we did Laplace's equation, you will
see that we can actually write it this way.
In 1D, it would be; this would be a tri diagonal
matrix, in 2D, it is going to be a matrix
whose bandwidth is much much larger okay,
you have done this before, you can write it
in this form, fine. The original equation
is nabla squared phi equals 0, okay, if you
get this exactly, then phi – phi h will
be a representation error, fine right, so
we solve this in some fashion; we can solve
this in some fashion.
You could guess a phi; you could guess a capital
phi, right, you could get some; you can guess
a phi, a candidate solution for this, right
am i making sense, phi H is what you are seeking,
if you have the phi H, you have the representation,
you have the answer, you have the value at
the nodes okay, you do not have this, you
only have a representation of that on the
computer. So, if you have this you have the
solution.
If you guess something which has a error in
it, I will make it capital phi, you could
guess that okay and 
in order to get to where I want to go, since
I have already know where I am headed right,
I am going to do this in steps, I am going
to define an Eh, which is an error, which
is the phi h, which I seek, - capital phi
h, which I have guessed, is that fine, everyone,
okay right. I will also define the residue
rh as fh – Ah phi h, is that fine, okay.
So, what am I going to do? I am going to multiply
this by; you need to multiply that by Ah,
so I will get Ah eh equals Ah phi h – Ah
phi h, I have not done any linearization and
going from really the original equations are
linear but it helps that the equation; the
system of equations is linear right, so I
am using that factor, it distributes over
and this Ah fh is oh, okay, I have a small
error here.
For a minute, I was staring at it saying wait
a minute, there is something wrong, if I have
the solution, the residue had to the 0, right;
if I have the solution, the residue has to
be 0, for a minute, I was staring at this
thing, what is wrong there is something wrong,
okay, fine. So, what does this give me? This
gives me fh - that which is rh, so you get
Ah, eh equals rh, okay, this equation incidentally
is called the correction equation; equation
is called the correction eqaution.
And in fact, you can use this equation to
solve the problem instead the original equation;
instead of using; instead of this, instead
of using this you can actually use this to
solve the problem, am I making sense. How
would you do that? You would guess a phi h;
guess a capital phi h, compute rh, solve for
eh some iterative fashion maybe, you do not
have to solve it; solve it right, you do not
have to use a direct method but get an estimate
for this.
So, find an eh from; then update your phi
h new, then you can iterate, you can do this
iteratively, am I making sense, so you could;
in theory you could use this equation, it
is a little contrived; it looks a little contrived,
right but I just want to show it is equivalent
to solving the original equation, solving
for this correction is equivalent to solving
the original equation, is that fine everyone
okay.
Now, we go one step further, so I can iterate,
I can use either Gauss Seidel or something
of that sort you can imagine that I do this,
I find this, I do one sweep of Gauss Seidel,
I sweep through once with Gauss Seidel, calculate
the new one, go back here, find the new r,
one sweep of Gauss Seidel and you keep on
repeating that process, okay. So, you can
set up an iterative scheme right.
You can use either Gauss Jacobi iteration
or no Seidel or something of that sort, you
can set up an iterative scheme fine. So, you
are going through these iterations; going
through these iterations, you do 10 iterations,
it seems you are converging very nicely, all
the high frequencies are gone and now you
are stuck with the low frequency terms right,
you are taking 101/ 101 grid and you are iterating
away, right and it is not going.
Because the low frequency take turns take
a long time, so the question is; would not
it be nice if I could solve this problem now
on a coarser grid, so that that low frequency
would turn out to be a high frequency on the
new grid, okay. So, we do a small wrinkle,
what we do is; we take the same thing here,
we take the same thing there but we add a
wrinkle.
So, we say, we have the phi h, find the rh,
okay, ah, let me write the; so iterate Ah
phi h equals fh, few times, so to indicate
that I am iterating it a few times, I will
draw an arrow this way and say iterate or
many times you want to do it, okay iterated
some n times, you already have a disposable
parameter, it will be 5 times, 10 times you
figure out what is good right, iterate n times.
Calculate rh equals fh - Ah phi h, so this
is our current estimate after n iterations,
what comes out of this is capital phi h that
is what comes out of that. Now, in some fashion
transfer rh to r2h, I do not want to call
it r2h, so I; r2h, you need I have to does
an extra step, be careful with this part I
am going to come back and erase it and make
some changes, transfer from r to r2h okay;
rh to r2h, you understand what I mean.
So, if you say wait a minute, how do I transfer
or how does this magic occur? We will see
it in one dimension right, so these are the
grid points that I have one dimension, I will
keep it coarse, so that we are able to and
let me get some coloured chalk, so if I have
a value here, I have a value at these points,
so this is h, 2h would be this okay, so to
find the value here; to find the value at
this point to transfer.
The simplest way to do is just throw that
away, that is the simplest way to do it, just
ignore these points, just throw those 2 away,
take the one that is there, it is a best way
to do it, you do not like it though as long
so much and all those adjacent points should
ideally throw it away this is what you feel,
you feel regret, then do a little work right,
take a weighted average, one of this, one
of that, 2 of those divided by 4, right you
understand what I am saying.
So, 2 phi p, phi p – 1, phi p + 1/ 4, right
and these are all capital phi’s okay, this
is phi, of course it should be r, I should
actually be transferring r, right, it is not
really phi, it should be r, let me correct
that; 2rp, rp – 1, rp + 1/ 4, all of these
at h, this is okay, so now you have a way
by which you can get r at 2h, am I making
sense at the point p, fine. Transfer from
rh to r2h back here, iterate this, n times
get a candidate phi, find the residue, transfer
the residue, okay.
Then what? On that coarse grid, solve A2h
e2h equals r2h, means solve, I mean iterate
a few times, iterate to get eh, okay, transfer
e2h to eh that should not be difficult, is
not it, that should not be; you can interpolate
using the same example, if you want the value
here, you can interpolate right, you can interpolate,
you always get the value in between. Then
repeat the correction, update.
Transfer it back phi h new equals phi h +
eh that you have transferred, okay in fact,
instead of what you can do is; you can do
this and just to be sure that you have everything
on the h grid fine, before you say I have
the solution, you can iterate Ah phi h equals
fh, a few more times just to make sure you
have a solution on that fine good, fine, everybody
is okay, the transfer to a coarse grid and
transferred back.
Now, comes the little trick that we are going
to do okay, now comes the little gimmick that
we are going to play, come back here, you
are here, you have done the transfer okay,
you have done the transfer, having done the
transfer, come back here and I am starting
to iterate, right, you are working on a 50
/ 50 grid, you are doing iterations, you do
10 iterations all the high frequency errors
on that 50/ 50 grid disappear.
But it still does not converge because on
that grid there are low frequency errors that
grid cannot converge that rapidly that though
there are low frequency errors on that grid
that do not go away, so you think, if only
I could run them on 25/ 25 grid, right and
you can, if you just change the rotation a
little okay, so if you guys do not mind, we
will go back here, changes the notation a
little, you change this to f to h, transfer
rh, we will call it change it to f2h.
If you change it to f2h what happens to this
equation, that says Ah eh equals f2 h that
looks very suspiciously like the original
equation which we are trying to solve, which
is Ah phi h equals f2h; fh, okay. So, what
you need to do is; you iterate this, another
n times or m times or whatever it is, n1 times
or n2 times whatever to get this and do not
transfer it back, instead calculate r2h, now
you understand why I wanted to call this f2
h.
Because I propose to define a residue at this
level, calculate r2h, which is f 2h – A2h
e2h, transfer r2h to r4h okay, r4h, you could
in theory transfer it to any size that you
wanted but it is a little easier if you keep
them; if you keep the relationship transfer
r2h to r4h, iterate A4h e4h equals; oops little
mistake; transfer r2h to f4h, cannot fall
into; now first time it is okay, second time
we cannot make that mistake.
Now, we know the game, r2h has to go to a
f4h, iterate this, how many levels do we want
to go well, that depends on where you started,
if you started with 1023 grids or something
huge number, huge size; 1000 / 1000 grids,
right and clearly there is some relationship
to powers of 2, we have to look at what is
that relationship, okay, I let you figure
that out, so then you can keep on having the
grid, right till you get to a point where
you are happy with what you have; the convergence
rate that you have, fine, okay.
Oops, okay that is fine, what I will do is;
we will get back to this. We will talk about
may be a little of this multi grid thing in
the next class okay, thank you.
