mirror of
https://github.com/CoolProp/CoolProp.git
synced 2026-04-23 03:00:17 -04:00
Resolved issues with Dmolar,T in subcooled liquid zone without resorting to saturation call; see #624
More work remains for some of other two-phase flashes
This commit is contained in:
@@ -1405,12 +1405,19 @@ void HelmholtzEOSMixtureBackend::T_phase_determination_pure_or_pseudopure(int ot
|
||||
this->_phase = iphase_liquid; return;
|
||||
}
|
||||
else{
|
||||
_phase = iphase_liquid;
|
||||
_Q = -1000;
|
||||
// Next we check the vapor quality based on the ancillary values
|
||||
double Qanc = (1/value - 1/static_cast<double>(_rhoLanc))/(1/static_cast<double>(_rhoVanc) - 1/static_cast<double>(_rhoLanc));
|
||||
// If the vapor quality is significantly inside the two-phase zone, stop, we are two-phase
|
||||
if (Qanc > 0.05 && Qanc < 0.95){
|
||||
break; // It's two-phase
|
||||
}
|
||||
|
||||
_phase = iphase_liquid; // Needed for direct update call
|
||||
_Q = -1000; // Needed for direct update call
|
||||
update_DmolarT_direct(value, _T);
|
||||
CoolPropDbl pL = components[0].ancillaries.pL.evaluate(_T);
|
||||
if (_p > pL*1.05){
|
||||
this->_phase = iphase_liquid; _Q = -1000; return;
|
||||
if (Qanc < 0.1 && _p > pL*1.05 && first_partial_deriv(iP, iDmolar, iT) > 0 && second_partial_deriv(iP, iDmolar, iT, iDmolar, iT) > 0){
|
||||
_phase = iphase_liquid; _Q = -1000; return;
|
||||
}
|
||||
else{
|
||||
_phase = iphase_unknown;
|
||||
|
||||
Reference in New Issue
Block a user