[Music] Stanford University thanks very much I'm a very tickled that you're here because I know I'm competing with a football game the start of a baseball game uh so I'm keeping a very close eye on the time because I know the first pitch is at 4:57 so I want to be out before then uh and I'm also competing with the rain and then the first thing is I'm talking about mathematics which generally is something that people want to escape from after college not revisit uh at a homecoming weekend but my purpose for this afternoon is
really sharing with you a bit of the passion that I have for computational mathematics and as Adam was saying I'm directing quite a large Institute now on campus it's the Institute of computational mathematical engineering and you may not have heard of that because we haven't actually been in existence all that long there was a precursor to this institute which was a program in computer science and I actually did my PhD in that program so I'm an alumna myself from 96 and I was fortunate enough to come back here in 2001 as a faculty member after
getting my PhD in computer science in energy resources don't ask me how that happened uh but they allowed me back in and since uh four weeks I'm director of this institute but we have 140 graduate students 70 Masters and 70 phds we have no no undergraduate students but we're teaching 20 courses in the School of Engineering and for our Sciences for Applied Mathematics and so on in the whole for the whole university 4,000 student units and so most of the um harassing the mathematical harassing of undergraduate and graduate students is led by my Institute and
so that's a wonderful feeling to be able to control that for some people very painful experience but I love it and I've always really loved mathematics and I want to uh show you a little bit today why and one of the reasons why I absolutely love this is on the board right now and that's a whole bunch of complicated equations and those are the equations we're going to be talking about today but my idea is that I make this much simpler for you because really when you look at it very carefully all of the equations
that govern fluid flow processes be it climate models weather models U optimization of seale design for competitive yacht races one of the things I've done another thing I've done is optimizing wings for terrasaurus of course they don't exist but we just made up some for National Geographic have all so done fluid flow in oil and gas reservoirs aquifers groundwater models all of these processes that may seem completely different are all governed by these equations there's all the same stuff and then they look very complex right and this is of course what we what we like
we like to use Greek symbols we like to use long uh mathematical Expressions so we can impress people at Friday beers and so on you know sometimes we even put it on t-shirts and have something like n no n we understand this and you don't but really when you start looking at it and breaking it down it's all relatively simple and it's really quite wonderful when you see how all of these fields know Coastal oceans wind turbine optimization you name it is all connected in exactly the same way and this is one of the reasons
why I love computational mathematics and why in the 25 years or so that I've been doing this professionally I've worked on 10 12 13 different projects all sorts of different uh fluid flow uh problems and sometimes when people look at my CV or my publication say you're crazy you know you're all over the place said no I'm always doing just this and so that's what I'd like to share with you so by the end of this hour you're either going to tell yourself that you will never ever do a math course classes without quizzes again
at a homecoming weekend or you're going to be so excited that you will come back next year and apply to do a master's in my program right it's normally either or okay so I'm hoping to see you all back next year for Masters it actually happened once but about 5 years ago I gave a talk at homecoming weekend and there was somebody in the audience who was 84 years old and decided at the end of the talk that he wanted to do another PhD he had a PhD already from Stanford in physics from 1954 I
think it was and he came back and he started it but unfortunately it was a little bit too fast for him but he did take some of my courses which is absolutely fantastic anyway so let's go and and look at these equations so so here they are and they like I said these equations govern fluid flow no matter where the fluid flow is know sometimes the equations look slightly different but in concept they're all the same so I wanted to tell you a little bit about it and I won't uh raas the screen right now
I'm just just going to write here because you know I am just right so let me start here um there is a couple of things in these equations okay couple of terms and when we understand these terms let me put one other down here you've understood all these equations and then I can start talking about how to solve these on a computer because ultimately that's what we'll do okay so and we'll move between Blackboard and screen for a bit uh because you know this is a math course so obviously I have to use this Blackboard
okay now what are all these things here U is stuff that we're interested in knowing now when you think about fluid flow what could U be U is just the name for something we're interested in when we're looking at fluid flow something that describes ocean flow wind and what could you be for example energy or velocity velocity volume we're leaving pressure if we had all of that right if we had and we're assuming that density does not change so we're not taking that into account right now but if we knew how the velocity changed as
I'm traveling through space or as time time changes if I know how the pressure behaves in a system and if I knew how energy behaved so what the temperature was like then the miraculous thing is I can really describe this whole process and moreover I can predict it because think about for example air flow like this in a room okay so we open some windows and there was a nice breeze outside we could maybe feel the air move in this room what drives that air now what is causing it to move pressure difference in pressure
now you can say well it's the wind outside right but ultimately that wind is driven by pressure differences low pressure high pressure what else ultimately by the sum but we're not going to go that far I want to keep the computations a little bit less than than the solar system because then may we have a chance to actually simulate it of the open sure size of the opening so configuration right now how things are moving is dependent on the configuration of my room in other words on the boundaries that I have in in that flow
domain you know if you understand that lingo well how about gravity know you can say gravity doesn't really play a big difference if I have an air molecule flowing around here not going to just drop down right but gradually gravity will also influence things so things move because there is a force acting on them right and as a result of this Force things change velocity changes uh when things start to Heap up somewhere I can maybe have a density change I can have energy change because things can start flowing faster so kinetic energy changes and
so on so all I really need to understand of any fluid system is what's in that system what's going to be moving or changing that I'm interested in and most of the time that is just that's my U that is things like pressure velocity and most of the time we don't think just about velocity but we actually think about something called momentum which is nothing but a mass times a velocity but if my Mass is constant right if I say or air is always the same density waste the same got s certain percentage of nitrogen
certain of oxygen always sort of waste the same per volume then I can just think about velocity and I can maybe write something down for energy but that's coupled to pressure so very often these things are taken together so I think about momentum I think about energy okay and then if I need to I think about Mass that's all so that my you and these things are changing because of forces and most of fluids processes have very few forces acting on them there's there's a pressure gradient right pressure difference pressure differences there is uh uh
gravity sometimes there are forces is at boundaries can you think of a force at the boundary of something that may influence a flow Fric friction right or sometimes we like to call that skin friction because it's friction that happens at the boundary for example on an airplane wing the actual airplane surface is holding back air flow you don't realize that when you're sitting in the airplane when you're sitting in in an airplane and you're looking outside over the wind and you know that you're going 500 miles per hour the funny thing is that at the
surface of the wing the air is actually not moving at all it's just changing very very quickly from 500 milph to zero in a very thin layer over that Wing which we call a boundary layer so it's got very very strong pressure or velocity change in that very thin layer there's a lot of force on that Wing as a result of it right that Wing is really stopping that flow and you can just imagine if you're trying to stop a Runway train and there's a lot of force on you it's the same on that Wing
right but luckily we know how to engineer these things so we have maybe some boundary forces okay and all of these things here they determine how you change so let me just write down determins how you changes you know be it pressure momentum energy whatever as a function of time right so how it changes in time how fast it changes how slow it changes know how long does it take for it maybe it doesn't change at all and also it's a functional space because not everywhere in my domain I may have the same velocity or
the same pressure right so if I look at weather we have nice low pressure here now and somewhere else may be high pressure so it changes also as a function of space now this is really all we need to do and all we need to know we not just need to set up some equations that describe this that says equations that say if I have a strong pressure gradient so my pressure somewhere is high and very close to it it's low what do you think will happen to the air velocity it's going to be high
right because I have a strong force pushing that air from high pressure to low pressure so I have a strong wind so I need an equation that says this a high pressure gradient gives me a strong High Velocity I need to have things like if gravity is strong then my downward velocity my Vertical Velocity will grow now things will start to fall if I have skin friction at a boundary then near that boundary my flow will need to slow down that's all we do it's just a bunch of rules to govern the behavior very natur
natural intuitive behavior of this fluid flow so we look at the fluid problem we write down the sort of things that we want to understand about this flow we write down all of the forces that we can think of that may drive that flow sometimes we throw some out because not all of them may be important right for example in this room if I did air flow in this room I would leave out gravity sure it has some influence but it's so tiny compared to any drafts or all the winds that I may feel in
this room that I can throw that out so we look at it we simplify and then we decide how this changes and the ratio you know these rules that say if my pressure gradient my pressure force is this big then it starts to flow this fast or that fast well that I just know from experience that comes from experimentation because that depends on things like viscosity of a fluid and so on but really all of these rules the General behavior is very intuitive pressure gradient higher flow stronger but how much stronger what that ratio is
that is something we just get from experimentation there's no rocket science involved with that okay so we look at tables and other things and we just write down equation now let's look at this a bit it determines how you changes as a function of time or a function of space that stuff function of time function of space is in simp symbols like this so if I see du DT what it says is how much does you change with with respect to a change in time the little Delta is just a change in so if I
translate this in words this just says change in you in a certain change in time that's all okay what would this say then yeah so if x my X Direction you know we are three dimensioned so I have an X direction I've got a y direction I've got a z Direction this just says if I walk in this direction so I'm changing X this is how much U is going to change now right now here nothing much is changing but it could be that if I'm walking here all of a sudden I'm picking up a
draft from one of the open windows on that side and I start feeling a breeze and then obviously the velocity of the air in this direction changes right so that would then be you so here it's zero and here start picking up the breeze and say oh the udx must be positive because as I'm changing X all of a sudden that velocity starts to grow so that's the udx the udy is the same in the y direction I can do this for pressure I can can do this for velocity I can do this for mass
and that's it so as a physicist and mathematician we just set these things up looking at these physical rules and there come the equations okay so that's the first step it's not so hard can we load the screen go back to the um presentation h b thanks so now let's look at these equations that are a little bit fuzzy which I said before is um by choice because that's how we sometimes feel about them no it's just because copy and paste didn't work very well from latch I don't know if you can see this but
do you see all these DTS D Xs dys and what do you see you see V's you see little Peak that's what that stands for pressure what do you think little U would be that's a velocity but it is one of the how many velocities do I need to describe flow three right and x and y in the Z Direction so we're so incredibly creative as mathematicians we generally call them UV W okay so we have XYZ UV W so you recognize it the udx this is the change in velocity in the X Direction it's
multiplied by something that's a viscosity that makes a lot of sense if I start to push on something whether or not that goes real fast or not well that depends on whether I'm pushing air or whether I'm pushing peanut butter well what's the difference between them well one is a lot runnier than the other no one is very sticky and we call that very viscous so obviously that viscosity needs to come in somewhere well there it is now let's see if I can find some forces right because these are all equations that tell me how
velocity changes or momentum changes and they can only change as a result of applying a force okay so where are my forces they're hidden a little bit but who can see some forces here's a little guy this is g g is the gravitational constant it's multiplied by the density this is just gravity mg now so there's a gravity force and then I had one other force that I talked about there was the pressure gradient so what would be a pressure gradient that tells me how much a pressure changes over space right so how what would
that look like what sort of term would be the pressure gradient the pdy the PDX hey the PDX and the PDX and the udx are in the same equation all makes perfect sense okay so that's really it so now we have the equ equations and then the only thing that we need to think about is how do we model these now you know from algebra that if you have an equation like uh X2 is 9 you can solve for x right can you still do that plus or minus three right or a more uh complicated
one 2X is 16 right X is 8 right so here in this case though the equations are a little bit more complicated first of all we've got these DDX ddts all put together then as you can see we have a bunch of equations because how many unknowns do we have here well we have P we need to know U we need to know V we need to know W right so these are already four equations if I have four unknowns how many equations or four unknowns how many equations do I need to solve for four
unknowns four okay that was the easy one about algebra that's always the same okay and so I have four equations and are these equations independent can I take one and just solve it and then I have the solution and solve the next one no they're all related to each other and that makes a lot of sense because I can't start moving things in this direction in the air without impacting flow in that direction now why would that be suppose I was God which I always like to fantasize about so this is my room right it's
filled with air and I point my finger there and I tell these air molecules there to start moving in this direction what do you think will happen with the rest of the room will I just see that flow only in this direction I would have a vacuum there then right that would not be sustainable so what would happen things would rush in from this side so if I flow in this direction I'm immediately causing a flow in that direction so I cannot solve an equation for this Direction only it will all be coupled together right
and so all of these systems are coupled they're very complex and I cannot just find a formula that gives me the solution at any point in space at any point in time that's impossible in other words there is no analytic solution to this I cannot do what you did in algebra okay so when I first saw this I thought for all these years I have been taught algebra and now I finally come to grad school and the first thing they tell me it's I can't use it right have to go do something else so what
do we do well let me go on and show you first a couple of pictures of things that I've worked on these equations that you just saw can do things like this okay so this is a vertical takeoff and Landing aircraft and you see the Jets coming down now what these streams are here these are Fortis or velocity lines but you can sort of Imagine High Velocity coming down Okay so this would be w in my equation will be very high here right this is the vertical velocity and what is driving that well a jet
and in this jet I'm really just creating huge pressure difference that pushes that air out right it's just a pressure gradient that is doing this so if I were to put the pressure here then I see really really high pressure somewhere there and immediately a lower pressure as that flow is pushed down and then here it hits the boundary and then there is a boundary Force right that I talked about out skin friction and other things and the flow is forced away in this direction and then becomes turbulent and all of these things are governed
by these equations okay I don't need anything more for turbulence or all of that it's all just in those equations that I showed you with the ddxs the DD y DD Zs it's all the same okay but obviously I didn't do this algebraically this is another example one of my colleagues uh is it's just air flow past the race car and then here you see pressure so these These are streamlines to indicate how the air is actually moving and how the particles move over this over this car and here you see the pressure build up
at the surface some areas at the surface experience a much larger Force than than others as this air is hitting it it depends on how aerodynamic this this car is but again all of this is just governed by these equations that I show told you and they're all solved in exactly the same way in fact these two could be solved by the same software uh this is another thing that I've done it's looking at flow for sale design I worked for Team New Zealand for a while for the americ cup if you know who knows
about the America's Cup oh okay good some Sailors in the audience it was wonderful to work with them I I worked on developing the Jer and if you remember well in 2000 that was the only thing that didn't break right but that may be because we didn't design it very well so that we overloaded all the other systems you don't know that either right but here in in s flow and I just show you this again exactly the same equations that we just had uh but I showed this because the behavior of the flow is
very different depending on this boundary configuration right so these equations are all exactly the same but what you see and observe can change a lot you know with the vertical takeoff and Landing aircraft we had all that turbulence coming up but sometimes flows are very smooth so for example if I'm sailing up wind very close to the wind with my with my cils my sails just act like a wing of an airplane it's the same sort of thing but you can see here with smoke this is all smoke so you can visualize how the air
flows okay so these are just how the smoke particles are moving and you see that especially on the on the jig there the the head sell it's very very smooth there's nothing turbulent there it's everything is smoother almost as if it is attached here you see a little bit of a wake little bit of a turbulent wake where the flow is coming off but on the downwind leg when I have my Jer when the flow hits that I see big Eddies and turbulent flow again forming very very different Behavior but exactly the same equations and
he would think the same configuration because I have a boundary like a seal in both of these cases it's just that the oncoming flow is from a different direction and in one case it's from a direction that is very directly aligned with the seal and then the flow stays very smooth it's not really hindered so much by that seal so we call this attached flow and in the other case it's more like a parachute coming down where the float just hits the seal that on is going around it and then the seal with it friction
on the SE surface cannot keep that flow close to it it's almost as if you're on your bike your motorbike and you're trying to go around a sharp Bend and you're going too fast and you're flying out of the bend what is causing that well you don't have enough centripetal force right enough friction to in other words to balance the centri force that's the same here air flow hits the Cil needs to go around the bend goes really really fast and the SE just doesn't have enough skin friction now is a very simplistic way of
looking at it to keep that flow attached to the seal and it flies off it detaches and it starts twirling around okay but the same seal the same equations just different behavior and it I found it amazing that with that set of equations I can do all of these different things I'll show you a little simulation now this is just a if it works yeah this is just a simple did you see it move isn't it amazing oh this is my my little uh very simple little simulation but here I have a downwind sail like
a like a Jer the wind is coming in goes around and here it detaches and I can just on my little laptop this just plays on this little thing do these type of simulations with with these equations and then I could do more complicated things like going into three dimensions and actually doing both of these sales but now this particular simulation here that I that I ran for Team New Zealand would take like a week to run it's not very good right so the sometimes these equations they describe everything but they're very very expensive to
simulate so we need to do something about it and this is why when we doing things like seal design we generally just look at two-dimensional cross-sections and when they do Wing design they generally look at two dimensional cross-sections of a wing yeah did your New Zealand work really change the look at that sale did my work change the look of the sale not really see when you're are working on something like this for a competitive team what they're looking for what team New Zealand is looking for is shaving off two or three seconds of a
lag of the sailing race that may be no 20 minutes long they just want to shave off a few seconds that's all and so when you think about this the the changes that they're looking for really are very subtle changes and I can design a beautiful sale but if the crew is not behaving you know then they won't see the two or three seconds the errors that I'm making because I'm using approximations right I'm ignoring some stuff even when I write these equations down uh here assimilate things in windy conditions well wind is Gusty and
I can't predict what it's going to be over 20 minute time so I make some approximations to the wind they're probably off by more than the two or three seconds so here we always say these simulations give me bread and butter right on the Shelf in my cupboard but they don't help because I'm working in the era margin if you'd like but the nice thing about doing these calculations is that with a simulator like this I can look at some really strange shapes and just play now this is the way I see it this is
not to give them the final design that is exactly a little bit better and it's the same in the aircraft industry you don't use these computers nowadays anymore to get this final design that is just right you always do that with wind tunnel tests and then you have to go and actually fly these things to see how it really behaves right ultimately but what you can do in this it's like a virtual laboratory right sort of at skill and I can put in all sorts of funky designs be creative and see if they do anything
I can explore in other words much more than I can if I have to build a skilled model and put it in a wind tunnel test which is much more expensive so what we do with a lot of this stuff is just play trying out new ideas and with the jica for Team new newand we did that we tried out some new ideas and then the other there's a really interesting thing because now I can come up with a new genica design what does that mean I can come up with a new shape saying if
you had this shape of sale you could seil a little bit faster then I give it to the seal designer and say I want this shape of SE and they say are you kidding me how can I build a sale that retains that shape when I put it in the wind because of course it's a lot more complicated when you actually need to build this right and so there's all sorts of stuff going on but see this more as a virtual laboratory where you can play okay all right now I will let's just leave this
up but I'm going to scribble a little bit here on the side because we had those equations and I told you we cannot compute this with an algebraic equation right so and I've shown you results so obviously we must be doing something to be able to compute this but it's not a formula and so what do you do well the very first thing that you do as an engineer when you have an equation that is way too complex to solve exactly right or algebraically is what you compromise right I mean I'm call myself a computational
engineer I'm not really an applied mathematician because I look at these equations I say I cannot find one formula I'm not interested in simplifying the physics so much that I can do this analytically I could do that could look at very simple domain very simple flow maybe just two Dimensions or even just one dimension they people do that onedimensional flow that's kind of funny right um so that they can find real to bre equations that model this but I don't want to do that I want to have the three-dimensional feeling of this flow but I
can't find it exactly and I think who cares if I can't find it exactly I'll find it approximately I don't need to know exactly that it is 13745 69 m/ second I just want to know it's around 1 that's probably enough right or maybe I want to get a few floating points in there but I don't need this completely accurately so here is the general idea of my field they say Okay suppose that I want to simulate something and it's on this domain we're looking down on the Pacific Ocean okay and I want to simulate
wind here maybe the wind sort of goes like this okay and all of these equations that I just showed with all the ddxs and ddts simulate model this and I'm going to say to myself I don't need to know the solution everywhere that is the trick right so I want to know things only approximately and the way I'm going to compromise is to say I don't need to know the solution at every single XYZ and at every time T I'm going to be happy if I know the solution in some set of points okay and
this was a fantastic idea in the whole field of computational fluid dynamics that I'm talking about is based on it so what they do is they divide this domain into a grid okay and the idea is that at each of these intersections of these grid lines they're called GD points you find an approximate solution okay so in one dimension what would that look like so one dimension look something like this now say we have a domain between zero and one I don't find a solution everywhere but I just find it at a bunch of points
all of these points here and if I was looking for U of X then now I'm saying no I'm not going to look for U of X as a function but I'm going to find u0 U1 U2 for all of these points this is x0 this is X1 this is X2 through to well maybe this is x capital n and all I'm doing is finding those Solutions a unu n un n minus one I just find n values that's all somehow we still need to talk about how but somehow I find them and then I
start to think hey this the solution here or maybe the solution here in this specific ocean through the equations that I have of course depends on the solutions there and there right for example the velocity here will depend on the pressure I have there and the pressure I have there but it also depends on the velocity I have there right because as I said earlier all of these things are coupled together so when I start translating these complex equations to relationships between the use at each of these points I will probably get a large set
of coupled equations out of it right but it's now just a system of equations for the use in each of these grid points and even if there are a million grid points and every grid Point says five unknowns I don't care it's only 5 million unknowns with 5 million equations my computers are big enough that I can solve this no problem right on the computer so the first step is that we do this that we say Okay instead of wanting the solution everywhere we just want it on the grid and then my question to you
is what if I now want to have the solution right here because this specifically may be Hawaii you know I'm interested in the Wind on the big island and it's not in a grid Point what would I do I could take a fin a grid but I don't have enough computer for that maybe I could shift the grid I heard that so that the grid point overlaps with that exactly but that may be hard because then the next thing I know somebody in Tahiti wants to know it and has just shifted my grid and Tahiti
is no longer on it okay so I keep shifting and don't want to do that either but I could just interpolate right so if I have a solution here here here and here I can probably find a pretty decent approximation to Something in the middle can take some sort of average of them in interpolated in other words if I have the solution at a bunch of points I can probably find a solution that is okay and that's all we're looking for in between those points if I want a more accurate solution I got it computed
for more points right it's a simple thing no such thing as a Freel lunch right you want accuracy you got to do it for more for more points now this opens up a fantastic area several one is there are gri ERS that look at the Domain and create a nice grid for that domain and there's all sorts of ways you can do this I'm a very simple Grider I look at the Domain and I want to put in straight lines like this because I like working with these types of grids because computationally they lead to
simpler things but there are people that like using triangularization so instead of having these straight lines they gr something like this anybody from near Pang so recognize this so this is simulation we did on pet sound on for tidle flow modeling and everywhere the there is a vage vortex of a triangle a point in a triangle is one of these grid points they're not as organized as nicely but these points is where we compute the solution and guess what the closer we get to the land to boundaries where things are changing faster the more points
we want okay out here not much is happening really sort of steady flow we sort of know what it is it doesn't change very rapidly it just changes only with the tides I don't have all sorts of small disturbances or turbulence or small addes of a river coming in all of these things happening at small scale don't have any of that so I can take what we call a coarse grid here there's only a couple of points in which you need to know the solution and then I know it pretty much everywhere but here there's
a lot of stuff happening with a river coming in and all sorts of you know Jets and addes here I need to have a lot of points so much in fact that you can't see them anymore right lot of points it together so this actually took one of my students about two months to create this grip to get it just right it seems very simple to do this triangularization but there are all sorts of things you have to be aware of for example if I do a grid here and the triangle is completely skewed almost
squashed together like this then I equations don't behave so well it's just too skewed and and when I actually look at the equations and then how these equations solve themselves on the computer I get problems now I may have too big of an error now so there's a whole science behind this that when you start translating these equations on these grid points how they behave okay so but they look very uh fancy I think we like looking at these things we've done one for cono here in monre Bay right this is the grd and I
I gave you the answer but I always ask what's this thing when I show that to people that's actually the train track it's a little bit higher so we there's no flow going there there's just flow here in this little area here under the train okay so that's Alon slooh again takes a long time to think of these types of grits here's a grid on the airplane now obviously this is not just the airplane itself self that we're gritting but also the flow around it but I won't show you that because it's so hard to
see these things grow in three dimensions but in three dimensions just little tetrahedra so not triangles on the surface but tetrahedra volumes in three dimensions and you can see something here near this edge here the Leading Edge of the airplane wing very very dense grits because a lot of stuff is happening there a huge differences in pressure and so on you can actually see the pressure Distribution on the wing here blue is very low pressure why would the top of an airplane wing have very low pressure well it better if it wasn't we would be
in real trouble yeah because it's the pressure difference between the top of the wing and the bottom of the wing that keeps This Plane up and so we like seeing very very low pressure here and these low pressure areas the true low pressure areas where most of this lift is is actually near the front of the airplane wing okay so if the back of the airplane wing damages a little bit don't worry too much when you're looking out and you see that fall off or break but if the front falls off you better get out
okay now you can do other things like this is just a little simulation very simple thing but as you're moving something this is gas going through a reservoir you see as the gas is moving you see what the grid is doing can you see that that very hard to see him but as this gas is moving through if you looked at this really carefully you can see the grid change so locally we're putting in more grid points because it's much harder to calculate some of this uh this gas flow in those regions where the gas
and the oil come together so we can we do what we call adaptive griding so there all sorts of wonderful tricks that you can play to get good Solutions the question I still haven't answered and I'm going to take three minutes for this and that's the end of your math class is how do I do the translation from these equations onto the grid okay and there whole courses at Stanford called numerical analysis courses find a difference courses find a volume courses they give you ways to do it and there's all sorts of different methods but
they're basically all the same thing so that's what we're going to talk about and it's something like this but I'd like to use the board so if we can just raise this and I'll close this and it just give you a quick idea of how this is done and then you can probably use your uh your creativity to understand that this is a little bit more complicated in multiple Dimensions but it doesn't matter it's all the same thing really all right let me just use this B I think yeah okay so here we are in
one dimension okay just one dimension and we have a bunch of points in which we want the comput a solution okay and this point I want to compute you and that point is point number three or Point number four point number five but I call it Point number I okay so I give it a little number I and what point is this then I + one see you would get an A for this class and this is UI minus one okay now maybe you look something like this I don't know I don't know what that
solution is right but suppose that this is my real solution now in my equations what do I have floating around I have things like DDX right DX right that is the change in you as X is changing what is that really it's a derivative remember that from way past so in this on at this position here now I'm interested in D udx in other words I'd like to replace the udx in all of these equations that I had with an approximation right that in involves only solutions at these points right because I cannot compute the
true dudx because I don't have all that information about you the only information that I want to compute the only thing I want to know about the solution is these guys just in those points okay so it's this one this solution and that solution so now my task is find D udx an approximation to it in this point using only discrete values like this again I don't know how big the UI and the UI minus 1es and so forth are but it doesn't matter because I'm going to compute it all I want to find is
how to replace this in my equation by an approximation and we call this a discrete approximation because I'm only using the discrete points yeah does it make sense so how do I do that I want to find an approximation to the slope in this point right the slope of this line the tangent line using only those points what would be a really nice approximation well the slope is nothing but a change in U corresponding to some change in X so how about if I take a change in U this minus this for example right so
UI + 1us ui- one divided by this distance well I like these grids that have the same distance between all grid points okay because this would then simply be that so now imagine all these complex equations I had in the beginning and every DDX and every ddy and every ddz is simply replaced by an approximation like that what would I get I would get a whole bunch of equations with u's V's W's and P's in i i +1 IUS one all of these grid points that I have and and for every grid point I would
get a bunch of those equations so alt together if I have a million grip points and five unknowns per grip point or five equations I got a system of 5 million equations that all contain these solution values UI minus one U + one and so on and I can solve them all together but it's a large coupled system of equations how many of you have solved systems of coupled equations I mean so it just takes a big computer and the smart algorithm I may maybe some of you have heard about a gausin elimination to solve
a matrix vector equation this is just a m big huge Matrix vector equation that you get but for those of you who know about it it's very large fully coupled often nonlinear CU I don't know if you noticed this but sometimes we don't have UD the udx but we have something like * DX it comes up in the momentum equation for example when I derive a momentum equation and so when I start discretizing that I get something like UI * UI + 1 - UI - 1 / 2 H and that is part of my
equation so now I have a product a multiplication of two unknowns and becomes nonlinear maybe it's quadratic okay when I have to solve a large system of nonlinear equations ultimately I get a huge Matrix vector equation and I need to solve this on my computer but that's all okay so if you know how to do this so you take a couple of my courses next year I think you need with Rusty calculus you need two and then you know everything there is to know about this so two quarters worth of investment and you can go
and use commercial packages and do your simulations the tricks and the reason why I get money for Consulting the the hard parts of this is to have good boundary conditions that are realistic know what parts of the physics you can ignore so that means you need to know a little bit about the underlying physics right you need to understand it well enough to be to know what parts to throw out you need to be a reasonable gridder you need to be able to create nice grids and that's actually more of an art than a science
this takes a long time to play with this especially if you have complex domains like pet sound or monre Bay U but sometimes for a room like this would be very very simple because it kind of square very easy to put a good good Grid in this and then once you have all of these equations you really need to know a little bit about Matrix calculations to do this fast okay so that's maybe another course so let's say three courses right two numerical analysis one one Matrix computation and you can solve almost any fluid flow
problem okay and you can make a little bit of money you're looking for another career not as much as if you do search engine design which is also just a matrix calculation anyway that's my job and that's what I love and hopefully you learned a little bit for more please visit us at stanford. EDU