8#ifndef COOLPROPFLUID_H_
9#define COOLPROPFLUID_H_
43 std::vector<double>
cL,
cV;
47 const void get_densities(
double T,
double rho_min,
double rho_crit,
double rho_max,
double& rhoL,
double& rhoV)
const {
48 int Nsoln = -1, Ngood = 0;
49 double rho1 = 0, rho2 = 0, rho3 = 0;
56 if (Nsoln == 1 && rho1 < rho_max && rho1 > rho_crit) {
59 if (rho1 < rho_max && rho1 > rho_crit) {
63 if (rho2 < rho_max && rho2 > rho_crit) {
67 if (Nsoln > 2 && rho3 < rho_max && rho3 > rho_crit) {
72 throw ValueError(
format(
"More than one liquid solution found for critical spline for T=%0.12g", T));
75 throw ValueError(
format(
"No liquid solution found for critical spline for T=%0.12g", T));
85 if (Nsoln == 1 && rho1 > rho_min && rho1 < rho_crit) {
88 if (rho1 > rho_min && rho1 < rho_crit) {
92 if (rho2 > rho_min && rho2 < rho_crit) {
96 if (Nsoln > 2 && rho3 > rho_min && rho3 < rho_crit) {
101 throw ValueError(
format(
"More than one vapor solution found for critical spline for T=%0.12g", T));
104 throw ValueError(
format(
"No vapor solution found for critical spline for T=%0.12g", T));
125 std::vector<CoolPropDbl>
A,
t;
131 std::vector<CoolPropDbl>
A,
B,
n,
m;
159 std::vector<CoolPropDbl>
B,
t,
d;
214 std::vector<CoolPropDbl>
a,
t;
220 std::vector<CoolPropDbl>
a,
t;
224 std::vector<CoolPropDbl>
a,
t;
228 std::vector<CoolPropDbl>
a,
t;
255 std::vector<CoolPropDbl>
b,
t;
259 std::vector<CoolPropDbl>
n,
d,
t;
278 std::vector<CoolPropDbl>
a,
d1,
d2,
t1,
t2,
f,
g,
h,
p,
q,
gamma,
l;
406 std::string superancillaries_str;
407 std::optional<SuperAncillary_t> superancillaries = std::nullopt;
433 if (!superancillaries){
434 if (!superancillaries_str.empty()){
435 auto start = std::chrono::high_resolution_clock::now();
438 auto end = std::chrono::high_resolution_clock::now();
439 auto duration = std::chrono::duration_cast<std::chrono::microseconds>(end - start);
443 return superancillaries;
448 superancillaries_str = s;
450#if !defined(LAZY_LOAD_SUPERANCILLARIES)
459 assert(R_u < 9 && R_u > 8);
582#if !defined(NO_FMTLIB) && FMT_VERSION >= 90000
584 return fmt::underlying(type);
588 return fmt::underlying(viscosity);
592 return fmt::underlying(conductivity);