A Simple Model of Thermal Transfer in Air

AI Thread Summary
The discussion centers on developing a Minecraft mod called ThermoCraft, which simulates heat transfer through air blocks and players. The mod's core concept involves assigning temperature values to air blocks, which adjust based on their adjacency to heat sources (like furnaces and lava) or heat sinks (like ice and snow). Heat transfer occurs between adjacent air blocks, with the rate influenced by their relative heights. Players also have temperature values that interact with the surrounding environment, and their clothing can affect heat transfer rates. Key points include the need for a model that accurately reflects heat dynamics, including conservation of energy, while acknowledging that real-time simulation of air movement may be computationally intensive. Suggestions include automating equations for temperature changes and considering convection effects, as heat typically moves upward in real-world scenarios. The conversation highlights the complexity of simulating heat transfer in a game environment and the challenges of balancing realism with performance.
Schilcote
Messages
7
Reaction score
0
I'm making a Minecraft mod, and I need a bit of help. Quite simply, it simulates heat transfer.

Unfortunately, I don't know enough about the subject to construct a good model. Here's what I have so far:

The base idea of ThermoCraft is that each air/empty block has a certain floating-point temperature value (very roughly equivalent to watts of heat energy), which it will try to equalize with adjacent air blocks. Other blocks may be thermally conductive, but in the first version it may be best to stick to air only.

Air temperature values are affected in three ways:

Certain blocks, such as lit furnaces, fire, lava, nuclear reactors, the output side of a heat exchanger (see section on added blocks), etc... will increase the temperature value of each block of air that is touching them.

Certain other blocks, such as ice, snow, or the input side of a heat exchanger, will decrease the temperature value of each block of air touching them. Ice and snow will melt into water after “absorbing” enough temperature. This does not follow the heat-transfer rules described below- the block directly removes heat from the air around it.

Each air block in the world will look at each air block adjacent to itself and, if the checked block's temperature value is less than the checking block's value, it will increase the checked block's temperature level by 0.03*(highertemp-lowertemp) units and decrease its own by the same amount.

However, if the block being transferred to is above the block being transferred from, the temperature increase and respective decrease will be doubled. Inversely, if the block receiving the heat is below the block giving it, it will be halved.

I.E, if a block of air has a temperature value of 100, and a block beside it has a temperature value of 50, the colder block's temperature will increase by 0.03*(100-50)=1.5 units every tick, and the warmer block's temperature will decrease by 1.5 units every tick. If the colder block is above the warmer, however, the heat will transfer twice as quickly: 0.03*(100-50)*2=3 units per tick. If the colder block is below the warmer block, heat will transfer one-fifth as quickly: 0.03*(100-50)*0.2=0.3 units per tick. Obviously, it is therefore advantageous to put your heat-generating apparatuses at the bottom of any space that you wish to warm.

Each player also has a temperature value, representing their core temperature. This will change in the same manner as adjacent air blocks will (meaning that the presence of a player in a cold room will warm the room slightly, while chilling the player).

Looking back, I can see that simulating heat in terms of watts is probably a really silly way to do it. Wikipedia is being obtuse, Wolfram Alpha thinks I'm a lunatic, and my teachers don't know either. I need some guidance on how best to simulate what I want to simulate.

The parameters of the simulation are:

1. The simulation will only be run on the air and players, and only encompasses temperature, not humidity. All objects that are not air or a player are assumed to have exactly zero thermal conductivity.
2. Air is divided into blocks one cubic meter in volume.
3. Certain objects dump heat into the air.
4. Certain objects remove heat from the air.
5. A player (human being) simulates heat transfer in the same way as the air.
6. Players can put on insulative/heat-removing clothing to change the rate at which heat transfers to/from them.
7. A player contains a "heat pump" that tries to force his internal temperature to 37 degrees Celsius by generating heat or forcing it into the environment.
8. A player whose temperature goes below 35 °C or above 39 °C will enter a state of hypo/hyperthermia and become ill. Severity of effects will increase as the temperature moves further from the ideal.

Anyone have any ideas? I'm also not great with academic math, so I'm not going to be able to understand anything past the algebra II level without a little bit of help. Thanks.
 
Technology news on Phys.org
Interesting and looks do-able, but not simple. Needless to say, you are dealing simultaneous equations...this looks very much like finite elements where your elements are 1 cubic meter in size, though.

Even if it may be more (CPU) time consuming than a simple "IF" statement, I think you need to automate your equations so that they just work...instead of this thing where you say "If this block is higher than that one"...

...Instead, I think you may need to introduce the height of a block and its neighbor into the equation so that depending on its own height and the others, the equation yields the correct delta of temperature for each block...maybe instead of a single term, you can have two terms or something...of course, the final units of each term needs to be celcius...the heights are simply there to produce an additional term of a certain magnitude and a certain sign (positive or negative).

also, the summation of all heats coming into and leaving a block need to add up to zero for conservation of energy...this looks very much like nodal analysis (looks very much like Kirchhoff's law

I do this sometimes, but solve for final steady state results under non-changing boundary conditions.

It seems that you would need to apply your temperatures deltas every time step.

...I am just rambling now...
 
Your idea could make a realstic mode for heat conduction in a solid, if you get the right balance beteen the size of each block and the time step of the simulation. But it won't work very well for the atmosphere, because the main way heat is moved around is by convection. In other words, the air in one block moves into a different block, and takes its heat along with it.

The same thing happens in liquids. If you heat a pan of water on a stove, the heat doesn't conduct up through the water. The hot water at the bottom rises to the top, and some cold water sinks to the bottom to take its place. You can see this in a pan of water, especially if you put some sort of powder that doesn't disolve in the water so it's easier to see the movement.

Trying to model the "real" air motion would be much too expensive to do in "real time" in a game, but you might be able to think of a simple way to get the right sort of effect. For example if a block at 20 degrees has blocks at 10 degrees all around it, most of the heat should move upwards, rather than sideways or down.
 
AlephZero: I thought his implicit *1.0 in the first equation and the explicit *2.0 and *0.2 were intended to simulate such behavior where hot air rather move up than down or to the side. That's what I thought, anyway.
 
gsal said:
AlephZero: I thought his implicit *1.0 in the first equation and the explicit *2.0 and *0.2 were intended to simulate such behavior where hot air rather move up than down or to the side. That's what I thought, anyway.

That seems to imply that heat is only exchanged "symmetrically" between adjacent blocks. It is equivalent to a solid that conducts heat better in one direction (vertical) than the others. Or alternatively, it's equivalent to having blocks that are not cubes, but the height is smaller than the other two dimensions.

A convection current can carry heat around a "loop" of blocks, where the loop can be any size.

The simulation needs to have something equivalent to "conservation of energy" on a global scale, but not on the local scale between every pair of adjacent blocks.
 
Thread 'Is this public key encryption?'
I've tried to intuit public key encryption but never quite managed. But this seems to wrap it up in a bow. This seems to be a very elegant way of transmitting a message publicly that only the sender and receiver can decipher. Is this how PKE works? No, it cant be. In the above case, the requester knows the target's "secret" key - because they have his ID, and therefore knows his birthdate.

Similar threads

Back
Top