This class is a friend class of HelmholtzEOSMixtureBackend, therefore the static methods contained in it have access to the private and protected variables in the HelmholtzEOSMixtureBackend instance.
In this way the Flash routines can be kept in their own separate file and not pollute the HelmholtzEOSMixtureBackend namespace
Definition at line 29 of file FlashRoutines.h.
|
| template<class T > |
| static T | g_RachfordRice (const std::vector< T > &z, const std::vector< T > &lnK, T beta) |
| |
| template<class T > |
| static T | dgdbeta_RachfordRice (const std::vector< T > &z, const std::vector< T > &lnK, T beta) |
| |
| static void | PQ_flash (HelmholtzEOSMixtureBackend &HEOS) |
| |
| static void | PQ_flash_with_guesses (HelmholtzEOSMixtureBackend &HEOS, const GuessesStructure &guess) |
| |
| static void | QT_flash_with_guesses (HelmholtzEOSMixtureBackend &HEOS, const GuessesStructure &guess) |
| |
| static void | PT_flash_with_guesses (HelmholtzEOSMixtureBackend &HEOS, const GuessesStructure &guess) |
| |
| static void | QT_flash (HelmholtzEOSMixtureBackend &HEOS) |
| |
| static void | QS_flash (HelmholtzEOSMixtureBackend &HEOS) |
| |
| static void | DQ_flash (HelmholtzEOSMixtureBackend &HEOS) |
| |
| static void | DQ_flash_with_guesses (HelmholtzEOSMixtureBackend &HEOS, const GuessesStructure &guess) |
| |
| static void | HQ_flash (HelmholtzEOSMixtureBackend &HEOS, CoolPropDbl Tguess=-1) |
| |
| static void | HQ_flash_with_guesses (HelmholtzEOSMixtureBackend &HEOS, const GuessesStructure &guess) |
| |
| static void | QS_flash_with_guesses (HelmholtzEOSMixtureBackend &HEOS, const GuessesStructure &guess) |
| |
| static double | resolve_T_via_superancillary (HelmholtzEOSMixtureBackend &HEOS, parameters key, double target_value, std::optional< double > guess_T, const char *fn_name) |
| |
| static bool | sat_superanc_path_applies (HelmholtzEOSMixtureBackend &HEOS) |
| |
| static std::pair< double, double > | alpha0_offset_total (HelmholtzEOSMixtureBackend &HEOS) |
| |
| static void | PT_Q_flash_mixtures (HelmholtzEOSMixtureBackend &HEOS, parameters other, CoolPropDbl value) |
| |
| static void | PT_flash (HelmholtzEOSMixtureBackend &HEOS) |
| |
| static void | PT_flash_mixtures (HelmholtzEOSMixtureBackend &HEOS) |
| |
| static double | T_DP_PengRobinson (HelmholtzEOSMixtureBackend &HEOS, double rhomolar, double p) |
| | Use Peng-Robinson to get guess for temperature for given density and pressure. More...
|
| |
| static void | DP_flash (HelmholtzEOSMixtureBackend &HEOS) |
| |
| static void | solver_for_rho_given_T_oneof_HSU (HelmholtzEOSMixtureBackend &HEOS, CoolPropDbl T, CoolPropDbl value, parameters other) |
| |
| static void | DHSU_T_flash (HelmholtzEOSMixtureBackend &HEOS, parameters other) |
| |
| static void | HSU_P_flash (HelmholtzEOSMixtureBackend &HEOS, parameters other) |
| |
| static void | HSU_P_flash_singlephase_Newton (HelmholtzEOSMixtureBackend &HEOS, parameters other, CoolPropDbl T0, CoolPropDbl rhomolar0) |
| |
| static void | HSU_P_flash_singlephase_Brent (HelmholtzEOSMixtureBackend &HEOS, parameters other, CoolPropDbl value, CoolPropDbl Tmin, CoolPropDbl Tmax, phases phase) |
| |
| static void | HSU_D_flash_twophase (HelmholtzEOSMixtureBackend &HEOS, CoolPropDbl rhomolar_spec, parameters other, CoolPropDbl value) |
| |
| static void | HSU_D_flash (HelmholtzEOSMixtureBackend &HEOS, parameters other) |
| |
| static void | HS_flash (HelmholtzEOSMixtureBackend &HEOS) |
| |
| static void | HS_flash_generate_TP_singlephase_guess (HelmholtzEOSMixtureBackend &HEOS, double &T, double &p) |
| |
| static void | HS_flash_singlephase (HelmholtzEOSMixtureBackend &HEOS, CoolPropDbl hmolar_spec, CoolPropDbl smolar_spec, HS_flash_singlephaseOptions &options) |
| |
| static void | HS_flash_twophase (HelmholtzEOSMixtureBackend &HEOS, CoolPropDbl hmolar_spec, CoolPropDbl smolar_spec, HS_flash_twophaseOptions &options) |
| |
| static bool | hs_corrector_probe (HelmholtzEOSMixtureBackend &H, double T0, double rho0, double h_t, double s_t, double &T_out, double &rho_out, double Tlo_override) |
| | Test-only: invoke the internal HS corrector with an explicit Tlo floor. More...
|
| |
A generic flash routine for the pairs (D,P), (D,H), (D,S), and (D,U). Similar analysis is needed
- Parameters
-
Something homogeneous to avoid flash calls
TODO: separate TL and TV for ppure
Definition at line 1710 of file FlashRoutines.cpp.
| double CoolProp::FlashRoutines::resolve_T_via_superancillary |
( |
HelmholtzEOSMixtureBackend & |
HEOS, |
|
|
parameters |
key, |
|
|
double |
target_value, |
|
|
std::optional< double > |
guess_T, |
|
|
const char * |
fn_name |
|
) |
| |
|
static |
Unified internal helper for both the no-guess default flashes (DQ_flash, HQ_flash, QS_flash) and the *_flash_with_guesses paths when the fluid has a superancillary (#2773). Validates inputs, looks up the saturation superancillary for property key (one of iDmolar, iHmolar, iSmolar), and returns the disambiguated T-root.
If guess_T is set, picks the monotonic sub-interval whose temperature range contains guess_T (with tie-break by midpoint distance for boundary cases) and TOMS748-solves there. If guess_T is std::nullopt, enumerates every root, deduplicates by |T_i - T_j| < 1e-6 K (extrema produce near-duplicate roots in adjacent intervals), and either returns the single root, throws MultipleSolutionsError if more remain, or throws OutOfRangeError if none.
Refuses pseudo-pure fluids (caloric superancillaries are not built for them; see #2773 review). Member of FlashRoutines for friend access to HelmholtzEOSMixtureBackend's protected state. fn_name is used only in error messages.
Definition at line 712 of file FlashRoutines.cpp.