Exemple #1
0
        public static GasMix FromTemperature(float[] gases, float temperature, float volume = AtmosUtils.TileVolume)
        {
            float moles = gases.Sum();

            float pressure = AtmosUtils.CalcPressure(volume, moles, temperature);

            return(new GasMix(gases, pressure, volume));
        }
Exemple #2
0
        public static GasMix FromTemperature(float[] gases, float temperature, float volume = AtmosConstants.TileVolume)
        {
            float pressure = 0;

            if (temperature >= 0)
            {
                pressure = AtmosUtils.CalcPressure(volume, gases.Sum(), temperature);
            }

            return(FromPressure(gases, pressure, volume));
        }
Exemple #3
0
 private void Recalculate()
 {
     Pressure = AtmosUtils.CalcPressure(Volume, Moles, Temperature);
 }
Exemple #4
0
 public void SetTemperature(float newTemperature)
 {
     Temperature = newTemperature;
     Pressure    = AtmosUtils.CalcPressure(Volume, Moles, Temperature);
 }