 We started with conduction then move on to advection, now let us go to the combination of the two which is called a convection. I will start with an introduction followed by finite volume discretization. I will go little quickly because there will be lot of repetition which I will be doing from conduction and advection because it is just the combination of the two. Implementation details is also basically repetition, solution algorithm is also more or less same. I will go fast but feel free to interrupt me if you do not understand anything. So this is convection I say. This is a combination of diffusion phenomena, conduction and pure advection. So if the flow is from the high side with 1 meter per second let us say you felt the temperature of what degree note that we are assuming that it is a one dimensional heat transfer. If it is at 100 meter per second let us say you felt a temperature of 10 degree, if it is from the fire side you felt a temperature 60 degree, if the velocity increases you felt a temperature of 90 degree. This is a combination of conduction and advection. So there is a when you talk of advection there are two variables, advecting variable which is like a passenger, sorry advecting variable which is mass flux or normal velocity which acts like a driver. And advected variable which is temperature in case of heat transfer it acts like a passenger in the transport of momentum and energy. When it is a transport of momentum this advected variable will not be temperature it will be u velocity in x momentum v velocity in the y momentum. The same example I am saying I think basically this is the repetition of what I had discussed in the previous slide. When there is a feel when there is a flow you feel more hot or cold which are not only dependent on the magnitude but it also depends on the direction of the advecting velocity. Let us look into the momentum and energy equation and let us see whether they are advection diffusion equation. Here the energy equation is written for two dimensional unsteady state force convection with no viscous dissipation, no volumetric heat generation. So this is your unsteady term, this is your advection term and this is your diffusion term. What topic we are talking? Advection diffusion which is a convection. So if I want to test convection in momentum equation I have to take this as constant but if I take this force convection it is fine. This is pure unsteady advection diffusion or pure unsteady convection equation. So let us take this energy equation and let us try to develop code for pure convection but if you want to decouple this from flow you have to prescribe this flow. There is one problem for which there is an electrical solution also so it is good. Note that many times in code development you can use some assumption which can make the problem hypothetical. It may not be a real world problem but many times, most of the times the good thing is that there is an analytical solution for a hypothetical problem but that is an excellent thing as far as testing of the code is concerned. So let us take this energy equation and we are assuming that we know the flow. One such problem for which analytical solution is obtained is this what we call as slug flow in a plane channel. What is slug flow? u is equals to u infinity v is equals to 0 all over the flow domain. Left wall is suppose fluid is entering at ambient temperature and let us suppose top wall and bottom wall are maintained at r hot and this is the fully developed boundary conditions we are using at the outlet. Note that in the convection case how many boundary conditions you need? When it is a pure advection there is a first derivative. As soon as you have diffusion there are second derivative. So you need boundary conditions on both the boundaries left, right, top, bottom. So the flow is something like this. You may feel say that no slip boundary condition is not obeyed. Yes, answer is this is hypothetical. This is not real world flow situation. So we are taking a hypothetical case where in a channel everywhere the flow velocity is u is equals to u infinity v is equals to 0, bottom wall is heated fluid is entering with some ambient temperature and it is leaving under fully developed condition. Is the physical description clear? There is an analytical solution available for this in a book on convective heat transfer by Burmester. We use that analytical solution for the validation of this code, this module. So we test conduction separately, advection separately, we combine then we test whether we are combining correctly. So note that we test it in every step to be rigorous in our product. Finally, the finite volume discretization, here I put everything in one slide. For unsteady term it is the same thing I have discussed. So I will not repeat that. For diffusion or conduction first level, second level I have repeated many times. I will not discuss that. This is the total heat gained by conduction because it is in minus out. This is for advection, here also it is out minus in. So this is the total heat lost by advection, two levels of approximation. Second level is advection scheme. So discretization is done. If you know how to discretize diffusion, if you know to advection, you just need to combine. So this is the discretized form of total heat, sorry rate of change of internal energy or enthalpy. This is the total heat lost by advection. This is the total heat gained by conduction. So that is what is our advection diffusion, unsteady advection diffusion equation. Here again this is your explicit method where this total heat transfer by advection and diffusion you calculate using the previous time level value. Here you calculate using the new time level value. And I had shown separately what is this A and D, capital A and capital D. Note that here it is in minus out, here it is out minus in. Now if you use an explicit method, you have one stability criteria for pure diffusion. You have one stability criteria for pure advection. But there is no stability criteria for combination of the two. So what you can do is that you can use this as guidelines. So you calculate one delta T, let us call this as delta T subscript D from diffusion. You calculate second delta T which you obtain from convection. And to be conservative, let us take the minimum of the two. But you are not guaranteed to converge. So these are sufficient condition but not necessary condition for convergence. This needs to be ensured for convergence that is compulsory. But this is not sufficient for convergence. So you run the code using the minimum of the two. If it diverges, you reduce it further. So normally we multiply this by a factor. It is analogous to under relaxation factor because in an unsteady state problem delta T acts like an under relaxation factor. An under relaxation factor definition is more relevant in case of studies. You can develop codes in a studied state form. Here whatever I am discussing is unsteady state because I want you to, as I said that I want you to get a feel that you can create a fluid dynamic movie. So whatever code I am giving, I am giving you for unsteady state. So that you see the results in really dynamic states rather than seeing a picture you see a movie. But that under relaxation comes only when you have this codes can be developed in study state form. Also there can be a formulation in study state also. But here I am discussing the formulation in unsteady state. And in unsteady state this delta T acts like a relaxation factor. Whereas for study state problem you need to define it separately. In that basically what you try to do is that when you are solving a study state problem between two consecutive time steps, the increase or decrease in temperature you try to reduce. So the basically the growth of numbers you try to reduce. That is what is under relaxation. After each time step, the way the temperature increases or decreases, the amount of increase or decrease you try to reduce. And this all things comes because the nature of the coefficients of the labric equations sometimes makes the coefficient matrix stiff. And if you are following an iterative method it is difficult to converge. I think I will not have the time to show you. I had one, I had separate discussion on that. I had put it at the end of thank you slide in this topic. But I do not think I will have time to discuss that how the coefficient plays role in the stability. But maybe in the final workshop I will discuss it. Implementation detail. It is the same what we did in conduction and pure advection. I take the simplest grid. These are the grid points for temperature. Now here I am talking of combination of advection flux which is negative of enthalpy flux. This is the conduction flux. So the combination of these two gives you total heat gained by conduction plus advection. This is the sign convention which we are following I discussed previously. So at the green square we calculate the total heat transfer due to advection plus conduction. So we calculate the heat flux, total heat flux in the x direction at this green square. At this red inverted triangle we calculate the total heat flux in the y direction and that this is the pseudo code for that. It is very similar to the pseudo code for pure conduction and pure advection. Here note that I am showing you directly as ad. This ad I had shown you in a previous slide it is combination of the two. It is a combination of this advection enthalpy flux and conduction heat flux. We combine after you have calculated this QA. So this is basically the addition of the two multiplied by surface area. And then you calculate total heat gained by convection which is a combination of advection and diffusion and use it here. Any question on this? Sir instead of saying code why do you call it pseudo code? The difference between the pseudo code and code is that I had not written in programming language. Standard programming syntax may be wrong in this. But it is easy to for somebody to understand. Because everybody knows what is for means. So basically a for loop that everybody understand. I am using some syntax star for multiplication. These are in word power point you can use this symbol. But this symbol may not work in actual program. But if you know the syntax of the programming language you can directly use this and code it. I would not say directly because there are some preprocessor stage which I am not showing you pseudo code for that. Because I believe that those are two elementary and easy. But anyway I discussed that in solution algorithm separately. Any other question? Can you put some more light on this under relaxation and over relaxation contents? Okay his question is discuss more on under relaxation over relaxation. Okay let me start with over relaxation. Now typically if you take the diffusion equation you can do one exercise also. Actually this relaxation as I mentioned this are basically defined for study state numerical methodology. What I mean is that you can develop code for study state also. Where there is no unsteady term. So in a what I am doing is that I am we are marching in time real time. These are real time simulations. But even you can take a study state equation and you can develop a code. But in that case it is not time marching. It is marching iteration by iteration. And in that case you do not start with an initial condition. You start with an initial guess. So if you develop a code first you develop a formulation then implementation details then code solution algorithm and finally code for a study state formulation. Then in that formulation what the simplest way is that whatever temperature increase or decrease is occurring after every iteration you use the same value as it is for the next iteration. But if you increase if you multiply the difference between the two consecutive iteration by a factor omega let us say. So the absolute difference between the two consecutive iterative temperature between two let us suppose in the last iteration it was 0. And in this iteration let us suppose that point value temperature is 100. So this difference you multiply by a factor omega. I am talking of one point but in actual CFD you will have number of points. So that difference you multiply by an omega. So then let us suppose this omega is 1.1 which means what 100 minus 0 into 1.1 will be 110. So this 110 is used as a value for the next iteration for that point. This is called as over relaxation. If you multiply by 0.9 then in the next iteration instead of 100.9 is going. If you take it 1 then you are not doing any relaxation. So in a steady state formulation increasing the increase or decrease of the temperature is called as over relaxation or decreasing the decrease or increase of the temperature between two consecutive iteration is called as under relaxation. I will come to that. Then this is the next thing. Why it needs to be done? What is the necessity? If you look into the diffusion problem we have done certain test cases also you can find that as far as computational time is concerned. If you do over relaxation the computational time for steady state solution initially it will decrease then it will increase. So there is an optimum relaxation factor also for pure diffusion problem somewhere around 1.4. So you can reduce the time if you over relax in but that is to be a particular value but that you do not know beforehand. So varies from problem to problem. If you are solving a non-linear problem like steady state in US stoke equation then your solution many times does not converge especially in the mass conservation. Then you need to use an under relaxation especially the increase or decrease of pressure between the two consecutive time step sorry not time step iteration here steady state formulation. It needs to be reduced otherwise your number blow up with iteration, whether that answers your question. Unsteady state problem we are having a time marching solution. But when you go from one time step to another time step in between also we are going to have a large number of iteration. No in implicit yes explicit no but in implicit we will be having there we can use. There we can use you are right. Solution algorithm is quite similar so let me not show you. This is similar to conduction advection. Let us go to the problem directly. Anyway I will give the lecture slides to you. So the problem is this. Describe this problem in the beginning. So based on the formulation the implementation details solution algorithm code is developed. In fact we will be giving you this code. You have to run this code and the figure which I am showing you you have to generate. And this is the solution from the code. What is this curve first of all what is in the x axis? Temperature. What is in the y axis? Y coordinate. So this is what non-dimensional temperature profile varying from 0 to 1. What is symbols? Symbol is analytical solution from this book. What is solid line? Presents numerical results. What are the different colors? The red color is at axial location 2. We are doing a non-dimensional study we are taking height as 1. So x pi h is the non-dimensional axial location. This is at 2. This is at 6. This is at 12. And this is at 18. So as it is moving down what is happening? The profile is becoming flatter. Why? Because the ambient fluid due to heating finally it will approach towards wall temperature. So there is an analytical solution for this and this way you combine your pure advection subroutine, pure conduction subroutine although you have tested it independently. But you test it again after combining. This is a test problem. In the afternoon we will give you code for pure conduction, multi-solid heat conduction, non-linear heat conduction, pure advection and this problem. You have total 5 codes. All are out of 5, 4 are 2-dimensional, 1 is 1-dimensional. That non-linear heat conduction is a 1-dimensional code. Conduction you have 2 codes. One for single solid, one for multi-solid. One code for pure advection where you will solve that flow inclined at an angle of 45 degree. And the last one is pure convection. So today afternoon you have to solve 5 problems. Maybe you will generate 20 figures. I am not sure I am not counted but just I am telling you. Our PhD students generate thousands of figures, hundreds of animations to understand the fluid mechanics. Okay. So it is quite interesting but you have to do a lot of hard work. I hope with this lectures you will get excited and excited and start working on it. Thank you for your attention.