/// <summary>
        ///
        /// </summary>
        /// <param name="satTemp">Must be between 273.15 and CriticalTemperature (in K)</param>
        /// <param name="phase"></param>
        /// <returns>null if out of range</returns>
        public override PVTEntry GetEntryAtSatTemp(double satTemp, SaturationRegion phase)
        {
            double?satPressure = GetSatPressure(satTemp);

            if (satPressure == null)
            {
                return(null);
            }
            IPVTEntryFactory fac = null;

            switch (phase)
            {
            case SaturationRegion.Liquid:
                fac = new Region1Factory(satTemp, satPressure.Value);
                break;

            case SaturationRegion.Vapor:
                fac = new Region2Factory(satTemp, satPressure.Value, CriticalTemperature, CriticalPressure);
                break;

            case SaturationRegion.Solid:
            default:
                fac = null;
                break;
            }
            return(fac?.BuildThermoEntry());
        }
예제 #2
0
        public void SatPressure(SaturationRegion region, double temperature,
            double pressure, double specificVolume, double internalEnergy, double enthalpy,
            double entropy, double isochoricHeatCapacity, double isobaricHeatCapacity,
            double speedOfSound,
            double vaporFraction, double liquidFraction, double solidFraction)
        {
            PVTEntry expected = new PVTEntry()
            {
                Region = (Region)region,
                Temperature = temperature,
                Pressure = pressure,
                SpecificVolume = specificVolume,
                InternalEnergy = internalEnergy,
                Enthalpy = enthalpy,
                Entropy = entropy,
                IsochoricHeatCapacity = isochoricHeatCapacity,
                IsobaricHeatCapacity = isobaricHeatCapacity,
                SpeedOfSound = speedOfSound,
                VaporMassFraction = vaporFraction,
                LiquidMassFraction = liquidFraction,
                SolidMassFraction = solidFraction,
                Density = 1 / specificVolume
            };

            PVTEntry actual = _steamTable.GetEntryAtSatPressure(pressure, region);
            ValidateEntry(expected, actual);
        }
예제 #3
0
 /// <summary>
 /// Gets entry and Pressure for saturated liquid or vapor at passed satTemp. Null when no entry found.
 /// </summary>
 /// <param name="satTemp">Desired saturation temperature</param>
 /// <param name="phase"></param>
 /// <returns></returns>
 public abstract PVTEntry GetEntryAtSatTemp(double satTemp, SaturationRegion phase);
예제 #4
0
 /// <summary>
 /// Gets entry for saturated liquid or vapor at passed pressure. Null when no entry found.
 /// </summary>
 /// <param name="pressure">Desired Pressure (Pa)</param>
 /// <param name="phase"></param>
 /// <returns></returns>
 public abstract PVTEntry GetEntryAtSatPressure(double pressure, SaturationRegion phase);