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.

PVD

Thermal conduction basics?

Recommended Posts

PVD    28

Looks like devs are having a lot of fun while watching how people are trying to guess in what way heat conductivity works in this game or they just not have time for this ****. No, really, I've spend lots of time trying to guess how it works, but wild guesses are not giving much fun and also not such helpful, so I went further and looked under devs skirt. And, what I have found there that is one big solid SimDLL.dll, which seems to be writed in C++ and not tries to be friendly:

nPD33uZ.png

Today's dish is triple pointer! Okay... You can be god of C++, but in order to launch your magic onto other platforms you will have to implement some sort of interface, so here is goes C#. I have not been digging a lot in the library, but what I have found with dozen of patience could be enough to guess about some basics of conductivity (check files Sim.cs and SimUtil.cs):

https://pastebin.com/mugsh6BD

Actually, this one is looking as class for debugging, but maybe it is used in game. Anyway, after "some" experiments and faults, I have tried to create the description of heat transferring:

G2M5OyF.png

In two words:

Objects have energy and temperature, objects with high temperature and energy transfer its energy to objects with low temperature and energy. How fast, is depends from temperature difference, mass and conductivity.

But it all need to be tested carefully, here I have performed basic tests:

For testing I used scrap made home based solution - C# script, so if you don't want to have fun with spending much time on coding or doing monkey calculations, check attachments below (I will also do by best to explain how to work with it, but don't rely on me).

Okay, first test is going to be about gas and liquid conduction, for gas I've chosen carbon dioxide, for liquid - water, in game it may looks something like this:

1muMiKJ.png

Two tiles of different materials connected with each other, but insulated from environment by wall of Abyssalite. In game I've added 1kg of dioxide at 3500K and 1000kg of water at 280K (all measurements are in Kelvin, go and change displayed temp in options, if you have another):

RvAwEbd.png

So, I started testing and began measuring each object's temperature every 2^i s times (1, 2, 4, 8, 16, etc.), here is what I've got:

 3431.2   280.0 //    1s
 3377.3   280.0 //    2s
 3272.1   280.0 //    4s
 3084.4   280.1 //    8s
 2743.7   280.2 //    16s
 2181.6   280.3 //    32s
 1413.8   280.4 // 1m  4s
  684.8   280.6 // 2m  8s
  334.6   280.6 // 4m 16s
  298.0   280.7 // 8m 32s

And here how it will look in scripts acceptable form ("water_dioxide.sim").

!objects
//Name  Material  Temp  Mass 
  obj0  co2(gas)  3500     1 // 1 kg of carbon dioxide at 3500K
  obj1  H2O(liq)   280  1000 // 1000 kg of water at 280K
!time
  2000 // Maximum simulation time in seconds
!tests
//TempA   TempB
 3431.2   280.0 //    1s
 3377.3   280.0 //    2s
 3272.1   280.0 //    4s
 3084.4   280.1 //    8s
 2743.7   280.2 //    16s
 2181.6   280.3 //    32s
 1413.8   280.4 // 1m  4s
  684.8   280.6 // 2m  8s
  334.6   280.6 // 4m 16s
  298.0   280.7 // 8m 32s
                // etc.

I think it's no really hard to create one more data set using this example, but you will also need data set of materials, that's how it looks ("materials.dat", all .dat and .sim files are just simple .txt ASCII files, so you can easily edit them in notepad):

//   Name  Sol   Heat   Cond  Dens  DefTemp
 h2o(gas)   -   4.179   .184     1    400.0 // steam
 h2o(liq)   -   4.179   .609  1000    282.2 // water
 co2(gas)   -   0.846   .146     1    320.0 // carbon dioxide
ph2o(liq)   -   6       .580  1000    312.5 // polluted water
dirt(sol)   +   1.480  2.000  1840    290.0 // dirt
   h(gas)   -   2.400   .168     1    320.0 // hydrogen
  fe(sol)   +   0.449  4.000   800    242.2 // iron ore

HeatSim.exe checks all files in it's local directory, so if you would like to add/edit something, open it in the explorer. And now, more sweet part - results:

2o2pb4v.png

So, all sense of written above is in achieving this "TolA" and "TolB", which show temperature difference between tests data and simulator data, if they are quite small, then simulator in this case works fine. By results I may say that it works normally for this case.

Another test (in all further tests I will only post raw data and results) is about gas + gas (steam + dioxide, "steam_dioxide.sim"):

!objects
//Name  Material  Temp Mass
  obj0  h2o(gas)  5000   .5 // 500 g of steam at 5000K
  obj1  co2(gas)   500  3.0 // 3 kg of carbon dioxide at 500K
!time
2000
!tests
4984.3  512.9
4968.7  525.7
4939.9  551.2
4877.3  601.0
4767.8  691.2
4563.9  859.0
4212.9 1148.0
3682.2 1584.9
3068.1 2090.5
2803.7 2308.2 // in-game stopped at 374

VT9ABVr.png

Liquid + liquid (water + dirty water, "water_dirtywater.sim"):

!objects
//Name   Material  Temp
  obj0  ph2o(liq)   380
  obj1   h2o(liq)   280
!time
2000
!tests
378.8 281.7
377.9 283.1
376.1 285.6
372.3 291.0
366.8 299.0
358.5 310.9
348.6 325.1
341.3 335.6
339.4 338.4 // in-game stopped at 224

nmWKLQu.png

Next three is going to be about about materials in solid states, these one may be the most painful and most inaccurate (due to unstable fps and mistakes in formula), as solid receive serious 1/100 penalty to it's conductivity.

solid + gas (hydrogen + dirt, "dirt_hydrogen.sim"):

!objects
//Name   Material  Temp Mass
  obj0     h(gas)  4500   25 // 25 kg of hydrogen at 4500K
  obj1  dirt(sol)   150 1000 // 1000 kg of dirt at 150K
!time
2000
!tests
4484.8 150.6
4472.7 151.1
4448.5 152.1
4403.7 153.9
4315.3 157.5
4141.6 164.5
4100.0 166.2 // ~40s

JArGGI0.png

solid + solid (iron ore + dirt, "dirt_ferum.sim"):

!objects
//Name  Material  Temp Mass
  obj0  dirt(sol)  590  900 // 900 kg dirt at 590
  obj1    fe(sol)   50 3500 // 3500 kg of iron ore at 50K
!time
2000
!tests
589.1  50.8
588.4  51.4
586.9  52.6
584.2  54.9
578.7  59.6
568.4  68.3
549.0  84.7
514.0 114.4
458.1 161.8
385.8 223.1
324.5 275.0 // game stopped at 1024

vYSKR1j.png

And most painful, liquid + solid (water + iron ore), this one took more that half an hour to take measurements in game (and still not achieved equilibrium), sim shows that It will take about 2700 seconds to do that, "water_ferum.sim":

!objects
//Name  Material  Temp Mass
  obj0  h2o(liq)   280  750 // 750 kg water at 280K
  obj1   fe(sol)   400 2500 // 2500 kg of iron ore at 400K
!time
10000
!tests
280.0 399.9
280.0 399.9
280.1 399.8
280.1 399.6
280.3 399.2
280.5 398.5
281.0 397.1
282.0 394.3
283.9 389.0
287.3 379.5
293.0 368.3
300.6 342.2

YiYiPvz.png

As I said, source code, data and executable (unzip it or it will not work) are in attachment. So what is your role in all of this? First will be nice if you will check all this, and think about it's correctness, then make some measurements and insert it into sim and report what you have got. If one day we would have correct formula, then we could create rich simulations in order to check heat transfer in complex factories, huge bases etc.

HeatSim.zip

Share this post


Link to post
Share on other sites
MoMuffins    73

Finally someone brave enough to dig into the code.  :)

I also have been figuring this out but without the aid of code.  I was hoping to figure out the rate in the first order rate equation through two separate setups, one between H2+Wolframite and another between H2+Coal, chosen due to the latter's interesting thermo conductivity number, 15 and 1, respectively.  The measurements for the the second setup is incomplete but I will complete it today.

Hopefully, the difference will point in the right direction for how rate is affected.

https://docs.google.com/spreadsheets/d/14dZdXw_bNOSO4OYBTZuYeQliCeyzSyfbhDg0zFRKTsk/edit#gid=0

You actually do not need to reach equilibrium to deduce the rate.  It is linear if you log it.

Share this post


Link to post
Share on other sites