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.

R = 8.314 PV = nRT n = PV RT

The amount of energy in a Stationeers gas system is nTs. For a target temperature and moles, you can use that formula to calculate the energy.

moles temperature
ntTttarget
nfTffurnace
aTthot
bTtcold

1 TLDR

b = nf(Tf Th) + nt(Th Tt) Th Tc a = nt nf b

If a < 0 or b < 0 then we need to pump out some furnace gas. If Tf < Tt

a = (Tt Tf)nt Th Tf removefromfurnacenf nt + a

else ( Tf > Tt )

b = (Tt Tf)nt Tc Tf

2 derivation

We will add some hot and cold gas to the furnace and reach the target moles

nt = nf + a + b

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 s for the gas mix is uniform between the hot tank, cold tank, and furnace and set it to 1.

E = ntTt = nfTf + aTh + bTc

Given this system of equations we can solve it:

nt = nf + a + b a = nt nf b E = ntTt = nfTf + aTh + bTc ntTt = nfTf + (nt nf b)Th + bTc ntTt = nfTf + ntTh nfTh bTh + bTc bTh bTc = nfTf + ntTh nfTh ntTt b(Th Tc) = nf(Tf Th) + nt(Th Tt) b = nf(Tf Th) + nt(Th Tt) Th Tc

It is possible that a or b 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.

nt = nx + a nx = nt a E = ntTt = nxTf + aTh ntTt = (nt a)Tf + aTh ntTt = ntTf aTf + aTh ntTt Tfnt = a(Tf + Th) a = (Tt Tf)nt Th Tf

We can then reduce the furnace to nx moles and then add in a hot moles to reach the target temperature and pressure.

3 and then Stationeers patched

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 nc 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.

4 add hot until we reach the target temperature, regardless of pressure

E = (nf + a)Tt = nfTf + aTh nfTt + aTt = nfTf + aTh aTt aTh = nfTf nfTt a = nf(Tf Tt) Tt Th

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.

5 current solution

The decision to remove furnace gas used to be if the normal calculation came back with a negative value for a or b (because we can not remove hot gas from a furnace, we can only remove furnace gas).

The workaround is to check the a and b 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.

6 final tuning

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.

PIC

Figure 1:Half of the dead zone

Fortunately this can be addressed by being more discriminating when routing the calculation into either the hot-only or cold-only calculation. If Tt > Tf we need to increase the temperature, so use the hot-only calculation. If Tt < Tf 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 Tf, 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.

7 hot tank combustion

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.

1N2O + 1volatiles = 2N2 + 2CO2 + 572000joules

Specific heat for combustion of pure 1:1 fuel mix

t023 + t020.4 + 572000 = t12(20.6) + t12(28.2) t0(43.4) + 572000 = t1(97.6) t0(0.44467) + 5860.655 = t1

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

E(C) = gsgmgt

Suppose you have an arbitrary gas mix in an insulated pipe and it is hot enough to combust.

bi 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.

mg represents moles of gasses before combustion. mg represents moles of gasses after complete combustion (which will take time).

t is temperature before combustion. t is temperature after combustion.

b1 = min(mO2,mvol2) b2 = min(mN2O,mvol) E(C) = gsgmgt + 572000(b1 + b2) mO2 = m O2 b1 mvol = m vol 2b1 b2 mN2O = m N2O b2 mN2 = m N2 + 2b2 mCO2 = m CO2 + 6b1 + 2b2 mX = m X + 3b1 E(C) = gsgmgt

and then

gsgmg = gsgmg sO2b1 svol(2b1 + b2) sN2Ob2 + sN22b2 + sCO2(6b1 + 2b2) + sX3b1 = gsgmg 21.1b1 20.4(2b1 + b2) 23b2 + 20.6(2b2) + 28.2(6b1 + 2b2) + 24.8(3b1) = gsgmg + 181.7b1 + 54.2b2

The section about Gas Mixers has been moved to its own document.