mirror of
https://github.com/CoolProp/CoolProp.git
synced 2026-02-03 18:35:03 -05:00
Allow for PT and P+Y inputs for p < ptriple; closes #757
This commit is contained in:
@@ -1163,7 +1163,12 @@ void FlashRoutines::HSU_P_flash(HelmholtzEOSMixtureBackend &HEOS, parameters oth
|
||||
case iphase_gas:
|
||||
{
|
||||
Tmax = 1.5*HEOS.Tmax();
|
||||
if (saturation_called){ Tmin = HEOS.SatV->T();}else{Tmin = HEOS._TVanc.pt();}
|
||||
if (HEOS._p < HEOS.p_triple()){
|
||||
Tmin = std::max(HEOS.Tmin(), HEOS.Ttriple());
|
||||
}
|
||||
else{
|
||||
if (saturation_called){ Tmin = HEOS.SatV->T();}else{Tmin = HEOS._TVanc.pt();}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case iphase_liquid:
|
||||
|
||||
@@ -1356,7 +1356,17 @@ void HelmholtzEOSMixtureBackend::p_phase_determination_pure_or_pseudopure(int ot
|
||||
}
|
||||
else if (_p < components[0].EOS().ptriple*0.9999)
|
||||
{
|
||||
throw NotImplementedError(format("for now, we don't support p [%g Pa] below ptriple [%g Pa]",_p, components[0].EOS().ptriple));
|
||||
if (other == iT){
|
||||
if (_T > std::max(Tmin(), Ttriple())){
|
||||
_phase = iphase_gas;
|
||||
}
|
||||
else{
|
||||
throw NotImplementedError(format("For now, we don't support p [%g Pa] below ptriple [%g Pa] when T [%g] is less than Tmin [%g]",_p, components[0].EOS().ptriple, _T, std::max(Tmin(), Ttriple())) );
|
||||
}
|
||||
}
|
||||
else{
|
||||
_phase = iphase_gas;
|
||||
}
|
||||
}
|
||||
else{
|
||||
throw ValueError(format("The pressure [%g Pa] cannot be used in p_phase_determination",_p));
|
||||
|
||||
Reference in New Issue
Block a user