TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Loi_Etat_GR_base.h
1/****************************************************************************
2* Copyright (c) 2022, 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 Loi_Etat_GR_base_included
17#define Loi_Etat_GR_base_included
18
19#ifndef RU_
20//universal gas constant
21#define RU_ 8.3143*4.18448
22#endif
23
24#include <Loi_Etat_base.h>
25
26/*! @brief Base state law class for real gases, defining a dilatable fluid with the equations of state:
27 * rho = rho(Pth, H)
28 * T = T(Pth, H)
29 *
30 * @sa Fluide_Dilatable_base Loi_Etat_base
31 */
32
34{
35 Declare_base_sans_constructeur(Loi_Etat_GR_base);
36
37public :
39 void initialiser_inco_ch() override;
40 void calculer_lambda() override;
41 void initialiser() override;
42 void remplir_T() override;
43 void calculer_Cp() override;
44 const Nom type_fluide() const override;
45 double De_DP(double,double) const override;
46 double De_DT(double,double) const override;
47 double Cp_calc(double,double) const;
48 double inverser_Pth(double,double) override;
49 void calculer_masse_volumique() override;
50
51 // Pure virtual methods
52 virtual double calculer_temperature(double,double) = 0;
53 double calculer_H(double,double) const override = 0;
54 double Drho_DP(double,double) const override = 0;
55 double Drho_DT(double,double) const override = 0;
56 virtual double DT_DH(double,double) const = 0;
57 double calculer_masse_volumique(double,double) const override = 0;
58
59 // Inline methods
60 inline double masse_molaire() const { return MMole_; }
61
62protected :
63 double MMole_, Cp_, R;
64 DoubleTab tab_TempC, tab_Cp;
65};
66
67#endif /* Loi_Etat_GR_base_included */
void calculer_Cp() override
Computes Cp using the PolyCp_ polynomial.
void initialiser_inco_ch() override
Initialises the enthalpy unknown.
double calculer_masse_volumique(double, double) const override=0
double De_DT(double, double) const override
virtual double calculer_temperature(double, double)=0
double masse_molaire() const
double De_DP(double, double) const override
void calculer_lambda() override
Computes the conductivity divided by Cp: equivalent to k*dT/dh for using enthalpy in the diffusion op...
double Drho_DT(double, double) const override=0
void calculer_masse_volumique() override
Recomputes the density (masse volumique).
double calculer_H(double, double) const override=0
For ideal gases: does nothing. For real gases: must recompute enthalpy from pressure and temperature.
double inverser_Pth(double, double) override
Computes the thermodynamic pressure from enthalpy and density by Newton iteration.
double Cp_calc(double, double) const
Computes Cp as a function of physical quantities P and h. Cp = dh/dT = de/dT - 1/rho^2 * drho/dT.
void remplir_T() override
Fills the temperature array from the enthalpy unknown.
const Nom type_fluide() const override
Returns the type of fluid associated.
void initialiser() override
Initialises the state law by computing Pth.
virtual double DT_DH(double, double) const =0
double Drho_DP(double, double) const override=0
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31