mirror of
https://github.com/CoolProp/CoolProp.git
synced 2026-04-23 03:00:17 -04:00
Throw the correct error when inputs are not two-phase to two_phase_deriv; closes #639
This commit is contained in:
@@ -2823,11 +2823,13 @@ CoolPropDbl HelmholtzEOSMixtureBackend::calc_first_two_phase_deriv(parameters Of
|
||||
CoolPropDbl HelmholtzEOSMixtureBackend::calc_first_two_phase_deriv_splined(parameters Of, parameters Wrt, parameters Constant, CoolPropDbl x_end)
|
||||
{
|
||||
if (_Q > x_end){throw ValueError(format("Q [%g] is greater than x_end [%Lg]", _Q, x_end).c_str());}
|
||||
if (_phase != iphase_twophase){throw ValueError(format("state is not two-phase")); }
|
||||
shared_ptr<HelmholtzEOSMixtureBackend> Liq(new HelmholtzEOSMixtureBackend(this->get_components())),
|
||||
End(new HelmholtzEOSMixtureBackend(this->get_components()));
|
||||
|
||||
Liq->specify_phase(iphase_liquid);
|
||||
Liq->update(DmolarT_INPUTS, SatL->rhomolar(), SatL->T());
|
||||
Liq->_Q = -1;
|
||||
Liq->update_DmolarT_direct(SatL->rhomolar(), SatL->T());
|
||||
End->update(QT_INPUTS, x_end, SatL->T());
|
||||
|
||||
bool mass_based_inputs = ((Of == iDmass) && ((Wrt == iHmass && Constant == iP) || (Wrt == iP && Constant == iHmass) || (Wrt == iDmass && Constant == iDmass)));
|
||||
|
||||
Reference in New Issue
Block a user