Actions

Difference between revisions of "Temperature independent fuel mixing"

From Unofficial Stationeers Wiki

m (fixed typo)
(add simplification to O2 part of formula)
 
(15 intermediate revisions by 2 users not shown)
Line 1: Line 1:
When fuel is made with a Pipe Gas Mixer, the desired ratio will be wrong if the gases have different temperatures. By using volume pumps and some logic circuits, the correct 2:1 fuel mix can be obtained without waiting for the temperature to equalize.
+
Making fuel with a gas mixer set to 33:67 works fine when the incoming O2 and H2 have the same temperature. But when the temperature is different, the mix will become incorrect.
  
This setup measures the total fuel pressure and the ratio of oxygen in the fuel mixture, these values are then multiplied to calculate the partial oxygen pressure. Since the mixed gas has a uniform temperature, this calculated value is indirectly a measure of how many moles of oxygen there are in the tank. The partial oxygen pressure is then used to decide if more oxygen should be added or not, this also doubles as a safety mechanism, since it gives the player some control over the max pressure in the fuel tank (which is tripple this value). Volatiles are added automatically whenever the ratio of oxygen in the fuel mix becomes too high. A problem with this setup is that it will continue to add oxygen when the volatile storage is empty, which will ruin the fuel ratio. This can be fixed either by adding valves (infront of the volume pumps so they don't blow the pipes) for manual control or by adding more circuits.
+
To get a perfect fuel mix regardless of the temperature difference, a circuit can be used to calculate which gas mixer setting to use. The gas mixer will accept decimal values, so it's incredibly accurate. This allows it to always make a perfect 1:2 mix. Just don't forget that making hot fuel will lead to explosions, if that should happen, please enjoy the strongest and most perfect explosion possible.
  
'''Components'''
 
* Gas pipes
 
* Gas storage
 
* Wires
 
*4 Logic I/O
 
*3 Logic Processor
 
*2 Logic Memory
 
*2 Volume pumps
 
*1 Pipe Analyzer (requires electrum)
 
  
[[File:Temperature independent fuel mixing.jpg|thumb|Example of how to place the circuit in a location where it will blow up if the fuel self ignites]]
+
'''Components needed:'''
 +
*3 logic I/O (2 readers, 1 writer)
 +
*4 logic processor (all math)
 +
*3 logic memory
 +
*2 pipe analyzer
 +
*1 gas mixer
  
'''Setup'''
 
#Connect volume pumps from O2/H2 respectively leading towards the fuel side
 
#Connect the pipe analyzer on the fuel side
 
#Optional: Use a Power Area Control or Transformer to isolate the logical components to their own network. This also makes it easy to shut off the system.
 
#Place logical components
 
  
*A1: Reader for pipe analyzer, total pressure (in KPa)
+
'''Build:'''
*A2: Reader for pipe analyzer, ratioOxygen (between 0 and 1)
 
*A3: Math multiplier, A1*A2 (this is the partial oxygen pressure in the fuel tank)
 
  
*B1: Compare, B2 vs. A3, greater
+
This part will turn the following equation into a circuit, it will only work when the '''H2 pipe''' is connected to '''input 1'''(the side)<br>
*B2: Memory, 2000 (desired partial oxygen pressure, 3x this will be the total pressure)
+
gas mixer setting = 100 / ( 1 + Temp.oxygen/(2*Temp.volatiles) )
*B3: Writer for Oxygen volume pump, on
 
  
*B4: Compare, A2 vs. B5, greater
+
*Connect the H2 pipe to input 1 (side) and O2 pipe to input 2 (top)
*B5: Memory, 0.334 (use Labeller to set this value)
+
*2 pipe analyzers
*B6: Writer for Volatiles volume pump, on
+
**On the O2 and H2 sides
 +
*2 logic readers
 +
**Read the temperatures of the pure O2 and H2
 +
*4 math and 3 memory units for calculations
 +
**A = 2*Temp.volatiles
 +
**B = Temp.oxygen/A
 +
**C = B+1
 +
**D = 100/C
 +
*1 logic writer to send the result to the gas mixer
 +
**The gas mixer will accept decimal values, so the mix will be a perfect 2:1 mix of H2 and O2
  
'''Notes'''
+
 
*Warm fuel can self ignite. Don't mix fuel near critical infrastructure.
+
'''Extra:'''
*For safety, set the desired partial oxygen pressure to 2000 max, the total pressure will be tripple this value in kPa.
+
*If the O2 pipe connects to input 1 (the side) instead, the equation to use is
*If the system runs out of volatiles, the fuel mix will still be fed oxygen.
+
**gas mixer setting = 100 - (100 / (1 + Temp.oxygen/(2*Temp.volatiles))), which simplifies to 100 / (1 + (2*Temp.volatiles)/Temp.oxygen)
*If the system runs out of oxygen, the system will stop adding volatiles.
+
**This means B above must be changed to B = A/Temp.oxygen
*Give volume pumps a 1:2 ratio on their values, this reduces errors in the fuel mix when the system is rebalancing.
+
*Use a PAC or Transformer to put this circuit on it's own data network
*Power use 120 W on standby
+
*The circuit will require 170W on standby and 270W while mixing fuel
 +
 
 +
 
 +
 
 +
 
 +
'''The fun math part that everyone will read'''
 +
 
 +
The ideal gas law, the chemical formula and some understanding of the gas mixer is all that's needed to find the desired equation
 +
*PV=nRT
 +
*1 O2 + 2 H2 -> products
 +
We want one expression for oxygen and another for volatiles, .o and .v will be used to indicate if it's oxygen or volatiles
 +
*oxygen: P.o*V.o = n.o*R*T.o
 +
*volatiles: P.v*V.v = n.v*R*T.v
 +
The chemical formula tells us how n.o and n.v are related, n.v is twice the value of n.o, so we can remove the .o and .v by replacing them with n again
 +
*n.o = n
 +
*n.v = 2n
 +
Now we will use this to solve both expressions for n
 +
*oxygen: n = P.o*V.o / (R*T.o)
 +
*volatiles: n = 1/2 * P.v*V.v / (R*T.v)
 +
Combine the expressions
 +
*P.o*V.o / (R*T.o) = 1/2 * P.v*V.v / (R*T.v)
 +
We now cancel R from both sides. We can also remove P.o and P.v because the gas mixer is already compensating for differences in incoming pressures and we don't want to do that twice, this leaves us with
 +
*V.o/T.o = 1/2 * V.v/T.v
 +
The gas mixer can only influence the volume, not the temperature, so we will solve for the volume ratio
 +
*V.o/V.v = T.o/(2*T.v)
 +
The V.o/V.v ratio has no unit, it's just a number. So we can replace it with the settings on the gas mixer, because the value itself is unchanged from doing that
 +
*1) Ratio.o/Ratio.v = T.o/(2*T.v)
 +
This is our first equation.<br>
 +
We now have two unknowns, Ratio.o and Ratio.v, and one equation. The gas mixer can give us another equation, looking at the input values of it tells us that it accepts values between 0 and 100, it even takes decimal values if the Labeler is used which is great, it means there won't be any rounding errors in the fuel, it will really be a perfect 1:2 ratio. Treating 100 as 100% means ratio.o and ratio.v makes more sense to use, we can just multiply with 100 at the end to give the gas mixer the value range it wants, doing it this way means we can avoid some clutter so the formulas are easier to read
 +
*2) Ratio.o + Ratio.v = 100% = 1
 +
Two equations, two unknowns. This can be solved.<br>
 +
Lets do calculations for both Ratio.o or Ratio.v, the end result is the same but the formulas and which pipe goes where will be different.
 +
 
 +
First lets solve for Ratio.o
 +
*Ratio.v = 1 - Ratio.o
 +
now substitute this into the first equation
 +
*Ratio.o/(1-Ratio.o) = T.o/(2*T.v)
 +
After some algebra we get
 +
*Ratio.o = T.o/(2*T.v) / (1 + T.o/(2*T.v))
 +
To make it easier to look at, lets substitute T.o/(2*T.v) for k
 +
*Ratio.o = k / (1 + k)
 +
*Ratio.o = 1 / (1/k + 1)
 +
The 1/k part is annoying, but since the substitution is a fraction we can shuffle things around
 +
*k = T.o/(2*T.v)
 +
*1/k = (2*T.v)/T.o
 +
Inserting that gives
 +
*Ratio.o = 1 / ((2*T.v)/T.o + 1)
 +
Now we will multiply with 100 to get a value between 0 and 100 which the gas mixer wants.
 +
*gas mixer setting = 100 / (1 + (2*T.v)/T.o)
 +
This is the final equation when O2 connects to input 1, the result will be sent to the gas mixer
 +
 
 +
Secondly lets do Ratio.v
 +
*Ratio.o = 1 - Ratio.v
 +
now substitute this into the first equation
 +
*(1-Ratio.v)/Ratio.v = T.o/(2*T.v)
 +
After some algebra we get
 +
*Ratio.v = 1 / (1 + T.o/(2*T.v))
 +
To make it easier to look at, lets substitute T.o/(2*T.v) for k
 +
*Ratio.v = 1 / (1 + k)
 +
Now we will multiply with 100 to get a value between 0 and 100 which the gas mixer wants.
 +
*gas mixer setting = 100 / (1 + T.o/(2*T.v))
 +
This is the final equation when H2 connects to input 1, the result will be sent to the gas mixer

Latest revision as of 13:18, 20 August 2023

Making fuel with a gas mixer set to 33:67 works fine when the incoming O2 and H2 have the same temperature. But when the temperature is different, the mix will become incorrect.

To get a perfect fuel mix regardless of the temperature difference, a circuit can be used to calculate which gas mixer setting to use. The gas mixer will accept decimal values, so it's incredibly accurate. This allows it to always make a perfect 1:2 mix. Just don't forget that making hot fuel will lead to explosions, if that should happen, please enjoy the strongest and most perfect explosion possible.


Components needed:

  • 3 logic I/O (2 readers, 1 writer)
  • 4 logic processor (all math)
  • 3 logic memory
  • 2 pipe analyzer
  • 1 gas mixer


Build:

This part will turn the following equation into a circuit, it will only work when the H2 pipe is connected to input 1(the side)
gas mixer setting = 100 / ( 1 + Temp.oxygen/(2*Temp.volatiles) )

  • Connect the H2 pipe to input 1 (side) and O2 pipe to input 2 (top)
  • 2 pipe analyzers
    • On the O2 and H2 sides
  • 2 logic readers
    • Read the temperatures of the pure O2 and H2
  • 4 math and 3 memory units for calculations
    • A = 2*Temp.volatiles
    • B = Temp.oxygen/A
    • C = B+1
    • D = 100/C
  • 1 logic writer to send the result to the gas mixer
    • The gas mixer will accept decimal values, so the mix will be a perfect 2:1 mix of H2 and O2


Extra:

  • If the O2 pipe connects to input 1 (the side) instead, the equation to use is
    • gas mixer setting = 100 - (100 / (1 + Temp.oxygen/(2*Temp.volatiles))), which simplifies to 100 / (1 + (2*Temp.volatiles)/Temp.oxygen)
    • This means B above must be changed to B = A/Temp.oxygen
  • Use a PAC or Transformer to put this circuit on it's own data network
  • The circuit will require 170W on standby and 270W while mixing fuel



The fun math part that everyone will read

The ideal gas law, the chemical formula and some understanding of the gas mixer is all that's needed to find the desired equation

  • PV=nRT
  • 1 O2 + 2 H2 -> products

We want one expression for oxygen and another for volatiles, .o and .v will be used to indicate if it's oxygen or volatiles

  • oxygen: P.o*V.o = n.o*R*T.o
  • volatiles: P.v*V.v = n.v*R*T.v

The chemical formula tells us how n.o and n.v are related, n.v is twice the value of n.o, so we can remove the .o and .v by replacing them with n again

  • n.o = n
  • n.v = 2n

Now we will use this to solve both expressions for n

  • oxygen: n = P.o*V.o / (R*T.o)
  • volatiles: n = 1/2 * P.v*V.v / (R*T.v)

Combine the expressions

  • P.o*V.o / (R*T.o) = 1/2 * P.v*V.v / (R*T.v)

We now cancel R from both sides. We can also remove P.o and P.v because the gas mixer is already compensating for differences in incoming pressures and we don't want to do that twice, this leaves us with

  • V.o/T.o = 1/2 * V.v/T.v

The gas mixer can only influence the volume, not the temperature, so we will solve for the volume ratio

  • V.o/V.v = T.o/(2*T.v)

The V.o/V.v ratio has no unit, it's just a number. So we can replace it with the settings on the gas mixer, because the value itself is unchanged from doing that

  • 1) Ratio.o/Ratio.v = T.o/(2*T.v)

This is our first equation.
We now have two unknowns, Ratio.o and Ratio.v, and one equation. The gas mixer can give us another equation, looking at the input values of it tells us that it accepts values between 0 and 100, it even takes decimal values if the Labeler is used which is great, it means there won't be any rounding errors in the fuel, it will really be a perfect 1:2 ratio. Treating 100 as 100% means ratio.o and ratio.v makes more sense to use, we can just multiply with 100 at the end to give the gas mixer the value range it wants, doing it this way means we can avoid some clutter so the formulas are easier to read

  • 2) Ratio.o + Ratio.v = 100% = 1

Two equations, two unknowns. This can be solved.
Lets do calculations for both Ratio.o or Ratio.v, the end result is the same but the formulas and which pipe goes where will be different.

First lets solve for Ratio.o

  • Ratio.v = 1 - Ratio.o

now substitute this into the first equation

  • Ratio.o/(1-Ratio.o) = T.o/(2*T.v)

After some algebra we get

  • Ratio.o = T.o/(2*T.v) / (1 + T.o/(2*T.v))

To make it easier to look at, lets substitute T.o/(2*T.v) for k

  • Ratio.o = k / (1 + k)
  • Ratio.o = 1 / (1/k + 1)

The 1/k part is annoying, but since the substitution is a fraction we can shuffle things around

  • k = T.o/(2*T.v)
  • 1/k = (2*T.v)/T.o

Inserting that gives

  • Ratio.o = 1 / ((2*T.v)/T.o + 1)

Now we will multiply with 100 to get a value between 0 and 100 which the gas mixer wants.

  • gas mixer setting = 100 / (1 + (2*T.v)/T.o)

This is the final equation when O2 connects to input 1, the result will be sent to the gas mixer

Secondly lets do Ratio.v

  • Ratio.o = 1 - Ratio.v

now substitute this into the first equation

  • (1-Ratio.v)/Ratio.v = T.o/(2*T.v)

After some algebra we get

  • Ratio.v = 1 / (1 + T.o/(2*T.v))

To make it easier to look at, lets substitute T.o/(2*T.v) for k

  • Ratio.v = 1 / (1 + k)

Now we will multiply with 100 to get a value between 0 and 100 which the gas mixer wants.

  • gas mixer setting = 100 / (1 + T.o/(2*T.v))

This is the final equation when H2 connects to input 1, the result will be sent to the gas mixer