 Now, I want to show you the animation, as I mentioned that we are right now talking about the implementation details. Now, actually the procedure which I am telling you or the formulation I am proposing and the programs which I am discussing the pseudo codes which I will be discussing. The idea here is that let us program which is more physics based. So, let us not program algebraic equations which is a mathematical equation, but let us program in such a way that even in your programs we have physical terms rather than coefficients because you know that when you program linear algebraic equations then they are mathematical. So, that way to draw your attention so that when you are programming you are having the feel of what terms you are calculating because many times you in a program if you calculate coefficients you do not get feel of what the coefficient means. So, the procedure which is being proposed here is that even during programming let us do the way the energy conservation occurs. So, in conduction I had mentioned that let us first calculate the heat fluxes at the phase centers. Now, to do that you should know that what are how many when you want to calculate heat fluxes like in your analytical course you just have to use a calculator to calculate one value, but in a computational course here what is being done is that you it is not one you have to calculate many and that too here in this case in a 2 in a 1D it is a you store it in a 1 dimensional data structure in a 2D you store in a 2 dimensional structure. So, you need to have a data structure and this heat fluxes which you calculate basically it is calculated using the temperatures. So, temperature is also having a data structure of matrix let us suppose your heat flux is also having a data structure of matrix, but and whenever you want to use expressions when you want to do repeatedly same similar type of calculations you know that you do you create loops and then you need to know what is the you need to know that let us suppose for a particular element in let us say for heat flux in the x direction qx what are the running indices of the neighbors which are involved. So, to have idea about the let us say to calculate a particular qx at a particular phase center which are what which temperature should be involved we should answer to all those questions. So, to answer to that this slide is the answer to that where we are following a convention let me remind you that the objective of this different type of grid points which I am showing right now you may when I when you see it for the first time you may be getting confused that unnecessarily there are so many grid points which are coming into the slide, but there is a purpose because when you program this picture is very helpful in to for you to make a decision that what should be the minimum value and maximum value in your loop. So, that way this is very useful. So, we know that when you take a control volume there are two vertical phase center and there are two horizontal phase centers now. So, and we want to it is not that we want to use different running indices for temperature and qx and qy we want to use one running indices we can that is possible if you follow a convention like in this case I want to have qx now in this the control volume which I am showing you right now in this control volume there are two vertical phase center at which you will have qx left and right. So, I have to make a decision that out of the two only one should have i,j ok. So, and note that a phase is common to. So, the what is the left phase for right now this is the left phase for this control volume, but it will be the right phase of the west control volume this is the right phase of the this control volume, but it will become left phase of a descent control volume. If I decide to follow a convention that let us suppose this is the heat flux let us say here in this case enthalpy flux in conduction it was conduction heat flux if this is the positive phase for this control volume and if I say that the running indices for this will be j,i then the running indices of this phase center will be that of the control volume at for which this is the east phase. So, this is the east phase or left phase for a control volume whose running indices is j,i-1. So, this will become axj,i-1 similar convention we use in case of in y direction and let us say this is a domain and we draw equispaced vertical lines equispaced horizontal lines and this are the grid points which we get these are the grid points for at the centroids of the control volume. These are the grid points at the boundary, these are the grid points right now for temperature. Now as I said that the procedure here which we are following we are following in the physical sense, physical sense means we are not solving the in a mathematical way we are not solving the algebraic equations as such but we are solving step by step the way conservation law happens. So, in a energy conservation what we are saying is that let us suppose from initial condition and boundary condition I know we know the temperature distribution everywhere. So, we know the temperature on let us say all these circles once we know the temperature distribution then what we are doing what we are saying and is that let us calculate the heat fluxes now where we calculate this fluxes we calculate at phase centers. So, then we say when if you want to calculate we need to know what should be the running indices and by the way if you define let us say heat flux as this then if it is a first order operand scheme then this if the flow is in the positive x direction then this A x the temperature which will come will be this cell center value if you are using a first order operand scheme. Here I am showing you the enthalpy flux at the phase center assuming that the flow the mass flux at the phases are in the positive x and positive y direction. So, this is the running indices it is varying from 1 to 7 5 interior points 2 nodes at the boundary j is also varying from 1 to 7. Now, I would like to draw your attention that how many green squares you have in this case 1, 2, 3, 4, 5, 6 6 green squares representing the various vertical phase centers which are into this. So, note that in the x direction there are 7 grid points temperature grid points there are 6 temperature qx grid points this green squares are 6 in the x direction but how many are they in the y direction 1, 2, 3, 4, 5. So, note that temperature is 7 by 7 qx is 6 by 7. So, this is 6 by 5 and note that in the energy conservation this no other qx will be involved qx at this 6 by 5 that is 30 qx values of qx will be involved. And for all those qx if you are using a first order operand scheme and if the flow is in the positive x and positive y direction then you can use this expressions. Now, similarly I am showing you the grid points for the enthalpy flux in the y direction how many are they 5 in the x direction 6 in the y direction. So, note that temperature grid points are 7 by 7 out of which interior grid point is 5 by 5 which is 25 the green square which corresponds to let us say enthalpy flux in the x direction or conduction heat flux in the x direction is 6 by 5 30 values and the conduction heat flux in the y direction or enthalpy flux in the y direction they are 5 by 6 it is also 30 but it is just that. So, there is a difference of 1 in one of the direction which interchange when you move from the flux in the x direction to the flux in the y direction. Note that this figure is very important as far as deciding the running indices in the loop which are shown. Let us come back to the slide. So, you can see that this slide is corresponds to an implementation details and it is very important it gives you a feel it helps you a lot in making a decision. Let me tell you you may develop a big program which may have million points. So, but this small exercise you develop a program and test it in this case although it is a very small problem it has very less number of grid point. But let me tell you that if you have done this exercise the program which you have developed can be used to solve let us say million grid point solution. So, right now so this simple figure I would say it is a very important figure as far as a CFD developer is concerned. Now, before I move ahead I would like to show you in whiteboard I had shown you that. So, I had shown you a control volume where I was showing you the enthalpy flux. Let us say this is the green square I was talking of it could be an enthalpy flux it could be a conduction heat flux this is rho Cp if you use a first order of print scheme this becomes Pp this is your P ok. Now, here is your w here is your capital N here is your capital S. Now, and this is your i comma j this is j plus 1 this is j minus 1 this is j i minus 1. Now, what I am trying to emphasize here is that the qx here the qx here is i comma j and the qx here corresponds to the i comma j of this and here I the running indices i minus 1 comma j. So, this will be qx i minus 1 comma j here you will have qy i comma j here you will have qy i comma j minus 1. So, when you do a balance whether it is an enthalpy flux or an energy flux you get what is entering is entering from the. So, when you let us say you want to calculate total heat gained by conduction what you do is when you want to calculate gain it is inflow and outflow. So, inflow is from the west face center where you have qx i minus 1 comma j plus qy or let me do in another way. So, this is entering in the x direction what is leaving in the x direction is minus qx from the east face center i comma j. So, this is the heat gain from for the heat transfer in the x direction multiplied by this needs to be multiplied by surface area. Surface area is vertical surface surface is delta y plus plus qy i comma j minus 1 minus q yes minus qy i comma j into delta x. So, this gives you heat conduction heat gain by conduction, but this can also give you total heat gain by advection where instead of this q now we will have small a. So, this way we can calculate total heat gain by conduction or advection let us come back to the slide and this is what is shown in the next slide. This is the enthalpy flux in the x direction calculated on all green squares and note that we the earlier figure has helped us in coming up to a decision that this j will be varying from 2 to j max minus 1 i will be varying from 1 to i max minus 1 just to give you an idea j max is 7. So, it becomes 2 to 7 minus 1 which is 6 2 to 6 are 5 grid points in the y direction for green square 1 to 7 minus 1 1 to 6 6 grid point in the x direction. Whereas, you go in the y direction it is 6 in the y direction and 5 in the x direction. So, note that you may not get this details in any book, but this is very helpful if you want to learn how to do programming in CFD and actually this loops are very important as far as programming in this subject is concerned. So, I would suggest that this subject is easy as far as the mathematics which is involved or the formulation which is involved, but the implementation details are something which I really feel that you need to come up with such procedures. So, that actually somebody else can start program when you are working in new fields you have to the implementation details varies, but I would like to make you understand that this is a very important thing unfortunately it is missing in most of the books, but probably it is the most important thing and as far as programming is concerned. So, once you calculate the heat flux in the x and y direction here in this case it is an enthalpy flux in case of advection then this is the expression which I have shown you in the white board you can go back and see. So, this is the expression I have shown you for the total that in this white board you can see I have shown you the expression for total heat gained by advection and let us come back now to the slide and the same expression I am showing you here. Note the loop of because this is the loop which is used to calculate the temperature which is varying from 2 to 6 that is 5 by 5 because you have 5 by 5 interior grade points and finally this is a used to calculate the temperature for the next time step. Now this is the last thing in this topic. So, typically the way we have moved in this topic is we started with an introduction followed by the finite volume method then we went into the solution methodology in the solution methodology we discussed two type of formulation study state formulation and study state formulation in a study state formulation I have shown you the final algebraic equations which we get using the different advection scheme first order of wind second order of wind second quick and then I had also discussed that had gone into the details implementation details where I had talked about how you near to the boundary how you can consistently apply the higher order schemes like second order upwind and quick schemes and I had also shown you the derivation of the expressions for those near boundary cells. Now finally, so with this the objective is that you should be able to develop your own programs for this module and test it. So, now as far as testing of your program is concerned here we are I am showing you some example problems which are commonly used as test problems for the codes or programs which you have developed. So, this is the problem which we are taking up which I had shown you earlier also I had shown you an animation for this in the beginning of today's lecture. So, I had mentioned that the flow is inclined at an angle of 45 degree and you have a domain which is also square. I had mentioned that left wall the domain is that here I am doing a showing the same thing in a non-dimensional way. Now when I am doing a non-dimensional this is a non-dimensional temperature denoted as 5. So, the non-dimensional temperature is expressed here as P minus Tb, Tb means bottom wall temperature divided by left wall temperature minus bottom wall temperature. So, earlier this left wall as a 100 degree centigrade but if you use this expression you will get this as unity and on the bottom wall you will get the non-dimensional temperature as 0. So, this is the setup of the problem for simplicity we have taken the thermo physical property like density and specific it as unity because this problem is a hypothetical problem it is just that we want to test our module many time let me tell you that whenever you are developing your own programs you should be clever enough because what happens many times you are looking in developing program in a area let us say maybe a fluid structure interaction or a multi phase flow you are developing a program and maybe you are doing something new which where which has not been done earlier and you had to come up with your own test problem. So, this whatever you learn from this test problems it will help you out in future if you are doing research in code development for some new areas. So, the non-dimensional temperature here is unity here it is 0 flow is inclined at an angle of 45 degree the domain is square the exact solution is on the below diagonal you have 0 degree and non-dimensional value as 0 above the diagonal you get a non-dimensional temperature of unity. We have taken thermo physical property as 1 you are taking the non-dimensional velocity inclined velocity as 1. So, the horizontal and vertical component will come up to be 1 divided by root 2 and so now this is the problem and the boundary condition for which you are solving and this are the results which you get I will show you the result on two different grid sizes first which is called as a coarse grid and second which is a fine grid here we are taking a grid size which is 22 by 20 sorry 22 by 22 actually there are 22 grid points in the x direction but out of those two are the boundary grid points. So, you have 20 interior grid points in the x direction 20 interior grid points in the y direction. So, which makes it 400 grid points in the domain in a domain of size 1 by 1 boundary condition is non-dimensional temperature is equals to 1 on the left and 0 on the bottom one what is shown here is the variation of non-dimensional temperature along vertical center line. Let us go to the previous figure and let us see what does the exact solution says. So, we are plotting what is vertical center line this is the vertical center line. So, in this vertical center line how the temperature is varying as far as exact solution is concerned in the bottom half temperature is 0 and in the top half the temperature is 1 but across the center there is a sharp change in the temperature from 0 to 1 that is what is shown in this figure. So, the black line in this figure shows the non-dimensional temperature and you can see that this black line is vertical from 0 to 0.5 and its value is 0 and above if you go from 0.5 to 1 you say you will again see that this line is vertical which means that the non-dimensional temperature is constant and its value is unity and at x equals to 0.5 what you see is there is a sharp change from 0 to 1 this is the exact solution. So, there are three other lines which are shown here with symbols the one which is shown with the red square with the dash dot line is the result which is obtained from first order upwind scheme. So, what you are finding the first order upwind scheme first in the first order upwind scheme is not able to capture the sharp change. If you go to second order upwind scheme which is shown by green diamond symbol with dashed line it is better as compared to first order upwind scheme as far as the sharp change near to the center is concerned. However it is giving us a solution which we call as unbounded solution what is in the unbounded outside the what are the bound values in this case bound values are 0 and 1. So, it is giving solution less than 0 and greater than 1 at some locations. So, this solutions are called as unbounded solutions when you go to the quick scheme which is shown by a solid blue line with the circle symbol what you see is the solution is not only unbounded but it is oscillatory. However, as far as the sharp change is concerned quick is best amount as compared to second order upwind and first order upwind scheme. Let us refine the grid and then see how this results look like. When you define the grid this is the results which you get. Now what is happening? The first thing important thing which you see is that in the quick scheme the oscillation has disappeared completely. However, the unboundedness is still there but the quick scheme is able to capture the sharp change in the best way as compared to the other schemes first order scheme. So, first order good thing about the first order scheme is that it is not unbounded it is never oscillatory but it is less accurate. In fact if you compare this scheme if you look into the expression for the schemes which expression involves least computational time the expression which involves least number of neighbor will take least computational time or which one is the simplest expression first order upwind. On the same grid side obviously first order upwind will take least computational time but you can see that it is much it is very inaccurate as compared to other schemes. So, let us say second order upwind scheme or quick scheme will take more computational time on this grid size but they are more accurate. In fact we had done a detailed study this study was done by my first PhD student we had compared various convection scheme this first order upwind second order upwind quick scheme on square lead driven cavity inclined lead driven cavity and we had published a paper if you are interested you can go to my home page for the details. And I just wanted to mention that in that study what we had done is that we have calculated we have compared the results with the benchmark solutions we have done a qualitative as well as quantitative comparison. And finally we came up with a conclusion that quick scheme gives results of a particular level of accuracy in least computational time. So, to achieve same level of accuracy quick schemes takes least computational time or if you want to have conclude in a slightly different way to in a same computational time quick scheme gives maximum accuracy. So, I think this is a last slide of this topic and we will move to the next slide we started with pure diffusion conduction moved on to advection and the next topic is combination of the two. So, thank you for your attention but before this maybe we can have 5 minute question answer session before I move to the next topic. Yeah Amrita school Bangalore please ask your question. I have a question in the boundary value problems like when you defend the nodes on the boundaries wherein you are trying to specify the values on the boundaries. Suppose this is the case wherein you should know the values at the boundaries. So, suppose if you take the quick scheme at the boundaries the variation is like the variation of the boundaries is like very you are varying the cell points the distance between cell moment and the boundary points varies which is not that accurate. How about using the go cell method in these cases? Okay let me go to the slide the question is that right now the implementation detail the way we are having the boundary grid point the boundary grid points exactly at the boundary there is another way of applying boundary condition which was quite popular earlier but I think nowadays this way of treating the boundaries more popular. So, what he is saying is that there is a method which is called as go cell method where the way boundary condition is applied is that fictitious cell is taken of the same size as the border cell and then the boundary condition is applied. So, the question is that so I agree with you that go cell method can also be used in applying the schemes and but I believe that this also gives equally accurate results. So, and many at times that go cell method especially when you go for unstructured grid formulation or complex geometry formulation you cannot have a go cell. So, that is not a more generic method having the grid points exactly at the boundary works for most of the complicated problem as well. Thank you. One more thing what the mesh points we have taken a select Cartesian mesh over here wherein our unit vectors are aligned towards our access Cartesian access. So, suppose if we have an a domain which is not oriented in our access directions then we cannot apply this kind of conditions this is and we have taken equi grid points over here and suppose if the grid points vary like if we say we are trying to capture the boundary layer or wherein or even in this case if we can happen if we can happen points then directly we cannot apply this scheme. So, in that set the boundaries with the fictitious boundary points oriented towards on the boundary is that feasible or is the go cell method feasible like? The question is right now we are taking a Cartesian grid we are taking a uniform grid. So, instead if it is a complex geometry problem where the grid are not let us say aligned along horizontal vertical but they are let us say curve. So, in those cases first question is in fact there are two parts of the question is how do we work apply this schemes and under those situations whether it is better to apply the go cell method or have the boundary grid point exactly at the boundary. Actually I had discussed this all this methodology I had written a chapter in a book during my PhD computational fluid flow and heat transfer which is in edited book where different chapters are written by different faculties of different tighities. So, I had written a chapter along with my PhD supervisor professor Ishwaran on finite volume method. So, for complex geometry how to apply the schemes I had discussed there. However, I had discussed there as far as I remember using a go cell method but later on I when I started working here I realized that this is a better way of applying the boundary condition. And so, for complex geometry indeed this is better as compared to the go cell method and this is the first level course in computational fluid dynamics. So, we are making a beginning so that way I am restricting to a simple geometry formulation. So, the complex geometry formulation is more of an advanced CFD topic which we teach here to our in our CFD course in IIT Bombay. But for this workshop I had we had avoided due to limitation of time as we wanted all the teachers to make a beginning and teaching CFD. So, this is what we feel that this is a good to begin with. Thank you. We will stop interaction here.