mirror of
https://github.com/CoolProp/CoolProp.git
synced 2026-01-22 20:38:01 -05:00
Implement PT flash with guesses in HEOS backend
This commit is contained in:
@@ -458,6 +458,14 @@ void FlashRoutines::PQ_flash_with_guesses(HelmholtzEOSMixtureBackend &HEOS, cons
|
||||
HEOS._T = IO.T;
|
||||
}
|
||||
|
||||
void FlashRoutines::PT_flash_with_guesses(HelmholtzEOSMixtureBackend &HEOS, const GuessesStructure &guess)
|
||||
{
|
||||
HEOS.solver_rho_Tp(HEOS.T(), HEOS.p(), guess.rhomolar);
|
||||
// Load the other outputs
|
||||
HEOS._phase = iphase_gas; // TODO: fix me once you know the state
|
||||
HEOS._Q = -1;
|
||||
}
|
||||
|
||||
void FlashRoutines::PT_Q_flash_mixtures(HelmholtzEOSMixtureBackend &HEOS, parameters other, CoolPropDbl value)
|
||||
{
|
||||
|
||||
|
||||
@@ -34,7 +34,13 @@ public:
|
||||
|
||||
/// Flash for given pressure and (molar) quality with guess values provided
|
||||
/// @param HEOS The HelmholtzEOSMixtureBackend to be used
|
||||
static void PQ_flash_with_guesses(HelmholtzEOSMixtureBackend &HEOS, const GuessesStructure &guess);
|
||||
/// @param guess The GuessesStructure to be used
|
||||
static void PQ_flash_with_guesses(HelmholtzEOSMixtureBackend &HEOS, const GuessesStructure &guess);
|
||||
|
||||
/// Flash for given pressure and temperature with guess values provided for molar density
|
||||
/// @param HEOS The HelmholtzEOSMixtureBackend to be used
|
||||
/// @param guess The GuessesStructure to be used
|
||||
static void PT_flash_with_guesses(HelmholtzEOSMixtureBackend &HEOS, const GuessesStructure &guess);
|
||||
|
||||
/// Flash for given temperature and (molar) quality
|
||||
/// @param HEOS The HelmholtzEOSMixtureBackend to be used
|
||||
|
||||
@@ -971,6 +971,8 @@ void HelmholtzEOSMixtureBackend::update_with_guesses(CoolProp::input_pairs input
|
||||
{
|
||||
case PQ_INPUTS:
|
||||
_p = value1; _Q = value2; FlashRoutines::PQ_flash_with_guesses(*this, guesses); break;
|
||||
case PT_INPUTS:
|
||||
_p = value1; _T = value2; FlashRoutines::PT_flash_with_guesses(*this, guesses); break;
|
||||
default:
|
||||
throw ValueError(format("This pair of inputs [%s] is not yet supported", get_input_pair_short_desc(input_pair).c_str()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user