Implement PT flash with guesses in HEOS backend

This commit is contained in:
Ian Bell
2015-05-10 16:31:24 -06:00
parent e5a25a1cc0
commit 98567db67d
3 changed files with 17 additions and 1 deletions

View File

@@ -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)
{

View File

@@ -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

View File

@@ -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()));
}