@@ -55,15 +55,15 @@ void CCoolProp::SetTDState_rhoe(su2double rho, su2double e) {
5555 dPde_rho = fluid_entity->first_partial_deriv (CoolProp::iP, CoolProp::iUmass, CoolProp::iDmass);
5656 dTdrho_e = fluid_entity->first_partial_deriv (CoolProp::iT, CoolProp::iDmass, CoolProp::iUmass);
5757 dTde_rho = fluid_entity->first_partial_deriv (CoolProp::iT, CoolProp::iUmass, CoolProp::iDmass);
58- if (fluid_entity->phase () == 6 ) {
58+ if (fluid_entity->phase () == CoolProp::iphase_twophase ) {
5959 // assume it is pure gas
6060 fluid_entity->specify_phase (CoolProp::iphase_gas);
61- if (abs (Pressure / Pressure_Critical - 1 ) < 0.01 ) {
61+ if (abs (Pressure / Pressure_Critical - 1 ) < epsilon ) {
6262 // if P is very cloase to Pc, the CoolProp has issue
63- Pressure = Pressure_Critical * 0.99 ;
63+ Pressure = Pressure_Critical * ( 1 -epsilon) ;
6464 }
6565 fluid_entity->update (CoolProp::PT_INPUTS, Pressure, Temperature);
66- if (abs (fluid_entity->rhomass () / Density - 1 ) * 100 < 1 ) {
66+ if (abs (fluid_entity->rhomass () / Density - 1 ) < epsilon ) {
6767 // origial phase is near saturation gas, then just compute sound speed
6868 SoundSpeed2 = pow (fluid_entity->speed_sound (), 2 );
6969 }
@@ -79,8 +79,8 @@ void CCoolProp::SetTDState_rhoe(su2double rho, su2double e) {
7979}
8080
8181void CCoolProp::SetTDState_PT (su2double P, su2double T) {
82- if (abs (P / Pressure_Critical - 1 ) < 0.01 ) {
83- P = Pressure_Critical * 0.99 ;
82+ if (abs (P / Pressure_Critical - 1 ) < epsilon ) {
83+ P = Pressure_Critical * ( 1 -epsilon) ;
8484 }
8585 fluid_entity->update (CoolProp::PT_INPUTS, P, T);
8686 su2double rho = fluid_entity->rhomass ();
@@ -89,17 +89,17 @@ void CCoolProp::SetTDState_PT(su2double P, su2double T) {
8989}
9090
9191void CCoolProp::SetTDState_Prho (su2double P, su2double rho) {
92- if (abs (P / Pressure_Critical - 1 ) < 0.01 ) {
93- P = Pressure_Critical * 0.99 ;
92+ if (abs (P / Pressure_Critical - 1 ) < epsilon ) {
93+ P = Pressure_Critical * ( 1 -epsilon) ;
9494 }
9595 fluid_entity->update (CoolProp::DmassP_INPUTS, rho, P);
9696 su2double e = fluid_entity->umass ();
9797 SetTDState_rhoe (rho, e);
9898}
9999
100100void CCoolProp::SetEnergy_Prho (su2double P, su2double rho) {
101- if (abs (P / Pressure_Critical - 1 ) < 0.01 ) {
102- P = Pressure_Critical * 0.99 ;
101+ if (abs (P / Pressure_Critical - 1 ) < epsilon ) {
102+ P = Pressure_Critical * ( 1 -epsilon) ;
103103 }
104104 fluid_entity->update (CoolProp::DmassP_INPUTS, rho, P);
105105 StaticEnergy = fluid_entity->umass ();
@@ -113,8 +113,8 @@ void CCoolProp::SetTDState_hs(su2double h, su2double s) {
113113}
114114
115115void CCoolProp::SetTDState_Ps (su2double P, su2double s) {
116- if (abs (P / Pressure_Critical - 1 ) < 0.01 ) {
117- P = Pressure_Critical * 0.99 ;
116+ if (abs (P / Pressure_Critical - 1 ) < epsilon ) {
117+ P = Pressure_Critical * ( 1 -epsilon) ;
118118 }
119119 fluid_entity->update (CoolProp::PSmass_INPUTS, P, s);
120120 su2double rho = fluid_entity->rhomass ();
0 commit comments