 I welcome all of you to this workshop on computational fluid dynamics. In yesterday's lecture, I had started the topic on computational heat conduction and started with the finite volume discretization and then shown you the solution methodology and implementation detail. Finally, I had discussed some example problems. I can understand that in this mode of teaching where we use technology a lot. So, the speed of the delivery or the coverage of the content is more and the audience have less time to assimilate whatever has been taught. So, it is always a good idea that when we revise what has been taught in the previous lecture we do in pen and paper. So, let me quickly go through the main thing, the main concepts which you should take from this course at least as far as teaching CFD is concerned. So, let me show you some of the very important things what I have taught in the previous lecture in whiteboard. So, the first important point which I emphasized is in the previous lecture is to start from a conservation law and apply to a control volume. So, what here we are doing is let us take conservation law applied to a control volume. Now, this conservation law applied to a control volume can result in two types of equation one which is called as partial differential equation second which is called as linear algebraic equations. Let me divide this into two parts and let me show you this is what you do let us say in an undergraduate course and this is what you are learning here. Let us do side by side this derivations. So, in an undergraduate course typically you start with a control volume here also we are starting from the same control volume here you write to derive the differential equation you write on the left face of the control volume q x here what we do is that we use what we call as first level of approximation what is first level of approximation what we call as surface averaging. So, here what we say is that this surface left surface we called as west surface and we look at a centroid of this surface denoted as small w. Similarly, on the east face centroid denoted as small e north face centroid denoted as small n and south face centroid denoted as small s and then here we have written q x here we write q small w here when we write q x plus delta x or x plus dx here we write q e note that the direction of the arrows are same here you write q y here we write q s here we you write q y plus dy here we are writing it as q n. Now, then what we do is here I am applying the conservation law for steady state case let me write down as steady state heat conduction with no volumetric heat generation. So, for steady state heat conduction with no volumetric generation how do we derive the partial differential equation this is the partial differential equation this is the linear algebraic equation. So, what we do is that we calculate total heat gained by conduction we do a energy balance. So, when we calculate total heat gained by conduction which is whatever heat which is entering from the x and y. So, it becomes q x is entering on the left face q x plus dx is leaving from the right face and the width of the control volume is del x del y. So, the surface area on the vertical face is delta y plus q y minus q y plus dy into delta x this is the way we do an energy balance similar energy balance we do here also. So, q conduction total heat gained by conduction is calculated here as. So, q x here becomes q w q x plus sorry dx here becomes q e into surface area here again is same delta y plus q y minus q y plus sorry q y here will become q small s q y plus dy here will become q small n delta x then what we do is to derive the differential equation. So, you can see that there is a 1 to 1 analogy between whatever we have done here and whatever we are doing here. Now, here when we want to derive the partial differential equation this total heat gained by conduction I will write a bar symbol here just to denote that this represents q conduction total heat gained by conduction divided by volume of the control volume. What is the volume of the control volume delta x into delta y here. So, when we divide this by delta x delta y and when we use let me do that when I divide by delta x delta y this delta y cancels down and I get delta x in the denominator as well as I get and then when I apply the limits I get del minus of del dot q note the minus sign and then when I apply Fourier law of heat conduction this minus when we will apply Fourier law of heat conduction it is minus k d t by dx. So, there is another minus sign and finally, it becomes k del square t when we substitute q x equals to minus k del t by del x q y is equals to minus k del t by del y. So, this equation finally, we get is k del square t is equals to 0 in this case which you know it is k del square t by del x square plus del square t by del y square is equals to 0. So, this is the partial differential equation you derive. Now, here in finite volume method after the first level of approximation there is a second level of approximation. I just want to show you that there is a one to one correspondence between this step and this step and there is one to one correspondence. So, there is a two stage of derivations I would say this is the first stage where there is one to one correspondence there is a second stage which is the final stage when we apply second level of discretization second level of approximation what we do is that here we basically use discrete form of Fourier law of heat conduction. So, what we do here is to let us suppose to calculate q e the cell center here is capital P. So, if you draw a horizontal line on east phase center it intersects q e and q q capital E and q capital P. So, I may be I will draw it here. So, if this is a phase E this is P this is E and this distance is delta S e. So, how do we calculate approximate q e minus k t e minus t p divided by delta S e. Similarly, we approximate q w q s and q n q w as minus k t p minus t w divided by delta S w. Let us go to the next page I wanted to finish in this page. So, I could so that I could show one to one correspondence, but the space is not sufficient enough and then let me write down all q here. So, q e is equals to minus k I am assuming k is constant it is not function of space function of temperature it is not varying with space q w is becomes minus k t p minus t w divided by delta S w q n is equals to minus k t n minus t p divided by delta S n q s is equals to minus k t p minus t capital S divided by delta S w. Just to give you an idea when there is a waste phase of a control volume p is lying here capital w is lying here and when you want to calculate q w it is your positive axis in this direction. So, minus k d t by d x you want to calculate here you draw a horizontal line it intersects the two grid points capital P and capital E and you use a piecewise linear approximation. So, it becomes t p minus t w divided by this distance which is delta S w. Similarly, we do on the other phase centers. Now, to obtain the algebraic equation we have to substitute this into this earlier equation as it is not in this page I will write it again q w minus q e delta y plus q s minus q n into delta x. Now, what I can do is I can assume because when there is a uniform grid what I am trying to tell is that when your control volumes are of equal size let us suppose this is a control volume p and this is control volume e then let us suppose this is delta x this is also delta x then this distance which we denote as delta S e for a uniform grid generation this becomes equal as equal to delta x delta S similarly delta S w although I am not showing the picture corresponding to that becomes also equals to delta x delta S n becomes equal to delta y delta S small s also becomes equal to delta y. So, for a uniform grid distribution for an interior grid point if I want to get an expression once if I substitute this q w from here to here q e from here to here with appropriate value of this delta S e and delta S w finally I will get minus k I will write it down e I will write down the final expression you will get t e minus 2 p p plus t w divided by delta x into delta y plus k t n minus 2 p p plus t w divided by delta x into delta y. So, you substitute this value of S which I had written here into this discrete form of Fourier law of heat conduction and substitute into this equation how the way we calculate the total heat gained by conduction and you get an expression like this. Now, if I you want to calculate to just to draw an analogy if you want to calculate q bar conduction that is q conduction divided by the volume of the control volume which is delta x delta y then you get k t e minus 2 p p plus t w if you are dividing by delta x into delta y delta y cancels down. So, if I have delta x delta y if you divide by volume you get delta x delta y here delta y cancels down and you get here delta x square as well as you get a second term t n minus 2 t p plus t w divided by delta y square. Now, if you know the finite difference method you although I will show you separately in the next page that actually this equation comes out to be exactly the same equations which you get in finite difference method when you use a central difference scheme in the discretization. However, just for more clarity I will show this in separate page between what is the difference between a finite difference method and a finite volume method. So, let me quickly revise whatever I have done right now. So, that way I had if you have noted down you could see that I divided the page into left half and the right half and I showed you that on the left half you can derive a partial differential equation and the which you do in your undergraduate course and on the right half of the page I have shown you that you can use the same control volume and on the under undergraduate course you start with q x q x plus delta x q y q y plus delta y here we apply first level of approximation and we appropriately write them as analogously write them as q w q e q n q s you do a balance as in your undergraduate course let us say and here also we do the same balance to get a partial differential equation we divide by the volume here we want an algebraic equation. So, it is not necessary to divide by the volume however I had divided by the volume just to show you that this is the finite volume discrete form of the differential equation because the differential equation are per unit volume basis. So, what I what I had shown here is that this is the finite volume discrete form of the differential equation which is the total heat gained by conduction per unit volume. So, if there is any question specific to this I would request you to limit your questions to whatever has been taught just now. Yeah, Jantu has it about. So, this regarding the second term in the q conduction the small correction to be done the T n minus 2 T p plus T s should be done. Yeah, you are right. Yeah, there is a mistake you are right correct this should be T s yeah. V 90 Narkur has a question on what has been taught today. Sir, for the expression in the q conduction in the second term I think the term must be delta y and the product it is multiplied with delta x. Okay, whatever I could understand is a question that this should be delta y and this should be delta x is it right that is what you are pointing out here or where you are pointing the second term. Oh, yes, yes, correct you are right. Yeah, this should be actually here it was delta x. So, when we divide by delta x delta y delta x cancels down and in the denominator you get delta y and here the same term delta x remains. This will be Q s if you substitute as this expression here it will come out to be delta x and here it will come out to be delta y. You are right, you are right. Let me write this equation again I think there is a lot of confusion which is coming up because I have done a mistake here. So, right now there is a mistake here which I have done. So, I will write down this equation again. Q conduction will come out to be k Te minus 2 Tp plus Tw into delta y divided by delta x plus k T capital N minus 2 Tp plus T capital S divided by delta y into delta y. So, just note that here I have done a mistake this I have put at delta x this is delta y in the previous slide. Here in both denominator you can see it was delta x there is a mistake here and it should be this is delta y and this is delta x that is what is being pointed out first thing. And the second correction in this is one thing and here there is a second thing this should not this is not equal to Tw. So, finally, when you divide this expression by delta x delta y delta y cancels down here it is Ts. So, let me put it finally, Q bar conduction is equals to Q conduction divided by volume which is delta x delta y then it becomes k Te minus 2 Tp plus Tw divided by delta x square plus k Tn minus 2 Tp plus Ts I will in the previous slide there is a mistake here divided by delta x square in the previous stage there was a mistake here. So, there were these were the three things which are being pointed out in the previous page this is Ts and this should be delta T delta y and this is delta x delta y and delta x sorry this should be delta x square delta y square this is delta x square and this should be delta y square any other question please. Thank you. Now, if this I wanted all of you to be absolutely clear in this idea because this is the minimum thing which we expect you should understand from this and at the same time with this I wanted you to believe that indeed the finite volume method of discretization is as easy as the derivation which you do for partial differential equations. So, it is as easy as what you derive in your undergraduate course. So, that way I say that you can start teaching this course our programming and programming details are something which are new to this it is just that you are not exposed to it if you start working on it you will also find that it is very easy you had given you SyLAB course because we hope that it help you to get started because the biggest problem which we feel is that people find lack of literature not only lack of literature but lack of literature in terms of the programs also ok. So, let me go to the next thing which I wanted to show in the whiteboard the next thing which I wanted to show is when we if you use a finite difference method how does the equations looks like. So, let us let me I had already shown you finite volume method. So, in a finite volume method I will show you that right now I had shown you in a finite volume method the equations which we get is q bar conduction let me show you right now I had just previous page I had shown you it is K e P e minus 2 T p plus T w divided by delta x square plus K t n minus 2 T p plus T s divided by delta y square. So, this is finite volume method I had shown this in my previous slide ok this is this is I had shown you the same thing which I am writing here. So, in a finite volume method I get this. Now, in a finite difference method what you basically do is that you discretize K del square t by del x square plus del square t by del y square by using central difference scheme. So, if you use central difference scheme it will become P i plus 1 minus 2 T i comma j plus T i minus 1 comma j divided by delta y square by central difference scheme plus K t i comma j plus 1 minus 2 t i comma j plus T i comma j minus 1 divided by delta y square ok. Now, so this is the expression for let us say K del square t or total heat gain by conduction per unit volume. So, this is the expression which you get in finite difference method. Now, let us compare this two expression let us compare this two expressions. So, here you have K here also there is a K this is T east and here it is i plus 1 this is subscript is P actually this is 1 minus 2 1 here also you have 1 minus 2 1 the only thing is that the subscript in this equation and even in the denominator here you have a delta x square and here also you have a delta x square here you have 1 minus 2 1 denominator delta y square here also you can see 1 minus 2 1 delta y square. So, what is the difference between this two expressions is that the subscripts which are used are different here we are using certain letters here we are using certain indices. So, that is the actually when you do programming although in finite volume method we write it like T capital E T capital P, but in a programming you store this temperatures in a matrix and the you use a running indices which had shown you in the last lecture. So, basically P represent i comma j east neighbor represent east neighbor is what does T P what is the location of T P x comma y and is running indices terms it is i comma let me show you in the next slide. So, if you take a cell P this is its east neighbor this is north neighbor this is south neighbor this is west neighbor. So, enough so this is located at x comma y this is located at x plus delta x comma y this is located at x minus delta x comma y. So, if the running indices is i comma j here on E is located with an increment of x by delta x. So, here there will be an increment of i by 1 here on the west face x is reducing by minus delta x. So, it will be i minus 1 comma j I will highlight again pointer. So, this is P this is the this is just a representative control volume. So, if P we represent by x comma y capital E we represent capital E is located at x this is at x comma y E is grid point is located at x plus delta x comma y. So, if this running indices for this is i comma j then as x is getting an increment by delta x the running indices increment is always by an integer. So, if it has been 2 delta x then it will be i plus 2 if it is 3 delta x it will be i plus 3. So, this becomes i plus 1 similarly this is at x minus delta x. So, this becomes i minus 1 and using the same idea north and south are located with an increment of plus delta y and minus delta y respectively. So, north we write as i comma j minus 1 south we write sorry j plus 1 and south we write as i comma j minus 1. So, whatever I have shown in the last slide. So, this E is same as i plus 1 w is same as i minus 1 north is same as j plus 1 south is same as j minus 1. So, what I am showing you here whether you use a finite volume method or a finite difference method for interior grid points you get exactly same equations. Before I close this discussion I would also like to point out another difference as far as finite difference and finite volume method is concerned. This is mostly used as far as the grid is concerned this is related with grid the way we generate the grid. So, I would show you that typically in a finite difference method. So, what I am showing you now is a grid structure grid points I will write grid points in finite difference method and finite volume method. Let us take a square plate or a square domain heat transfer problem let us suppose that is the take the same here also. So, as far as simplest form of grid generation is concerned the procedure is same let us suppose I draw two equi-spaced vertical lines here. Here also I do the same thing two equi-spaced horizontal lines here also I do the same thing in a finite difference method the grid points are this located at the vertices of the control volume. In finite volume method grid points are located at the centroids of the control volume they also needs to be located at the boundary to apply the boundary conditions. If I look into the running indices here in this case it becomes 1 2 3 and 4 and j it becomes 1 2 3 and 4 whereas, in this case it will be 1 for the left boundary 2 3 4 5 similarly j will be 1 2 3 4 and 5. What I am showing you is what is most commonly used many times there may be certain deviation as far as the prescription of the grid points in the two methods are concerned. But this is what is most commonly used grid points in finite difference method and the finite volume method. So, with this I am I had shown you because in the moodle yesterday I saw that someone has asked me to clarify the difference between finite difference and finite volume. So, I would say that in finite difference we just start with the we start with the governing partial differential equation and we apply Taylor series a Taylor series expansion where we you know that there are different type of discretization first order second order third order. So, there are higher order discretization also the second order discretization of del square t by del x square is this similarly for del square t by del y square. So, we obtain what we call as finite difference equation for this individual terms and substitute into the differential terms respectively and obtain the linear algebraic equation. Whereas, in finite volume method the way we do is that we start from the control volume the way we start in the derivation of partial differential equation and using two levels of approximations we end up with an algebraic equation which comes out to be same as finite difference for interior grid points for a simple geometry problem. This is just a square domain which we are taking square or rectangular domain where the boundary is aligned along the horizontal or on the x and y direction. This is x equals to 0 this is x equals to let us say l this is y is equals to 0 sorry let me use point 10. This is x equals to 0 left boundary right boundary is x equals to l bottom boundary is y is equals to 0 top boundary is y is equals to h. So, all these boundaries are aligned along the standard Cartesian coordinate system. However, there are problems I will take an example to clarify this. Let us suppose I have a flow across a square cylinder or a square prismatic bar you can call free stream flow across a. This I can solve by having a by enclosing this square cylinder in a let us say rectangular region. So, this now here what are the boundaries there are two boundaries there are two boundaries when is this inner boundary. So, this is the first boundary inner boundary and there is a second boundary which we are called which we call as outer boundary. Note that we have to apply boundary condition on both the boundaries and we have to capture picture or movie for the fluid flow in between these two boundaries which is let us say this region is that clear. Now, this is what I call as simple geometry problem why simple geometry because the boundaries either horizontal where y is equals to constant and either or vertical where x equals to constant. But if I solve an external flow problem where it is flow across a circular cylinder then my inner boundary is circular and my outer boundary is if I am now there are two possibilities I can take two types of outer boundaries. If my outer boundary is circular then I can solve this in cylindrical polar coordinate system then it will be a simple geometry problem. But if I my outer boundary is rectangular then my inner boundary is circular. So, in this inner boundary what is happening is radius equals to constant let us say r is equals to capital R and this outer boundary here let us say on this boundary x equals to 0 sorry yeah x is equals to l here you have y is equals to 0 here let us say y is equals to h. So, you have a combination of let us say cylindrical coordinate and a Cartesian coordinate which then it becomes a complex geometry problem. Now in this case there are different type of methodologies as far as CFD is concerned commonly used methodologies that whatever grids we generate it is a body fitted grid. Now if you want to generate a body fitted grid we use what we call as the curvilinear grids and then in that case you get control volumes which are not horizontal vertical and typically you get a control volume in this case which will be maybe something like this. So, this is not horizontal this is not vertical so here we have to use what we call as complex geometry formulations why I am telling all this is that although it seems that the finite difference and finite volume gives the same result in a simple geometry problem. Moreover when you go to the complex geometry problem like this then you have you see the real strength of the finite volume method. So, finite volume method when you go to complex geometry formulation if you go look into the history of development of computational fluid dynamics people found that finite difference method does not work that well in complex geometry problem and finite volume method has inherent characteristics of the obeying the conservation law and that is the basic thing in fluid mechanics. So, that is why finite volume method is more popular as compared to finite difference and it has there when you use a finite difference in a complex geometry problem there is a chance that you may have to struggle to get the convergent solution. So, I think this way the two main points which I wanted to discuss before I move into the today's lecture I will stop here I am not right now taking the question maybe I can take one question right now I would suggest that do not ask something on this simple geometry complex geometry that I can take in the evening, but if there is something which you want to ask as far as the finite difference in finite volume method is concerned if you have questions on this pages if you have not understood anything on this I will be happy to answer I want to limit the questions. So, if you have if a specific question related to what equations I have derived here or the grid points which I have shown here please ask. Let us go quickly go to Jane to Heatherbar regarding comparing these two methods FEM and FEM are there any specific advantage to go for FEM over FEM as often we understand that FEM is very useful for complex geometries how about if you look at FEM why do you why should we go for FEM what are the advantages of FEM over FEM. At this point I would answer his question let me repeat his question his question is we can definitely understand the advantage of F finite volume method as compared to finite difference method, but his question is is there any advantage with the finite difference method as compared to finite volume method as far as I understand I do not see any advantage of finite difference method over finite volume method. In fact finite difference method also people use using the idea of finite volume method where they not only define the grid points there nowadays there is another type of finite difference method where it is becoming popular where they use not only grid points at the centroid of the control volume, but they use at the face centers also, but rather than doing that I believe that finite volume method is a better method. So, as far as I know finite difference method I do not see any specific advantage as compared to the finite volume method. We will stop the question answer session now.