 In this lecture what we're going to do is we're going to take a look at an Excel template that enables you to solve the heat diffusion equation using the finite difference method. And all of the equations that we've developed or derived in the last couple of lectures involved the heat diffusion equation and applying the finite difference technique to it. And we came up with a number of equations that we could use for either interior nodes or boundary conditions. And so essentially what this spreadsheet does is it takes those and converts it into an Excel format. And when you start the Excel spreadsheet it may complain about a circular reference error depending upon the version of Excel that you're using. If it does complain about that just ignore it and just say cancel. Another thing is if you come up under file and you go under options, now this is going to depend on the version of Excel that you're using. But if you go under formulas you'll see enable iterative calculation. You want to make sure that that is selected. And then this will determine the maximum number of iterations before Excel stops computing. So I'm going to change that to 5,000 and I quite often also have the maximum change being a little bit smaller so I'll convert that at another zero in there and click OK. That will specify how many times Excel has to go through iterations in order to solve it. So what we have in this spreadsheet over on the left, the first two blocks here, these are interior nodes and that's where we'll set the interior node values, either an interior node without generation or an interior node with generation. If you see the divide by zero error don't get too concerned. That's just because we haven't populated the values that go into that cell. But what we do, we populate things here and then we copy and paste them into our grid. And here you can see a grid that has been set up. Basically what I like to do is, we'll just delete that and do no color. So depending upon how many cells you need for doing your model, the first thing that you usually do is you set up your grid, however many grid cells you might need. So let's say we're doing a problem, that is a five by five. So one, two, three, four, five, one, two, three, four, five. So that is a five by five grid, I'll color that orange just so that we know where our grid is. And what I also like to do is change the width. So let's change the width here. It makes it a little easier to see. And then I'm just going to enter in 25 degrees C. It can be whatever you want. But this is just the starting condition. It makes it easier when you copy and paste in your values. And it also ensures sometimes the Excel will complain if you don't have numbers in here. And for some of the formulas or the boundary conditions that we're going to copy in, it'll give you a divide by zero error. And that will mess up your spreadsheet. So you'll want to start by doing that, populate the values. Now, how many cells should you be entering? Well, that depends on the grid spacing, your delta x or your delta y. And for this spreadsheet, we use uniform grid spacing. But if you recall the way that we derive the equations for the finite difference, the way that we set it up, we had nodes on the surface. And so for a system where, let's say if we had three grid points, that would be two delta x for three grid points. So essentially what I'm saying is the number of cells that you need is going to be whatever length. So take the length of your object here and divide by the delta x that you're going to set. And that needs to come out to be an integer. So make sure that that's an integer. But take your length of the object or the width in this case, divided by delta x and add one. And that is the number of cells that you need to have going across. Do the same thing for the vertical dimension. And the reason is, if you look at the nomenclature when we set up that grid, we went from zero to m or zero to n. And so consequently, we have n plus one grid points or n plus one grid points. And that's why you have to add the one to that. So that's just a little technicality with it. Another one is once you're running the Excel spreadsheet, you push F9 to make it go and do the calculation. And you'll see down in the bottom here, there will be a thing showing you how many iterations it's gone through. And we'll look at that later when we solve the problem in a later segment. So we begin. We set up our grid knowing delta x and delta y. And you enter in values to begin with. Once you've done that, you might want to color the perimeter, whatever the perimeter conditions might be. And so let's say you have an insulated boundary here. What you can do, you can color code. We're not going to put anything in those cells. But it's just a way to remind you what's going on. So if you have an insulated boundary, sometimes I use the fiberglass pink color to remind me that that's insulation. And then let's say the other boundaries are natural convection or force convection. So I'll make them blue. And that's the way that I can remember that I have convective heat transfer on those boundaries in the bottom was insulated. And so that's just the thing for you to do to know how to set up your grid. It gives you kind of a picture type thing so you remember what those boundary conditions were. You don't paste the boundaries here. You're actually going to put them into your grid. And so the boundary nodes or cells are the ones that I'm highlighting here. Those are the boundaries. And your interior nodes are going to be those cells there. And so what you do after you have set this up and you put these colors, then you need to go over here and determine which of the boundary conditions apply for your particular case. And so what I'll do now is I'll scroll through and show you the boundary conditions that have been established. We have a couple of different convective boundary conditions that you can have two different values of convective heat transfer. Maybe you have natural convection on one surface and maybe you have force convection on another. But whenever you set these up, what you need to do you need to enter in the value of the convective heat transfer coefficient. So let's say we have natural convection. I'll put something low 10 watts per square meter Kelvin. Thermal conductivity, I'll say it's 200. And delta x, delta y, 0.001, that's for one millimeter. That depends on your grid that you want to set up and how big your object is. Q dot, I'll assume that we don't have generation. But even if you enter it in, well, no, it will have an effect here. So we don't want to enter it in yet. And then T convection, let's assume that the ambient convective air temperature 25 degrees C. So you put that in and notice when I did that, all of these cells went from divide by zero to some value. And that means that we've entered in all of the values that we need to. If I click on one of those cells and go up to the formula bar, it shows what it is pulling from. So it's pulling from all these values up here. The bio number obviously is pulling in from values above and that's why these other cells aren't highlighted. But if I click in the bio number, then you can see that those ones have been pulled in. So that is a convective boundary. Let's take a look. Now I put little pictures here. And this spreadsheet, the model originally came out of the appendix of a textbook by J.P. Holman. And it was a McGraw-Hill textbook, Heat Transfer. And they had an Excel spreadsheet model in the back. But what I've done, I've kind of amplified it, giving you a lot more boundary conditions. Draw these little pictures, which hopefully make it a little easier to figure out which boundary condition to apply for which condition. But what the picture is showing is here, this is the node where we're operating on. So this would be a right-hand surface with a convection, a convective boundary condition. You can see the air or the fluid flowing over a T convection and H1. And it shows the node spacing. And then if you click on this cell, you can see that it's pulling from the nodes that we see in the pictures, the bottom, above, and then the left. And if we go to the next boundary condition that we have here for a right surface, it's pulling from the right cells, the above, below, and to the right. Click down here. And it's pulling from below. Click here, and it should be pulling from above. And that's what we see. So those are some of the boundary conditions. And then we have corners. So if you have a corner boundary condition with convection, you would use that cell. And what you will do, you have to paste in, copy and paste all of the boundary conditions. So you'll be doing those, you'll be doing those, you'll be doing those, and finally, you'll be doing those. And so you would then click on one of these cells. So let's say we wanna copy and paste one of these here. So what I'll do is I will do control C and then I'm gonna drag over those three cells and control V. And now if I click in there, you'll see that that formula has been pasted into that cell. And it's pulling from the appropriate adjacent cells in order to solve that. So that's the way that you handle the boundary conditions. I'll show you the other boundary conditions. This is another convective boundary condition here. This is one with an insulated boundary. So in our problem, we do have insulation, but we would have to enter in the values. Thermal conductivity, I think we said was 200.001 delta X delta Y, no internal generation. So I would need to find the appropriate boundary condition. This is the one because the insulation's on the outside. I click there, control C, I go up to my object and that would be these ones here, control V, I paste it in. And if you click on those cells, sure enough it is pulling from the appropriate ones. It's not going outside of our grid and it should not. Now I haven't done anything about the corners yet. I'll get to that when we do the other segments later on where we look at more specific cases. But let's keep looking down at the other boundaries. We looked at insulated. Now constant heat flux with convection. That would be if you have like electric resistance heater with convective heat transfer on the outside. What else do we have? Constant heat flux with no convective. So that would just be if you have constant heat flux on a surface, composite solids. You might have a case where you go from one solid to another. You can specify the internal and external thermal conductivity. Just be careful to note which one is which and I've tried to color code it as well as say which is external or internal on the picture. And if we keep going down, we have some with composite solids and some convective boundary conditions there. Another composite solid. So if you have different cases for your object you can implement those. Now this is radiation with convection and so for radiation with convection one thing that you need to be careful with even after entering the values, let's say emissivity is 0.8. Surrounding temperature, this has to be Kelvin. Be careful with that. 298 H. Let's say we have 25. Doesn't really matter. It can be anything 200 for K. 0.001 Q dot, no internal generation. And I'll say 25 degrees C for the ambient air temperature for the convective heat transfer. But notice after I've entered all those values this still shows divide by zero. And what you need to do, you need to click in that cell, come up into the formula bar and click enter in order to get rid of the divide by zero. If you try copying and pasting the divide by zero up into your grid, it's gonna mess up and it won't work. And so make sure you do that before you copy and paste one of the radiation boundary conditions. So that's just one of the nuances of the spreadsheet. A little bit of a quirk with the way Excel works. And I can't remember exactly why. There might be some sort of circular reference error. There is something that caused it to do that. We have another radiation and convection boundary condition. And then finally, we just have straight radiation without convection. So those are the boundary conditions that I put together. If you feel so inclined and you figure out how they're set up, you can come up with your own boundary conditions. It does take a little bit of time to set them up. And it is a little bit of a headache given that you gotta make sure that you're getting all the proper cells when you do this. Hopefully there are no errors in the spreadsheet. I've used it quite extensively a number of times and it seems to be working properly. But anyways, those are your boundaries. And then what you need to do, let's say we've specified all the external boundaries, then you have to handle your interior nodes. So depending on if you have generation or no generation, those would be the ones that you would copy. If you do have generation, you would have to enter in your generation rate. So that's in watts per meter cubed. K, we said was 200.001 for delta x, delta y. Then what you do, you do a control C and you would paste in. And so there we go, it did some calculations for us. But I didn't specify all those boundaries. And then if you wanted to see it run, you keep pushing F9 and you'll see that that seems to be pretty much converged already. Let me try here. Yeah, it seems to be. What I'm doing is hiding the numbers because sometimes that can slow it down. But that's what you do. And let's say you had no internal generation, then you would have copied and pasted these ones in. And you see it returns back to 25 because nothing is going on here. There's nothing driving this process. I think everything was at 25 degrees C. So that is an introduction to the Excel spreadsheet after you have that, then you can plot it, which I'll show you in the examples that are coming. It is not the greatest, but it's not bad. It's for doing kind of quick and dirty calculations. But what it does is it will demonstrate the use of the finite difference method applied to heat transfer problems. So that's what we're gonna be looking at in the next three segments.