 Welcome back to the post session of the workshop in computational fluid dynamics. We will be starting with a new topic computational heat advection. So, the earlier topic was computational heat conduction where we have taken unsteady term which represented rate of change of internal energy and equated to total heat gained by conduction which is a diffusion process. Now here we are taking a topic where we are not considering diffusion that is conduction and we are having what we are calling as advection phenomena. I had discussed this what is diffusion phenomena and advection phenomena in my first lecture where I had shown you an animation that if you are standing between ice and fire and what we are the idea behind taking this topic separately conduction advection is that the any CFD development goes module by module like if you want to develop a big product as I said that ultimate objective of this course is that what you are learning is to develop a product which is you can call as a video camera fluid dynamics video camera or a tool by which you can create a movie of fluid mechanics. So, if you are developing a product the product consists of different components different modules and whenever you develop the different modules of a big product you have to test each one of them. So, the philosophy here is that we develop different modules. So, the first module I had already discussed that is conduction module or a diffusion module you when you develop that module you can test that module there are various test problem for that then now we are taking a second module advection module. So, you then after you had gone through this topic you develop let us say a program for this module you test this module. So, you have once you have tested this two then the next step is that you combine these two modules. So, when you combine the conduction with adduction you get what is called as convection then whether you have combined things properly then again you have to test it. So, then you get computational heat convection which is the next topic which I will be taking tomorrow first lecture. So, that way we are developing module by module we are learning module by module and at the same time as I always go back to that statement of Alba Einstein that a theory something which nobody believes except the person proposing the theory. So, we are doing a theoretical work. So, to make people believe in our results we develop module by module test module by module. So, that people believe in our results. So, this is the way the typical software development goes on. So, in a computational heat adduction again I will start with general introduction followed by the finite volume method. Then I will go to the advection scheme solution methodology followed by the implementation details and at the end I will discuss some example problems. I hope you remember this picture which I have shown you in the first lecture saying that if you are standing between ice and fire and if the flow velocity is very large from the ice side then the conduction mode of heat transfer is negligible and the advection mode of heat transfer is dominant. So, you can assume if the flow velocities are very large that the conduction heat transfer is very small it is like if you have z is equals to x plus 5 if y is very small z is approximately equal to x. So, that way total heat transfer we are saying it is by advection pure advection note that this is a hypothesis because in real world situation you have flow velocities which are not too high specially in case of incompressible flow. So, when the flow is from the ice side you experience a temperature let us say 0 degree centigrade and when the flow is from the fire side you experience a temperature 100 degree centigrade. This is the example of a pure advection where we are assuming that the heat transfer is in x direction only. Let us take a two dimensional example. So, here in this case what is happening is there is a this is a square computational domain the left wall of the computational domain is at 100 degree centigrade the bottom wall is at 0 degree centigrade and there is a fluid flow which is occurring the flow is inclined at an angle of 45 degree note that the domain is a square and the flow is inclined at an angle of 45 degree. So, what happens in case of pure advection is the fluid particle which passes through this wall of the domain along its path it carries a temperature of 100 degree centigrade the fluid particle which passes this boundary of the domain carries the temperature of 0 degree along its path. So, the exact solution for this two dimensional pure advection phenomena is such that the exact result solution is below diagonal you have 0 degree centigrade and above diagonal you have 100 degree centigrade. So, there is a step change in the temperature across this diagonal from 0 degree to 100 degree centigrade. So, a pure advection phenomena there is a step change which is occurring in this problem this is one of the commonly used test problem for 2D advection phenomena. Let us start with the finite volume method of the two dimensional and steady state advection. Let us apply the law of conservation of energy. So, the first statements which I am showing you is the statement for law of conservation of energy in a general sense rate of change of enthalpy of the fluid inside plus across the control volume inside is the unsteady term across forms the advection term is equals to heat gained by conduction plus volumetric heat generation. When we want to convert this problem into a pure advection problem I had mentioned that we take the conduction heat transfer as 0 moreover in this problem there is no volumetric heat generation. So, if this two are 0 then this left hand side should be equal to 0 and that is what I am showing you here. Now, when you consider if you consider this rate of change of enthalpy of the fluid inside the control volume this forms unsteady term I had mentioned that the rate of change of enthalpy of the fluid across the control volume when you want to know change across then what you do is that heat outflow minus heat inflow to calculate the change you balance in such a way that total enthalpy outflow minus inflow you do balance then this is what is total heat lost by what we call as advection heat transfer. So, we use this simplified form of the law of conservation of energy the simplification is done assuming it is a pure advection then the conduction heat transfer becomes 0. Now, here I am showing you the finite volume discretization of the unsteady term whatever approximation it has been shown here it is the same approximation which we had already done in the previous topic which is computational heat conduction I had mentioned to calculate the rate of change of enthalpy or internal energy of the fluid inside the control volume the approximation which is needed in finite volume method is there is a first level of approximation where we need to average the rate of change of temperature I had mentioned that if you let us suppose you are sitting in a room in the same room you want to calculate how much let us internal energy of the fluid inside that room is changing with respect to time. So, to calculate that I had mentioned density is constant specific heat is constant it is not a function it is not varying in space and time and so in that case what is basically varying if you want to calculate rate of change of internal energy or enthalpy the rate of change of temperature at different points in your room is varying. So, you have to obtain at a particular time the variation of this rate of change of temperature at different points in your room and your room has a certain volume. So, basically you have to do a volume integration of rate of change of temperature now this rate of change of temperature I had mentioned in computational fluid dynamics the idea is that we take control volume not as big as the size of your room, but we take very small control volume. So, as the size of your room let us say goes on reducing if it is very small then we use the approximation which we use reaches towards an exact solution. So, the idea is rather than taking its variation we take its value at the centroid of the control volume. So, there is an exact equality between these two expression because this is the average value of the rate of change of temperature multiplied by the volume of control volume. But now between these two expression note that the equality is that this is an approximate representation of this. So, why approximate because the average value of the rate of change of temperature in the control volume we are expressing by the rate of change of temperature at the centroid of the control volume. This is the volume averaging this is the first level of approximation the second level of approximation is the first order forward difference discretization of the temporal gradient of temperature this del capital T by del small t at the centroid of the control volume is expressed as this and finally we obtain the finite volume representation of the unsteady term as this. This is the first term unsteady term in fact in this there are only two term first term I had shown you right now this is that term now we are left with the second term. Now, this second term I would like to mention that this advection phenomena which I mentioned is basically happens due to when there is a earlier talked about the transport mechanism I had said that there are two types of transport mechanism molecular transport and an advective transport and in advective transport I had mentioned that the advective transport takes place due to the bulk motion of the fluid. So, when there is a bulk motion of the fluid there is some mass flow rate I had mentioned that this mass flow rates acts like a driver in the transportation process. Now, what is being transported what acts the passenger is the u velocity in case of x momentum v velocity in case of y momentum and temperature in case of energy equation. So, the product of the mass flow rate per unit area which is mass flux multiplied by the u velocity gives you x momentum flux. So, the advection term is like in conduction rate of heat transfer we express at the phases of the control volume as the conduction heat flux multiplied by surface area. So, advection heat flux also we express in terms of advection heat advection flux multiplied by surface area. Now, in this slide I am showing you what is the advection flux this advection flux is the momentum flux in the momentum conservation and this advection flux is enthalpy flux in case of energy equation. So, the expression corresponding to that is shown here and this three expression can be generalized in this form where this c is equals to 1 for momentum equation and is equals to specific heat in case of energy equation and this phi is the general variable u for x momentum v for y momentum and temperature for energy equation. So, now we go to the first level of discretization. Now, I would say that the discretization of the advection term is very much analogous to what we have done in case of conduction. So, as you remember that in first level of discretization in conduction was what conduction we had a conduction flux. So, conduction flux we have to calculate on the surface area. Today morning I started saying that let us suppose you have q x here then I said in finite volume method this q x is converted into q w. Similarly, here in case of advection you can still represent that as q w, but that q w will not be conduction flux here instead it will be enthalpy flux that is the only difference. So, like today morning I said there is this q x plus delta x will be q at small e there it was minus k dT by dx here in this case it will be rho C p into temperature at this phase center. So, there it was conduction heat flux because that is the flux in conduction heat transfer here it is an enthalpy flux. So, the first level of approximation is this when you do a balance the value of the flux the flux whether it is a conduction flux or an enthalpy flux at a surface area it varies from point to point that. So, that is why it is an integral this integral relationship which I am showing this surface area right now in a two dimensional control volume it is a vertical surface. So, you have an integral which is varying in the y direction here the limits of the integration is the y coordinate at this vertex C and then y at any. So, this integral we can express it as an x is exactly equal to this average value multiplied by the if you remember I had taken an example let us suppose in your room at the different surfaces let us say bottom surface top surface left right left wall let us say left wall if you turn to your right there is a wall. So, from that wall let us suppose there is some heat flux which is coming in now that heat flux varies from point to point on the wall. So, we said that we rather than considering that variation assuming that the size of that wall is very small the average we will express the variation as equal to the value at the centroid of that surface. So, this is what we call as the surface averaging of the flux at the control volume faces and then we. So, in earlier slides it for conduction wherever there is a small a it was Q because that was the Q represent conduction heat fluxes. Now, here instead of that you have other heat flux which is enthalpy flux. This is the first level of approximation and it is and then when you do a balance you get an expression like this. Note that the way we are I am showing you here it is west south is positive east north is negative. So, it is in my so this is in minus out means total heat gained by advection in this case. Now, what was the second level of approximation first level of approximation more or less is same what was there in conduction heat transfer. The second level of approximation what was the second level of approximation in conduction discrete representation of Fourier Lafitte conduction. Now, in the second level approximation in this case is discrete representation of advection flux. There it was conduction flux here it is an advection flux which is enthalpy flux in case of heat transfer which is an x momentum flux for x momentum conservation y momentum flux in case of y momentum conservation. So, the second level of approximation is for discrete or algebraic representations of advection flux. Note that in Fourier Lafitte conduction I had mentioned that the conduction heat flux is expressed as gradient of temperature. When you want to calculate enthalpy, enthalpy is expressed in terms of the value of temperature not the gradient of temperature. So, here as this flux is expressed at the phases of the control volume this phi which is temperature in case of energy equation comes at the phase center. So, in conduction we had calculated let us say in this east phase dt by dx at east phase. Now, here in advection instead we need the value of temperature at this phase center which is Te. So, we need a procedure to calculate the value of this east of the temperature at this east phase center in terms of neighboring cell center. Now, we will use a mathematical procedure which we will call as interpolation. Now, the thing is I had told you that in CFD you can use a mathematical procedure, but it should be guided by the fluid mechanics principle. So, what is the guiding principle in fluid mechanics for advection phenomena is this example. So, let us suppose this is your cell center P this is your cell center capital E and let us suppose this is your phase center. This is the phase center of a control volume. So, the question so the situation is the grid point P is at 0 degree centigrade the grid point capital E is at 100 degree centigrade and this is the phase center which is east phase center of this control volume, west phase center of this control volume and we have to calculate temperature at this phase center in terms of neighboring cell center and I am saying that we have to use a mathematical procedure. So, we have to give weights let us suppose the temperature at this phase center will be A into this temperature plus B into this temperature what are A's and B's? A's and B's are weights. So, if you give 50 percent weight to this and 50 percent weight to this then you will get 0 plus 100 divided by 2. There are various options there can be various values of A and B. So, whether we should give equal weight to both the neighbors on both the sides or we should give more weights to the we should decide the value of the weights based on the direction of the flow. What does the fluid mechanics situation or fluid mechanics understanding of this situation dictates? From this situation you can understand that the weight should be decided based on the flow direction. So, just to give you an example that if the flow is from the ice side we should give 100 percent weight to the this neighbor 0 percent weight to this neighbor. If the flow is from the fire side we should give 100 percent weight to this neighbor and 0 percent weight to this neighbor. So, the weights which comes as a mathematical procedure is guided by the fluid mechanics and heat transfer principles. So, what is in a software if you use this is what is called as convection scheme. You may be finding switches like first order of point scheme, second order of point scheme, power law scheme, hybrid schemes all the schemes are convection schemes where what is convection scheme? Convection scheme is a mathematical procedure to calculate the value of the variable which could be velocities it could be temperature at the phase centers in terms of neighboring cell centers. You can see that in this expression we have to calculate the value of temperature in case of heat transfer at the phase center in terms of neighboring cell centers. So, as I said that if the flow is from the ice side you give 100 percent weight to the ice neighbor. So, when you do that it is called as an extrapolation procedure because you are using neighbor only from one side. So, if the value of the temperature you are having an expression where the temperature here is function only neighbors on one side then it is called as an extrapolation procedure. If it is a function of one neighbor on this side another neighbor on this side which is on both sides then this procedure is called as interpolation. So, there are various advection schemes and you may be thinking that there was a scheme also which was used in conduction or diffusion. What is that scheme? We had used one we can call it as a diffusion scheme to calculate the normal gradient of temperature at phase centers in terms of neighboring cell centers where we have used what we call as piecewise linear approximation it is called as a central difference. You may be thinking that for diffusion there is only one scheme central difference scheme, but for advection there are various schemes. Let us say if you look into a CFD software why? The answer to this question will come in tomorrow's first lecture where we will discuss convection in more detail. So, advection scheme is an extrapolation or interpolation procedure to calculate the advected variable at phase centers in terms of neighboring cell center values. Note that why we are doing all this is that anything, whenever there is a dependent variable or its gradients value is expressed at phase centers we have to the reason we converted in terms of neighboring cell center is because final expression, final linear algebraic expression should be in terms of value at this yellow circle not the phases. Note that final linear algebraic equation we want temperature only at yellow circle values not at any other point whether it is a phase center or any other point in the domain. So, if we are doing a formulation during the formulation if it is so happens that the dependent variable which is temperature in this case comes at the point other than this centroid of the control volume or yellow circle we have to come up with a mathematical procedure guided by the fluid mechanics principles that we have to convert it in terms of the values at this yellow circle. That central difference scheme which we have used in diffusion is also guided by the heat transfer principles that piecewise linear approximation because the conduction phenomena is such that a value at a particular point is equally affected by all its neighbor. And when there is a equal effect from all side the variation is linear the slope becomes constant. So, this advection flux which is an enthalpy flux in case of energy equation we substitute into this equation. And finally, obtain the linear algebraic equation using an advection scheme or when you do a balance note that the way I had shown you here is east north minus west south. So, it is out. So, the idea here is there is an enthalpy flux which is entering which is leaving from the east phase. So, there is a rate at which enthalpy is leaving the control volume. There is rate at which enthalpy is entering the control volume. So, outflow minus inflow gives you the net momentum lost by the fluid in the control volume. In case of energy equation it becomes net internal energy or enthalpy lost by the fluid in the control volume due to advection heat transfer. If this A is x momentum flux then it becomes net x momentum lost by the fluid in the control volume. If this A is y momentum flux then it becomes net rate at which y momentum is lost by the fluid in the control volume. So, we are following Eulerian approach. So, this rate of change has two components. First is the which gives us unsteady term which is rate of change inside the control volume. There is a second component which is called as an advective component which occurs because at the phases of the control volume there are certain fluxes and across the control volume when you do a balance there is a change. So, this is that component in discreet form, in algebraic form. Now, let us go to advection scheme. I have taken it as a separate subtopic. I had not discussed in one slide because there are many advection schemes. I will show you the mathematical derivations also. So, this is the picture of what I wanted to say as far as advection scheme is concerned. So, if the flow is from the high side, note that whenever there is a flow there is an upstream side and there is a downstream side. So, let us suppose this is a phase centre and if the flow is in the positive x direction. So, if the flow is in this direction then it is behind the flow direction and this is ahead of the flow direction. So, this is called as a downstream neighbor. This is called as an upstream neighbor. And when the flow is in the opposite direction then this becomes upstream neighbor and this become downstream neighbor. So, when the flow is from the high side we said that the temperature here will be equal to the high temperature. When the flow is from the fire side we say it as a fire temperature. But both these neighbors for this case this is the upstream neighbor. For this case this is the upstream neighbor. So, in general the value of the temperature at phase centre is equal to the temperature at of the upstream neighbor. This is what is called as first order upwind scheme. If you look into the software it is called as a convection scheme. But here I would like to call it as an advection scheme. The reason being that convection is made up of combination of the way I am defining convection. It is a combination of conduction and advection. So, we have a diffusion scheme which is a central difference scheme. And here there is no diffusion. So, let me call this scheme as advection scheme. But this word is commonly used in software as convection scheme. But here I am calling it as an advection scheme. So, what is advection scheme? It is an approximation to calculate the advected variable which is a passenger at the phase centres in terms of cell centre values. And this should incorporate the physical behaviour of advection. This is done by an advection scheme where we use interpolation based on the direction of the driver which is the mass flow rate. There are various types of advection schemes. Here I am taking 4 different types. Two involving extrapolation and the other two involving interpolation. The method for extrapolations are first order upwind and second order upwind. The first order upwind let us say it involves only one neighbour. Let us suppose it takes either ice or fire. But this scheme let us suppose what happens in actual problem is that you have a grid point where there is only not one upstream. Head of ice on the ice side there may be some other object at a temperature let us say 50 degree centigrade or vice versa on the fire side. What I am saying is that in that ice and fire thing this is ice. But there may be another grid point with some other temperature. So, why to take one point on upstream side? Why cannot we take two points? Why cannot we take three points? You can take more number of points but your expression will become more complicated. But the order of your representation will go on increasing. So, that is why when there is one point it is a first order. When there are two points it becomes second order. When there are three points it becomes third order. Later on I will show you how it becomes first order, second order and third order. So, the first order involves only one point upstream. Second order involves two upstream cells but it is both note that both are taking neighbors only on one side which are upstream sides. So, that is why this is called as an extrapolation method. Now, there are interpolation methods here such as it takes one downstream neighbor and one upstream neighbor. It takes both let us say ice temperature and fire temperature. This is called as a central difference scheme and there is another scheme which is called as quick scheme. It takes one downstream neighbor and two upstream neighbor. This quick the full form is quadratic upwind interpolation for convective kinematics. Among all the schemes we have done a detailed study for a lead driven cavity flow problem and we had found that this schemes gives better results as compared to the other schemes. So, let us discuss the mathematical procedure method how we derive the mathematical expression corresponding to each of the schemes. Let us derive those. The idea is very simple the mathematics which is involved is also very simple. It is just that probably you are not exposed to it. So, the idea here is we approximate the variation of the advocated variable or passenger as a linear quadratic or cubic in terms of its downstream upstream and upstream of upstream neighbor. Just to give you an idea if there is a east face center and if the flow is in the positive x direction then this point becomes upstream. This point becomes upstream of upstream and this point becomes downstream. However, if the flow direction is in reverses the flow direction is in the negative x direction then in that case this becomes your downstream neighbor. This is your upstream neighbor and this is your upstream of upstream neighbor. Let me start with the derivation of second order upwind scheme. So, as I said that locally we assume certain variation. Let us suppose I assume a linear variation. So, what is the expression for a line A x plus B? How many constant it has? Two constants. So, if you want to calculate A and B you need to know the value of phi at two different x locations. So, let us suppose this is your origin. This is x equals to 0. So, at x equals to 0 you have phi is equals to phi. Right now I am showing you an expression. Let us suppose this is the mass flow direction. So, this is the upstream neighbor, this is upstream of upstream neighbor and this is your downstream neighbor. So, if this is the origin at x equals to 0 phi is phi u u at x equals to this distance is delta x. This distance is 2 delta x. This is at 3 delta x by 2. So, at x equals to 0 phi is equals to phi u u at x equals to delta x phi is equals to phi u. So, with this 2 you can calculate B as phi u u A as phi u minus phi u u divided by delta x. Once you calculate, once you get an expression for A and B substitute into this expression and you get a variation of phi local variation of phi. Now, actually you have used this equation between these two points phi u u and phi u and you have got a linear variation. Now, what you are assuming is that this linear variation is not only applicable between these two grid points, but this linear variation we are extending or assuming that it is applicable also up to this point. So, that is why it is called as linear extrapolation. Linear variation we have assumed between two upstream neighbor and that linear variation we are extending. So, that is why it is called as linear extrapolation and we use the same expression and substitute x equals to what is the value of x at this point 3 delta x by 2. So, substitute x equals to 3 delta x by 2 and you get an expression like this. Earlier we had talked about piecewise linear approximation. And here also we are talking of a linear approximation, but this is a different type of linear approximation. It is a linear extrapolation. I would like to highlight here that just look into the coefficients of this neighbors. So, let us suppose this is ice and ahead of ice let us suppose there is something else which is at 80 degree centigrade suppose. So, what is the weight of this ice you are giving here in this expression? 3 by 2. What is 3 by 2? 150 percent. And what is the weight of this upstream of upstream neighbor? Minus 1 by 2. What is that? Minus 50 percent weight. So, 150 percent weight to the ice neighbor if the flow is from the ice side and minus 50 percent weight to the upstream neighbor of the ice. But how much is 100 minus 150 minus 50 percent? It is 100 percent. So, always note that when you are doing this derivation the sum of the coefficient should come up to be unity. Sum of the weights should be 1. Let us do a quadratic fit locally locally. Note that in CFD this in earlier whether in conduction it was piecewise linear. Here also I would say that this expression is applied in a piecewise linear manner. Here also this expression is applied in piecewise quadratic manner. We are taking this variation locally just note that not all over the domain. We are taking this variation between certain grid points. This is a local variation. That is why it becomes piecewise approximations. So, when we have a what is the expression for a quadratic curve A x square plus B x plus C. How many constant it has? 3 A B and C. So, we need 3 location of values of this dependent variable at 3 discrete x locations. So, here again origin is taken here which is x equals to 0. This is x equals to 0. This is x equals to delta x. This is x equals to 2 delta x. And at those actual those x location these are the values of 5. So, from this although I am showing you C, but you can also calculate A and B. And then you substitute into this expression. You get a expression for quadratic variation in terms of phi u, phi u u and phi d. You get a functional relationship for local quadratic variation. So, if you know this 3 point values. So, you can get a you can calculate this coefficients. If you know the delta x, if you know the value of this let us say you know temperature here is 100, here temperature is 0, here temperature is let us say 80 degree centigrade. You substitute into this you can calculate the coefficients of this quadratic variation. And this quadratic variation you are applying that this variation is from here to here. So, you take a point which is at the phase center where you want to know what will be the value of the advector variable at phase centers in terms of the neighboring cell center. Here the neighboring cell center you are taking at two upstream neighbors, one downstream neighbor. So, you substitute x is equals to 3 delta x by 2 in this expression and you get this expression. So, let us suppose this is i is at 0 degree centigrade. This is phi r at 100 degree centigrade. And let us suppose this is another neighbor which is at 80 degree centigrade and the flow is from the ice side. Now, let us look into the weights. This downstream is what? Fire. What is the weight we are giving to this? Fire at 100 degree centigrade. What is the weight which we are giving here? 3 by 8. How much is 3 by 8? It is 37.5 percent. So, 37.5 percent weight we are giving to this fire at 100 degree centigrade. What is the weight of the ice? 6 by 8. 6 by 8 is how much? 75 percent. What is the weight of this at 80 degree centigrade? Minus 1 by 8. How much is minus 1 by 8? Minus 12.5 percent. So, weight for fire is 37.5 percent. For the ice it is 77.5 percent. And for the 80 degree centigrade which is upstream of ice it is minus 12.5 percent. What is the sum of 37.5 plus 75 minus 12.5? So, here again note that that the sum of the weights is unity. So, in any advection scheme, although right now I have shown you for the two advection scheme, we use such polynomials linear or quadratic. And come up with an expression for the value of the advected variable at face centers in terms of neighboring cell center. And the coefficients in this expressions basically represent weights and the sum of the weights should be unity. I had shown you this here also. Note that this expression right now I am showing you assuming that the width of the control volume is uniform. But this derivation is equally applicable if that this width of the control is non-uniform. For non-uniform grid in this coefficient you get those distances also as the coefficients. So, this scheme or this expression you can also derive for a non-uniform grid. It is just that for a uniform grid it comes this coefficient constants. In case of non-uniform grid instead of this coefficient it involves the distances also. In an advection scheme all as I said that the expression or the neighbor which is involved in the expression depends upon the flow direction. Like if this flow is from the ice side then the temperature at which point is involved ice grid point. If the flow is from the fire side that the temperature at fire grid point is involved. But when you are programming if you use if statements then it is a costly it takes more computational cost as compared to if you use a single line expression. So, what I am showing you here is a single line expression which automatically automatically takes into account the direction of mass flow. Right now this advection flux is a product of mass flux into the advected variable. And as I mentioned that in first order of point scheme the value of the this variable at this phase center is equal to upstream value which is if the flow direction is positive like this is the upstream neighbor if it is in this direction then this is the upstream neighbor. So, this is a general expression but which one is the upstream neighbor that is basically decided by this single line expression. So, let us look into this max function max and minimum function. There are two possibilities m is either positive or m is negative. And you will see that when m is positive one of this two term is non-zero other term becomes 0. Like if m is positive then what will happen to this maximum you will get plus m e here then this is non-zero term. If m is positive when you go to here then here it is a minimum function. If it is a positive value and 0. So, the smaller value will be 0. So, then this term will become 0. Now, let us look into this expression if this m is negative if m is negative let us see what happens in this term and then this term if it is negative then a maximum of a negative value and 0 is 0 then this term becomes 0 and this is non-zero. So, it automatically implements this idea. Now, let us go to the next I will come back to the all then I will explain what is this is called as a constant extrapolation. I am just mentioning it I will discuss more about in the later slides. This is constant extrapolation because the value at this cell center is just taken as same. So, it is a linear constant value which you are extrapolating like if the flow is from the high side that 0 degree centigrade you are when you take a horizontal line means you are not considering its variation. So, that 0 value you are that constant 0 values you are extrapolating if it is from the fire side that 100 it is you are taking the same value the same constant the same 100 value is taken here. So, this is called as a constant extrapolation. Central difference scheme is a linear interpolation and actually central difference scheme is like what we do in your diffusion problem. So, we are standing between ice and fire in pure diffusion what happens you take 0 plus 100 divided by 2 if you are standing exactly in the middle. So, in this case the expression which you get does not depend upon the flow direction because you always get phi u plus phi d divided by 2 for a uniform grid generation because if one is upstream second other will be downstream, but the expression is such that both at 50 percent weight. So, it does not matter which one is upstream which one is downstream because weight is same 50 percent to both the neighbors. This is a second order of print scheme I just like to point out the weight in this case was 100 percent to the upstream neighbor. In this case the weights are 50 percent 50 percent when you go to the second order of print scheme it is also a linear variation, but if you compare the this slide and this slide in this slide it is an interpolation it is using one neighbor on neighbors on both the sides. Whereas in this case it use neighbors only on one side. So, it is a linear extrapolation that was linear interpolation and this is the general expression that is a function of two upstream neighbors upstream and upstream of upstream and this is the final expression of that when you go to the quick scheme this is a general expression and this is a general this is a single line expression consisting of different neighboring values. So, we to get a single line expression we are using functions maximum and minimum. If you I before I refer what I would like to mention that if you look into most of the CFD books they do not use this minimum function, but what they do is that they use they modify this as maximum of minus m e comma 0, but whether you use that function or this function it results the same expression. Here I am showing you all the schemes in one slide earlier I had shown you each of this scheme separately. Now here you can see and compare in one slide first order of print is constant extrapolation central difference is linear interpolation second order of print linear extrapolation quick quadratic interpolation this is first order accurate second order accurate second order accurate this accuracy of this is somewhere in between second and third order accurate. You can also see that more is the accuracy more are the number of neighbors which are involved this is first order accurate involves only one neighboring value this involves two neighboring value. So, the expression which you are using it becomes more complicated when more neighbor are involved the expression takes more computational time when it involve more neighbors. So, the computational cost increases when more neighbors are involved, but on the other hand the advantage is that when accuracy increases. So, you can obtain a result of same accuracy on lesser number of grid points if you are using a higher order schemes, but the point is what about computational time. So, in any as I say that the bottom line in any computational development is we have to show that the price which is involved in running the computer or AC to run the simulation that ultimately decide whether your method is good or bad. So, what finally will be tested is that computational time you are taking this your method is taking this much computational time and achieving certain accuracy with a certain computational cost. So, with the same computational cost at the same time if some other method is giving less accuracy then your method is good, but with the same computational cost there is some other method which is giving better accuracy then your proposition is not good that is ultimate proposition which you have to prove if you want to come up with a new better numerical method. We have done this in one of our recent research paper where we have developed a modified what we call as a level set method and we had drawn bar charts where we had or we have ran on different grid sizes we have calculated the computational time and shown that indeed our method gives better accuracy in or achieves a certain level of accuracy in lesser computational time. Still I know that you may be having one question you may be having a question that why this many schemes why not one scheme or you may be having that why not you just first order a point scheme because pure advection is like that only or why not you second order only this question will be answered after tomorrow's lecture on computational heat convection where I will discuss the role of this different schemes will take an example problem and you will use the schemes and then discuss the advantages and disadvantages of these different schemes. So on a particular fluid flow problem the scheme which you have to choose varies from problem to problem varies from the governing parameter the value of the governing parameter such as a run on number in the problems which you are solving. So that is why in a CFD software there are various options and there are more options there is more confusion which one to use and you need to be intelligent enough to know that this should be you when this should be used when this should be used and so on. Before I move ahead let us take some questions if you have questions feel free to ask but I would request that if you can ask question on this topic it will be beneficial to all of the participants. You go to a center PVG Pune if you have a question. My question is for non-linear heat conduction heat transfer slide number 21. So in this you said that the conductivity at the interface has to be evaluated using linear interpolation of temperature of centroidal point of control volume. Instead of that if I cannot use the logic of multisolids for calculating the conductivity at the interface which earlier you have explained if I can use which will be appropriate whether the linear interpolation or logic of multisolid. The question is from this slide where I had mentioned that we use a harmonic mean to calculate the conductivity. Now the question is right now I am talking about the advection schemes where I am talking of linear extrapolation, linear interpolation, quadratic interpolation. So the question is that here we are doing a harmonic mean and now I am saying that in advection scheme we use a linear interpolation. So I think the question is whether we use linear interpolation or whether we use advection scheme to this conductivity. The answer is no because that is an entirely different thing. What I am discussing in advection, the mathematical procedure or interpolation, extrapolation which we are using there is not for the thermo physical property. That is for temperature in case of energy equation, u velocity for x momentum equation, v velocity for energy equation. So what I am discussing in advection scheme is not for thermo physical property. So that is what I am taking there is not relevant for this case. Here from the heat transfer principles we are used a resistance concept and calculated the thermo physical property. So I would say do not correlate this mathematical procedure with that mathematical procedure. The principles which are involved in this expression and that expressions are different. There it is an advection phenomena, here it is a conduction phenomena. Amrita Koyamato if you have a question please ask. Sir what is the difference between advection and conduction? Okay the question is what is the difference between advection and conduction. I will show in a wide board difference between conduction advection. To do that let me take a control volume and then show you. So in a conduction you have a conduction heat flux. Let us say qx, qsx plus dx. In advection multiplied by delta y which is the surface area. Here you have an advection flux multiplied by surface area. What is this qx? It is minus k dt by dx. Now what is this ax? It is basically the enthalpy flux density multiplied by specific heat multiplied by temperature sorry, temperature at x into surface area. This is the flux let me not multiply with surface area. Similarly ax plus dx is rho cp temperature at x plus dx. So in conduction we do the balance of conduction heat fluxes. So in conduction we do the balance of conduction heat fluxes which also in this case comes from this phases. So in this we do the balance of conduction heat fluxes. In advection we do the balance of enthalpy fluxes. One last question from Nirma University then. Sir I have question related to the last slide of today's discussion. How the accuracy of this method is decided? The question is how the accuracy of this advection scheme is decided. To know the accuracy exactly one way I can say is that if you I said that this is let me come to the slide. I said this is first order accurate, this is second order accurate, this is second order accurate. One way to know is that whenever you consider a linear variation if you do a Taylor series expansion. Right now I am doing this derivation let me go to the derivation. This derivations which I am doing I am starting with a linear or a quadratic variation and then I am doing this derivation. So that order of accuracy it is not coming out from this expression directly. But the same derivation can be done by Taylor series expansion which is given in many CFD books. So from the if you do a Taylor series expansion you will get the same expression. But along with this expression there will be some partial derivative term which will be coming which you will be truncating. Like in a finite difference method you know that there is a truncate the lowest power of delta in the truncated term gives you the order of accuracy. So the same derivation can be done through Taylor series expansion and in that case there are certain truncated terms and the lowest power of delta x in those truncated terms gives you the truncation error. So this is the way it is decided. Thank you. What is the accuracy of this quick scheme? The question is what is the accuracy of this quick scheme? If you use a pure adduction case then this is third order accurate. But if you are using this in a Navier-Stokes equation because in a Navier-Stokes equation you have a diffusion term also which is second order accurate then the overall accuracy comes out in between 2 and 3. Thank you. So I had shown you the finite volume discretization. I started with the first level of discretization where which was basically the surface averaging of the fluxes which is the enthalpy flux in this case at the phase center. So instead of using x or x plus delta x values we are having east phase value, west phase value. The second level of averaging was the discrete representation of the expression of enthalpy flux. The enthalpy flux expression involves the value of temperature at the phase center and we use a mathematical procedure called as adduction scheme to calculate the value at the phase center in terms of the neighboring cell center. With this we get a linear algebraic equation which is the finite volume equation. So here I am showing you the discretized form of the expression using explicit method and implicit method. So here the total heat gained by conduction. Note that if you take this term on the left hand side it becomes heat lost by advection phenomena. If you take the term from the left hand side to the right hand side it becomes gain. With the chain in sign loss becomes gain in heat transfer. So this represents rate of change of internal energy or enthalpy is equals to total heat gained by enthalpy transport. Now here just observe the superscript of temperature. The superscript of temperature here is n. Here it is n plus 1. So in this case total heat gained by enthalpy transport or advection is calculated using temperature of previous line level and that is why this is called as an explicit method. Here it is calculated using the temperature of the new time level. So that is why it is called as an implicit method. However I am not showing you the discrete form of this temperature by applying a advection scheme. As in pure conduction I mentioned that there is a stability analysis, von Neumann stability analysis by which we can obtain an expression for time step restriction alpha delta t 1 by delta x square plus 1 by delta y, alpha delta x 1 by delta t 1 by delta x square plus 1 by delta y square less than equal to half. That was the expression in case of pure conduction. Similar analysis is done for pure advection and for pure advection from that analysis the final expression which is obtained is shown here. So as in explicit method in conduction we have one expression for time step restriction. Here for advection this is an expression for the time step restriction. This is the expression for time step restriction. The expression is delta t into absolute magnitude of u velocity divided by delta x plus absolute magnitude of v velocity divided by delta y should be less than equal to 1. Note that this u velocity and v velocity earlier in this conduction it was the expression at alpha which is thermal diffusivity k by rho c p. It has delta t, it has delta x square and delta y square. That expression does not have temperature. But here in this case note that there is a velocity and this velocity varies from grid point to grid point. So this time step will vary from grid point to grid point. So if the velocity is varying from grid point to grid point and this delta t will vary from grid point to grid point. So if there are 100 grid points you may get 100 different value of time steps. So out of this time step we use a conservative value which is minimum of those 100 values. So that is what is written here delta t is equal to 1 divided by maximum of this. So your time step in an explicit method should follow this equation otherwise you have a stability problem that is with respect to time. Let us say if you are solving an advection heat transfer problem your temperature will approach the number for temperatures which you are getting with respect to time will approach towards infinity. The solution algorithm is discussed for explicit method here. The procedure which is shown here is quite similar to what has been discussed earlier in case of conduction. The only difference is that in conduction you had calculated conduction heat fluxes. Here you will calculate enthalpy flux. To calculate the conduction heat flux you have calculated the normal gradient of temperature using central difference scheme. Here to calculate the temperature in enthalpy flux you will use an advection scheme. So first you enter the user input which is a material property geometrical parameters, maximum number of control volumes in x and y direction, boundary conditions inputs and the convergence criteria to check for steady state. So this is a stopping criteria. You want to stop the code when the code has reached to steady state. Computer does not understand what 0 is. So you have to define that what is the level of studyness you want from your code. Then there is a grid generation from which you calculate all the geometrical parameter because this geometrical parameter comes as the coefficient of the linear algebraic equation. You obtain delta t from the stability criteria. You calculate the mass flux because this mass flux will be used to calculate the advection flux. You set the initial value of phi. It is a heat transfer problem temperature. You set the boundary condition for phi. Phi right now represents general advected variable which is temperature for energy equation. Before you go for next time step, I had mentioned that you have to take the present time value as the old time value. Then you calculate this advection flux which will be enthalpy flux in case of energy equation by using an advection scheme and use an advection scheme to calculate the value at the phase center. Then calculate total heat gained by advection. Once you have calculated total heat gained by advection, you multiply that with delta t specifically divided by rho into volume and subtract from the previous time value of the temperature. Once you have done this, you calculate the temperature at new time level. At each time step, you have old time level value of temperature and you calculate temperature of the new time level. Then you check for a steady state. If the solution has not to reach steady state, you cannot stop. Then the new value which you have got becomes old here and you continue. So, at each time step, you have two matrix, one the temperature of old time level and second temperature of the new time level. This is the convergence criteria for steady state. So, what you do is that you note that there is a sigma sign here. So, you consider all the grid points. Let us say there is 100 grid points. So, you do this summation, calculate the root mean square value of the temperature difference and use this to compare this root mean square value. See whether it has reached to practically 0, which is your convergence criteria, which let us suppose it is defined as epsilon, epsilon you have defined in your user input. This convergence criteria is expressed in terms of a symbol, let us say epsilon. Then as user input, if you have defined this epsilon, practically 0 value as 10 to power minus 3. Then you check that whether this rms phi is less than that 10 to power minus 3. If it is then you stop, otherwise you continue this till it has reached to a steady state. Whereas, in a steady state formulation, maybe I will stop here and but before that I would like to take question from the remote center. Still we have around 5 minutes left. Amrita Coimbatore? I have a small doubt regarding grid generation. Topic number 3, slide number 8. Here a physical domain is a circular in geometry. Computational domain is a rectangular one. This physical domain. Computational domain. Let me repeat the question. The question is this is a physical domain. This is circular. This is a computational domain, which is a rectangular. Now, the question is how do we cope up with this difference in the domain? I would like to mention that actually we are solving everything. We are calculating all the geometrical parameters. We are doing all the formulations in this domain. But when we are programming, just for the ease of programming, because as I said that once you do the formulation before you program, there is there are certain things called as implementation details, which you have to do. So, for that, so note that the title of this slide is implementation details. So, this is just to show you how we scroll through and what here it becomes easy to see the face centers. So, it is easy to visualize and understand the implementation details. But everything we are doing in the physical domain. So, there is no domain transformation. We are using the governing equation in this cylindrical polar. It is just that before coding for our ease in implementation, I had shown this figure. Thank you. We will break for the lunch.