 In the previous lecture which is an introduction I had emphasized some very or may be iterated the there are certain concepts which Professor Puranic has introduced I mentioned few of them which are very important as far as moving ahead in CFD is concerned. So, that again try to explain may be in slightly different manner how to derive the govern conditions what are the boundary conditions and then now we are starting with the actual you can call it as a CFD. So, I am starting with a simplest case in CFD which we call as the heat conduction problem. So, this what I am calling as a computational heat conduction is basically a numerical method to solve the heat conduction problem. So, as I mentioned that so let us suppose here in this topic what you are aiming ultimately what is the objective? The objective is let us say that you want to develop a software which can solve heat conduction problem. Now, to develop a general software or general program you need to have various options like as I mentioned in my previous lecture that in a software there is a preprocessor part there is a solver part and there is a post processor part. So, when you want to develop a general software let us say for heat conduction you have to have general features such as user should be able to enter the domain any domain he should be able to use any boundary condition. So, you need your programming you have to develop some those switches and then there will be a solver part which will solve set of equations with certain numerical methodology for that problem and there will be a post processor part which will plot the results. However, here what we are emphasizing is not on the preprocessor part we will just mention the preprocessor part we as far as coding is concerned software or program development is concerned here we are our emphasis is on the solver part because that is what we consider as the most important thing. So, I would point out that here the objective is to discuss more on the solver part that how the equations are actually solved and the results are obtained after there is a user input. I mentioned that when you want to let us say ultimate objective in this case is that you create a software for solving heat conduction problem and let us suppose you want to create of a movie for heat flow to understand how the heat transfer is occurring. Now, let us suppose if you want to create a movie then you want to generate pictures to generate picture here what type of picture you want you want picture which should represent heat transfer what is the picture which represent heat transfer all of you may be knowing that the temperature represents the is the variable which we use to represent heat transfer as far as the heat transfer is concerned. There is another thing which is called as the heat line which is analogous to streamline which was proposed by Bayesian in 80s which is also quite popular. So, let us suppose you want to create a movie for temperature distribution or to create that movie you zoom to some region in space. When you zoom to some region in space as I said that when you want to create a movie movie is made of pictures and you want to create a picture a picture is made up of let us say many pixels and that pixel analogously I had said that in computational heat competitive CFD analogous to pixel here we have what we call as grid points. So, I will start with grid generation. So, once you select a domain then we do a first level of discretization which we call as a grid generation. Once you generate the grid let us suppose you have decided that what will be the pixel of your camera. Now, so this is the first part second part is. So, let us suppose if there are 100 points in the domain let us suppose you want to obtain create a movie for heat transfer in a square plate. So, let us suppose in a square plate you decided after grid generation. So, grid generation is a procedure to convert the infinite number of points into certain discrete points. So, when you get those 100 points then you will use a method to obtain 100 algebraic equations with 100 unknowns of the temperature at those 100 points. So, this is a method to discretize the domain. This is a method to obtain the set of linear algebraic equation and solution methodology is a detailed procedure how to solve those algebraic equations. But when you want to develop your program or software there are a lot of implementation details which are involved. I would highlight that in many CFD books these are not given in that much detail because if you want to develop program after learning first 3 steps still you struggle how to develop a program or software. This is very important in each of my lecture I give special emphasis on this part which I called as a implementation. Finally, I will take up some example problem which will give you a flavor of CFD application. So, the first 4 parts of this lecture are basically on the CFD development and the last part is on CFD applications where I have taken some 1 dimensional and 2 dimensional problem and show you some of the movies for heat transfer. So, let us start with the first level of discretization which is a domain discretization. Now, this I would like to show you through an animation because I believe that although you may be looking to this picture but you can get a better feel of grid generation through an animation. So, I will show this with an animation here I am showing you how many points are there in this. We are dividing let us suppose this is a plate which we have taken from a furnace and it is subjected to certain thermal boundary conditions and we want to do divide this domain into certain discrete point. Now, the grid generation is as I mentioned is a procedure for discrete representation of domain. So, in this plane there may be infinite number of points and we are dividing it into certain fixed number of points. Now, what you see here is I am showing the points as circles. There are circles I am showing in 2 colors one is yellow color and a green color. So, the yellow color circles what you see here they are lying inside the plate and there are blue circles which are lying at the boundary. So, I will show you that if you take a plate of length L 1 and height L 2 how we generate the grid this is the simplest form of the grids which I am showing you just because when you start when you teach a first course on computational fluid dynamics this is the simplest form of grid generation which you can take. So, here I want to show you what is grid simplest form of grid generation. For the students in the class I feel that this is the simplest way which you can explain them what grid generation is. If you can draw equispaced vertical lines let us suppose the domain is of length L 1 and L 2 here what I am showing you an animation where we are dividing the domain by drawing equispaced vertical lines and equispaced horizontal lines. Now, by doing this how many we get certain small size of squares how many small size of squares are there here you can see that this is 1, 2, 3, 4, 5, 5 in the x direction 5 in the y direction and in finite in the finite volume method which is most commonly used in CFD this is the way we define grid points. So, the grid points are located at the centroids of the control volume. So, there are 25 control volumes and there are 25 yellow circles which are lying at the centroids of the control volume. This is called as interior grid points. Now, when you want to solve equations linear algebraic equations later on which will be obtained from the governing equations or the differential equations governing conservation laws or differential equations you want to apply the boundary conditions. Let us suppose the left wall of this plate is at 100 degree centigrade. Now, when you want to apply the boundary conditions you will apply at some points. So, these are the points which are shown by blue circles at which you will apply 100 degree centigrade. So, there are two types of points two types of circles I am showing in the figure yellow circles which are lying inside the plate blue circles which are lying at the boundary of the plate. This is the left boundary this is at the bottom boundary this is at the right boundary and this is at the top boundary. So, with this you have divided this plate into how many points how many yellow circles are there in the x direction 5 how many blue circles are there in the x direction 2 total 7 points in the x direction total 7 points in the y direction. If you take the real world problems it may be as high as million by million also and when you want to solve it computationally you want to create let us say a movie you want to store data like in this case you want to store data for that is temperature here for 7 by 7. So, when you want to store a data you need a data structure. So, what is the best data structure for this case. So, what is the best data structure for this case it is a just a 7 by 7 data which you have to store that is a matrix 2 dimensional matrix. So, you note that we use matrix as a data structure to store the data why do you need to store the data because with this data you can create a picture for a particular time. And if you create those picture at different time instance you can create a movie and then you can try to understand the heat transfer phenomena. So, when you want to store a data structure then like when you want to store in a matrix there are certain number of rows and certain number of columns. So, you need a running indices. So, what is shown here I is called as running index and what is shown as j here is called as a this is the running indices in the x direction this is the running index in the y direction. So, this running index in the x direction is varying from 1 although in programming like C language it starts from 0, but here we are starting from 1 and it ends at some maximum value for this example what is this I max. So, I is equals to 1 is what all this are at I is equals to 1 I is equals to 2 are all this points I is equals to 2 all j this is I is equals to 3 all j 4 5 6 7. So, I max is 7 similarly, if you go to j this is j is equals to 1 this is j is equals to 2 this is j is equals to 3 and this is j is equals to j max. So, what is the value of j max 7. So, I varies from 1 to 7 j varies from 1 to 7. Now, if you look into the yellow circles carefully, you will realize that the thickness of the black line which is at the periphery of the circle is thick for certain control volumes. If you compare the this circle with this circle or this circle with this circle what is the difference the black line at the boundary is thick in this cases, because here we are defining the different types of control volumes. Note that this type of control volume we are taken for the derivation of continuity and momentum equation in the previous lecture here we will use the same control volume. So, from the same control volume you can obtain differential equation which was shown in the earlier lecture and from the same control volume here we will obtain algebraic equations. There are three types of control volume for implementation details this classification is done which help you to have a better understanding if you want to develop a program. So, there are three types of control volume, this control volumes are in fact all yellow circle control volumes are called as interior control volumes but the interior control volumes have certain control volume whose one of the adjacent neighbor is a boundary point. Now, what are the neighbors let me first explain you later and I will show you that when you take any control volume it will have its west neighbor this capital W corresponds to west neighbor, capital E corresponds to east neighbor, capital N corresponds to the north neighbor and capital S corresponds to the south neighbor. So, if you go to this control volume you see its north neighbor is a blue circle its west neighbor is a blue circle if you go to this control volume its west neighbor is a blue circle. So, those interior control volumes whose one of the neighbor is a blue circle or a boundary point those control volume here is called as a border control volume. So, all the yellow circles are interior control volume but border control volumes are those interior control volumes whose one of the neighbor east, west, north, south at least one of the neighbor is boundary control volume. Now, this boundary control volume is you can define it as a control volume whose volume is 0 because as I say that the points are sitting at the centroid of the control volume. Here at the boundary there is no non-zero control volume it is lying at the boundary at the face of the here. So, you can assume that the volume of this boundary control volume is 0. So, that is why centroid is at face at the boundary. So, this boundary control volume is a 0 volume has a 0 volume and I am here showing you the running indices for the interior control volume, border control volume and boundary. Let us start with the running indices of an interior control volume. So, how many interior control volumes are there? 5 in the x direction, 5 in the y direction total 25. Now, the running indices if you want to scroll through those 25 yellow circle is i is equals to 2 to 6 and j is equals to 2 to 6. i is equals to 2 is the this 3, 4, 5, 6. So, i varies from 2 to i max minus 1 note that i max is 7. So, it is 2 to 6, j also varies from 2 to 7 minus 1 2 to 6. So, 5 points you are scrolling in the x direction, 5 points you are scrolling in the y direction. What is border control volume? Border control volume is an interior control volume which are at the boundary. So, this is at i is equals to 2 means i is equals to 2 all j are these points i is equals to 2 j is varying from 2 to j max minus 1 2 to 6. So, i is equals to 2 j is equals to 2 to 6 are all these points i is equals to i max minus 1 that is 6 for all j which are these points j is equals to 2 all i are these points j is equals to 6 all i are all these points. So, this are the running indices note that here in computational dynamics you do computation point by point control volume by control volume note that we apply conservation law to each of this control volume and make sure that the conservation laws are obeyed. So, we have to move from one control volume to the next control volume and so on. Now, to move we have to tag we have to have a tag. So, that we know the neighbors also we generate linear algebraic equations where later on I will show that value at a particular point is the function of its certain neighbor not all the neighbors. Once you do a grid generation it is not that you only divide the control volumes into certain control volumes and generate certain points called as interior points and the boundary points that is not sufficient you do this division because there are certain parameters which you want to calculate from the control volume. The geometrical parameters are calculated in a grid generation procedure what are those geometrical parameters like the width of the control volume such as let us say in a grid generation procedure what is basically done is that coordinate of the vertices of the control volume are calculated. So, in this figure I would mention this is just one representative control volume. So, let us suppose out of this 25 control volume let us take only one control volume and let us try to calculate the geometrical parameter. So, this control volume with its east west north south neighbor is shown in the next slide note that there are two type of key I am showing one small letter second capital letter this capital letter E is corresponds to neighboring cell center this small letter E corresponds to east face center east face of this control volume note that this east face of this control volume is also west face of east control volume when you go to this control volume now it becomes west face. So, this is there is a line which I am showing you here red line what does this represents this represent centroid of the this east surface this is the north face center north this is the centroid of the north surface area of this control volume this is the centroid of the west face of the control volume. So, note that here I am showing you not only the centroid of the control volume, but centroid of the surface area of the control volume. So, this is the representative control volume whose centroid of the its faces are small e small and small w and small s and the neighboring cell centers are capital E capital N capital W and capital S. So, these are the definitions as far as the face centers and the cell centers are concerned now as far as calculation of geometrical parameters are concerned what we do is that we know the coordinate of the vertices which is this is which vertex north east vertex this is which vertex north west vertex this is south west vertex this is south east vertex. So, as this is a rectangle we are doing a Cartian coordinate system you can calculate the coordinate of the centroid. So, x p is the coordinate of the centroid of this control volume y p is the coordinate of the centroid of this control volume as a function of its coordinate of its vertices once you know the coordinate of the vertices you can calculate the coordinate of the centroid you can calculate the delta x and delta y you can also. So, the width of the control one this delta x and delta y are the width of this representative control volume. Delta S w and delta S e is this distance delta S e is this distance delta S e is x e minus x p delta S w is x p minus x w. So, this delta S is representing distance of a control volume from its neighbor. Small w means west neighbor, small e means east neighbor, small s from means south neighbor, small n means north neighbor. So, note that in this slide I have shown you how to calculate the width of the control volume and distance of a cell center from its neighbor. Note that in this course that is why I say that fluid mechanics is more difficult to teach or it is more conceptual, but in CFD we have to discuss the details of this methods. These are just calculation of some distances which may not be fluid mechanics some is basically a geometrical problem. So, this involves some, but I believe that this mathematics is what you may have studied in your schools is much simpler as come. So, I do not believe that CFD is too mathematical to teach and later on I will show you. So, the mathematics which are involved do you feel that this is complicated enough? It is a basic geometrical problem which we are doing here. Right now it does not involve any mathematics we are just calculating the certain geometrical variables for the control volume which is width of the control volume and the distance of a cell center from its neighbor. If you have a control volume like this you can calculate delta x delta y in a much simpler manner. How? If l 1 is the length of this control volume and if you are dividing what is delta x this width is delta x. So, this l 1 is divided into how many widths 1, 2, 3, 4, 5. So, if l 1 is 5 what is delta x 1 divided by 5 which is 0.2. So, this general expression is delta x is equals to l 1 divided by i max minus 2. Similarly, if you look into if want to calculate delta y. So, when you are there is a uniform distribution what I am showing you here is that you can calculate delta x delta y in a very simpler manner simpler expressions delta y even here you can calculate as l 2 divided by j max minus 2 which is shown here. Now, the surface area, surface area I am just showing you the magnitude not as a vector. So, I am not showing its direction what is each surface and what is the west surface of this control volume? East west surface are vertical surface. So, the surface area here will be it is a two dimensional control volume. So, the dimension perpendicular to this plane we are taking as unity this will be delta y into 1. So, as delta s e and delta s w it is delta y into 1 what is the surface area of the north surface and the south surface north surface and south surface are horizontal surface. The surface area is delta x into 1 which is shown here. How do you calculate volume of the control volume? Multiply the widths of the control volume delta x into delta y which are the width of the control volume delta z we are taking as unity in this case. So, with this you calculate the width of the control volume surface area volume and as far as for that control volume simple uniform grid you can calculate width of a cell center from its neighbor this distance for this type of control volume the delta s e and delta s w. Let us suppose here the distance between the two neighboring cell center is this width is let me show in a different way. Here I said that delta x is let us suppose l 1 is 1. So, let us try to obtain the coordinates. So, what is the coordinate of this? 0 let us say this is 0 0. So, the x coordinate here is 0 this will be 0.1 this will be 0.3 this will be 0.5 this will be 0.7 this will be 0.9 and this will be 1. So, if you want to calculate the distance between cell center at this phase this is 0.3 and this is 0.1. So, difference is 0.2 if you go here here again it is 0.5 minus 0.3 here it is 0.7 minus 0.5 here it is 0.9 minus 0.7. So, for this it is equal to delta x, but when you go near to the boundary what happens? Like for this what is the distance between these two cell centers it is 0.1 delta x by 2. So, near to the boundary for border cell like for all this border cell delta s w delta s w means on the west side west phase what is the distance between the cell center? The distance between these two cell center is 0.1. Similarly, the distance between these two cell center is 0.1. So, there are certain at for the border control volumes at certain phases the distance will be half as shown here. For all control volume this distances in the east and west direction is equal to delta x on the north and south it is delta y except for the left phase of the border left border control volume. What I mean by left border control volume this is the this is left border control volume this I am calling as right border control volume. This is bottom border control volume and this is top border control volume. So, for left border control volume delta s w is delta x to on the right border control volume again delta s e not delta w will be delta x by 2 similarly for the bottom top border there it will be delta s s and delta s n. So we are using some simple expression from geometry and obtaining okay so this completes the grid generation it is simplest form in the coordinator workshop I would like to mention I had taken this topic in much more detail but what I felt is that this basically involve geometrical procedures you may think that if you use a software the grid generation is much more complicated as compared to this you may have unstructured grid you may have a curvilinear structured grid. So I understand that they are there but here I do not have time to cover all those and I am covering what I consider more essential as far as which is a more direct connection with fluid mechanics. So the grid generation topic I had avoided in this essentially five day lecture as far as core CFD part is concerned however in future I would be if we have a more advanced course on computational fluid dynamics I will be happy to discuss the topic on grid generation in much more detail. So after the grid generation now let us go to the second level of discretization which is obtaining the set of algebraic equations. I know many of you feel that CFD is mathematical quite mathematical and I know the background of most of the let us say faculty or let us say students of most of the colleges in our country that I taught this course for the first time in NIT and after my masters and before my PhD I had taught even in private engineering college after my graduation and before my masters. So I have feel about the background of the students in this colleges whether it is a private engineering college or it is a national institute of technology and for the here in IIT I had been teaching this course for four continuous years taught through distance mode also. So what initially when I had taught I used to I also used to feel that this subject is quite mathematical and I could also see that this is a very important subject and it has to it should go as an undergraduate course so that more number of people are trained and I see that in industry also there is lot of need of good trained people as far as CFD is concerned and although we have people working in CFD but we need to train them in a better way. So this had motivated me to come up with a finite volume method where I try to reduce the level of mathematics which is involved so that for a teacher I can say that this method you tell me where you feel it is too mathematical. So this motivation I had come up with a procedure to obtain set of a LeBrick equation which I called as a physics based control finite volume method. Let me explain what the philosophy with which I had I will I am discussing this point topic. What I want to emphasize is that in an let us suppose in an undergraduate course on heat transfer or fluid mechanics. Let us say in the first course of heat transfer first lecture of a heat undergraduate heat transfer course what do we typically do. We take a control volume we write in that let us say Cartesian control volume we write Qx on the left side Qx plus delta x on the right side and so on. We apply conservation law of conservation of energy and we show them how to obtain governing partial differential equation for two dimensional heat conduction with volumetric heat generation. Now in CFD what is typically being done in fact almost all the CFD books is that they start with this differential equation. Now when you teach a CFD course starting with differential equations I agree with most of you that you find difficult to connect to the students because typically the first or the second lecture of the CFD start with differential equations big big equations instead what I feel is that if you start with the same control volume with which you have started your undergraduate course on heat transfer or fluid mechanics it is easy to catch their attention and to sustain their attention in future lectures. So in a CFD class or in almost all the CFD books it starts with differential equation and then it use Gauss divergence theorem then you find that things are becoming much more mathematical students find hard to get a feel of what is Gauss divergence theorem how it works and using this Gauss divergence theorem in a typical CFD traditional CFD course you see that you get a algebraic equation. What I have done is that I will not start with the differential equation in a class of CFD let me start with the control volume with which I teach the undergraduate fluid mechanics for heat transfer course. So starting from the same control volume let me not use Gauss divergence theorem let me not use differential equation and still reach to the algebraic equation same algebraic equation note the word same so the idea is let us try to reach the same end result without following this path instead following this path and I had seen that student gets much more understanding feel of how we have obtained this algebraic equation. This what I call as novel physics based finite volume method this I you can call as traditional more mathematical as then physical. So all through this course I will be using this physics based finite volume method however I will convince you I will do this also and I will convince you that whether you start from here or whether you start from here you end up with this algebraic equation. There is quite analogy and similarity between how you obtain a differential equation from a control volume and how you obtain algebraic equations from a control volume. So to show that analogy what I will do is that I will do what you do in let us say undergraduate course in fluid mechanics. So let us start with something which you already know and then I will try to take you to something which probably is new to you. In an undergraduate course on heat transfer you apply law of conservation of energy to control volume and there is one more thing which I would like to point out that in this when you derive differential equation you draw limits delta x delta y delta z tends to 0 to get differential terms. Basically you use limit volume delta v tends to 0 whereas in a traditional CFD what you do is that basically on conservation law you take volume to 0 to obtain differential equation. On the same differential equation you integrate with volume. So here you are reducing volume to 0 and here you are integrating the volume. So the combination of these two steps is basically that I do not take volume is equals to 0 and then integrate let me take the control volume and directly obtain the differential equation. So in an undergraduate course we use limits we apply the conservation law we divide by the volume because there are certain flux term where you have surface area divided by volume you get elemental length scale in the denominator you use limits and get the differential term. So this is what is done in undergraduate heat transfer course you apply law of conservation of energy rate of change of internal energy or enthalpy is equals to heat gained by here I am showing you the differential equation for a more general case not only for conduction but also convection. So rate of change of internal energy is heat gained by convection plus volumetric heat generation. So this is the rate of change of internal energy as I mentioned so this is the symbolic form of the law of conservation of energy this is the rate of change of internal energy inside this control volume this is total energy which is heat energy which is going in this is rate at which energy is going out this is the total heat gained by volumetric heat generation. As I mentioned that to get the differential equation we have to divide by volume so let us divide all these terms by volume. So rate of change of internal energy per unit volume in a differential form is expressed as rho Cp del capital T by del small t I hope you could understand and appreciate this rho into delta V is mass mass into specific into delta T is the change in internal energy and when you take derivative with respect to time it is rate of change. Now this volumetric heat generation most of the problem it is given to you we denote commonly as Q bar now this E in minus E out divided by delta P this I will denote as heat gained by convection per unit volume. So now if I want to have heat gain then gain will be in minus out heat inflow minus heat outflow divided by volume. So what are this heat rate of heat transfer which we are representing here we are expressing it in terms of flux term which is heat flux multiplied by surface area. So when you take in minus out this plus this minus this and this and when you divide by volume for vertical phases when you divide by volume here you have delta y and volume is delta x delta y so you get a delta x term in the denominator these two terms if you divide by volume you do a balance and divide by volume you get a delta y in the denominator by surface area divided by volume gives you delta x here and here it gives you delta y and then you take the limit delta x tends to 0 delta y tends to 0. So the differential representation of rate at which heat is gained by convection per unit volume note that here it was inflow minus outflow so it was Q x minus Q x plus delta x in the next slide I am taking minus sign outside I am taking Q x plus delta x minus Q x and applying limits and I get minus of del dot Q this you should consider as first stage of derivation this derivation is analogous to in momentum transport del dot sigma. Now here we have to apply because this gives you energy equation in terms of heat fluxes and heat fluxes are non-measurable quantities so we need another law which is called as a subsidiary law which in this case is Fourier law field conduction using Fourier law field conduction we convert this del dot Q to del squared t which is shown in the next slide so this I consider as the first stage of the derivation then in the next slide use a subsidiary law when use a Fourier law field conduction you have only this term you do not have the second term but here I am showing you convection so there is a conduction plus there is an advection this is a conduction heat flux this is an enthalpy flux so conduction heat flux in the x direction plus enthalpy flux in the x direction gives me total heat flux in the x direction similarly in the y direction so this Q x and Q y if you substitute here so in the previous slide it is del by del x of Q x plus del by del y of Q y and note that it is minus sign here so when you take the derivative with the minus sign this minus will become plus and this plus will become minus and in the next slide you get so the advection term is negative on this side but when you take on the right hand side it becomes positive and you get this equation which is called as the energy equation for heat convection in 2D Cartesian coordinate system I would like to draw your attention that there are two stages of this derivation this is the first stage why I am saying this that later on I will draw analogy when we derive algebraic equation there also we will derive in two stages in first stage we will derive in terms of heat fluxes in second stage we will derive the final equation where you will have temperature everywhere and starting from the same control volume although we need to use certain approximation okay so I completed the derivation of energy equation in two stages first stage where the differential equation was in terms of heat flux del by del x of Q x plus del by del y of Q y second stage where we applied substituted Q x is minus k del t by del x plus rho u C p t similarly for Q y and finally obtained the second derivative here again we will do the we will take the same control volume however we will use certain approximation to do those two stages in an algebraic form we use the same conservation law rate of change of internal is goes to total heat entering the control volume but here for simplicity I am showing you for conduction I am not taking advection I am not taking convection I will take it in the coming lectures although the differential equation I had shown you for convection but the algebraic equation right now as this is the topic on computational heat conduction I am limiting to conduction okay now let us so now the idea is we will take different terms like in conduction what are the terms you have rate of change of internal energy is one term left hand side and what is the second term rate at which heat enters the control volume by conduction is the second term and there is a third term heat gain by volumetric equation so let us take this three term one by one and let us obtain algebraic equation so how do you obtain rate of change of internal energy in a control volume so I am showing you a control volume and let me switch to the whiteboard and show you so there is a control volume in this control volume this is the centroid denoted by p now I want to calculate the rate of change of internal energy in this volume it is a conduction problem so it is a solid so if you want to calculate the change in a volume how do you express internal energy it is a solid so Cp is equals to Cb so let me denote it by elemental mass into specific heat into this will have we want to calculate rate of change so I will have a time derivative is it okay or this dm I can express as density multiplied by elemental volume and Cp rho is for in a solid let us assume that density and specific heat are not are homogeneous are constant everywhere so they will not vary in the volume so this rho Cp comes out of the integral and in this differential term you can take it inside the control volume and you get a term like this delta vp is the volume of this control volume so you want to calculate how to calculate or I would write how to express del capital T by del T integral dv in a volume in algebraic form you want algebraic equations what does this integrand means here rate of change of temperature all of your you are sitting in a room suppose your room is air conditioned so this term del capital T by del t let us suppose in your room temperature is varying with respect to time now it is varying with respect to time as well as space but at a particular time this gradient will have a particular value let us suppose in your room temperature is varying with respect to time as well as with respect to space but at a particular time instant this del capital T by del spawn t let us suppose you take a temperature measuring device and try to measure the temperature at different points in your room you will get different values so this value will vary from point to point so let us suppose this control volume which we are considering is your room but if I do not want to but that is a very in computational fluid dynamics we do not take control volume as large as your room size but we take a very small control volume however just to give you an idea let us assume that in your room if you have calculated if you want to if you do not want to do this experiment at different points in your room but you want to do at only one point what is the best point which can which will have a least error as compared to the exact result which point is best in your room one point you tell me that point mathematically if you try to understand our physical it has a physical basis also centroid the centroid of the room so there is one point which is a centroid of your room at that point if you measure this del capital T by del small t if the size of your room is very very small as you keep reducing your size this approximation will becoming will start becoming more and more accurate now you tell me whether this mathematics is difficult is it too mathematical this is the approximations which we will be using let us go back so this del capital T by del small t variation of what is this this is the rate of change of temperature in this control volume so just for explanation I had said that let us take this your room as this control volume but in actual case this control volumes are much smaller than the size of your rooms and I mentioned that the rate of change of temperature varies from point to point but we are not considering point to point variation but we are so this gradient this will be exactly equal to the average value multiplied by the volume and here note that here here there is an equal sign and here there is an approximate sign so we are approximating that the average value of the rate of temperature in your room let us say or in a control volume is equal to the value at the centroid so the first level of approximation is equals to volume averaging of the rate of change of velocity we will do in momentum equation but right now here it is for temperature in a control volume as a value at the centroid of the control volume this is called as a second order approximation actually the this approximation later one I will highlight that this approximation is very simple this is a very simple mathematics which is involved into this like if I ask you that if you have a very if you have a function a non-linear function let us say f of x now it may be varying in a very non-linear fashion but if you take let us suppose the function is varying between x1 and x2 now if you want to know the value of let us say function if let us suppose you want integral of f of x now to calculate that integral if I say that I do not want to calculate value of x at various points but I want to calculate only one point and if I use that point as centroid let us say x1 plus x2 divided by 2 so the type of the approximations which we are using is the value of f at x1 plus x2 divided by 2 into delta x is equals to integral of f dx now this approximation you tell me when it we start becoming true as soon as that the delta x goes on reducing why because when you when however non-linear a function may be when the delta x starts reducing the curve locally starts becoming linear any non-linear curve you take when you take a very small element length in the direction of independent variable you can say that the curve is made up of elemental lines okay so this is the simple mathematics which is being used to explain it more clearly let me show you a function let us suppose you have a function f of x x is varying from let us say x1 to x2 and let us suppose the variation is something like this now what I am saying is that integral of f dx is exactly equal to average value of f into delta x now this average value I am approximating as x1 plus x2 by 2 which corresponds to the x coordinate at the centroid into delta x now here you can also see that the curve is quite non-linear but if this delta x what right now this is your delta x okay this delta x is x2 minus x1 in this case so as this delta x goes on reducing so if it has reduced various if you take very small length locally you can consider the variation as linear and that is what type of approximation we are using this is called as a second order approximation and this approximation note that this will be used many times for various terms so this is the type of simple mathematics which we use in CFD so this average value of the rate of change of temperature we express in terms of the value at the centroid so this is what I call as first level of approximation okay so this we can also say that this is volume averaging of the rate of change of temperature in a control volume you are averaging the rate of change of temperature so this is the first level of approximation what is the second level of approximation this differential term rate of change of temperature at one point which is the centroid of the control volume how to express this in a algebraic form discrete form this is a differential term we have to convert into when you want to convert into algebraic equation then it is a discrete form so this expression you may be remembering Professor Puranik had taught finite difference method and in that this is which type of discretization this is called as forward difference this is a derivative with respect to time earlier he might have talked about dt by dx where it was xi plus 1 minus xi sorry ti plus 1 minus ti divided by delta x but here it is a time derivative so it is time derivative here is expressed at superscript n so the spatial the point will not change so t will remain same so it is first subscript is pp will remain same but the time level which is expressed by n n is the old time level n plus 1 is the new time level like in any unsteady problem if you want to capture let us say movie you want to capture data or let us suppose to capture a data you want to have an equation where there should be certain terms which should be of previous time level and there should be certain terms which should be of the new time level because to here in CFD the idea which we use is that we start with an initial picture which comes from the initial condition and then using the value or data of that picture we use some expression and obtain the temperature or data for the next time level or generate pictures for the next time level and then so from t is equals to 0 let us say I create picture for t is equals to 1 second using the temperature for t is equals to 1 second I create the picture for 2 second and so on so to create those type of pictures you need expressions which involve values at different time levels so note that for time here we will represent by superscript so the superscript is represent the time level and the p corresponds to typically i,j east will corresponds to i plus 1,j west will corresponds to i minus 1 north to j plus 1 and south to j minus 1 they will be shown as superscript so this is the second level of approximation this is the discreet representation of rate of change here we are using first order forward difference if you substitute into this finally you end up with a discreet or a lebric form of the unsteady term okay so this is so we have converted the first term rate of change of internal energy of the solid inside the control volume so this left hand side we had converted into algebraic equation the same left hand side earlier I had shown you how to obtain differential term what is the differential term rho cp delta v del capital T by del small t and here it is an algebraic form now from the first term let us go to the next term rate at which it enters the control volume by conduction and let us use approximation note that finally in a differential form you get k del square t but that is the final form of the differential term in a for conduction term but before that you get del y del x of q x and del y del y of q y so in this slide I am showing you an algebraic form of that term so what is that algebraic form so here again in earlier case the rate of change of temperature was varying in a volume now here when we talk of heat transfer but that especially the conduction heat transfer the conduction heat transfer occurs across the surface of the control volume now when things occurs across the surface of the control volume like conduction rate of heat transfer you know we represent it by conduction heat fluxes so this q capital q is the total value is expressed in terms of small q small q is the heat flux heat transfer per unit area now this is the vertical surface so this vertical surface the area is delta y into 1 this is the flux multiplied by area this represents the total heat transfer similarly we do on the right face top face and bottom face now this q x value again this will vary on the surface as in earlier case it was varying in volume we took an example that in your room let us say rate of change of temperature is varying point to point in a volume so let us take this let us say you go back to your room and let us suppose you have many surfaces in your room and in each surface temperature or heat flux will vary point to point so let us suppose you are in a room let us look to your left surface on your left side there must be a wall so let us suppose on that wall there is a conduction heat transfer which is occurring and it will vary from point to point but again here again we use an approximation where we earlier we were averaging in a volume here we want to average in a surface but the idea remains same what is the idea we will take it as a one point variation so we express this total value in terms of the value at the centroid of the surface so note that in previous slide capital P was centroid of the control volume in this slide small w small s small e small n which is denoted by this small green line represents the this is the centroid of the west surface centroid of south surface east surface not surface so we are representing this total heat transfer on the various heat surfaces by heat conduction in terms of value of the heat flux at the centroid of the surface multiplied by surface area and on the west surface and south surface it is entering so it is a plus sign and on north and east it is leaving so in minus out gives you total heat gained by conduction okay so here I am showing in more detail that we do surface averaging to calculate let us say on the east surface this q which is varying with respect to y will vary from point to point but we are taking its average value as value at the centroid so what is the algebraic form of this algebraic form I will show in the board algebraic form is this what I am trying to emphasize here is that this equation is analogous to minus of del by del x of qx plus del by del y of qy that was a differential form of the law of conservation of energy this is an algebraic form and I will show an expanded form of this algebraic form in the whiteboard so the total heat gained by conduction after we use the approximation on the west surface and the south surface it is entering so it will be qw delta sw plus qs delta s at s minus q at n delta s at n minus q east delta se so this I am saying that this is analogous to minus of del by del x of qx plus del by del y of qy these two are analogous this is a differential form this is an algebraic form and this is a differential form but they are analogous so note that by using the first level of approximation we got equation analogous to del by del x of qx plus del by del y of qy using the second level of approximation so what should be the second level of approximation it will be Fourier law of heat conduction so second law of approximation is for discrete representation of Fourier law so on a east phase at the centroid of the east phase this qe means conduction heat fluxes at the centroid of the east phase this is equal to minus k delta by del x at east phase here we assume which is true in most of the cases that k is not varying from point to point so k is constant we have to just need an approximate representation of del del t by del x on east phase now this east phase if you take a uniform control volume which we are taking right now this point lies exactly in between the so when what is del t by del x to calculate del t by del x you draw a horizontal line if you draw horizontal line at e it will intersect this p and e and this small e is exactly in between this capital e and capital p we want final algebraic equation in terms of the value of temperature not phase center note that we have if you have 25 yellow circle you need expression for temperature on those 25 yellow circle that is the reason we want to convert this del t by del x here in terms of the values at yellow circles so how do we calculate del t by del x at small e you draw horizontal line and on both side left side you have one yellow circle tp right side you have one yellow circle te so you can calculate del t by del x as t capital e minus t capital p divided by the distance between those two points if you use this what you are assuming local variation is what you are calculating slope of what does this represent this is slope of temperature variation in the x direction if you are using approximating this slope as this it means you are locally assuming that temperature variation is linear you use the same thing here also to calculate del t by del x at small w you take t capital p minus t capital w here also you are assuming linear but this linear is different from this linear because it is not necessary that the slope of this linear is same as this linear so this is called as piecewise linear approximation this is also second order accurate to calculate the normal gradients at face center here I am showing you to calculate normal gradient of temperature later on to calculate viscous stresses there you will need to calculate the normal gradient of u velocity for x momentum and normal gradient of v velocity for y momentum equation okay so this discrete representation of Fourier law of heat conduction now what we do is that let us go to the whiteboard so this q w we will express it as minus k t capital p minus t capital w divided by delta x w delta s w this q e will be minus k t capital e minus t capital b divided by so this all this small q we substitute the discrete representation of conduction heat fluxes which are this and then we obtain before going into the final equation I would just like to show you that the source term here in this case it is the volumetric heat generation so we are done with two terms the internal energy left hand side term and the right hand side conduction term we are left with the volumetric heat generation so in the case of volumetric heat generation if the volumetric heat generation is varying in a volume we assume its value at the centroid and most of the cases volumetric heat generation is given to us so this is an input so we do not need further approximation of this so the total if this is the volumetric heat generation term you just multiply by the volume to calculate the total heat gained by volumetric heat generation so with this if you substitute the algebraic form so this was the algebraic form which had shown you for the left hand side term this is for the conduction term and this is for the volumetric heat generation so this is the final algebraic equation which you get from the control volume so we started from the conservation law we started from the conservation law and use two level approximation for unsteady term and obtain this algebraic form for the unsteady term for the diffusion term we applied first level second level and in the whiteboard I have shown you after the first level this is the algebraic form when you substitute this Fourier law discrete form of Fourier law fluid conduction into this you get a final algebraic equation in terms of temperature and then this is the algebraic form for Fourier from for the volumetric heat generation and finally you get this equation so from the control volume you know from your undergraduate courses how to obtain differential equations here you can see from the same control volume using simple approximation simple ideas surface averaging volume averaging how to calculate a gradient on a phase centers in terms of the neighboring cell centers these was linear approximation using those simple mathematical ideas you can end up with an algebraic equation note that this algebraic equation you can use these approximations are good if your surface areas are small if your control volumes are