예제 #1
0
 /// <summary>
 /// 已知单相状态的T P计算状态点
 /// </summary>
 /// <param name="T">温度[K]</param>
 /// <param name="P">压力[kPa]</param>
 /// <param name="phase">相态</param>
 private void FindSPhaseStateWithTP(double T, double P, SubstancePhase phase)
 {
     EnsureCurrentFluid();
     Int32 phaseflag = 0;
     if ((phase == SubstancePhase.Saturated_Liquid) || (phase == SubstancePhase.Subcooled)) phaseflag = 1;
     else if ((phase == SubstancePhase.Saturated_Vapor) || (phase == SubstancePhase.Superheated)) phaseflag = 2;
     else
     {
         RefpropErrorHandler.ErrorHandler(this, "错误的状态");
     }
     base.S_TPRHO(T, P, this.MoleFractions, phaseflag);
     //base.Thermal2Cal(this.Temperature, this.MoleDensity, this.MoleFractions);
     //base.TRNPRPCal(this.temperature, this.density, this.MoleFractions);
 }
예제 #2
0
 /// <summary>
 ///  已知单相状态的T P计算熵值
 /// </summary>
 /// <param name="T">温度[K]</param>
 /// <param name="P">压力[kPa]</param>
 /// <param name="phase">相态</param>
 /// <returns></returns>
 private double EntropyCal(double T, double P, SubstancePhase phase)
 {
     EnsureCurrentFluid();
     Int32 phaseflag = 0;
     if ((phase == SubstancePhase.Saturated_Liquid) || (phase == SubstancePhase.Subcooled)) phaseflag = 1;
     else if ((phase == SubstancePhase.Saturated_Vapor) || (phase == SubstancePhase.Superheated)) phaseflag = 2;
     else
     {
         RefpropErrorHandler.ErrorHandler(this, "错误的相态");
         return 0;
     }
     base.S_TPRHO(T, P, this.MassFractions, phaseflag);
     base.EntropyCal(T, this.MoleDensity, this.MoleFractions);
     return base.entropy;
 }