TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Energie_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 Energie_Multiphase_included
17#define Energie_Multiphase_included
18
19#include <Convection_Diffusion_Temperature_base.h>
20#include <Operateur_Evanescence.h>
21
22/*! @brief Specialisation of Convection_Diffusion_std for multiphase flows where the transported scalar
23 * is temperature (for ideal gases) or enthalpy (for real gases).
24 * (Generalisation of Convection_Diffusion_Temperature to real gases.)
25 *
26 * @sa Conv_Diffusion_std Convection_Diffusion_Temperature
27 */
29{
30 Declare_instanciable(Energie_Multiphase);
31public :
32 void set_param(Param& param) const override;
33 int lire_motcle_non_standard(const Motcle&, Entree&) override;
34
35 inline const Champ_Inc_base& inconnue() const override;
36 inline Champ_Inc_base& inconnue() override;
37 void discretiser() override;
38 int impr(Sortie& os) const override;
39 void dimensionner_matrice_sans_mem(Matrice_Morse& matrice) override;
40
41 /*
42 interface {dimensionner,assembler}_blocs
43 specifics: evanescence is taken into account (last)
44 */
45 int has_interface_blocs() const override;
46 void dimensionner_blocs(matrices_t matrices, const tabs_t& semi_impl = {}) const override;
47 void assembler_blocs_avec_inertie(matrices_t matrices, DoubleTab& secmem, const tabs_t& semi_impl = {}) override;
48 const Motcle& domaine_application() const override;
49 void verifie_ch_init_nb_comp_cl(const Champ_Inc_base& ch_ref, const int nb_comp, const Cond_lim_base& cl) const override;
50
51 /* convected field: alpha * rho * e */
52 static void calculer_alpha_rho_e(const Objet_U& obj, DoubleTab& val, DoubleTab& bval, tabs_t& deriv);
53 std::pair<std::string, fonc_calc_t> get_fonc_champ_conserve() const override
54 {
55 return { "alpha_rho_e", calculer_alpha_rho_e };
56 }
57
58 static void calculer_alpha_rho_h(const Objet_U& obj, DoubleTab& val, DoubleTab& bval, tabs_t& deriv);
59 static void calculer_alpha_rho_e_conv(const Objet_U& obj, DoubleTab& val, DoubleTab& bval, tabs_t& deriv);
60 virtual std::pair<std::string, fonc_calc_t> get_fonc_champ_convecte() const
61 {
62 return { "alpha_rho_e_conv", calculer_alpha_rho_e_conv };
63 }
64
65 Champ_Inc_base& champ_convecte() const override // by default the conserved field
66 {
67 return champ_convecte_.valeur();
68 }
69 int has_champ_convecte() const override
70 {
71 return bool(champ_convecte_);
72 }
73 void init_champ_convecte() const override; // to be called in the completer() of operators/sources that will need champ_convecte_
74
75protected :
76
79};
80
81/*! @brief Returns the unknown field representing the unknown (T or H) (const version).
82 *
83 * @return (Champ_Inc_base&) the unknown field representing temperature (ideal gas) or enthalpy (real gas)
84 */
86{
87 return l_inco_ch_;
88}
89
90/*! @brief Returns the unknown field representing the unknown (T or H).
91 *
92 * @return (Champ_Inc_base&) the unknown field representing temperature (ideal gas) or enthalpy (real gas)
93 */
95{
96 return l_inco_ch_;
97}
98
99#endif /* Energie_Multiphase_included */
Class Champ_Inc_base.
class Cond_lim_base Base class for the hierarchy of classes that represent the different boundary con...
Specialisation of Convection_Diffusion_std for multiphase flows where the transported scalar is tempe...
void verifie_ch_init_nb_comp_cl(const Champ_Inc_base &ch_ref, const int nb_comp, const Cond_lim_base &cl) const override
Verifies the number of components read for a field specification.
int has_interface_blocs() const override
int impr(Sortie &os) const override
Prints the boundary fluxes to an output stream.
Operateur_Evanescence evanescence_
const Motcle & domaine_application() const override
Returns the name of the equation's application domain.
int lire_motcle_non_standard(const Motcle &, Entree &) override
Reads non-simple-type parameters of an Objet_U from an input stream.
void assembler_blocs_avec_inertie(matrices_t matrices, DoubleTab &secmem, const tabs_t &semi_impl={}) override
static void calculer_alpha_rho_e_conv(const Objet_U &obj, DoubleTab &val, DoubleTab &bval, tabs_t &deriv)
std::pair< std::string, fonc_calc_t > get_fonc_champ_conserve() const override
void dimensionner_blocs(matrices_t matrices, const tabs_t &semi_impl={}) const override
int has_champ_convecte() const override
void init_champ_convecte() const override
OWN_PTR(Champ_Inc_base) l_inco_ch_
Champ_Inc_base & champ_convecte() const override
static void calculer_alpha_rho_e(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 (T or H) (const version).
void discretiser() override
Discretizes the equation.
static void calculer_alpha_rho_h(const Objet_U &obj, DoubleTab &val, DoubleTab &bval, tabs_t &deriv)
virtual std::pair< std::string, fonc_calc_t > get_fonc_champ_convecte() const
void set_param(Param &param) const override
void dimensionner_matrice_sans_mem(Matrice_Morse &matrice) override
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
Matrice_Morse class - Represents a (sparse) matrix M, not necessarily square,.
A character string (Nom) in uppercase.
Definition Motcle.h:26
Base class for TRUST objects (Objet_U).
Definition Objet_U.h:68
Operateur_Evanescence class: generic class in the operator hierarchy representing a term.
Helper class to factorize the readOn method of Objet_U classes.
Definition Param.h:112
Base class for output streams.
Definition Sortie.h:52