TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Loi_Etat_GP_WC.cpp
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#include <Fluide_Weakly_Compressible.h>
17#include <Loi_Etat_GP_WC.h>
18#include <Debog.h>
19
20Implemente_instanciable(Loi_Etat_GP_WC,"Loi_Etat_Gaz_Parfait_WC",Loi_Etat_Mono_GP_base);
21// XD perfect_gaz_WC loi_etat_gaz_parfait_base gaz_parfait_WC BRACE Class for perfect gas state law used with a
22// XD_CONT weakly-compressible fluid.
23// XD attr Cp double Cp REQ Specific heat at constant pressure (J/kg/K).
24// XD attr Cv double Cv OPT Specific heat at constant volume (J/kg/K).
25// XD attr gamma double gamma OPT Cp/Cv
26// XD attr Prandtl double Prandtl REQ Prandtl number of the gas Pr=mu*Cp/lambda
27
29{
30 os <<que_suis_je()<< finl;
31 return os;
32}
33
35{
36 Cerr << "Reading the perfect gas equation of state for WC ... " << finl;
38
39 if(rho_constant_pour_debug_)
40 {
41 Cerr << "Remove the keyword rho_constant_pour_debug from your data file !" << finl;
43 }
44 return is;
45}
46
51
52double Loi_Etat_GP_WC::inverser_Pth(double T, double rho)
53{
54 Cerr << "Should not enter in the method Loi_Etat_GP_WC::inverser_Pth !" << finl;
56 return -1.e10;
57}
58
59/*! @brief Computes the density.
60 *
61 */
63{
64 const DoubleTab& tab_ICh = le_fluide->inco_chaleur().valeurs();
65 Fluide_Weakly_Compressible& FWC = ref_cast(Fluide_Weakly_Compressible,le_fluide.valeur());
66 DoubleTab& tab_rho = le_fluide->masse_volumique().valeurs();
67 const DoubleTab& pres = FWC.pression_th_tab();
68 const int n = tab_rho.size();
69 for (int som=0 ; som<n ; som++)
70 {
71 tab_rho_np1(som) = calculer_masse_volumique(pres(som,0),tab_ICh(som,0));
72 tab_rho(som,0) = 0.5 * ( tab_rho_n(som) + tab_rho_np1(som) );
73 }
74 tab_rho.echange_espace_virtuel();
75 tab_rho_np1.echange_espace_virtuel();
76 le_fluide->calculer_rho_face(tab_rho_np1);
77 Debog::verifier("Loi_Etat_GP_WC::calculer_masse_volumique, tab_rho_np1",tab_rho_np1);
78 Debog::verifier("Loi_Etat_GP_WC::calculer_masse_volumique, tab_rho",tab_rho);
79}
static void verifier(const char *const msg, double)
Definition Debog.cpp:21
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
const DoubleTab & pression_th_tab() const
State law class for ideal gases in the weakly compressible (WC) framework.
void calculer_masse_volumique() override
Computes the density.
double inverser_Pth(double, double) override
Computes the thermodynamic pressure from temperature and density.
Base state law class for mono-species ideal gases.
DoubleTab tab_rho_np1
friend class Fluide_Weakly_Compressible
DoubleTab tab_rho_n
virtual void calculer_masse_volumique()
Recomputes the density (masse volumique).
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
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
_SIZE_ size() const
Definition TRUSTVect.tpp:45
virtual void echange_espace_virtuel(IsExchangeBlocking exchange_type=IsExchangeBlocking::DefaultBlocking, const std::string kernel_name="noname")