TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
CoolProp_to_TRUST_Sat_generique.h
1/****************************************************************************
2* Copyright (c) 2025, CEA
3* All rights reserved.
4*
5* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
6* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
9*
10* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
11* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
12* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
13*
14*****************************************************************************/
15
16#ifndef CoolProp_to_TRUST_Sat_generique_included
17#define CoolProp_to_TRUST_Sat_generique_included
18
19#include <CoolProp_to_TRUST.h>
20
21/*! @brief CoolProp interface for saturation properties as functions of temperature.
22 *
23 * Common interface for TRUST and its baltiks to call CoolProp saturation-property methods.
24 *
25 * @sa CoolProp_to_TRUST
26 */
28{
29public :
30 void set_saturation_generique(const char *const model_name, const char *const fluid_name) override;
31
32 int tppi_get_lambda_l_sat_p(const SpanD P, SpanD res, int ncomp = 1, int ind = 0) const override
33 {
34 return tppi_get_single_sat_p_(SAT::LAMBDA, P, res, 1, 0, true);
35 }
36
37 int tppi_get_lambda_v_sat_p(const SpanD P, SpanD res, int ncomp = 1, int ind = 0) const override
38 {
39 return tppi_get_single_sat_p_(SAT::LAMBDA, P, res, 1, 0, false);
40 }
41
42 int tppi_get_mu_l_sat_p(const SpanD P, SpanD res, int ncomp = 1, int ind = 0) const override
43 {
44 return tppi_get_single_sat_p_(SAT::MU, P, res, 1, 0, true);
45 }
46
47 int tppi_get_mu_v_sat_p(const SpanD P, SpanD res, int ncomp = 1, int ind = 0) const override
48 {
49 return tppi_get_single_sat_p_(SAT::MU, P, res, 1, 0, false);
50 }
51
52 // for users seeking sigma from the saturation object
53 int tppi_get_sigma_pT(const SpanD P, const SpanD T, SpanD res, int ncomp, int ind) const override
54 {
55 return tppi_get_single_sat_p_(SAT::SIGMA, P, res, 1, 0, true);
56 }
57
58 int tppi_get_sigma_ph(const SpanD P, const SpanD H, SpanD res, int ncomp, int ind) const override
59 {
60 return tppi_get_single_sat_p_(SAT::SIGMA, P, res, 1, 0, true);
61 }
62
63 // application-specific methods to improve performance: used in Pb_Multiphase and F5 (for now)
64 int tppi_get_all_flux_interfacial_pb_multiphase(const SpanD P, MSatSpanD sats, int ncomp = 1, int ind = 0) const override;
65 int tppi_get_all_sat_loi_F5(const MSpanD input, MSatSpanD sats, int ncomp = 1, int ind = 0) const override;
66
67 void set_user_uniform_sigma(const double sigma) override { user_uniform_sigma_ = sigma; }
68
69private:
70 int tppi_get_single_sat_p_(SAT , const SpanD , SpanD , int , int , bool is_liq = true) const override;
71 int tppi_get_single_sat_p__(SAT , const SpanD , SpanD , bool is_liq = true) const;
72 int FD_derivative_p(SAT , const SpanD , SpanD , bool is_liq = true) const;
73 double user_uniform_sigma_ = -1.;
74 std::string fld_name_sat_ = "NONE";
75};
76
77#endif /* CoolProp_to_TRUST_Sat_generique_included */
78
CoolProp interface for saturation properties as functions of temperature.
int tppi_get_all_sat_loi_F5(const MSpanD input, MSatSpanD sats, int ncomp=1, int ind=0) const override
int tppi_get_all_flux_interfacial_pb_multiphase(const SpanD P, MSatSpanD sats, int ncomp=1, int ind=0) const override
void set_saturation_generique(const char *const model_name, const char *const fluid_name) override
int tppi_get_mu_l_sat_p(const SpanD P, SpanD res, int ncomp=1, int ind=0) const override
int tppi_get_sigma_pT(const SpanD P, const SpanD T, SpanD res, int ncomp, int ind) const override
int tppi_get_lambda_v_sat_p(const SpanD P, SpanD res, int ncomp=1, int ind=0) const override
int tppi_get_sigma_ph(const SpanD P, const SpanD H, SpanD res, int ncomp, int ind) const override
int tppi_get_mu_v_sat_p(const SpanD P, SpanD res, int ncomp=1, int ind=0) const override
void set_user_uniform_sigma(const double sigma) override
int tppi_get_lambda_l_sat_p(const SpanD P, SpanD res, int ncomp=1, int ind=0) const override
Common interface for TRUST and its baltiks to call CoolProp library methods.