TrioCFD 1.9.8
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 classe CoolProp_to_TRUST_Sat_generique
22 *
23 * Interface commune pour TRUST et ses baltiks qui permet appeler les methodes de la lib CoolProp
24 * Methods disponibles pour la saturation en temperature
25 *
26 * @sa CoolProp_to_TRUST
27 */
29{
30public :
31 void set_saturation_generique(const char *const model_name, const char *const fluid_name) override;
32
33 int tppi_get_lambda_l_sat_p(const SpanD P, SpanD res, int ncomp = 1, int ind = 0) const override
34 {
35 return tppi_get_single_sat_p_(SAT::LAMBDA, P, res, 1, 0, true);
36 }
37
38 int tppi_get_lambda_v_sat_p(const SpanD P, SpanD res, int ncomp = 1, int ind = 0) const override
39 {
40 return tppi_get_single_sat_p_(SAT::LAMBDA, P, res, 1, 0, false);
41 }
42
43 int tppi_get_mu_l_sat_p(const SpanD P, SpanD res, int ncomp = 1, int ind = 0) const override
44 {
45 return tppi_get_single_sat_p_(SAT::MU, P, res, 1, 0, true);
46 }
47
48 int tppi_get_mu_v_sat_p(const SpanD P, SpanD res, int ncomp = 1, int ind = 0) const override
49 {
50 return tppi_get_single_sat_p_(SAT::MU, P, res, 1, 0, false);
51 }
52
53 // pour les gens qui cherchent sigma de l'objet saturation
54 int tppi_get_sigma_pT(const SpanD P, const SpanD T, SpanD res, int ncomp, int ind) const override
55 {
56 return tppi_get_single_sat_p_(SAT::SIGMA, P, res, 1, 0, true);
57 }
58
59 int tppi_get_sigma_ph(const SpanD P, const SpanD H, SpanD res, int ncomp, int ind) const override
60 {
61 return tppi_get_single_sat_p_(SAT::SIGMA, P, res, 1, 0, true);
62 }
63
64 // methodes particulieres par application pour gagner en performance : utilisees dans Pb_Multiphase et F5 (pour le moment !)
65 int tppi_get_all_flux_interfacial_pb_multiphase(const SpanD P, MSatSpanD sats, int ncomp = 1, int ind = 0) const override;
66 int tppi_get_all_sat_loi_F5(const MSpanD input, MSatSpanD sats, int ncomp = 1, int ind = 0) const override;
67
68 void set_user_uniform_sigma(const double sigma) override { user_uniform_sigma_ = sigma; }
69
70private:
71 int tppi_get_single_sat_p_(SAT , const SpanD , SpanD , int , int , bool is_liq = true) const override;
72 int tppi_get_single_sat_p__(SAT , const SpanD , SpanD , bool is_liq = true) const;
73 int FD_derivative_p(SAT , const SpanD , SpanD , bool is_liq = true) const;
74 double user_uniform_sigma_ = -1.;
75 std::string fld_name_sat_ = "NONE";
76};
77
78#endif /* CoolProp_to_TRUST_Sat_generique_included */
79
classe CoolProp_to_TRUST_Sat_generique
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
classe CoolProp_to_TRUST