Jump to content

Decrypting heat transfer


Recommended Posts

Some of this is clearly outdated. Specifically I am sure that pipes work differently now. At the time of this post the radiant pipes did not even exist.

However this is still a good starting point and could largely still be correct. Just note that insulated pipes actually insulate, contrary what the old post said.

Let me know, if something else changed. Would be interesting.

Link to comment
Share on other sites

The wiki page on this stuff is pretty good now and includes the changes since that original post.

https://oxygennotincluded.gamepedia.com/Thermal_Conductivity

Those editing the page are heroes the community needs but doesn't deserve.

Note that there are some minor details missing, but they aren't very important in the grand scheme of things.

Link to comment
Share on other sites

The wiki you linked is not consistent.

"Thermal Conductivity" page lists the multiplier of insulated tiles for heat transfer as (2/255)^2. However the insulated tile page lists it as 1/100. The latter being what I found in the code as well. Of course there could be some hidden mechanic in the engine somewhere else. But one of these statements must be wrong/outdated.

Link to comment
Share on other sites

The 1/100 is incorrect. While it is indeed in the code, it is not relevant for heat transfers. A dirty little secret is that the dev team isn't particularly competent and there is all sorts of vestigial/deadend code.

You can easily confirm this for yourself. The wiki page even has an example that demonstrates this.

Link to comment
Share on other sites

Another few things changed since the referenced post was made.

At one point in development, heat transfer between two tiles always used the lower of two neighboring tiles' thermal conductivities. There were some issues with this, and it came a bit to a head when Klei introduced radiant pipes & vents.

At some other point in development, klei decided to try using the average of two neighboring materials' conductivities. The results were kind of disastrous.

At a later time, klei changed things again so that heat transfer used the log-average of neighboring tiles' thermal conductivities. Except in the case where heat exchange was happening between an object with the "insulated" property, and then the lowest of the two neighboring conductivities was used.

Actually approach #3 there worked pretty well, and I don't recall seeing any patch notes indicating it had been changed again. But I've also seen some discussion that makes me believe that it's either fallen out of common knowledge or other people think it's gone back full circle at some point.

Would be interested in knowing what it is now.

Link to comment
Share on other sites

18 hours ago, avc15 said:

At a later time, klei changed things again so that heat transfer used the log-average of neighboring tiles' thermal conductivities. Except in the case where heat exchange was happening between an object with the "insulated" property, and then the lowest of the two neighboring conductivities was used.

 

That's not true, at least not for solid tiles. The geometric mean of two k-values are used.

I did a quick test in sandbox with Iron ore and refined iron, with temperature difference of 20C, and 100kg.

With log-average the Increase in temperature after 1 tick should be:

q = k_log * dT * 0.2 *1000 

q = (55-4)/(ln(55)-ln(4)) * 20 * 1000

q = 77.8 kJ

 

So the change in temperature should be:

dT = q/(cp*m)

dT = 77.8/(0.449*100)

dT = 1.7C

And with geometric mean it you get:

q = k_geom * dT * 0.2 *1000 

q = sqrt( 4*55) * 20 * 0.2 * 1000

q = 59.3 kJ

Change in temperature: 

dT = q/(cp*m)

dT = 59.3/(0.449*100)

dT = 1.3C 

From my test, you can see that the temperature changes by 1.3c, so the geometric mean is used. 

Spoiler

image.png.77c7897cfab3f714bed728345bd9b9fe.png

 

Link to comment
Share on other sites

1 hour ago, Chintam said:

 

That's not true, at least not for solid tiles. The geometric mean of two k-values are used.

 

Yeah, I'm not a mathematician, but this scans. Geometric mean makes sense.

Edit: here's a link to the patch drop in question. There's some discussion about exactly what a log-average is, and that it's actually the same thing as a geometric mean. But I think geometric mean can be expressed as an exponential of a geometric mean of logarithms, which isn't quite the same thing.

Anyway, log-average is actually applicable to real heat transfer and mechanical engineering for heat exchangers - but I think maybe someone at Klei mixed up two things. However, the results will be similar.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...