# What is balanced cooling in vacuum?

## Recommended Posts

I have been working for a while on cooling buildings in vacuum (space) and after pondering about it for weeks and working on it for a week, I finally got it working. This brings up the next question, which has little to do with actual coding and more gameplay/game balance: how powerful should it be?

What I have now is a modded liquid bridge (copy, the original is still available). It's just 2 cells wide and when liquids goes through, it will exchange temperature with the building at the input cell. If the liquid is blocked (not moving), no heat transfer takes place.

I have a test setup where water cools an aquatuner (in vacuum) and then the water goes through the aquatuner to be cooled. When the aquatuner ends up with a stable temperature, input and output water temperature is the same. This is actually a very good test because it caught earlier attempts, which failed to provide the same temperature, hence it would delete or create DTUs. Since it's the same now, the energy transfer code is good and the question is just the code to determine how much energy should be transferred.

How much heat should be transferred for each dot of water?

Right now the code says the liquid will heat up half the temperature difference multiplied by (liquid thermal conductivity * constant) where the () is capped between 0 and 1. Once it determines how much the liquid is heated, the building is cooled by that temperature * thermal capacity * mass transferred. The building part is ok. The question is the math in heating the liquid.

Do anybody have a good idea for a formula to determine how much the liquid should be heated? How should building heat conductivity and capacity be used? Should the pipe conductivity be used? How do we prevent the liquid from becoming hotter than the building?

##### Share on other sites

Why not just use the same formula as a regular conductive pipe?

You know how those interact with everything else, and you know how everything else interacts with buildings, so...

EDIT: To hopefully clarify, imagine the special bridge thing is a regular pipe, running through a perfect conductor liquid that interacts with the building.

##### Share on other sites

37 minutes ago, Yunru said:

Why not just use the same formula as a regular conductive pipe?

You know how those interact with everything else, and you know how everything else interacts with buildings, so...

EDIT: To hopefully clarify, imagine the special bridge thing is a regular pipe, running through a perfect conductor liquid that interacts with the building.

That was my first idea. Long story short, once the aquatuner had stopped increasing in heat, the water was still being cooled more than it was heated up before entering. Since I couldn't figure out why it would delete DTUs instead of transferring, I decided to remake everything based on a brand new concept.

Another reason why I'm a bit concerned with radiant pipes is that I don't really want to add complex (read: slow) temperature calculations to every single one all over the base. The new bridge building is much more CPU friendly due to the much lower number of buildings to call each second. On top of that, it triggers on transferring liquid, meaning it's not even called if the pipe is blocked or empty.

##### Share on other sites

You sure you're using the right calculation?

There was a thread somewhere about what the calculations were and how they're completely different from common knowledge.

##### Share on other sites

Just now, Yunru said:

You sure you're using the right calculation?

Evidently I don't

However I know energy is calculated correctly with the bridge approach and it's the most CPU friendly. Both are good arguments for going with that solution.

2 minutes ago, Yunru said:

There was a thread somewhere about what the calculations were and how they're completely different from common knowledge.

If you mean this one, then yes I have read it and I'm looking at it again. However the case I have isn't explicitly listed meaning it's not just a matter of reading that page.

##### Share on other sites

Actually I meant this one, although I think they say the same thing:

Edit: Can't you just inverse the equation used by the aquatuner? Surely it already accounts for things like SHC?

##### Share on other sites

I have been thinking a lot about exploits, or rather how to avoid them. I want to cool buildings in space, but I don't want some cooling solution, which changes everything in the base.

I have decided it should only work in vacuum and it should have the capacity of 5 g/s. At that temperature a robo miner has 40k times more mass, meaning I skip the thermal conductivity and just set the liquid to the building temperature. This makes it easier to code and faster to execute.

If we have a robo miner, which operates all the time, it produces 2 kDTU/s. With 5 g/s of water, the temperature will stay stable if the water is 96 C below the building temperature.

I think that's the best concept for a space cooling solution, which isn't also an exploit for other temperature management.

On 6/22/2019 at 9:00 PM, Yunru said:

Can't you just inverse the equation used by the aquatuner? Surely it already accounts for things like SHC?

I am doing something of that nature. That is I actually copied a line of code from the steam turbine and modified it to match the needs of the bridge building. That's how I ended up with moving DTUs without deleting any DTUs.

##### Share on other sites

8 hours ago, Nightinggale said:

If we have a robo miner, which operates all the time, it produces 2 kDTU/s. With 5 g/s of water, the temperature will stay stable if the water is 96 C below the building temperature.

@Nightinggale, let me run a scenario by you. So I can build a single robominer in any vacuum tile, not use it, and keep it at -100C, (not hard to achieve - colder will make this more extreme). Then I can send 500C supercoolant through it (at 5g/s), and the coolant will go from 500C to -100C without anything needed other than a pump running once every 2000 seconds (0.12W - basically nothing). This yields

• 5g/s*8.44(DTU/g)/C*600C = 25320 DTU/s.

I assume you'll have the building heat up by the same amount, so the cooling will drop as the difference changes. However, I can cool buildings with internal storage (keep them in vacuum), by cooling the tiles under them, and I can cool tiles under buildings in lots of ways. If can keep the temp of the building low, this is better than 2 wheezeworts (24kDTU/s).  This could all be speculation, and exaggeration, but have you checked it?

9 hours ago, Nightinggale said:

I think that's the best concept for a space cooling solution, which isn't also an exploit for other temperature management.

Are you sure you want to add this? The exploits can get much more elaborate. With 47 of these (costs are space - about a single ranch (put it with your hatches) - and about 6 DTU/s for the pump - basically nothing) you can displace more heat than an aquatuner displaces (for (1200+240)DTU/s). That's some pretty impressive heat transfer at basically no cost. Massive exploits will ensue....  I'm pretty sure I could make something extremely entertaining with this - at least I've been known to do such....

9 hours ago, Nightinggale said:

I skip the thermal conductivity and just set the liquid to the building temperature. This makes it easier to code and faster to execute.

A solution that follows this line of thinking will result in similar exploits as what I described above. The ONI developers have done a reasonably good job of avoiding things like this (Thumbs up Klei), though not perfectly. When you don't have enough mass, they clamp heat transfer, precisely to avoid rapid changes in heat (either upwards or downwards) that result from large differences in mass.  This is done on purpose, and your code ignores the reason for it. There are still a few fringe cases that give odd bugs (like using small amounts of liquid to prevent kilns and batteries from generating appropriate quantities of heat, and other such shenanigans). If you change this mechanic, so that only your building has the ability to create 500C temp changes instantly, then you introduce a game changing mechanic. I do not suspect Klei to even consider this as a viable solution.

It's a mod though, so some will love this solution. Don't let my comments stop you.

So far, I think building a vent, together with a couple background tiles (one behind the thing you want to cool, and another next to it with a vent over it) is probably a better option. Send a small amount of useless gas to cool the thing down, in just about the same amount of space as your contraption (haven't seen it, but that's my guess). The heat dissipates into space, and is no longer useful for anything else.  This is currently doable in game, and often discussed.

I do hope you come up with a nice system for cooling robominers in space, but I currently think this one has some major flaws.  I hope the feedback helps. Keep up the great work.

##### Share on other sites

This has turned into a gigantic learning experience, both regarding DTUs and exploits. The latter part has turned out to be even harder than I thought.

Maybe liquid cooling is a bad idea. Gas cooling seems better. Worst case is hydrogen where 2 kDTU will increase the temperature of 1 kg by 5/6 C. Other gasses will have even higher temperature changes. It's not a lot, but it's a lot higher than what a full liquid pipe will do.

Another way to avoid exploits would be to cap the temperature change, or rather set max 2 kDTU transfer. That should take care of exploits using extreme temperatures.

With the luck I have in this project, odds are that Klei has figured out a way to cool robo miners in space and they will release that just before I finish this mod. Maybe it's best to put it on pause for the moment and see what will be in the next test release.