Stationeers

Stationeers

Not enough ratings
Advanced Fuel Mixer
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
261.793 KB
27 May, 2024 @ 2:26pm
27 May, 2024 @ 2:38pm
3 Change Notes ( view )

Subscribe to download
Advanced Fuel Mixer

Description
An advanced mixer script for a fuel pipe.

Let's face it, gas mixers are janky. Differing input pressures and temperatures cause them to behave quite counter-intuitively, and there's no clear information on how quickly they operate, and thus what settings would need to be used on them to adjust an existing gas mixture in the output to the desired ratio. Most scripts that deal with them just use a guess-and-check method that tries to offset the input setting based on what's in the output pipe, with no consideration for input pressures and temperatures.

Fun fact: did you know the speed of a gas mixer is based on a very arcane calculation involving the total volume of the input pipe networks and output pipe network? Adding pipe segments to the input, while keeping the pressure in that input the same, inexplicable speeds up the gas mixing rate.

This script is designed to make that easier and more predictable. It uses a separate volume pump per input, instead of a single gas mixer, and uses pipe analyzers on both the input lines and the output line, plus Ideal Gas Law calculations, to properly adjust the mixing ratio to achieve a precise molar ratio even if the input lines differ in pressure or temperature.

It also scales its output down as needed, allowing it to very precisely hit a desired target pressure, even in very small output volumes. As an example, the script set to a target pressure of 45 MPa, running on a pair of Turbo Volume pumps, with an oxygen input pressure of 30 MPa and volatiles at 40 MPA, pushing to an output pipe volume of only 30 L (3 pipe segments) resulted in a pressure of 45,000.004 kPa and a precise 2:1 mix ratio in that output. A due to the support for Turbo Volume Pumps, it's much faster than a gas mixer as well. The same setup pointed at a 1000 L output pipe network was able to fill it to the same precise 45 MPa pressure and 2:1 ratio in only 11 ticks.

The script also supports an optional fuel switch or lever on the final device pin. If set, fuel output can be disabled using that switch or lever. Notably, the volume pumps will continue to update their setting if the switch is turned off, they just won't be turned on, so this can be used to verify functionality before outputting to the target pipe, if you'd like.