@@ -56,25 +56,20 @@ void CCoolProp::SetTDState_rhoe(su2double rho, su2double e) {
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);
5858 if (fluid_entity->phase () == CoolProp::iphase_twophase) {
59- // assume it is pure gas
60- fluid_entity-> specify_phase (CoolProp::iphase_gas) ;
59+ // impose gas phase
60+ Temperature = Temperature + 0.1 ;
6161 CheckPressure (Pressure);
62+ CheckTemperature (Temperature);
6263 fluid_entity->update (CoolProp::PT_INPUTS, Pressure, Temperature);
63- if (abs (fluid_entity->rhomass () / Density - 1 ) < dp) {
64- // origial phase is near saturation gas, then just compute sound speed
65- SoundSpeed2 = pow (fluid_entity->speed_sound (), 2 );
66- } else {
67- // original phase is not near saturation gas, then specify the phase as gas phase
68- fluid_entity->specify_phase (CoolProp::iphase_gas);
69- SetTDState_PT (Pressure, Temperature);
70- }
64+ SoundSpeed2 = pow (fluid_entity->speed_sound (), 2 );
7165 } else {
7266 SoundSpeed2 = pow (fluid_entity->speed_sound (), 2 );
7367 }
7468}
7569
7670void CCoolProp::SetTDState_PT (su2double P, su2double T) {
7771 CheckPressure (P);
72+ CheckTemperature (T);
7873 fluid_entity->update (CoolProp::PT_INPUTS, P, T);
7974 su2double rho = fluid_entity->rhomass ();
8075 su2double e = fluid_entity->umass ();
@@ -130,4 +125,4 @@ CCoolProp::CCoolProp(const string& fluidname) {
130125 " or autodiff" ,
131126 CURRENT_FUNCTION);
132127}
133- #endif
128+ #endif
0 commit comments