Exemple #1
0
        public float HeatFromCoolingSteam(PrimaryElement steam)
        {
            float temperature = steam.Temperature;

            return(-GameUtil.CalculateEnergyDeltaForElement(steam, temperature, this.outputElementTemperature));
        }
Exemple #2
0
        private float GetCoolingEnergy(float delta, bool doPull = false)
        {
            if (!operational.IsOperational || !operational.IsActive)
            {
                return(0);
            }

            float energyPulled      = 0;
            var   energyToPullPerKG = GetEnergyPerHotMass();

            if (energyToPullPerKG > 0)
            {
                energyToPullPerKG = Mathf.Min(energyToPullPerKG, GetAvailableCoolingEnergy() * energyMaxMultiplier);
                if (energyToPullPerKG > 0)
                {
                    foreach (var item in GetHotStorageItems())
                    {
                        var element = item.GetComponent <PrimaryElement>();

                        float energyToPullPerItem = energyToPullPerKG * element.Mass;
                        float deltaTemp           = Mathf.Min(energyToPullPerItem, Mathf.Max(0, GameUtil.CalculateEnergyDeltaForElement(element, temperatureCurrent - 1, element.Temperature)));

                        energyPulled += deltaTemp;
                        if (doPull)
                        {
                            element.Temperature += GameUtil.CalculateTemperatureChange(
                                element.Element.specificHeatCapacity,
                                element.Mass,
                                -(deltaTemp * thermalEfficiency)
                                );
                        }
                    }
                }
            }
            return(energyPulled);
        }