# Moles calculation
#
#   moles = 1000 / (8.31446261 * 293.15 / volume)
#
#   More practically:
#
#   moles = volume * 0.41027581
#
#   Yes, you do need all those digits or your pressure wont end up exactly 1000
#
#
# The number 1000 comes from the default MaxReleasePressure for a GasCanister,
# which is 10 * Atmospherics.OneAtmosphere, rounded down.
#
# 8.31446261 is the universal gas constant
#
# 293.15 is our default atmospheric temperature
#

# If you change the mole amounts, you can calculate the new gas supply times with:
# minutes = (moles / outputPressure) * 325

- type: entity
  id: DoubleEmergencyAirTankFilled
  parent: DoubleEmergencyAirTank
  suffix: Filled
  components:
    - type: GasTank
      outputPressure: 101.3
      air:
        # 6 minutes due to output pressure
        volume: 2.5
        moles:
          - 0.2256516955 # 22% oxygen
          - 0.800378295 # 78% nitrogen
        temperature: 293.15

- type: entity
  id: NFTankO2N2EqualFilled
  parent: NFTankO2N2Equal
  suffix: Filled
  components:
  - type: GasTank
    #      0.21  | % oxygen in normal atmosphere
    #  /   0.5   | % oxygen in this mixture
    #  * 101.325 | one atmosphere
    # __________
    #    42.5565   output pressure
    outputPressure: 42.6
    air:
      # only 7.8 minutes due to pressure
      volume: 5
      moles:
        - 1.025689525 # 50% oxygen
        - 1.025689525 # 50% nitrogen
        - 0 # CO2
        - 0 # plasma
        - 0 # tritium
        - 0 # water vapor
        - 0 # ammonia
        - 0 # N2O
        # 2.051379050       total
      temperature: 293.15

- type: entity
  id: DoubleEmergencyTankO2N2EqualFilled
  parent: DoubleEmergencyTankO2N2Equal
  suffix: Filled
  components:
    - type: GasTank
      outputPressure: 42.6
      air:
        # 3.9 minutes due to output pressure
        volume: 2.5
        moles:
          - 0.5128447625 # 50% oxygen
          - 0.5128447625 # 50% nitrogen
        temperature: 293.15
