コード例 #1
0
        //cp unit is J/kg.k
        private static double CalculateCp(ArrayList materialComponents, double temperature, SubstanceState state)
        {
            double heatCapacity = 0.0;
            double cp           = 0;
            double molarWeight;
            double massFrac;

            foreach (MaterialComponent mc in materialComponents)
            {
                Substance s = mc.Substance;
                molarWeight = s.MolarWeight;
                ThermalPropsAndCoeffs tpc = s.ThermalPropsAndCoeffs;
                massFrac = mc.GetMassFractionValue();
                if (state == SubstanceState.Gas)
                {
                    cp = ThermalPropCalculator.CalculateGasHeatCapacity1(temperature, tpc.GasCpCoeffs) / molarWeight;
                }
                else if (state == SubstanceState.Liquid)
                {
                    cp = ThermalPropCalculator.CalculateLiquidHeatCapacity1(temperature, tpc.LiqCpCoeffs) / molarWeight;
                }
                heatCapacity += cp * massFrac;
            }

            return(heatCapacity);
        }
コード例 #2
0
        public double GetSpecificHeatOfVapor(double temperature)
        {
            //return 1880.0;
            double cp = ThermalPropCalculator.CalculateGasHeatCapacity1(temperature, gasCpCoeffs);

            return(cp / molarWeight);
        }
コード例 #3
0
        public double GetMeanSpecificHeatOfDryGas(double t1, double t2)
        {
            double cp;

            if (Math.Abs(t1 - t2) > 1.0e-4)
            {
                cp = ThermalPropCalculator.CalculateMeanGasHeatCapacity1(t1, t2, gasCpCoeffs);
            }
            else
            {
                cp = ThermalPropCalculator.CalculateGasHeatCapacity1(t1, gasCpCoeffs);
            }
            return(cp / molarWeight);
        }
コード例 #4
0
        public static double GetSpecificHeatRatio(ArrayList materialComponents, double temperature)
        {
            double heatCapacity = 0.0;
            double cp           = 0;
            //double molarWeight = 0.0;
            double w;
            double molarFrac;
            double totalMole = 0.0;

            foreach (MaterialComponent mc in materialComponents)
            {
                Substance s = mc.Substance;
                if (s.Name == "Generic Dry Material" || s is CompositeSubstance)
                {
                    continue;
                }
                w          = s.MolarWeight;
                molarFrac  = mc.GetMassFractionValue() / w;
                totalMole += molarFrac;
            }

            foreach (MaterialComponent mc in materialComponents)
            {
                Substance s = mc.Substance;
                if (s.Name == "Generic Dry Material" || s is CompositeSubstance)
                {
                    continue;
                }
                w = s.MolarWeight;
                ThermalPropsAndCoeffs tpc = s.ThermalPropsAndCoeffs;
                molarFrac = mc.GetMassFractionValue() / w / totalMole;
                //since heat capacity from ThermalPropCalculator is in J/kmol.K, it is necessary to
                //convert into kJ/kmol.K to be aligned with the unit of universal gas constant R
                heatCapacity = ThermalPropCalculator.CalculateGasHeatCapacity1(temperature, tpc.GasCpCoeffs) / 1000;
                cp          += heatCapacity * molarFrac;
            }

            return(cp / (cp - Constants.R));
        }
コード例 #5
0
        public static double GetSpecificHeatRatio(ArrayList materialComponents, double temperature)
        {
            double heatCapacity = 0.0;
            double cp           = 0;
            //double molarWeight = 0.0;
            double w;
            double molarFrac;
            double totalMole = 1.0;

            foreach (MaterialComponent mc in materialComponents)
            {
                Substance s = mc.Substance;
                if (s.Name == "Generic Dry Material" || s is CompositeSubstance)
                {
                    continue;
                }
                w          = s.MolarWeight;
                molarFrac  = mc.GetMassFractionValue() / w;
                totalMole += molarFrac;
            }

            foreach (MaterialComponent mc in materialComponents)
            {
                Substance s = mc.Substance;
                if (s.Name == "Generic Dry Material" || s is CompositeSubstance)
                {
                    continue;
                }
                w = s.MolarWeight;
                ThermalPropsAndCoeffs tpc = s.ThermalPropsAndCoeffs;
                molarFrac    = mc.GetMassFractionValue() / w / totalMole;
                heatCapacity = ThermalPropCalculator.CalculateGasHeatCapacity1(temperature, tpc.GasCpCoeffs);
                cp          += heatCapacity * molarFrac;
            }

            return(cp / (cp - Constants.R));
        }