mirror of
https://github.com/CoolProp/CoolProp.git
synced 2026-04-23 03:00:17 -04:00
Ancillary saturation solver works a bit better, still some issues.
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
This commit is contained in:
@@ -115,8 +115,8 @@ void FlashRoutines::QT_flash(HelmholtzEOSMixtureBackend &HEOS)
|
||||
throw ValueError("pseudo-pure failed");
|
||||
}
|
||||
|
||||
rhoLsat = HEOS.solver_rho_Tp(HEOS._T, psatLanc, rhoLanc);
|
||||
rhoVsat = HEOS.solver_rho_Tp(HEOS._T, psatVanc, rhoVanc);
|
||||
HEOS.SatL->update_TP_guessrho(HEOS._T, psatLanc, rhoLanc);
|
||||
HEOS.SatV->update_TP_guessrho(HEOS._T, psatVanc, rhoVanc);
|
||||
if (!ValidNumber(rhoLsat) || !ValidNumber(rhoVsat) ||
|
||||
std::abs(rhoLsat/rhoLanc-1) > 0.5 || std::abs(rhoVanc/rhoVsat-1) > 0.5)
|
||||
{
|
||||
@@ -124,12 +124,12 @@ void FlashRoutines::QT_flash(HelmholtzEOSMixtureBackend &HEOS)
|
||||
}
|
||||
}
|
||||
catch (std::exception &){
|
||||
// Near the critical point, the behavior is not very nice, so we will just use the ancillary near the critical point
|
||||
// Near the critical point, the behavior is not very nice, so we will just use the ancillary
|
||||
rhoLsat = rhoLanc;
|
||||
rhoVsat = rhoVanc;
|
||||
}
|
||||
HEOS._p = HEOS._Q*psatVanc + (1-HEOS._Q)*psatLanc;
|
||||
HEOS._rhomolar = 1/(HEOS._Q/rhoVsat + (1-HEOS._Q)/rhoLsat);
|
||||
HEOS._rhomolar = 1/(HEOS._Q/HEOS.SatV->rhomolar() + (1 - HEOS._Q)/HEOS.SatL->rhomolar());
|
||||
HEOS.SatL->update(DmolarT_INPUTS, rhoLsat, HEOS._T);
|
||||
HEOS.SatV->update(DmolarT_INPUTS, rhoVsat, HEOS._T);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user