TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Fluide_Dilatable_base.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 Fluide_Dilatable_base_included
17#define Fluide_Dilatable_base_included
18
19#include <EDO_Pression_th_base.h>
20#include <EOS_Tools_base.h>
21
22#include <Loi_Etat_base.h>
23#include <Fluide_base.h>
24#include <TRUST_Deriv.h>
25#include <TRUST_Ref.h>
26
27
28class Probleme_base;
29
30/*! @brief classe Fluide_Dilatable_base Cette classe represente un d'un fluide dilatable,
31 *
32 * heritant de fluide base
33 *
34 * @sa Milieu_base Fluide_base
35 */
36
38{
39 Declare_base(Fluide_Dilatable_base);
40public :
41 void verifier_coherence_champs(int& err,Nom& message) override;
42 void set_Cp(double);
43 void update_rho_cp(double temps) override;
44 void creer_champs_non_lus() override;
45 void initialiser_radiatives(const double temps);
47 int initialiser(const double temps) override;
48
49 const DoubleTab& temperature() const;
50 const Champ_Don_base& ch_temperature() const;
52
53 virtual void calculer_pression_tot();
54 void preparer_pas_temps();
55 void abortTimeStep() override;
56 void set_param(Param& param) const override;
57 void discretiser(const Probleme_base& pb, const Discretisation_base& dis) override;
58 void mettre_a_jour(double ) override;
59 virtual void update_pressure_fields(double );
60 void preparer_calcul() override;
61 virtual void completer(const Probleme_base&);
62 int lire_motcle_non_standard(const Motcle&, Entree&) override;
63 virtual void checkTraitementPth(const Domaine_Cl_dis_base&);
65 virtual void write_mean_edo(double);
66 virtual void write_header_edo();
67
68 // Virtuelles pure
69 virtual void secmembre_divU_Z(DoubleTab& ) const=0;
70 virtual void Resoudre_EDO_PT()=0;
71
72 // Methodes de l interface des champs postraitables
73 const Champ_base& get_champ(const Motcle& nom) const override;
74 void creer_champ(const Motcle& motlu) override;
75 bool has_champ(const Motcle& nom, OBS_PTR(Champ_base) &ref_champ) const override;
76 bool has_champ(const Motcle& nom) const override;
77 void get_noms_champs_postraitables(Noms& nom,Option opt=NONE) const override;
78
79 // Methodes inlines
80 inline const Nom type_fluide() const { return loi_etat_->type_fluide(); }
81 inline const OWN_PTR(Loi_Etat_base)& loi_etat() const { return loi_etat_; }
82 inline OWN_PTR(Loi_Etat_base)& loi_etat() { return loi_etat_; }
83 inline const Champ_Inc_base& inco_chaleur() const { return ch_inco_chaleur_.valeur(); }
84 inline Champ_Inc_base& inco_chaleur() { return ch_inco_chaleur_.valeur(); }
85 inline const Champ_Inc_base& vitesse() const { return ch_vitesse_.valeur(); }
86 inline const Champ_Don_base& pression_tot() const { return ch_pression_tot_; }
87 inline Champ_Don_base& pression_tot() { return ch_pression_tot_; }
88 inline const Champ_Don_base& mu_sur_Schmidt() const { return ch_mu_sur_Sc; }
90 inline const Champ_Don_base& nu_sur_Schmidt() const { return ch_nu_sur_Sc; }
92 inline const Champ_Don_base& source_masse_espece() const { assert (ch_source_masse_esp_); return ch_source_masse_esp_; }
93 inline Champ_Don_base& source_masse_espece() { assert (ch_source_masse_esp_); return ch_source_masse_esp_; }
96
97 inline bool has_source_masse_espece_champ() const { return bool(ch_source_masse_esp_); }
98 inline bool has_source_masse_projection_champ() const { return bool(ch_source_masse_proj_); }
99
100 inline const DoubleTab& rho_n() const { return loi_etat_->rho_n(); }
101 inline const DoubleTab& rho_np1() const { return loi_etat_->rho_np1(); }
102 inline void calculer_coeff_T();
103 inline void initialiser_inco_ch() { loi_etat_->initialiser_inco_ch(); }
104 inline void calculer_Cp() { loi_etat_->calculer_Cp(); }
105 inline void calculer_lambda() { loi_etat_->calculer_lambda(); }
106 inline void calculer_mu() { loi_etat_->calculer_mu(); }
107 inline void calculer_nu() override { loi_etat_->calculer_nu(); }
108 inline void calculer_alpha() override { loi_etat_->calculer_alpha(); }
109 inline void calculer_mu_sur_Sc() { loi_etat_-> calculer_mu_sur_Sc(); }
110 inline void calculer_nu_sur_Sc() { loi_etat_-> calculer_nu_sur_Sc(); }
111 inline void calculer_masse_volumique() { loi_etat_->calculer_masse_volumique(); }
112 inline void set_pression_th(double Pth) { Pth_n_ = Pth_ = Pth; }
113 inline int getTraitementPth() const { return traitement_PTh_; }
114 inline double pression_th() const { return Pth_; } // Pression thermodynamique
115 inline const double& get_pression_th() const { return Pth_; } // Reference to pression thermodynamique (for PDI, can't share a copy...)
116 inline double pression_thn() const { return Pth_n_; } // Pression thermodynamique a l'etape precedente
117 inline double pression_th1() const { return Pth1_; } // Pression thermodynamique calculee pour conserver la masse
118 inline double calculer_H(double hh) const { return loi_etat_->calculer_H(Pth_,hh); }
119
120 // Methodes inlines from EOS_Tools
121 inline Probleme_base& get_problem() { return le_probleme_.valeur(); }
122 inline const DoubleTab& rho_discvit() const { return eos_tools_->rho_discvit(); }
123 inline const DoubleTab& rho_face_n() const { return eos_tools_->rho_face_n(); }
124 inline const DoubleTab& rho_face_np1() const { return eos_tools_->rho_face_np1(); }
125 inline void calculer_rho_face(const DoubleTab& tab_rho) { eos_tools_->calculer_rho_face_np1(tab_rho); }
126 inline void divu_discvit(DoubleTab& secmem1, DoubleTab& secmem2) { eos_tools_->divu_discvit(secmem1,secmem2); }
127 inline double moyenne_vol(const DoubleTab& A) const { return eos_tools_->moyenne_vol(A); }
128
129 bool is_dilatable() const override { return true; }
130
131protected :
132 virtual void remplir_champ_pression_tot(int n, const DoubleTab& PHydro, DoubleTab& PTot) = 0;
133 void completer_edo(const Probleme_base& );
134
135 int traitement_PTh_ = 0; // flag pour le traitement de la pression thermo
136 double Pth_ = -1., Pth_n_ = -1., Pth1_ = -1.;
138 OBS_PTR(Probleme_base) le_probleme_;
140 OWN_PTR(Champ_Don_base) ch_source_masse_esp_, ch_source_masse_proj_; /* si besoin */
145};
146
148{
149 loi_etat_->remplir_T();
150 calculer_Cp();
151 calculer_mu();
153 calculer_nu();
157}
158
159#endif /* Fluide_Dilatable_base_included */
classe Champ_Don_base classe de base des Champs donnes (non calcules)
Classe Champ_Inc_base.
classe Champ_base Cette classe est la base de la hierarchie des champs.
Definition Champ_base.h:43
classe Discretisation_base Cette classe represente un schema de discretisation en espace,...
classe Domaine_Cl_dis_base Les objets Domaine_Cl_dis_base representent les conditions aux limites
classe EDO_Pression_th_base Cette classe est la base de la hierarchie des EDO sur la pression
classe Abstraite EOS_Tools_base
classe Fluide_Dilatable_base Cette classe represente un d'un fluide dilatable,
const Champ_Don_base & ch_temperature() const
Renvoie le champ de le temperature.
const Champ_base & get_champ(const Motcle &nom) const override
void creer_champ(const Motcle &motlu) override
int initialiser(const double temps) override
Initialise les parametres du fluide.
bool has_champ(const Motcle &nom, OBS_PTR(Champ_base) &ref_champ) const override
OBS_PTR(Champ_Inc_base) ch_inco_chaleur_
const DoubleTab & temperature() const
Renvoie le tableau des valeurs de le temperature.
const DoubleTab & rho_n() const
bool has_source_masse_espece_champ() const
const Champ_Don_base & source_masse_projection() const
virtual void Resoudre_EDO_PT()=0
double moyenne_vol(const DoubleTab &A) const
void mettre_a_jour(double) override
Effectue une mise a jour en temps du milieu, et donc de ses parametres caracteristiques.
const DoubleTab & rho_face_n() const
Champ_Don_base & nu_sur_Schmidt()
const DoubleTab & rho_discvit() const
OWN_PTR(Loi_Etat_base) loi_etat_
const double & get_pression_th() const
int lire_motcle_non_standard(const Motcle &, Entree &) override
Lecture des parametres de type non simple d'un objet_U a partir d'un flot d'entree.
bool has_source_masse_projection_champ() const
OWN_PTR(Loi_Etat_base) &loi_etat()
Champ_Inc_base & inco_chaleur()
Champ_Don_base & mu_sur_Schmidt()
Champ_Don_base & pression_tot()
Champ_Don_base & source_masse_espece()
virtual void calculer_pression_tot()
Calcule la pression totale : pression thermodynamique + pression hydrodynamique.
virtual void checkTraitementPth(const Domaine_Cl_dis_base &)
void completer_edo(const Probleme_base &)
const Champ_Inc_base & inco_chaleur() const
virtual void remplir_champ_pression_tot(int n, const DoubleTab &PHydro, DoubleTab &PTot)=0
const Champ_Don_base & source_masse_espece() const
virtual void secmembre_divU_Z(DoubleTab &) const =0
const Champ_Don_base & nu_sur_Schmidt() const
virtual void update_pressure_fields(double)
const Champ_Don_base & mu_sur_Schmidt() const
void calculer_alpha() override
Calcul de alpha=lambda/(rho*Cp).
virtual void write_mean_edo(double)
void discretiser(const Probleme_base &pb, const Discretisation_base &dis) override
void preparer_calcul() override
Prepare le fluide au calcul.
void preparer_pas_temps()
Prepare le pas de temps.
const OWN_PTR(Loi_Etat_base) &loi_etat() const
OWN_PTR(EDO_Pression_th_base) EDO_Pth_
void update_rho_cp(double temps) override
const Champ_Inc_base & vitesse() const
const DoubleTab & rho_np1() const
OBS_PTR(Probleme_base) le_probleme_
const DoubleTab & rho_face_np1() const
double calculer_H(double hh) const
void initialiser_radiatives(const double temps)
OWN_PTR(EOS_Tools_base) eos_tools_
void set_Cp(double)
Complete le fluide avec un Cp constant.
void verifier_coherence_champs(int &err, Nom &message) override
Verifie que les champs lus l'ont ete correctement.
Champ_Don_base & source_masse_projection()
void set_param(Param &param) const override
const Nom type_fluide() const
bool is_dilatable() const override
void divu_discvit(DoubleTab &secmem1, DoubleTab &secmem2)
const Champ_Don_base & pression_tot() const
void get_noms_champs_postraitables(Noms &nom, Option opt=NONE) const override
virtual void completer(const Probleme_base &)
Complete le fluide avec les champs inconnus associes au probleme.
void calculer_rho_face(const DoubleTab &tab_rho)
classe Fluide_base Cette classe represente un d'un fluide incompressible ainsi que
Definition Fluide_base.h:38
classe Loi_Etat_base Cette classe est la base de la hierarchie des lois d'etat.
Une chaine de caractere (Nom) en majuscules.
Definition Motcle.h:26
class Nom Une chaine de caractere pour nommer les objets de TRUST
Definition Nom.h:31
Un tableau de chaine de caracteres (VECT(Nom)).
Definition Noms.h:26
friend class Entree
Definition Objet_U.h:76
Helper class to factorize the readOn method of Objet_U classes.
Definition Param.h:112
classe Probleme_base C'est un Probleme_U qui n'est pas un couplage.