TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
EOS_to_TRUST.h
1/****************************************************************************
2* Copyright (c) 2026, 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 EOS_to_TRUST_included
17#define EOS_to_TRUST_included
18
19#include <eos++.h>
20#include <TPPI.h>
21
22#ifdef HAS_EOS
23#pragma GCC diagnostic push
24#if __GNUC__ > 5 || __clang_major__ > 10
25#pragma GCC diagnostic ignored "-Wsuggest-override"
26#endif
27#pragma GCC diagnostic ignored "-Wdeprecated-copy"
28#include <EOS/API/EOS_Std_Error_Handler.hxx>
29#include <EOS/API/EOS.hxx>
30#pragma GCC diagnostic pop
31#endif
32
33namespace NEPTUNE { class EOS; }
34
35/*! @brief classe EOS_to_TRUST
36 *
37 * Interface commune pour TRUST et ses baltiks qui permet appeler les methodes de la lib EOS
38 * Methods disponibles en temperature et enthalpie, egalement pour la saturation
39 */
40class EOS_to_TRUST : public TPPI
41{
42public :
43 ~EOS_to_TRUST() override
44 {
45#ifdef HAS_EOS
46 if (fluide) delete fluide;
47#endif
48 }
49
50 void desactivate_handler(bool op = true) override;
51
52 double tppi_get_p_min() const override final;
53 double tppi_get_p_max() const override final;
54
55 double tppi_get_h_min() const override final;
56 double tppi_get_h_max() const override final;
57
58 double tppi_get_T_min() const override final;
59 double tppi_get_T_max() const override final;
60
61 double tppi_get_rho_min() const override final;
62 double tppi_get_rho_max() const override final;
63
64 double tppi_get_p_crit() const override final;
65 double tppi_get_h_crit() const override final;
66 double tppi_get_T_crit() const override final;
67 double tppi_get_rho_crit() const override final;
68
69 MRange all_unknowns_range() override final;
70
71protected :
72
73#ifdef HAS_EOS
74 NEPTUNE::EOS_Std_Error_Handler handler ;
75 NEPTUNE::EOS *fluide = nullptr;
76#endif
77
78 int compute_eos_field(const SpanD P, SpanD res, const char *const pt, const char *const pn, bool is_T = false) const;
79 int compute_eos_field(const SpanD P, const SpanD T, SpanD res, const char *const pt, const char *const pn) const;
80 int compute_eos_field_h(const SpanD P, const SpanD H, SpanD res, const char *const pt, const char *const pn) const;
81
82private:
83
84#ifdef HAS_EOS
85 double tmin_ = -123., tmax_ = -123., pmin_ = -123., pmax_ = -123.;
86 double hmin_ = -123., hmax_ = -123., rhomin_ = -123., rhomax_ = -123.;
87#endif
88};
89
90#endif /* EOS_to_TRUST_included */
classe EOS_to_TRUST
double tppi_get_T_min() const override final
double tppi_get_h_crit() const override final
double tppi_get_p_min() const override final
double tppi_get_h_min() const override final
double tppi_get_h_max() const override final
double tppi_get_T_crit() const override final
double tppi_get_p_crit() const override final
double tppi_get_rho_max() const override final
MRange all_unknowns_range() override final
int compute_eos_field(const SpanD P, SpanD res, const char *const pt, const char *const pn, bool is_T=false) const
void desactivate_handler(bool op=true) override
double tppi_get_rho_min() const override final
double tppi_get_rho_crit() const override final
int compute_eos_field_h(const SpanD P, const SpanD H, SpanD res, const char *const pt, const char *const pn) const
double tppi_get_T_max() const override final
double tppi_get_p_max() const override final
~EOS_to_TRUST() override
TPPI()=default