0
$\begingroup$

I'm making a simple heat distribution program. It's a $2D$ matrix with cells holding heat value. Every iteration looks for cells near current which have lower heat value and gives them some of its heat. Each cell gets different amount of heat (based on heat difference and conductivity).

The problem is with the stage where the distributed amount of heat needs to be multiplied by a certain number to account for up to three nearby cells that don't accept heat (hotter than current cell). I can't figure out how to calculate that multiplier.

  • 0
    It's for giving the full amount of distributable heat to all available cells proportionately.2012-08-10

1 Answers 1

1

The usual approach is to have each cell have a temperature, where the quantity of heat in the cell is the temperature times the heat capacity. Then the heat flow across a boundary is the difference of the temperatures times the conductivity. So if you have a cell that is hotter than one neighbor and colder than the other three, it supplies heat to the colder neighbor and receives heat from the others. There is no need to treat hotter and colder neighbors separately. The total heat in your model is constant aside from what conducts through the boundaries.

  • 0
    Oh, looks like I've got over my head on this. Thanks for straighting this out for me.2012-08-10