
#1
Jan814, 08:21 PM

P: 16

I'm trying to write a very, very simple heat flow simulation program.
The idea is an environment space is a grid, with each grid space identical in respect to all other grid spaces (I'm calling a grid space an "element") except temperature. So, they are physically the same except temperature differences. I have found a formula for power output from a hot object in a cool environment: q = εδ (T_{h}^{4}  T_{c}^{4})A Where: q = Watts radiated ε : Emissivity (doesn't matter, set to 1 in this case) σ : StefanBoltzmann constant T_{h}: Temperature of hot object in Kelvin T_{c}: Temperature of cold object in Kelvin A: Area of hot object exposed to cold object (can be assumed to be 1, or not particularly important in the application) That's great, so now I know the instantaneous power output. But I need to integrate this so I can have a formula that basically has time as an input and outputs the temperature of the hot object at some time after the initial conditions. It's been some time since my calculus classes sadly. 



#2
Jan814, 08:24 PM

Sci Advisor
HW Helper
Thanks
PF Gold
P: 4,505

Are you sure you are dealing with radiative heat transport and not conductive heat transport?




#3
Jan814, 08:27 PM

P: 16

Yes, just radiative. I feel including conduction will be...complicated. Though one or the other only would be great.




#4
Jan814, 08:45 PM

P: 2

Heat Loss and Energy Remaining Between Two Identical Materials
It might be great!




#5
Jan814, 08:58 PM

Sci Advisor
HW Helper
Thanks
PF Gold
P: 4,505

Chet 



#6
Jan814, 09:01 PM

P: 16





#7
Jan814, 09:33 PM

Sci Advisor
HW Helper
Thanks
PF Gold
P: 4,505

Chet 



#8
Jan814, 09:54 PM

P: 16

The environment is divided into a rectangular grid of squares of any size (m x n). Each square can exchange heat with any of the 8 neighboring squares. The 4 left, right, up and down of a given square element have a heat exchange weight of 1.0. The diagonal squares exchange heat at a reduced rate of [itex]\frac{1}{\sqrt{2}}[/itex], taking into effect the increase distance between their centers. All the squares are physically identical (at least for the initial version of this program), except for temperature. They would have in this case identical conductance, mass, particle count, etc. The only variable is heat (or total energy) and time. The actual rate of exchange for this hypothetical material can be arbitrarily chosen. An example would be a block 1 meter in length, and maybe 1 watt per edge per Δkelvin. The rectangular environment is bounded by a perfectly insulating wall. No heat can be exchanged between it and the individual elements (which means the perimeter has a special case to deal with absent heat exchanging elements). The simulation can have a varying time step, and this will eventually be taken into account into the simulation. That's the basic idea at the moment: a really crummy experiment at a finite element analysis program. 



#9
Jan914, 01:35 PM

Sci Advisor
HW Helper
Thanks
PF Gold
P: 4,505

This sounds like a standard transient heat conduction problem. The sheet of material starts out at a uniform temperature, and some sort of heating takes place either within the sheet or at its edges. The edges that are insulated have no heat entering or leaving. There may be some heat entering through a portion of the boundary as imposed by a heat flux. You are using an 8 point finite difference (/element) approximation to describe the rate of change of temperature at each nodal point. This involves the 8 nearest neighbors. Correct so far?
Chet 



#10
Jan914, 09:57 PM

P: 16

Yes, 8 nearest neighbors, with the 4 diagonal ones weighted as less conductive as the other 4. The initial conditions are basically the temperature (or energy content: heat) of the elements specified. One example I've been using a square grid with the center square at a high temperature. The heat spreads in a roughly Gaussian distribution, I assume, out from the center.
I currently have a crude hack to move the "heat" around the grid, but I have to put in a constraint because other wise there will be an oscillation between elements because of the way the heat transfer is currently done (some basic subtraction for the flow of heat out, and some addition for the flow of heat in, regardless of other potentially important effects or surroundings). 



#11
Jan1014, 08:54 AM

Sci Advisor
HW Helper
Thanks
PF Gold
P: 4,505

Before we continue, can you please give me some more underlying background. Is this a project or problem for a course in
Heat Transfer Numerical Analysis Finite Element? Is it a project for your work? How have you set the problem up so far (equations)? Why are you using 8 points instead of 4? Is using 8 a requirement of the assignment? In other words, what is motivating this work? Chet 



#12
Jan1014, 11:14 AM

P: 16

Honestly, it's just for fun, haha. I like physics, programming, and using those first two interests to make little simulations. Heat flow and fluid flow have interested me, but I can't afford some of the CFD and FEA software packages, nor do I desire the accuracy and power that they provide.
The problem currently doesn't use any physical equations (in other words, anything close to modeling real world heat flow). I'm at work right now, but I think the pseudo code was something along these lines:




#13
Jan1014, 11:47 AM

Sci Advisor
HW Helper
Thanks
PF Gold
P: 4,505

You seem to have no experience with numerical analysis related to transient heat conduction problems. You need to learn how to formulate a finite difference approximation to the heat conduction equation (which is a partial differential equation), and you need to learn how to march in the time direction. There are going to be problems with the time integration (like the ones you are already experiencing) if you take too large time steps in an explicit finite difference scheme (like the one you're using). The solution is actually unstable, and you can't fix things in the ad hoc way you are attempting. The timedependent integration is numerically "stiff" if you are using an explicit scheme. The solution to this difficulty is to solve the equations with an implicit scheme. This is the only way you are going to be able to use increasing time steps. If you try to use too large a time step in an explicit scheme, the solution is going to go unstable. You can live with an explicit method if you are willing to take small stable time steps throughout the solution. A good book to start learning about numerical methods is Applied Numerical Methods by Luther, Carnahan, and Wilkes. Start looking at the chapters where they show how to do transient heat conduction problems. You also need to learn something about solving stiff differential equations if you would prefer to use an implicit method and take larger time steps. My recommendation for now is to stick with the explicit scheme with smaller time steps. Chet 



#14
Jan1014, 04:03 PM

P: 833

It's probably OK to use explicit integration in this simple example. The pseudocode looks reasonable. Make sure you know the difference between heat and temperature. You said each grid point is identical, but in general, you could have a point with lower heat but higher temperature if the heat capacity of that cell is lower.
I would suggest storing the constants (like 0.001) into variable names so it's easier to adjust the precision if needed. The time step is implied inside the 100. Right now, if you increase the grid resolution, it will take more time steps for a heat pulse to get from one end to the other. It might be a good exercise to explicitly write out the dimensions, and put the heat conduction coefficient into a variable name in such a way that it is independent of the grid resolution. 


Register to reply 
Related Discussions  
Pool heat gain by solar radiation versus heat loss by evaporation  General Physics  2  
Energy required to heat different materials?  Introductory Physics Homework  1  
Energy storage without electricity  the rate of heat loss from a vacuum container  Introductory Physics Homework  10  
Temperature Fusion (heat gain = heat loss)  Introductory Physics Homework  8  
Heat loss due to Evaporation Cools remaining liquid, so why not model it that way?  General Engineering  5 