TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Masse_Multiphase.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 Masse_Multiphase_included
17#define Masse_Multiphase_included
18
19#include <Convection_Diffusion_std.h>
20#include <Operateur_Evanescence.h>
21#include <Operateur_Grad.h>
22#include <TRUST_Ref.h>
23
24class Fluide_base;
25
26/*! @brief classe Masse_Multiphase Cas particulier de Convection_Diffusion_std pour un fluide quasi conpressible
27 *
28 * quand le scalaire subissant le transport est la fraction massique
29 *
30 * @sa Conv_Diffusion_std
31 */
33{
34 Declare_instanciable(Masse_Multiphase);
35public :
36 void set_param(Param& param) const override;
37 int lire_motcle_non_standard(const Motcle&, Entree&) override;
38 void associer_fluide(const Fluide_base& );
39 inline const Champ_Inc_base& inconnue() const override;
40 inline Champ_Inc_base& inconnue() override;
41
42 void discretiser() override;
43 const Milieu_base& milieu() const override;
44 const Fluide_base& fluide() const;
46 Milieu_base& milieu() override;
47 void associer_milieu_base(const Milieu_base& ) override;
48 void completer() override;
49
50 int nombre_d_operateurs() const override //pas de diffusion
51 {
52 return 1;
53 }
54 const Operateur& operateur(int) const override;
55 Operateur& operateur(int) override;
56
57 void dimensionner_matrice_sans_mem(Matrice_Morse& matrice) override;
58
59 /*
60 interface {dimensionner,assembler}_blocs
61 specificites : prend en compte l'evanescence (en dernier)
62 */
63 int has_interface_blocs() const override;
64 void dimensionner_blocs(matrices_t matrices, const tabs_t& semi_impl = {}) const override;
65 void assembler_blocs_avec_inertie(matrices_t matrices, DoubleTab& secmem, const tabs_t& semi_impl = {}) override;
66
67 /* champ convecte : alpha * rho */
68 static void calculer_alpha_rho(const Objet_U& obj, DoubleTab& val, DoubleTab& bval, tabs_t& deriv);
69 std::pair<std::string, fonc_calc_t> get_fonc_champ_conserve() const override
70 {
71 return { "alpha_rho", calculer_alpha_rho };
72 }
73
74 static void calculer_alpha_rho_conv(const Objet_U& obj, DoubleTab& val, DoubleTab& bval, tabs_t& deriv);
75 std::pair<std::string, fonc_calc_t> get_fonc_champ_convecte() const
76 {
77 return { "alpha_rho_conv", calculer_alpha_rho_conv };
78 }
79
80 Champ_Inc_base& champ_convecte() const override //par defaut le champ conserve
81 {
82 return champ_convecte_.valeur();
83 }
84 int has_champ_convecte() const override
85 {
86 return bool(champ_convecte_);
87 }
88 void init_champ_convecte() const override; //a appeller dans le completer() des operateurs/sources qui auront besoin de champ_convecte_
89
90 /////////////////////////////////////////////////////
91 const Motcle& domaine_application() const override;
92
93 inline const Operateur_Grad& operateur_gradient_inconnue() const { return Op_Grad_;}
94
95protected :
97 OBS_PTR(Fluide_base) le_fluide_;
98 Operateur_Grad Op_Grad_; // Pour calculer le gradient en VDF
100
101private:
102 void verifier_somme_alpha();
103};
104
105
106/*! @brief Renvoie le champ inconnue representant l'inconnue (T ou H) (version const)
107 *
108 * @return (Champ_Inc_base&) le champ inconnue representant la temperature (GP) ou l'enthalpie (GR)
109 */
111{
112 return l_inco_ch_;
113}
114
115/*! @brief Renvoie le champ inconnue representant l'inconnue (T ou H)
116 *
117 * @return (Champ_Inc_base&) le champ inconnue representant la temperature (GP) ou l'enthalpie (GR)
118 */
120{
121 return l_inco_ch_;
122}
123
124#endif /* Masse_Multiphase_included */
Classe Champ_Inc_base.
classe Convection_Diffusion_std Cette classe est la base des equations modelisant le transport
classe Fluide_base Cette classe represente un d'un fluide incompressible ainsi que
Definition Fluide_base.h:38
classe Masse_Multiphase Cas particulier de Convection_Diffusion_std pour un fluide quasi conpressible
OWN_PTR(Champ_Inc_base) l_inco_ch_
std::pair< std::string, fonc_calc_t > get_fonc_champ_conserve() const override
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.
static void calculer_alpha_rho(const Objet_U &obj, DoubleTab &val, DoubleTab &bval, tabs_t &deriv)
int has_champ_convecte() const override
const Operateur & operateur(int) const override
Renvoie l'operateur specifie par son index: renvoie terme_diffusif si i = 0.
void discretiser() override
Discretise l'equation.
const Motcle & domaine_application() const override
Renvoie le nom du domaine d'application de l'equation.
Operateur_Evanescence evanescence_
static void calculer_alpha_rho_conv(const Objet_U &obj, DoubleTab &val, DoubleTab &bval, tabs_t &deriv)
const Champ_Inc_base & inconnue() const override
Renvoie le champ inconnue representant l'inconnue (T ou H) (version const).
const Milieu_base & milieu() const override
Renvoie le milieu physique de l'equation.
void associer_milieu_base(const Milieu_base &) override
Associe un milieu physique a l'equation, le milieu est en fait caste en Fluide_base.
int has_interface_blocs() const override
void dimensionner_matrice_sans_mem(Matrice_Morse &matrice) override
void associer_fluide(const Fluide_base &)
Associe un fluide de type Fluide_base a l'equation.
OBS_PTR(Fluide_base) le_fluide_
void init_champ_convecte() const override
void assembler_blocs_avec_inertie(matrices_t matrices, DoubleTab &secmem, const tabs_t &semi_impl={}) override
const Operateur_Grad & operateur_gradient_inconnue() const
int nombre_d_operateurs() const override
Renvoie le nombre d'operateurs de l'equation: 2 pour une equation de diffusion.
void completer() override
Associe l inconnue de l equation a la loi d etat,.
const Fluide_base & fluide() const
Renvoie le fluide incompressible associe a l'equation.
Champ_Inc_base & champ_convecte() const override
void dimensionner_blocs(matrices_t matrices, const tabs_t &semi_impl={}) const override
Operateur_Grad Op_Grad_
std::pair< std::string, fonc_calc_t > get_fonc_champ_convecte() const
void set_param(Param &param) const override
Classe Matrice_Morse Represente une matrice M (creuse), non necessairement carree.
classe Milieu_base Cette classe est la base de la hierarchie des milieux (physiques)
Definition Milieu_base.h:50
Une chaine de caractere (Nom) en majuscules.
Definition Motcle.h:26
classe Objet_U Cette classe est la classe de base des Objets de TRUST
Definition Objet_U.h:73
friend class Entree
Definition Objet_U.h:76
Objet_U()
Constructeur par defaut : attribue un numero d'identifiant unique a l'objet (object_id_),...
Definition Objet_U.cpp:55
classe Operateur_Evanescence Classe generique de la hierarchie des operateurs representant un terme
Classe Operateur_Grad Classe generique de la hierarchie des operateurs calculant le gradient.
classe Operateur Classe generique de la hierarchie des operateurs.
Definition Operateur.h:39
Helper class to factorize the readOn method of Objet_U classes.
Definition Param.h:112