16#include <CoolProp_to_TRUST.h>
21 if (phase_name ==
"LIQUID" || phase_name ==
"LIQUIDE")
return;
22 if (phase_name ==
"VAPOR" || phase_name ==
"VAPEUR")
return;
23 if (phase_name ==
"UNKNOWN" || phase_name ==
"NOT_SET")
return;
25 Cerr <<
"Error in CoolProp_to_TRUST::" << __func__ <<
" !! The phase " << phase_name <<
" is not a recognized word !" << finl;
26 Cerr <<
"Please specify a phase of the following : liquid|liquide / vapor|vapeur / unknown / not_set ! Otherise dont specify any phase CoolProp will guess it !" << finl;
33 const char *use_refprop = std::getenv(
"TRUST_USE_REFPROP");
35 if (use_refprop !=
nullptr && std::string(use_refprop) ==
"1")
37 const char * refprop_dir = std::getenv(
"TRUST_REFPROP_HOME_DIR");
38 assert (refprop_dir !=
nullptr);
39 CoolProp::set_config_string(configuration_keys::ALTERNATIVE_REFPROP_PATH, std::string(refprop_dir));
43 Cerr <<
"You want to use the RefProp model but no path is provided towards the RefProp install !" << finl;
44 Cerr <<
"Check your TRUST configuration !" << finl;
48 Cerr <<
"CoolProp_to_TRUST::" << __func__ <<
" should not be called since TRUST is not compiled with the CoolProp library !!! " << finl;
56 assert(fluide !=
nullptr);
57 if (phase_name ==
"LIQUID" || phase_name ==
"LIQUIDE")
58 fluide->specify_phase(CoolProp::iphase_liquid);
59 else if (phase_name ==
"VAPOR" || phase_name ==
"VAPEUR")
60 fluide->specify_phase(CoolProp::iphase_gas);
61 else if (phase_name ==
"UNKNOWN")
62 fluide->specify_phase(CoolProp::iphase_unknown);
63 else if (phase_name ==
"NOT_SET")
64 fluide->specify_phase(CoolProp::iphase_not_imposed);
68 Cerr <<
"CoolProp_to_TRUST::" << __func__ <<
" should not be called since TRUST is not compiled with the CoolProp library !!! " << finl;
76 return fluide->p_triple();
78 Cerr <<
"CoolProp_to_TRUST::" << __func__ <<
" should not be called since TRUST is not compiled with the CoolProp library !!! " << finl;
86 return fluide->pmax();
88 Cerr <<
"CoolProp_to_TRUST::" << __func__ <<
" should not be called since TRUST is not compiled with the CoolProp library !!! " << finl;
96 const double T_min = fluide->Tmin(), p_min = fluide->p_triple();
97 std::array<double,1> t = { T_min }, p = { p_min }, h = { 0. };
101 Cerr <<
"CoolProp_to_TRUST::" << __func__ <<
" should not be called since TRUST is not compiled with the CoolProp library !!! " << finl;
109 const double T_max = fluide->Tmax(), p_max = fluide->pmax();
110 std::array<double,1> t = { T_max }, p = { p_max }, h = { 0. };
114 Cerr <<
"CoolProp_to_TRUST::" << __func__ <<
" should not be called since TRUST is not compiled with the CoolProp library !!! " << finl;
122 return fluide->Tmin();
124 Cerr <<
"CoolProp_to_TRUST::" << __func__ <<
" should not be called since TRUST is not compiled with the CoolProp library !!! " << finl;
132 return fluide->Tmax();
134 Cerr <<
"CoolProp_to_TRUST::" << __func__ <<
" should not be called since TRUST is not compiled with the CoolProp library !!! " << finl;
142 Cerr <<
"CoolProp_to_TRUST::" << __func__ <<
" is not implemented ... Call 911 for help ! " << finl;
145 Cerr <<
"CoolProp_to_TRUST::" << __func__ <<
" should not be called since TRUST is not compiled with the CoolProp library !!! " << finl;
153 Cerr <<
"CoolProp_to_TRUST::" << __func__ <<
" is not implemented ... Call 911 for help ! " << finl;
156 Cerr <<
"CoolProp_to_TRUST::" << __func__ <<
" should not be called since TRUST is not compiled with the CoolProp library !!! " << finl;
164 return fluide->p_critical();
166 Cerr <<
"CoolProp_to_TRUST::" << __func__ <<
" should not be called since TRUST is not compiled with the CoolProp library !!! " << finl;
174 Cerr <<
"CoolProp_to_TRUST::" << __func__ <<
" is not implemented ... Call 911 for help ! " << finl;
177 Cerr <<
"CoolProp_to_TRUST::" << __func__ <<
" should not be called since TRUST is not compiled with the CoolProp library !!! " << finl;
185 return fluide->T_critical();
187 Cerr <<
"CoolProp_to_TRUST::" << __func__ <<
" should not be called since TRUST is not compiled with the CoolProp library !!! " << finl;
195 return fluide->rhomass_critical();
197 Cerr <<
"CoolProp_to_TRUST::" << __func__ <<
" should not be called since TRUST is not compiled with the CoolProp library !!! " << finl;
double tppi_get_h_crit() const override final
double tppi_get_h_max() const override final
double tppi_get_rho_min() const override final
void set_phase(const Motcle &) override
void set_path_refprop() override
double tppi_get_rho_crit() const override final
double tppi_get_T_crit() const override final
double tppi_get_p_min() const override final
double tppi_get_T_min() const override final
double tppi_get_rho_max() const override final
double tppi_get_h_min() const override final
double tppi_get_T_max() const override final
double tppi_get_p_crit() const override final
double tppi_get_p_max() const override final
void verify_phase(const Motcle &) override
Une chaine de caractere (Nom) en majuscules.
static void exit(int exit_code=-1)
Routine de sortie de TRUST dans une region Kokkos.
virtual int tppi_get_h_pT(const SpanD P, const SpanD T, SpanD R, int ncomp=1, int ind=0) const