hello everyone and welcome back to my channel in the last lecture we started our discussion on the convection diffusion equation taking a general case of one dimensional steady convection diffusion we introduced the finite volume method so we took a step away from the finite differences and i told you how you can consider a finite volume around our point of interest p and using that property of the control volume or the finite volume we arrived at the discretized version of the governing equation so in a nutshell we had the governing equation we integrated that equation and
we use this control volume or we use this finite volume to come to that discretized version so today i would be talking about certain kind of schemes that are used in such problems where we have this convection term the whole uh complexity of navy navy strokes equations actually arrive from this convection term because that's where the non-linearity of the system actually lies so it's very important that we understand how we can deal with this non-linear convection term so in the lecture today i'll tell you about two very popular schemes the first of them being the
upfront scheme and the second being the quick scheme so we'll see how we can use these schemes or what exactly is the fundamental behind using these schemes for the convection term so before i go into that i'll give you a brief recap of what happened in the last lecture so let us jump right in so in the last lecture we had this particular equation so we had this equation here which is d over dx of rho u phi equal to d by dx of tau d phi over dx so on the right side we had
the diffusion term and on the left side we had the convection term and after we integrated the entire equation on this control volume which is of the importance here so we had this control volume around point p and we integrated this equation over that and using that we came at the integral version of the governing equation which is written here so after solving the integral we came to this particular step i'll call this as let us say equation capital one so capital one equation was without any assumptions so we took the governing equation as it
is we integrated it over the control volume and we arrived at equation one so until equation one we didn't have any kind of assumptions in the picture after step one we introduced this assumption of piecewise linear function or we assume that the function phi or the variable t or whatever it is it varies linearly between any two points so we said that the function phi it was varying linearly between p and capital w and similarly it varies linearly between p and capital e so using that we come to this particular big equation and we defined
something called as f that was related to convection f being equals to rho times u and we introduced a diffusion term as tau over delta x i'm sorry it should be gamma over delta x not tau so i'll write that particular equation again so we had this as the general solution of the convection diffusion equation and if i want to show you what what the solution of this particular equation that is the convection diffusion equation so we had the equation being the first derivative of rho u phi is equals to the first derivative of gamma
times d phi over dx so we had a convection term and we had a diffusion form so let us consider a 1d domain because it's a 1d situation so let us consider a domain which is at x equals to 0 and x equal to l being the endpoints and we say that the phi is phi 0 at x equals to 0 and phi is phi l at x equal to l now it is very easy to solve this particular governing equation because it's a ordinary differential equation it's not even a partial differential equation it's an
ordinary differential equation in one variable x and we have one variable phi which is of our interest so if you do the mathematics it's very easy to show that the phi the solution for phi is written in this particular form so we have a parameter called as capital p which i'll be showing you very shortly what that is the p is called as the peculiar number and that is given as rho ul divided by gamma so the peclet number is a ratio of the convection to the ratio of diffusion so if we look at this
particular equation or sorry if this particular solution and if i want to show you what the solution of this particular problem that is where at x equals to zero so we have this our x axis and this is phi axis so at x equals to zero we have this particular point which is phi zero and let us say this is as phi l and let us say that this is l so so that we have these two as the boundary conditions so i want you to understand how the peclet number is going to affect this
particular solution so the picnic number is defined as rho ul over gamma or the convection over the diffusion so piglet number zero it implies a pure diffusion problem because the magnitude of u would be zero right so when the effective number is zero it means the convection term is zero and we have only diffusion in the problem and coincidentally we have done this right we only considered the diffusion equation in the past and we saw that it's the solution of such a system is linear that the temperature was varying linearly from one end to the
other end so if the piglet number is 0 we know that this particular problem would have a linear solution now let us say that this is x equals to 0 and this is x equal to l and the the corresponding u or the convention is that the the u is positive if it's in the positive x axis and u is negative if it's in the negative x axis so i want you to have an intuition of let us say we have a low temperature here and a high temperature here and think about this for a
moment if you raise the temperature here for a while and if you have a velocity that is flowing from this direction to this direction like this right so you can imagine that as soon as you raise the temperature here it would be convected from this point to this point because of that velocity so the convection would be taking place here and all the property that is generated here would be transmitted there very quickly so whenever the u is greater than zero the properties here it would almost shift over here right so the corresponding variation of
phi on the plot here would be something like this right so let us say this is for p is greater than zero so p is greater than zero it it is due to the fact that the velocity magnitude is greater than zero and similarly when p is less than 0 or the u is in the negative direction it means that the variables here are going to be very rapidly transferred or convected to the variables that is on the x equals to 0 side so what i'm trying to say here is that for p less than
0 we would have a situation like this and the extreme cases are when this speculate number is very large or you can think of that this is a very strong convection so as soon as something happens here it reaches all the way up to here so we would have almost no variation until here and then all of a sudden there would be very large variations remember that the boundary conditions are always fixed this is always phi 0 and this is always pi l the only variable here is the packet number and that determines how quickly
or how slowly this change is going to happen so when the packet number is very large on the positive side the variation here would be very slow because it's connecting everything downstream but as soon as it reaches here there would be a very sharp gradient across this right so for very large piglet number i would almost have a variation like this so this is p greater greater than 0 and similarly for a very small piglet number on the negative side we would have something as shown as this so this is the ideal or the exact
solution of the problem later we would be trying to find numerically whether our schemes can they actually provide this solution or not so first i will talk about what is called as the upwind scheme so all of these schemes they are to deal with the convection parts so the diffusion term remains as it is will not touch the diffusion part will only deal with the convection part and all of these schemes they provide a way to find the convection f values you remember we have this f small e and f small w for the faces
of the control volume and we want to see how this convection coefficient or how this convection strength is actually given by these particular schemes so i'll first draw the same control volume again so we had this p we had this capital e and capital w and we had our control volume where we had the small e and small w we took our governing equation and we integrated it remember so we had something like f e phi small e minus f w by small w equals to diffusion i'm not going to touch the diffusion term because
that's not of my interest so previously what we did was we assumed that the phi was varying linearly let us say this is capital p this is capital e and so this would be the small e so we said that because the phi was varying linearly between these two points therefore the phi at small e it would be half off or the average of these two phi in the upwind scheme what we say is the value of phi at small e it would be the same as the upstream value so what that means is let
us say if the flow is going from left to left to right so it means that phi at small e is the same as pi x capital b so remember that picnic number thing again it assumes that if the piglet number is greater than 0 it means that or if the flow is going this way the upwind scheme assumes that the property here is actually being transferred from the capital p point so it doesn't say that the phi small e is the average of these two numbers it is very direct in the sense that it
says that the phi at small e or the control volume phase is the same as the upstream side because the flow is going this way so this is the upstream side this is the downstream side so for this particular point this point is the upstream point and this is the downstream point so that means that phi at small e is equal to phi at capital p so if i want to find out the phi at small e we say that it's equal to phi at capital p if the u is greater than zero or if
the u is less than zero it means the flow is going this way then the upstream point would become fire at capital e so whatever the control volume face value is it's the same as the variable at the upstream point so we have to decide what the upstream point is and to put this in so we have this function that says that if the u is greater than 0 we had certain value and if the u is less than 0 we have another value so now we want to put this particular problem here right so
we can't use this conditional statements here so what we do is we introduce a maximum function that is equals to these large brackets x and y and it returns whatever so this is equals to whatever the maximum of those two number is so if this is if let us say x is greater than y then it returns x and if x is smaller than y then this function would return y so based on that we can write that phi e this is equals to phi p the maximum function of f e comma zero so now
i have converted this u you remember that f e is nothing but rho times u small e right minus pi e minus phi small e comma zero so now we want to verify whether this particular statement is equivalent to this statement here so when the f e is greater than zero it means u e is greater than zero so when f e is greater than zero this particular bracket would simply become f e and this particular bracket because the f e is greater than 0 then minus f e would be a negative number and this
bracket would become 0 and this whole quantity would become f e times 5 p right and we said that when f e is greater than 0 or when u e is greater than 0 the phi e should be equal to phi p so this particular solution this should be f small e so f e phi e it becomes f e phi p i hope you understood this and similarly the fw phi w it would become phi w and the maximum of f w comma zero minus pi p minus f w comma 0 and when we
want to write the governing equation it would also take the same form of a p phi p equals to a e phi e plus a w phi w so at this point i don't want you to dive very deep into the mathematics that is going on behind the scene but i want you to have a physical understanding of what's going on so the idea here was the upfront scheme it doesn't assume that the function is varying piecewise linearly between the two points it rather takes the upwind value as it is for that particular function so
that is one way in which we can simplify the convection term and could arrive at the governing equations discretized version so we would be looking at the exact coding part of their upwind scheme or the piecewise polynomial linearly scheme later on but at this point i want to you to give an overview of what exactly would be going on and how we would be doing it in matlab later on the next scheme that i want to talk about is called as a quick scheme and if you are if you have used any kind of cfd
software i hope you you would have read these somewhere during when you were initializing this problem or finding the setup for your problem so these kind of schemes are very commonly used in cfd and that is why i'm only sticking to these very popular schemes although there are a lot of schemes that can be used but that's too many to cover and i want to do i want you to understand only the very popular or very robust schemes that are very commonly used so now let us look at the quick scheme so the quick scheme
here so i'll give you what it stands for and with that also you'll get an idea of what it would be so the quick scheme stands for quadratic upwind interpolation for convection kinematics so you can see that in the name itself we have this convection kinematics so all these schemes are meant to deal with the convection term and in quick scheme we see that it's quadratic upwind interpolation so it's still some sort of interpolation which is based on the upfront scheme but in the upwind scheme we were very direct he said that the upward value
is exactly the same but in quick scheme we want to improve the robustness of the scale so we consider more points on the upstream and the downstream side which i would be showing you later so let us say we have the same problem we have this p we have this capital e and capital w so let us consider the case of when u is greater than 0 so we had let us say we want to investigate this small e point so the idea of upfront scheme is very simple ah so the idea of quick scheme
is very simple we consider two points on the upstream side and one point on the downstream side so in this case because the flow is going from left to right so we have capital p and capital w on the upstream side and we have this capital e on the downstream side so we assume that the function varies quadratically that is the phi is in the form of ax square plus bx plus c so the phi would be varying something like this where we know the value of the functions right so we know that this is
phi capital w this is phi capital p this is phi capital e and we want to evaluate what is phi at small e so this particular quadratic form we know that there are certain boundary conditions we know that that at x equals to x w or if we assume that this is x equals to 0 or x equals to 0 we have phi equals to pi w at x equals to x p or small h which is the grid spacing we have phi equals to 5b and we have another variable that is x equals to
xe or 2h we have phi equals to phi e so we have one equation for phi which is quadratic in nature so it only needs although it only needs two indifferent uh boundary conditions or boundary points but we have more than that so we can easily determine these coefficients a b and c so if you solve this you can get a is equals to phi w minus 2 phi p divided by e divided by 2 h square you can get b of the form of 4 5 p minus pi w plus 3 phi e divided
by 8 and the c is simply equals to phi w so now we have the value of a b and c we know that the phi varies quadratically between these two points these three points and the phi small e it lies somewhere in between so using this quadratic function we can interpolate for phi e so we know that for phi small e it means that x equals to 3 h by 2 right so if this is the origin then this particular distance is 3 h by two if you put that you can obtain that phi
small e is six phi p minus pi w plus three phi e divided by eight right so in the quick scheme we use these three points around the control volume phase to obtain this phi small e so coming to the sort of conclusion here for the first part for the uh central difference or for the piecewise polynomial scheme the phi small e was given as the average of the surrounding points in the upwind scheme we considered the upwind direction and we said that the phi small e is the same as the phi at the upstream
point in the quick scheme we took two points on the upstream side and we took one point on the downstream side we fitted this quadratic polynomial and we interpolated for 5 small e similarly let us say we had these same points we had this p e and w and if the flow was from right to left then it means that we had to consider another point this east east so we if we want to evaluate the same small e because one upwind point is capital e we needed another upwind point which could have been phi
capital e capital e and the downstream point would be capital p so in this particular case the expression for phi e then would be 6 5 e minus 5 double e plus three five p divided by eight i hope i've written this right so for now i would recommend you that you can practice how these uh phi small e are obtained for the quick scheme cases generally speaking out of the three schemes the quick schemes give you the most accurate measurements or the most accurate results while it would take time because it has to evaluate
a lot of parameters to get that phi small e so we'll look at uh we'll take a very particular problem where we know about the flow field and using that knowledge we'll try to get this estimate of how the phi is varying in the particular problem so in the next lecture we will take example of a flow example of a case where we know how the u varies and using that knowledge will understand how the variation of fire is obtained from these three schemes so before coming on to that i hope that you'll give yourself
a lecture give yourself a hands-on on deriving these uh all these numerical schemes that we have considered so far and with that i believe that you can have a very good understanding firsthand of what these themes really are so i hope that you learned something today and i'll see you in the next video thank you