Beispiel #1
0
        public static double GetLiquidDensity(ArrayList materialComponents, double temperature)
        {
            double density = 0.0;
            double den     = 0;
            double massFrac;

            foreach (MaterialComponent mc in materialComponents)
            {
                Substance             s   = mc.Substance;
                ThermalPropsAndCoeffs tpc = s.ThermalPropsAndCoeffs;
                massFrac = mc.GetMassFractionValue();
                den      = ThermalPropCalculator.CalculateLiquidDensity(temperature, tpc.LiqDensityCoeffs);
                density += den * massFrac;
            }

            return(density);
        }
Beispiel #2
0
        public double GetDensity(double pressure, double temperature)
        {
            //double density = 1;
            //if (moisture.Name.Equals("Water")) {
            //   density = ThermalPropCalculator.CalculateWaterDensity(pressure, temperature);
            //}
            //else {
            //   double satTemperature = GetSaturationTemperature(pressure);
            //   if (temperature < satTemperature) {
            //      density = ThermalPropCalculator.CalculateLiquidDensity(temperature, moisture);
            //   }
            //   else if (temperature > satTemperature) {
            //      //density = ThermalPropCalculator.CalculateLiquidDensity(temperature);
            //      //need to use state equation to calculate state
            //   }
            //}

            return(thermalPropCalculator.CalculateLiquidDensity(pressure, temperature, moisture));
        }
Beispiel #3
0
        public double GetDensity(double pressure, double temperature)
        {
            double density = 1;

            if (moisture.Name.Equals("Water"))
            {
                density = ThermalPropCalculator.CalculateWaterDensity(pressure, temperature);
            }
            else
            {
                double satTemperature = GetSaturationTemperature(pressure);
                if (temperature < satTemperature)
                {
                    density = ThermalPropCalculator.CalculateLiquidDensity(temperature, liqDensityCoeffs);
                }
                else if (temperature > satTemperature)
                {
                    //density = ThermalPropCalculator.CalculateLiquidDensity(temperature);
                    //need to use state equation to calculate state
                }
            }
            return(density);
        }