Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Any solid knowledge on thermodynamics?  (Read 1823 times)

GavJ

  • Bay Watcher
    • View Profile
Any solid knowledge on thermodynamics?
« on: April 15, 2014, 04:37:20 pm »

I'm not finding much in searches other than "it's super broken lol." Below, I list known things, and desired information. I plan on investigating these things myself using !!Science!!, but if you already know an answer or mistake, please chime in and save me the trouble and I will try to update.

What I can gather:
1) Only things resting on solid ground OR gases (?) seem to transfer heat between co-occupying objects or tiles. Maybe not on the gases - this might be a special hardcoded thing, rather than tile by tile basic thermodynamics. But the behavior of magma mist makes it seem like tile-by-tile.
2) Heat transfers through unmined tiles or constructed things, as well as through at least 1 z layer of floor.
3) Materials can have fixed temps and specific heats (amount of heat required to change temperature) in the raws controlling how quickly they heat or cool off, but this doesn't seem to be the case for unmined rock (or it's hard coded if it is? Might be wrong about that), only objects.
4) Underground seems to have a sort of fixed temperature, always being habitable for instance even when outdoors is absolute zero or as hot as dragonfire.
5) [HOMEOTHERM] tags in creatures appear to give them an active buffer - they create that temperature with some amount of influence, but it can be overwhelmed by external influences. (Is there a way to modify the weight of that influence? As in, homeotherm = 10067, and it REALLY sticks there? Versus it sort of tries to stay there but not very hard? I suspect you may be able to use specific heat of body tissue materials to do this if not some other parameter). Removing HOMEOTHERM from a creature will put it at the mercy of its environment, i.e. make it cold blooded, and it will melt on floors above magma, etc.

Things I want to know and will conduct !!Science!! to investigate, but only if nobody has a quick answer:
1) Is any of the above wrong?
2) Is there a limit on how many tiles heat will transfer through, or is the falloff simply sharp enough that it is effectively 1-2 for anything important (like magma tubes in the middle of your fort)? I would imagine there is not limit, and that each tile just affects its neighbors, thus it could chain along, but it doesn't because the ambient underground temperature rapidly outweighs the influence of the magma through the wall.
2.5) Heat seems to transfer further horizontally that in z levels. Is this simply because each floor and each wall counts as a layer to pass heat through? Or some other reason?
3) If no hard limit, then can the radius be changed in any way? E.g. by changing the specific heat of unmined rock or the underground contributing temperature, or whatever? Or can we not do anything to unmined rock properties. I am not optimistic. Doing a search in the raws folder shows results for things like fat's melting point, but not for, say, underground temperature, making me assume it is hard coded.
4) Do things heat up outdoors even if they aren't touching any hot tiles? Like if you build a constructed floor of nethercap in a boiling hot atmosphere, and stand on it, would you be A-OK?
5) Are tiles "exposed to light/surface" the temperature of the biome?
6) Does fire spread heat in any special way? Or does it essentially just temporarily make the temperature of the burning object higher and then heat transfers as normal? I.e., is there a difference between a burning object versus a fixed-temperature material at a standard burning temperature?
7) Can HOMEOTHERM be used on inanimate objects?  Easy to answer, haven't gotten around to it yet. It would be like nether cap, but less absolute. Merely "preferring/tending toward" that temperature.
8) Even if you can't change the "weight" on homeothermal strength, I would still like to know what that weight IS. In order to be able to calculate where the equilibrium point is for a given homeothermal temperature and environmental temperature combination. This could be figured out through painstaking research.
8 ) Is there any way to CONDENSE a gas into a liquid or solid? Similar to how a glob of molten rock will recondense back into the rock boulder type (actually, I'm not 100% sure I remember seeing that happen either. It does happen with metals though yes?)
10) Speaking of which, what determines whether a material melts into a glob, versus melting into a contaminant like the water that comes from an ice boulder?
11) Do contaminants transfer heat? Like the blood of a super hot clown sprayed on the wall?
« Last Edit: April 15, 2014, 04:40:58 pm by GavJ »
Logged
Cauliflower Labs – Geologically realistic world generator devblog

Dwarf fortress in 50 words: You start with seven alcoholic, manic-depressive dwarves. You build a fortress in the wilderness where EVERYTHING tries to kill you, including your own dwarves. Usually, your chief imports are immigrants, beer, and optimism. Your chief exports are misery, limestone violins, forest fires, elf tallow soap, and carved kitten bone.

Snaake

  • Bay Watcher
    • View Profile
Re: Any solid knowledge on thermodynamics?
« Reply #1 on: April 15, 2014, 06:23:48 pm »

One observation I've made in my current fort... I've been under the impression that if you mine out the space under a frozen murky pool/river/brook and fill said space with magma, the magma will heat and melt the ice.

Well, my current embark is cold temperate, snow melts in late spring/early summer and comes back in late summer/early autumn. Pools are only unfrozen from the 5th to 24th of Malachite (20 days in Mid-Summer). I did the magma thing, and it did initially melt the ice... however, the pool began to slowly freeze again. Now the magma just sits there underneath, and the pool is frozen normally, like it would be without the magma.

And yes, temperature is on, and has been on the whole time.


Regarding your questions e.g. number 5, I think dfhack has commands to find out the temperatures of tiles/things.
Logged

GavJ

  • Bay Watcher
    • View Profile
Re: Any solid knowledge on thermodynamics?
« Reply #2 on: April 15, 2014, 07:48:12 pm »

That is very helpful, thanks. Is there any way to probe objects, perhaps with another utility?
Its creature probe just tells you civilization and race and ID number, unlike the tile one.

I can sort of clumsily infer things from the tile they're standing on, but it would be much easier if I could probe objects.

From tile data
* Magma seems hardcoded and boring to just be 10,075 in "warm" stones adjacent no matter what, and only adjacent.
* Creatures cool off or warm up the tile they are standing on if it is a different ambient temperature. I tested a map with an outdoor temp of 10,720 urist. A dwarf (set to 10,000 homeotherm in that save) made the tile he was standing on = 10,656, and the adjacent tile 10,704. After that, no effect.
* 2 Dwarves in the same tile made it 10,593, and 10,657 adjacent, then no effect. Almost exactly twice the cooling, which is weird if it's any sort of realistic equation. Probably something much more linear than actuality.
* Objects without homeopath also did this, but it was harder to test. A burning pile of plump helmet spawn made the tile under it cool off to 10,671. This is also weird, because it burning means it was at at least 10,500, which the dwarves almost certainly were not at. So why did they have similar cooling effects?
* A dog died much faster than the dwarves or draft animals did. It could be more frail? Or the algorithm might take body size into account, such as a fixed, linear amoutn of heat entering, which heats up a smaller thing more quickly? I can test this later by having identical creatures, save for body size.

In all cases, it looked like objects only affected adjacent tiles (as in diagonals too, one step away), and then nothing at all beyond that, like magma does.

And the temperature of the tile is heavily skewed toward ambient / the things in it only sway it a little bit, although their influence accumulates with multiple objects.



With the exception that a moving dwarf did leave a trail of cooler tiles behind him, which warmed up about 1 urist per tick in that case (not necessarily always of course).
« Last Edit: April 15, 2014, 08:09:22 pm by GavJ »
Logged
Cauliflower Labs – Geologically realistic world generator devblog

Dwarf fortress in 50 words: You start with seven alcoholic, manic-depressive dwarves. You build a fortress in the wilderness where EVERYTHING tries to kill you, including your own dwarves. Usually, your chief imports are immigrants, beer, and optimism. Your chief exports are misery, limestone violins, forest fires, elf tallow soap, and carved kitten bone.

Urist Da Vinci

  • Bay Watcher
  • [NATURAL_SKILL: ENGINEER:4]
    • View Profile
Re: Any solid knowledge on thermodynamics?
« Reply #3 on: April 15, 2014, 10:16:53 pm »

One observation I've made in my current fort... I've been under the impression that if you mine out the space under a frozen murky pool/river/brook and fill said space with magma, the magma will heat and melt the ice.

Well, my current embark is cold temperate, snow melts in late spring/early summer and comes back in late summer/early autumn. Pools are only unfrozen from the 5th to 24th of Malachite (20 days in Mid-Summer). I did the magma thing, and it did initially melt the ice... however, the pool began to slowly freeze again. Now the magma just sits there underneath, and the pool is frozen normally, like it would be without the magma.
...

Magma only does the temperature check when it moves, so the cold is just re-establishing itself:
- Some magma pump stack designs greatly reduced lag/ increased fps by having a ring of static magma present, so that the constantly disappearing/reappearing magma wouldn't constantly alter the temperatures.
- Some glacier ice water generator designs work by occasionally "churning" the magma. If you start to drain the magma, your pool should instantly melt.

The fractional temperatures of items and creatures are used with spec heat in order to determine temperature changes or energy conduction.
EDIT: every tick, the difference between the two temperatures of, say a hot item and the hand holding it, is moved from the hot item into the hand, adding to the fractional temperature. The "temp factor" of the hand body part, which is derived from spec heat, determines how large the fractional temperature needs to be in order to increase the actual temperature by 1.
« Last Edit: April 15, 2014, 10:37:42 pm by Urist Da Vinci »
Logged

GavJ

  • Bay Watcher
    • View Profile
Re: Any solid knowledge on thermodynamics?
« Reply #4 on: April 16, 2014, 02:47:33 am »

Quote
EDIT: every tick, the difference between the two temperatures of, say a hot item and the hand holding it, is moved from the hot item into the hand, adding to the fractional temperature. The "temp factor" of the hand body part, which is derived from spec heat, determines how large the fractional temperature needs to be in order to increase the actual temperature by 1.
If temperatures cannot be stored in fractions of a Urist, and if it decides whether or not to change by a Urist every tick, then to go from 10,000 to 10,078 where fat melts should take either 78 ticks (or less) or infinitely long.  How do you end up with 1,500 ticks, which is how long it took for my dwarves to begin melting?
Logged
Cauliflower Labs – Geologically realistic world generator devblog

Dwarf fortress in 50 words: You start with seven alcoholic, manic-depressive dwarves. You build a fortress in the wilderness where EVERYTHING tries to kill you, including your own dwarves. Usually, your chief imports are immigrants, beer, and optimism. Your chief exports are misery, limestone violins, forest fires, elf tallow soap, and carved kitten bone.

Urist Da Vinci

  • Bay Watcher
  • [NATURAL_SKILL: ENGINEER:4]
    • View Profile
Re: Any solid knowledge on thermodynamics?
« Reply #5 on: April 16, 2014, 03:19:05 am »

Quote
EDIT: every tick, the difference between the two temperatures of, say a hot item and the hand holding it, is moved from the hot item into the hand, adding to the fractional temperature. The "temp factor" of the hand body part, which is derived from spec heat, determines how large the fractional temperature needs to be in order to increase the actual temperature by 1.
If temperatures cannot be stored in fractions of a Urist, and if it decides whether or not to change by a Urist every tick, then to go from 10,000 to 10,078 where fat melts should take either 78 ticks (or less) or infinitely long.  How do you end up with 1,500 ticks, which is how long it took for my dwarves to begin melting?

Temperatures ARE stored in fractional urists. The size of the denominator (the bottom half of the fraction) is spec heat (or closely related to spec heat for body parts). At first, 10XXX-10000=XXX units of heat are transferred over per tick, and you might need 4181 or something to increase the body part by 1 urist. This results in an exponential decay function.

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: Any solid knowledge on thermodynamics?
« Reply #6 on: April 16, 2014, 09:53:37 am »

4) Underground seems to have a sort of fixed temperature, always being habitable for instance even when outdoors is absolute zero or as hot as dragonfire.
Underground tiles always have a temperature of 10015.

5) [HOMEOTHERM] tags in creatures appear to give them an active buffer - they create that temperature with some amount of influence, but it can be overwhelmed by external influences. (Is there a way to modify the weight of that influence? As in, homeotherm = 10067, and it REALLY sticks there? Versus it sort of tries to stay there but not very hard? I suspect you may be able to use specific heat of body tissue materials to do this if not some other parameter). Removing HOMEOTHERM from a creature will put it at the mercy of its environment, i.e. make it cold blooded, and it will melt on floors above magma, etc.

In older versions, the ability of a creature with HOMEOTHERM to tolerate surrounding temperatures was based on its LAYERING, but version 0.31 changed that into something else; presumably, it's based on individual tissue properties, but the ones in the stock raws are widely known to be wrong.
Logged
P.S. If you don't get this note, let me know and I'll write you another.
It's amazing how dwarves can make a stack of bones completely waterproof and magmaproof.
It's amazing how they can make an entire floodgate out of the bones of 2 cats.

GavJ

  • Bay Watcher
    • View Profile
Re: Any solid knowledge on thermodynamics?
« Reply #7 on: April 16, 2014, 11:10:07 am »

Quote
Temperatures ARE stored in fractional urists. The size of the denominator (the bottom half of the fraction) is spec heat (or closely related to spec heat for body parts). At first, 10XXX-10000=XXX units of heat are transferred over per tick, and you might need 4181 or something to increase the body part by 1 urist. This results in an exponential decay function.
I think you're meaning to say, then, is that heat is stored fractionally, while temperature is not, two different numbers?  Which would make sense.

Although that is realistic, it does seem an odd way to program it to have two different long integers or whatever they are when you could just combine it with one (AND fewer equations. A simplified amalgam of heat and temperature) since temperature is the only thing that actually impacts the rest of the game, not heat.

Unless he has plans later for heat specifically (no pun intended) or something.
Logged
Cauliflower Labs – Geologically realistic world generator devblog

Dwarf fortress in 50 words: You start with seven alcoholic, manic-depressive dwarves. You build a fortress in the wilderness where EVERYTHING tries to kill you, including your own dwarves. Usually, your chief imports are immigrants, beer, and optimism. Your chief exports are misery, limestone violins, forest fires, elf tallow soap, and carved kitten bone.

GavJ

  • Bay Watcher
    • View Profile
Re: Any solid knowledge on thermodynamics?
« Reply #8 on: April 16, 2014, 11:13:41 am »

Also, when I turned off [HOMEOTHERM], the dwarves died instantly in the 0th tick of the game in 10,720 temp. I.e. they were all dead and gone from the units chart before I even unpaused the game for the first time.

This seems odd, if the specific heat of body parts is used to increment temperature up whenever it passes specific heat threshold (or a multiple). In the first tick, by the above algorithm, they should have received about 700 urists of heat, and only rose a urist or two or three maybe. Not the 300+ immediate temp change you would need to insta-boil them or whatever killed them that quickly.

...Or do inanimate objects + (creatures with homeotherm) act as one category, while (creatures without homeotherm) are the oddballs with a different equation?
Logged
Cauliflower Labs – Geologically realistic world generator devblog

Dwarf fortress in 50 words: You start with seven alcoholic, manic-depressive dwarves. You build a fortress in the wilderness where EVERYTHING tries to kill you, including your own dwarves. Usually, your chief imports are immigrants, beer, and optimism. Your chief exports are misery, limestone violins, forest fires, elf tallow soap, and carved kitten bone.

Larix

  • Bay Watcher
    • View Profile
Re: Any solid knowledge on thermodynamics?
« Reply #9 on: April 16, 2014, 11:36:47 am »

It may be that inanimate objects and poikilotherm creatures simply start out at ambient temperature. I.e. the dwarfs didn't "heat up", they were spawned at 10 720°U, which instantly evaporated their blood.

Concerning question 8) above - solidifying non-solid matter: as far as i can tell, cooling a liquid (or gas) below the solid point turns the material into a glob of frozen/solid material, not into its standard "raw material" type (i.e. boulder, bar etc.). Such globs will be stored in the food stockpile and get cleaned if they're non-edible; edible types can be cooked into meals, e.g. frozen milk, molten and re-solidified cheese, probably frozen alcohol as well.
Logged

Urist Da Vinci

  • Bay Watcher
  • [NATURAL_SKILL: ENGINEER:4]
    • View Profile
Re: Any solid knowledge on thermodynamics?
« Reply #10 on: April 16, 2014, 08:01:48 pm »

...
Concerning question 8) above - solidifying non-solid matter: as far as i can tell, cooling a liquid (or gas) below the solid point turns the material into a glob of frozen/solid material, not into its standard "raw material" type (i.e. boulder, bar etc.). Such globs will be stored in the food stockpile and get cleaned if they're non-edible; edible types can be cooked into meals, e.g. frozen milk, molten and re-solidified cheese, probably frozen alcohol as well.

If you have a creature with a gas tissue, it can take damage from condensation. However IIRC all of the vanilla gas creatures, like the flame or steam randomly generated monsters, have a fixed temperature.

Urist Da Vinci

  • Bay Watcher
  • [NATURAL_SKILL: ENGINEER:4]
    • View Profile
Re: Any solid knowledge on thermodynamics?
« Reply #11 on: May 04, 2014, 05:04:47 pm »

...
5) [HOMEOTHERM] tags in creatures appear to give them an active buffer - they create that temperature with some amount of influence, but it can be overwhelmed by external influences. (Is there a way to modify the weight of that influence? As in, homeotherm = 10067, and it REALLY sticks there? Versus it sort of tries to stay there but not very hard? I suspect you may be able to use specific heat of body tissue materials to do this if not some other parameter). Removing HOMEOTHERM from a creature will put it at the mercy of its environment, i.e. make it cold blooded, and it will melt on floors above magma, etc.

In older versions, the ability of a creature with HOMEOTHERM to tolerate surrounding temperatures was based on its LAYERING, but version 0.31 changed that into something else; presumably, it's based on individual tissue properties, but the ones in the stock raws are widely known to be wrong.

I used DFHack to obtain body part temperatures from a variety of creatures in various situations (magma, water, dry land, holding hot object, etc.) and with differing properties, and have the following observations:

a) The [INSULATION:x] token in the creature tissue templates controls the weight of the homeotherm influence. Despite the name, it doesn't appear to play any role in resisting heat transfer. If you have homeotherm but no insulation, you end up about 3 degrees away from ambient temperature. If you have huge insulation, then insulated parts tend to stay at the homeotherm when subject to hot/cold outside dry air conditions (tile temperatures).

b) Water (coverings), magma, hot/cold items and contaminants tend to overwhelm homeotherm. Water will quickly pull the body part to the ambient temperature. Magma pulls the body part temperature to 12000 U.

c) Low SPEC_HEAT results in rapid temperature changes. High SPEC_HEAT slows down temperature change. The amount of heat transferred per tick is due to the temperature difference, not the spec heat. Body parts that are connected to many external body parts tend to change temperature faster.

d) Clothing appears to stay within 3-5 degrees of the body part temperature, except for things like nether-cap clothing with fixed temperatures. This appears to happen regardless of the clothing or armor's material.

e) While in older versions creatures with poor layering and heat could die in the wrong climates (some cave creatures couldn't survive above ground), there does not appear to be a "died in the heat" check in 0.34.11 (or at least the conditions are obscure/rare).

The max values for spec heat or insulation will be 65536 or less.

GavJ

  • Bay Watcher
    • View Profile
Re: Any solid knowledge on thermodynamics?
« Reply #12 on: May 04, 2014, 05:31:07 pm »

Thanks, that's all super helpful!

So basically,

* Homeotherm is the starting temp, and...
* "Insulation" in conjunction with homeotherm = eventual end point you land at for any given ambient temperature, in the limit.
* SPEC_HEAT is how quickly you get to the endpoint above, based on how far away you are from it now.

Yes?
Logged
Cauliflower Labs – Geologically realistic world generator devblog

Dwarf fortress in 50 words: You start with seven alcoholic, manic-depressive dwarves. You build a fortress in the wilderness where EVERYTHING tries to kill you, including your own dwarves. Usually, your chief imports are immigrants, beer, and optimism. Your chief exports are misery, limestone violins, forest fires, elf tallow soap, and carved kitten bone.