TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Loi_Etat_base.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 Loi_Etat_base_included
17#define Loi_Etat_base_included
18
19#include <Champs_compris_interface.h>
20#include <Champs_compris.h>
21#include <Champ_Don_base.h>
22#include <TRUST_Ref.h>
23
25class Probleme_base;
26
27/*! @brief Base class for the state law hierarchy defining a dilatable fluid.
28 *
29 * Abstract class from which all state laws must derive.
30 * Abstract methods: void calculer_coeff_T(), void calculer_masse_volumique()
31 *
32 * @sa Fluide_Dilatable_base
33 */
34
36{
37 Declare_base_sans_constructeur(Loi_Etat_base);
38
39public :
42
44 void assoscier_probleme(const Probleme_base& pb);
45 void mettre_a_jour(double);
46 void calculer_nu();
48 const Champ_Don_base& ch_temperature() const;
49
50 // Virtual methods
51 virtual void associer_fluide(const Fluide_Dilatable_base&);
52 virtual void preparer_calcul();
53 virtual void abortTimeStep();
54 virtual void initialiser_inco_ch();
55 virtual void calculer_mu();
56 virtual void calculer_lambda();
57 virtual void calculer_alpha();
58 virtual void calculer_mu_sur_Sc();
59 virtual void calculer_nu_sur_Sc();
60 virtual void calculer_masse_volumique();
61 virtual double calculer_H(double,double) const;
62 virtual double Drho_DP(double,double) const ;
63 virtual double Drho_DT(double,double) const ;
64 virtual double De_DP(double,double) const ;
65 virtual double De_DT(double,double) const ;
66
67 // Post-processing field interface methods
68 const Champ_base& get_champ(const Motcle& nom) const override;
69 void creer_champ(const Motcle& motlu) override { }
70 void get_noms_champs_postraitables(Noms& nom,Option opt=NONE) const override;
71 bool has_champ(const Motcle& nom, OBS_PTR(Champ_base) &ref_champ) const override;
72 bool has_champ(const Motcle& nom) const override;
73
74 // Pure virtual methods
75 const virtual Nom type_fluide() const =0;
76 virtual void initialiser() =0;
77 virtual void remplir_T() =0;
78 virtual void calculer_Cp() =0;
79 virtual double calculer_masse_volumique(double,double) const =0;
80 virtual double inverser_Pth(double,double) =0;
81
82 // Inline methods
83 inline Champs_compris& champs_compris() { return champs_compris_; }
84 inline const DoubleTab& temperature() const { return temperature_->valeurs(); }
85 inline const DoubleTab& rho_n() const { return tab_rho_n; }
86 inline const DoubleTab& rho_np1() const { return tab_rho_np1; }
87 inline double Prandt() const { return Pr_; }
88
89protected :
92 OWN_PTR(Champ_Don_base) temperature_;
93 DoubleTab tab_rho_n, tab_rho_np1; //rho at the previous and next time steps
94 double Pr_;
95 int debug;
96 virtual void compute_tab_rho(DoubleTab&); // compute tab_rho
97
98private :
99 Champs_compris champs_compris_;
100};
101
102#endif /* Loi_Etat_base_included */
class Champ_Don_base base class of Given Fields (not calculated)
class Champ_base This class is the base of the fields hierarchy.
Definition Champ_base.h:43
class Champs_compris_interface This class contains an interface of methods intended to manage
Base class for a dilatable fluid, inheriting from Fluide_base.
void assoscier_probleme(const Probleme_base &pb)
Associates the problem with the state law.
virtual void initialiser()=0
virtual void initialiser_inco_ch()
Initialises the heat equation unknown; sets rho arrays and updates density.
virtual double De_DP(double, double) const
virtual double calculer_masse_volumique(double, double) const =0
const DoubleTab & rho_n() const
DoubleTab tab_rho_np1
virtual void calculer_Cp()=0
friend class Fluide_Weakly_Compressible
void mettre_a_jour(double)
Updates the state law and the density field.
const Champ_base & get_champ(const Motcle &nom) const override
virtual void abortTimeStep()
virtual double De_DT(double, double) const
void creer_champ(const Motcle &motlu) override
double Prandt() const
const DoubleTab & temperature() const
DoubleTab tab_rho_n
Champ_Don_base & ch_temperature()
virtual void remplir_T()=0
virtual const Nom type_fluide() const =0
virtual void compute_tab_rho(DoubleTab &)
virtual double inverser_Pth(double, double)=0
virtual void associer_fluide(const Fluide_Dilatable_base &)
Associates the fluid with the state law.
virtual void calculer_masse_volumique()
Recomputes the density (masse volumique).
virtual double Drho_DT(double, double) const
virtual void preparer_calcul()
Prepares the fluid for computation by filling temperature and computing density.
Champs_compris & champs_compris()
virtual void calculer_alpha()
Computes the thermal diffusivity.
virtual double calculer_H(double, double) const
For ideal gases: does nothing. For real gases: must recompute enthalpy from pressure and temperature.
virtual double Drho_DP(double, double) const
OBS_PTR(Fluide_Dilatable_base) le_fluide
void get_noms_champs_postraitables(Noms &nom, Option opt=NONE) const override
OBS_PTR(Probleme_base) le_prob_
virtual void calculer_lambda()
Computes the thermal conductivity.
virtual void calculer_mu()
Computes the dynamic viscosity.
void calculer_nu()
Computes the kinematic viscosity.
virtual void calculer_nu_sur_Sc()
Does nothing; overloaded in Loi_Etat_Melange_Binaire.
bool has_champ(const Motcle &nom, OBS_PTR(Champ_base) &ref_champ) const override
OWN_PTR(Champ_Don_base) temperature_
const DoubleTab & rho_np1() const
friend class Fluide_Quasi_Compressible
virtual void calculer_mu_sur_Sc()
Does nothing; overloaded in Loi_Etat_Melange_GP.
A character string (Nom) in uppercase.
Definition Motcle.h:26
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31
An array of character strings (VECT(Nom)).
Definition Noms.h:26
Objet_U()
Default constructor: assigns a unique identifier to the object (object_id_) and registers the object ...
Definition Objet_U.cpp:54
class Probleme_base It is a Probleme_U that is not a coupling.