6 #include "externals/IF97/IF97.h"
59 this->_rhomass.
clear();
67 double epsilon = 3.3e-5;
68 if ((std::abs(
_T - IF97::Tcrit) < epsilon / 10.0) &&
69 (std::abs(
_p - IF97::Pcrit) < epsilon)) {
71 }
else if (
_T >= IF97::Tcrit) {
72 if (
_p >= IF97::Pcrit) {
78 if (
_p >= IF97::Pcrit) {
81 double psat = IF97::psat97(
_T);
82 if (
_p > psat * (1.0 + epsilon)) {
84 }
else if (
_p < psat * (1.0 - epsilon)) {
103 double H, S, hLmass, hVmass, sLmass, sVmass;
107 switch (input_pair) {
115 throw ValueError(
format(
"Saturation pressure [%g Pa] corresponding to T [%g K] is within 3.3e-3 %% of given p [%Lg Pa]",
116 IF97::psat97(
_T),
_T,
_p));
122 _T = IF97::Tsat97(
_p);
129 _p = IF97::psat97(
_T);
142 if (IF97::BackwardRegion(
_p,
_hmass, IF97_HMASS) == 4) {
144 hVmass = IF97::hvap_p(
_p);
145 hLmass = IF97::hliq_p(
_p);
146 _Q = (H - hLmass) / (hVmass - hLmass);
162 if (IF97::BackwardRegion(
_p,
_smass, IF97_SMASS) == 4) {
164 sVmass = IF97::svap_p(
_p);
165 sLmass = IF97::sliq_p(
_p);
166 _Q = (S - sLmass) / (sVmass - sLmass);
184 if (IF97::BackwardRegion(
_p,
_hmass, IF97_HMASS) == 4) {
186 hVmass = IF97::hvap_p(
_p);
187 hLmass = IF97::hliq_p(
_p);
188 _Q = (H - hLmass) / (hVmass - hLmass);
196 throw ValueError(
"This pair of inputs is not yet supported");
211 return IF97::rholiq_p(
_p);
214 return IF97::hliq_p(
_p);
217 return IF97::sliq_p(
_p);
220 return IF97::cpliq_p(
_p);
223 return IF97::cvliq_p(
_p);
226 return IF97::uliq_p(
_p);
229 return IF97::speed_soundliq_p(
_p);
232 return IF97::viscliq_p(
_p);
235 return IF97::tcondliq_p(
_p);
238 return IF97::sigma97(
_T);
241 return IF97::prandtlliq_p(
_p);
250 return IF97::rhovap_p(
_p);
253 return IF97::hvap_p(
_p);
256 return IF97::svap_p(
_p);
259 return IF97::cpvap_p(
_p);
262 return IF97::cvvap_p(
_p);
265 return IF97::uvap_p(
_p);
268 return IF97::speed_soundvap_p(
_p);
271 return IF97::viscvap_p(
_p);
274 return IF97::tcondvap_p(
_p);
277 return IF97::sigma97(
_T);
280 return IF97::prandtlvap_p(
_p);
289 if (std::abs(
_Q) < 1e-10) {
291 }
else if (std::abs(
_Q - 1) < 1e-10) {
315 return IF97::sigma97(
_T);
328 return IF97::rhomass_Tp(
_T,
_p);
331 return IF97::hmass_Tp(
_T,
_p);
334 return IF97::smass_Tp(
_T,
_p);
337 return IF97::cpmass_Tp(
_T,
_p);
340 return IF97::cvmass_Tp(
_T,
_p);
343 return IF97::umass_Tp(
_T,
_p);
346 return IF97::speed_sound_Tp(
_T,
_p);
349 return IF97::visc_Tp(
_T,
_p);
352 return IF97::tcond_Tp(
_T,
_p);
358 return IF97::prandtl_Tp(
_T,
_p);
475 return IF97::get_Ttrip();
479 return IF97::get_ptrip();
483 return IF97::get_Tcrit();
487 return IF97::get_pcrit();
496 return IF97::get_MW();
500 return IF97::get_Acentric();
506 return IF97::get_Pmax();
511 return IF97::get_Tmax();
515 return IF97::get_Tmin();
530 return IF97::get_rhocrit();