 Okay, so this is example 8.3.1 from page 378 of the Duffian Beckman text. So we're asked to solve for temperature in a hot water tank. So we're given a few things here. The mass of the tank is 1500 kilograms, and that's water. The loss coefficient area product of the storage volume, or tank, is 11.1 watts per degree Celsius, which you have to multiply by 3600 seconds per hour to convert that into joules per hour, which we'll have to do later. Let's see here. The ambient temperature is 20 degrees Celsius, and the initial tank temperature is 45 degrees Celsius. And then in a table in the text, we are given the useful energy gain, QU, as well as the loads for that tank, how much water is drawn from the tank for each hour. And with that information, we are asked to find the temperature of the tank at each hour for 12 hours. So we're going to start here by solving for one hour by hand, and then we're just going to implement it in a spreadsheet to get the rest of the hours iteratively. So there are three methods of heat exchange in this tank. So first we have the loads, which are given in the example in the text. And then we have solar gains, which are also given in the text. And these are calculated by the delta T, which is given by equation 8.3.1. And then the next mode of heat exchange is with the surroundings. We're losing heat to the surroundings by convection off the tank surface. And this one, we can calculate with equation 8.3.3. So the first part is we need to know how much energy potential is in the tank to begin with. So calculate energy potential, and we do this with that first equation, 8.3.1. So the amount of heat in the storage unit that is available to us is a function of the mass of the tank and the heat capacitance of the fluid in the tank and the temperature difference between the tank and the surroundings. If we do a quick unit check on this, we have kilograms for mass, and we have CP up here. I could have mentioned it earlier. In the example, the heat capacitance of this fluid is 4,190, and the units are joules per kilogram kelvin. So down here we have joules per kilogram kelvin. And all of that multiplied by the temperature difference in Celsius, which is equivalent to kelvin. So you can see that kilograms will cancel out as will kelvin, and we're left with joules for the units here. So plugging in some numbers, we get 1,500 times 4,190 times our temperature difference, which is 45 minus 20. I punch that in the calculator, we get 157.1 megajoules. So if you just punch that in, you're going to get 107 million joules. So that's sort of step one here is just calculating how much energy is there in the tanks. Next we have to include some of these modes of heat transfer. We're going to include first the load and the solar gain. And we're going to essentially use the same equation, but flipping it around a bit. So now we're going to include QU and LS. So QS is equal to, in this case, what we calculated before, 157.1. Now we're going to include zero solar gain during this first hour, and 12 megajoules of load as per the table on page 378. Maybe on the next page, I forget if it's on the next page or not, 379. So when we calculate that, including those important gains and losses, we end up with 145.1 megajoules. And that is equal to the mass of our tank, 1500 times CP, 4190 times, we're going to call this T intermediate right here. So as we finish this calculation, that will make sense, minus the ambient temperature solving for T intermediate. We get that it is equal to 43.09 degrees Celsius, 0.1 either way. So you take 145 right here, divide it by 1500, divide it by 4190, and then add 20 back onto the other side. And then you get intermediate temperature, 43.09. So next we have to include, we're going to come up here to the top of the page again. So now we're going to include loss to our surroundings. For that, we're going to use equation 8.3.3, TS plus, so time at the next time step essentially is equal to our T intermediate, or essentially the temperature of the tank in light of the loads and gains, plus our time step divided by MCP, mass of the tank and the heat capacitance of that heat transfer fluid, again the useful energy gain, the loads, and now the convective losses, times TS minus TA, sorry for running out of room up here, just squeaking it in on the edge there. Okay, so here we have our T intermediate is 43.1. Our time step is, I should make that a lower case T actually, time step is one hour, mass is 1500, CP is still 4190, QU is still 0, loads are still 12, UA is 11.1 times 3600, TS is 45, and TA is 20. So once you plug all those numbers in, you end up with 43.1 plus an additional loss, which is negative 0.16. So you end up with TS plus equals 42.9 degrees Celsius for the end of hour one. Okay, so the table from page 378 gives us these 12 hours, and then next we're given the solar energy gain at each hour, and we're given the load profile at each hour. So for this first piece, we had zero solar gain and 12 megajoules of loss, and the initial tank temperature is 45 degrees. So let me clear these contents here so we can type them all in. Over here on the right, you can see I've set up the system parameters. Heat capacitance of the tank is 4190, mass of the tank 1500, ambient temperature is 20 degrees Celsius, and the heat loss coefficient is 11.1, which is equal to 39,960 joules per hour. So you have to change the units on that one because we're looking at hourly data. So for this first thing here, QS, how much energy is in the tank, essentially. So that's equal to the mass of the tank times the heat capacitance of the fluid times the temperature difference, so 45 minus T ambient. And we want this in megajoules because that's the units of our solar gains and loads. So we're going to divide by 10 to the sixth to convert from joules to megajoules because as you can see, our heat capacitance is in units of joules per kilograms Kelvin. So you've really got to make sure that you're tracking your units through this stuff, and that can really throw your answers off in any situation. And in order to be able to drag this column all the way to the ground, everything that's from the parameters section needs to have those cells held so that they don't move anywhere. So you get 157. If we look back at what we calculated before, you can see that that is exactly what we got right here, 157 megajoules for that first step. So that's great. That equation looks like we've implemented it correctly. So then we move on to the next cell, this T intermediate. And for this one, we want to add up the different loads and gains in light of the ambient temperature to figure out what the temperature of the tank is in light of those factors. So we're going to have our solar gains minus our loads plus the ambient or the total tank, potential energy essentially in light of the temperature difference. And now we have to multiply it by 10 to the sixth for the megajoules and joules conversion because those are megajoules. I want to get back into joules briefly for this intermediate step because we're going to have to multiply by those system parameters again. And then we multiply by MCP. So again, we're going to want to just tag these ones with dollar signs so that they get held when we drag those cells down. And right off the bat, I see I made a mistake, I have 23.1. I also need to add in the ambient temperature for this step now into 43.1. So if we go back to our handwritten example right here, that answer 43.1 after implementing this equation right here into our spreadsheet. So that's great. So we did that step correctly as well. And then the last piece of the calculation is just to calculate, well, what is that final temperature at the beginning of the next time step or the end of this time step? And so to do that, we use equation 8.3.3. And this is equal to that intermediate temperature that we calculated here in light of gains and loads plus now the losses to our surroundings. We haven't included that yet, so that's the last piece that we have to include. I could have done all of the T intermediate and this last calculation in one step, but it's a little bit more transparent by splitting it up. The textbook doesn't split that up, and it makes it a little bit hard to figure out. So plus 1 over mass of the tank times the heat capacitance times energy gained minus loads minus 11.1 times 3600, which is this number over here, M in the M column, 39,960, 11.1 times 3600 to again get in units of joules instead of watts, because a watt is a joule per second. So this is actually, that's a typo right there, I'll fix that in a minute. Then you have to multiply that UA sub S term by the temperature difference of TS tank temperature minus T ambient. Then we've got to close all of our parentheses to add a few dollar signs in here to lock these cells so we can drag them down. T2, T2, M5 needs to be locked, and K4 needs to be locked, okay that should do it. So the typo I mentioned earlier, this one right here should not be watts per second, that's just watts. And then that means that when you multiply that's, because a watt is a joule per second, so we want joules per hour of hourly data, so that's this cell you can see is simply 11.1 times 3600. Okay so back up here to our H column where we had just typed in that last T sub S to the plus equation, you can see that after we do that we get 42.9, which going back to our hand calculation right here, that's what we had, so we've implemented that equation correctly as well now. Alright so now that we have that we should be able to simply set this cell in column E equal, so this is the tank temperature at the beginning of time step number two, we should be able to set that equal to the temperature of the tank at the end of the previous time step. So if we drag that down through all the hours, and then we proceed to drag these guys down through all the hours, and then plot it, we will get the temperature over time at all of those time steps, and that's the solution for this example. Thanks for listening, and again this has been example 8.3.1 in the text.