TrioCFD 1.9.9_beta
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 Specialisation of Convection_Diffusion_std for multiphase flows where the transported scalar
27 * is the volume fraction.
28 *
29 * @sa Conv_Diffusion_std
30 */
32{
33 Declare_instanciable(Masse_Multiphase);
34public :
35 void set_param(Param& param) const override;
36 int lire_motcle_non_standard(const Motcle&, Entree&) override;
37 void associer_fluide(const Fluide_base& );
38 inline const Champ_Inc_base& inconnue() const override;
39 inline Champ_Inc_base& inconnue() override;
40
41 void discretiser() override;
42 const Milieu_base& milieu() const override;
43 const Fluide_base& fluide() const;
45 Milieu_base& milieu() override;
46 void associer_milieu_base(const Milieu_base& ) override;
47 void completer() override;
48
49 int nombre_d_operateurs() const override // no diffusion
50 {
51 return 1;
52 }
53 const Operateur& operateur(int) const override;
54 Operateur& operateur(int) override;
55
56 void dimensionner_matrice_sans_mem(Matrice_Morse& matrice) override;
57
58 /*
59 interface {dimensionner,assembler}_blocs
60 specifics: evanescence is taken into account (last)
61 */
62 int has_interface_blocs() const override;
63 void dimensionner_blocs(matrices_t matrices, const tabs_t& semi_impl = {}) const override;
64 void assembler_blocs_avec_inertie(matrices_t matrices, DoubleTab& secmem, const tabs_t& semi_impl = {}) override;
65
66 /* convected field: alpha * rho */
67 static void calculer_alpha_rho(const Objet_U& obj, DoubleTab& val, DoubleTab& bval, tabs_t& deriv);
68 std::pair<std::string, fonc_calc_t> get_fonc_champ_conserve() const override
69 {
70 return { "alpha_rho", calculer_alpha_rho };
71 }
72
73 static void calculer_alpha_rho_conv(const Objet_U& obj, DoubleTab& val, DoubleTab& bval, tabs_t& deriv);
74 std::pair<std::string, fonc_calc_t> get_fonc_champ_convecte() const
75 {
76 return { "alpha_rho_conv", calculer_alpha_rho_conv };
77 }
78
79 Champ_Inc_base& champ_convecte() const override // by default the conserved field
80 {
81 return champ_convecte_.valeur();
82 }
83 int has_champ_convecte() const override
84 {
85 return bool(champ_convecte_);
86 }
87 void init_champ_convecte() const override; // to be called in the completer() of operators/sources that will need champ_convecte_
88
89 /////////////////////////////////////////////////////
90 const Motcle& domaine_application() const override;
91
92 inline const Operateur_Grad& operateur_gradient_inconnue() const { return Op_Grad_;}
93
94protected :
96 OBS_PTR(Fluide_base) le_fluide_;
97 Operateur_Grad Op_Grad_; // To compute the gradient in VDF
99
100private:
101 void verifier_somme_alpha();
102};
103
104
105/*! @brief Returns the unknown field representing the unknown (alpha) (const version).
106 *
107 * @return (Champ_Inc_base&) the unknown field representing the volume fraction
108 */
110{
111 return l_inco_ch_;
112}
113
114/*! @brief Returns the unknown field representing the unknown (alpha).
115 *
116 * @return (Champ_Inc_base&) the unknown field representing the volume fraction
117 */
119{
120 return l_inco_ch_;
121}
122
123#endif /* Masse_Multiphase_included */
Class Champ_Inc_base.
Convection_Diffusion_std This class is the base for equations modelling the transport.
Base class for an incompressible fluid and its properties:
Definition Fluide_base.h:36
Specialisation of Convection_Diffusion_std for multiphase flows where the transported scalar is the v...
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
Reads non-simple-type parameters of an Objet_U from an input stream.
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
Returns the operator at the given index: returns terme_diffusif if i = 0,.
void discretiser() override
Discretizes the equation.
const Motcle & domaine_application() const override
Returns the name of the application domain of the 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
Returns the unknown field representing the unknown (alpha) (const version).
const Milieu_base & milieu() const override
Returns the physical medium associated with the equation.
void associer_milieu_base(const Milieu_base &) override
Associates a physical medium to the equation; the medium is cast to Fluide_base.
int has_interface_blocs() const override
void dimensionner_matrice_sans_mem(Matrice_Morse &matrice) override
void associer_fluide(const Fluide_base &)
Associates a fluid of type Fluide_base with the 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
Returns the number of operators in the equation: 2 for a diffusion equation.
void completer() override
Associates the unknown of the equation to the state law.
const Fluide_base & fluide() const
Returns the incompressible fluid associated with the equation (const version).
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
Matrice_Morse class - Represents a (sparse) matrix M, not necessarily square,.
Milieu_base This class is the base of the (physical) medium hierarchy.
Definition Milieu_base.h:50
A character string (Nom) in uppercase.
Definition Motcle.h:26
Base class for TRUST objects (Objet_U).
Definition Objet_U.h:68
friend class Entree
Definition Objet_U.h:71
Objet_U()
Default constructor: assigns a unique identifier to the object (object_id_) and registers the object ...
Definition Objet_U.cpp:54
Operateur_Evanescence class: generic class in the operator hierarchy representing a term.
Classe Operateur_Grad Generic class of the hierarchy of operators computing the gradient.
class Operateur Generic class of the operator hierarchy.
Definition Operateur.h:39
Helper class to factorize the readOn method of Objet_U classes.
Definition Param.h:112