示例#1
0
        public void Diffuse(GasMixture a, float factor = 8)
        {
            foreach (var gas in a.gasses)
            {
                float amount = (gas.Value - gasses[gas.Key]) / factor;
                AddNextGas(amount, gas.Key);
                a.AddNextGas(-amount, gas.Key);
            }

            ShareTemp(a, factor);
        }
示例#2
0
        public void ShareTemp(GasMixture a, float factor = 8)
        {
            float HCCell     = HeatCapacity * TotalMass;
            float HCa        = a.HeatCapacity * a.TotalMass;
            float energyFlow = a.Temperature - Temperature;

            if (energyFlow > 0.0f)
            {
                energyFlow *= HCa;
            }
            else
            {
                energyFlow *= HCCell;
            }

            energyFlow *= (1 / factor);
            SetNextTemperature((energyFlow / HCCell));
            a.SetNextTemperature(-(energyFlow / HCa));
        }
示例#3
0
        public void ShareTemp(GasMixture a, float factor = 8)
        {
            float HCCell = HeatCapacity*TotalMass;
            float HCa = a.HeatCapacity*a.TotalMass;
            float energyFlow = a.Temperature - Temperature;

            if (energyFlow > 0.0f)
            {
                energyFlow *= HCa;
            }
            else
            {
                energyFlow *= HCCell;
            }

            energyFlow *= (1/factor);
            SetNextTemperature((energyFlow/HCCell));
            a.SetNextTemperature(-(energyFlow/HCa));
        }
示例#4
0
        public void Diffuse(GasMixture a, float factor = 8)
        {
            foreach (var gas in a.gasses)
            {
                float amount = (gas.Value - gasses[gas.Key])/factor;
                AddNextGas(amount, gas.Key);
                a.AddNextGas(-amount, gas.Key);
            }

            ShareTemp(a, factor);
        }