Esempio n. 1
0
        public static float GetOxygenContact(GasMix gasMix)
        {
            float Oxygen = gasMix.GasRatio(Gas.Oxygen);
            float Plasma = gasMix.GasRatio(Gas.Plasma);

            var NeedOXtoplas = Plasma * 2;
            var Ratio        = 0.0f;

            if (Oxygen > NeedOXtoplas)
            {
                Ratio = 1;
            }
            else
            {
                Ratio = Oxygen / NeedOXtoplas;
            }
            var tempComponent = 0.0f;
            var temp          = gasMix.Temperature;

            if (temp < Reactions.PlasmaMaintainFire)
            {
                tempComponent = 0;
            }
            else if (temp >= Reactions.PlasmaMaxTemperatureGain)
            {
                tempComponent = 1;
            }
            else
            {
                tempComponent = (float)Math.Pow((temp - Reactions.PlasmaMaintainFire) /
                                                (Reactions.PlasmaMaxTemperatureGain - Reactions.PlasmaMaintainFire), 2);
            }

            //Logger.Log("Ratio >" + Ratio + " ((Oxygen + Plasma / gasMix.Moles) that suff" + (Oxygen + Plasma / gasMix.Moles) + " (tempComponent * 3) >" +(1 + tempComponent * 2));
            return(Ratio * ((Oxygen + Plasma / gasMix.Moles) * (1 + tempComponent * 2)));
        }