Stationeers Advanced Furnace
Suppose you have a furnace with some gas inside. You want to achieve a specific temperature and pressure. For a specific temperature and pressure you can calculate the target number of moles.
The amount of energy in a Stationeers gas system is . For a target temperature and moles, you can use that formula to calculate the energy.
moles | temperature | |
target | ||
furnace | ||
hot | ||
cold |
If or then we need to pump out some furnace gas. If
else ( )
We will add some hot and cold gas to the furnace and reach the target moles
To reach the target temperature, we need to hit a target energy level. To simplify the equations (I’m already bumping up against the line limit for an IC10 routine) let’s assume that the specific heat for the gas mix is uniform between the hot tank, cold tank, and furnace and set it to 1.
Given this system of equations we can solve it:
It is possible that or could come back negative. In that case the only way to exactly hit the target temperature and pressure is to remove some gas from the furnace before adding a cold or hot gas.
For instance, if the cold gas moles comes back negative we solve a different system of equations.
We can then reduce the furnace to moles and then add in hot moles to reach the target temperature and pressure.
I had an IC10 MIPS script that implemented this formula. Unfortunately, a recent (2022-Sep) update to Stationeers broke it by adding heat leakage to the Advanced Furnace.
This heat leakage means that if you use the formulas above to choose how you pump gas into the furnace, your values will shift as the heat leaks out. This eventually leads to a loop of trying to pump gas out to make room for more hot gas.
The cybernetics must be adjusted to overshoot the heat target.
My first idea was to just ignore if ends up negative, and just pump in the calculated amount of hot gas. Unfortunately, a few quick calculations revealed that this failed to hit the temperature or pressure target.
If we also set the target temperature and pressure a little higher than the minimum needed for the alloy, that gives us some time to eject the ingot before the temperature goes out of spec.
There is still a possibility of an extreme case where pumping out furnace gas is necessary (imagine a furnace with 40MPa of gas at 400K) to reach the target without pumping in so much hot gas that the furnace breaches.
The decision to remove furnace gas used to be if the normal calculation came back with a negative value for or (because we can not remove hot gas from a furnace, we can only remove furnace gas).
The workaround is to check the and against a volume (after conversion) of -1 liters instead of zero. As long as the calculations recommend removing a liter or less of gas, the algorithm appears to work even in the presence of heat drain.
One final problem is that when the algorithm required removal of furnace gas, there were some dead spaces in the solution where even the second (one-gas) algorithm recommended adding negative amounts of (hot or cold) gas.
Fortunately this can be addressed by being more discriminating when routing the calculation into either the hot-only or cold-only calculation. If we need to increase the temperature, so use the hot-only calculation. If we need to decrease the temperature, so use the cold-only calculation. Each of those formulas (hot-only and cold-only) has a dead zone on either side of , so by picking the correct formula we can get a complete graph.
This only works because Stationeers does not recalculate temperature when you remove gas and reduce the pressure.
Filling the hot tank with gas is its own engineering challenge. Using AC units to pump heat is infeasible because they have 0 efficiency past 800K. Using in-line pipe heaters is energy intensive.
Before the 2022-Sep patches it was common to burn O2 and volatiles and pump them into the hot tank. Now that N2O has been added as an oxidizer, the heat of combustion for volatiles was cut in half, rendering it useless for high-temperature alloys.
Specific heat for combustion of pure 1:1 fuel mix
A result of this math is that if you have a 1:1 fuel mix in an insulated pipe and use a pipe heater to warm it to above 50C (323K) it will combust and reach a temperature of around 6005K.
The energy in a pipe system is
Suppose you have an arbitrary gas mix in an insulated pipe and it is hot enough to combust.
are burn quantities, and these formulas assume you have enough volatiles to burn all the oxidizers, which is not guaranteed in all cases. I have not bothered to figure out the formulas for a shortage of volatiles.
represents moles of gasses before combustion. represents moles of gasses after complete combustion (which will take time).
is temperature before combustion. is temperature after combustion.
and then
The section about Gas Mixers has been moved to its own document.