TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Loi_Etat_TPPI_base.cpp
1/****************************************************************************
2* Copyright (c) 2024, 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#include <Fluide_Dilatable_base.h>
17#include <Loi_Etat_TPPI_base.h>
18#include <Champ_Uniforme.h>
19
20#include <Param.h>
21
22Implemente_base(Loi_Etat_TPPI_base, "Loi_Etat_TPPI_base", Loi_Etat_Mono_GP_base);
23
24Sortie& Loi_Etat_TPPI_base::printOn(Sortie& os) const { return os << que_suis_je() << finl; }
25
27{
28 Param param(que_suis_je());
29 param.ajouter("model|modele", &model_name_, Param::REQUIRED);
30 param.ajouter("fluid|fluide", &fluid_name_, Param::REQUIRED);
31 param.ajouter("Cp", &Cp_, Param::REQUIRED);
32 param.lire_avec_accolades_depuis(is);
33
34 return is;
35}
36
38{
39 Cerr << "Loi_Etat_TPPI_base::inverser_Pth should not be called !! " << finl;
40 throw;
41}
42
44{
45 if (!le_fluide->has_viscosite_dynamique())
46 {
47 Cerr << "Error in Loi_Etat_TPPI_base::verify_fields() ... Mu is not read in your medium and it must be calculated by EOS/CoolProp !!!" << finl;
49 }
50 Champ_Don_base& mu = le_fluide->viscosite_dynamique();
51 if (sub_type(Champ_Uniforme, mu))
52 {
53 Cerr << "Error in Loi_Etat_TPPI_base::verify_fields() ... Mu should not be Champ_Uniforme since it must be calculated by EOS/CoolProp !!!" << finl;
55 }
56
57 if (!le_fluide->has_conductivite())
58 {
59 Cerr << "Error in Loi_Etat_TPPI_base::verify_fields() ... Lambda is not read in your medium and it must be calculated by EOS/CoolProp !!!" << finl;
61 }
62 Champ_Don_base& lambda = le_fluide->conductivite();
63 if (sub_type(Champ_Uniforme, lambda))
64 {
65 Cerr << "Error in Loi_Etat_TPPI_base::verify_fields() ... Lambda should not be Champ_Uniforme since it must be calculated by EOS/CoolProp !!!" << finl;
67 }
68
69 if (!le_fluide->has_diffusivite())
70 {
71 Cerr << "Error in Loi_Etat_TPPI_base::verify_fields() ... Alpha is not read in your medium and it must be calculated by EOS/CoolProp !!!" << finl;
73 }
74 Champ_Don_base& alpha = le_fluide->diffusivite();
75 if (sub_type(Champ_Uniforme, alpha))
76 {
77 Cerr << "Error in Loi_Etat_TPPI_base::verify_fields() ... Alpha should not be Champ_Uniforme since it must be calculated by EOS/CoolProp !!!" << finl;
79 }
80}
81
87
89{
90 Cerr << "Loi_Etat_TPPI_base::calculer_masse_volumique should not be called !! " << finl;
91 throw;
92}
class Champ_Don_base base class of Given Fields (not calculated)
Champ_Uniforme Represents a field that is constant in space and time.
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
Base state law class for mono-species ideal gases.
void preparer_calcul() override
Prepares the fluid for computation by filling temperature and computing density.
double inverser_Pth(double, double) override
Computes the thermodynamic pressure from temperature and density.
virtual void calculer_masse_volumique()
Recomputes the density (masse volumique).
virtual void preparer_calcul()
Prepares the fluid for computation by filling temperature and computing density.
const Nom & que_suis_je() const
Returns the string identifying the class.
Definition Objet_U.cpp:104
virtual Entree & readOn(Entree &)
Reads an Objet_U from an input stream. Virtual method to override.
Definition Objet_U.cpp:289
virtual Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
Definition Objet_U.cpp:278
@ REQUIRED
Definition Param.h:115
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Definition Process.cpp:466
Base class for output streams.
Definition Sortie.h:52