TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Transport_Flux_Chaleur_Turbulente.cpp
1/****************************************************************************
2* Copyright (c) 2019, 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#include <Transport_Flux_Chaleur_Turbulente.h>
17#include <Modele_turbulence_scal_Fluctuation_Temperature.h>
18#include <Discret_Thermique.h>
19#include <Les_Pb_Turb.h>
20#include <Param.h>
21
22#include <Fluide_base.h>
23Implemente_instanciable_sans_constructeur(Transport_Flux_Chaleur_Turbulente,"Transport_Flux_Chaleur_Turbulente",Convection_Diffusion_std);
24
26{
27 /*
28 Noms& nom=champs_compris_.liste_noms_compris();
29 nom.dimensionner(1);
30 nom[0]="Flux_Chaleur_Turbulente";
31 */
32}
33// printOn et readOn
34
36{
37 return s << que_suis_je() << "\n";
38}
39
40/*! @brief cf Convection_Diffusion_std::readOn(is)
41 *
42 */
44{
46 if (les_sources.est_vide())
47 {
48 // Ajout automatique du terme source
49 Source t;
50 Source& so=les_sources.add(t);
51 const Probleme_base& pb = probleme();
52 Cerr << "Construction and typing for the source term of the Transport_Flux_Chaleur_Turbulente transport equation." << finl;
53 if (sub_type(Pb_Thermohydraulique_Turbulent,pb))
54 {
55 Nom typ = "Source_Transport_Flux_Chaleur_Turbulente";
56 so.typer(typ,*this);
57 }
58 so->associer_eqn(*this);
59 }
60 return is;
61}
62
67
69{
70 if (mot=="diffusion")
71 {
72 Cerr << "Reading and typing of the diffusion operator : " << finl;
73 is >> terme_diffusif;
74 return 1;
75 }
76 else
78}
79
80/*! @brief surcharge de la methode d'Equation_base.
81 *
82 * renvoie le nombre d'operateurs.
83 *
84 */
89
90/*! @brief surcharge de la methode d'Equation_base.
91 *
92 * renvoie le ieme operateur.
93 *
94 */
96{
97 assert(i>=0);
98 assert(i<nombre_d_operateurs());
99
100 switch(i)
101 {
102 case 0:
103 {
104 return terme_diffusif;
105 }
106 case 1:
107 {
108 return terme_convectif;
109 }
110 default :
111 {
112 Cerr << "Error for Transport_Flux_Chaleur_Turbulente::operateur(int i)" << finl;
113 Cerr << "Transport_Flux_Chaleur_Turbulente has " << nombre_d_operateurs() <<" operators "<<finl;
114 Cerr << "and you are trying to access the " << i <<" th one."<<finl;
116 }
117 }
118 return terme_diffusif;
119}
120
121/*! @brief surcharge de la methode d'Equation_base.
122 *
123 * renvoie le ieme operateur.
124 *
125 */
127{
128 assert(i>=0);
129 assert(i<nombre_d_operateurs());
130
131 switch(i)
132 {
133 case 0:
134 {
135 return terme_diffusif;
136 }
137 case 1:
138 {
139 return terme_convectif;
140 }
141 default :
142 {
143 Cerr << "Error for Transport_Flux_Chaleur_Turbulente::operateur(int i)" << finl;
144 Cerr << "Transport_Flux_Chaleur_Turbulente has " << nombre_d_operateurs() <<" operators "<<finl;
145 Cerr << "and you are trying to access the " << i <<" th one."<<finl;
147 }
148 }
149 return terme_diffusif;
150}
151
153{
154 Cerr << "Method Transport_Flux_Chaleur_Turbulente::completer() " << finl;
155 les_sources.completer();
156 inconnue().associer_eqn(*this);
157 for(int i=0; i<nombre_d_operateurs(); i++)
158 {
159 operateur(i).completer();
160 }
161 le_dom_Cl_dis->completer();
162 // Supression car le completer fait appel au 2eme completer desormais
163 //le_dom_Cl_dis->completer(domaine_dis());
164}
165
167{
168 const Discret_Thermique& dis = ref_cast(Discret_Thermique,discretisation());
169 Cerr <<que_suis_je()<<" equation discretization" << finl;
170 dis.Flux_Chaleur_Turb(schema_temps(),domaine_dis(),le_Flux_Chaleur_Turbulente);
171 champs_compris_.ajoute_champ(le_Flux_Chaleur_Turbulente);
173}
174
176{
177 le_fluide = ref_cast(Fluide_base, un_milieu) ;
178}
179
181{
182 if(!le_fluide)
183 {
184 Cerr << "No fluid has been associated to"
185 << "Transport_Flux_Chaleur_Turbulente equation." << finl;
187 }
188 return le_fluide.valeur();
189}
190
192{
193 if(!le_fluide)
194 {
195 Cerr << "No fluid has been associated to"
196 << "Transport_Flux_Chaleur_Turbulente equation." << finl;
198 }
199 return le_fluide.valeur();
200}
201
202
203
215
217{
218 static Motcle domaine = "Thermique";
219 return domaine;
220}
221
223{
224 static const double LIM = 1.e+2;
225 DoubleTab& chaleur = le_Flux_Chaleur_Turbulente->valeurs();
226 int size= chaleur.dimension(0);
227 for (int n=0; n<size; n++)
228 {
229 if ( (chaleur(n) >= LIM) || (chaleur(n) <= -LIM) )
230 chaleur(n) = 1.e-3;
231 }
232 return 1;
233}
virtual void associer_eqn(const Equation_base &)
Associates the field with the equation of which it represents an unknown.
Convection_Diffusion_std This class is the base for equations modelling the transport.
void set_param(Param &titi) const override
int lire_motcle_non_standard(const Motcle &, Entree &) override
Reads non-simple-type parameters of an Objet_U from an input stream.
Class Discret_Thermique: base class representing a spatial discretisation applied to thermal problems...
void Flux_Chaleur_Turb(const Schema_Temps_base &, Domaine_dis_base &, OWN_PTR(Champ_Inc_base)&) const
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
class Equation_base The role of an equation is the calculation of one or more fields....
virtual const Milieu_base & milieu() const =0
virtual void associer_domaine_dis(const Domaine_dis_base &)
Associates the discretized domain with the equation.
virtual void associer_pb_base(const Probleme_base &)
Associates with the Problem passed as parameter.
const Discretisation_base & discretisation() const
Returns the discretization associated with the equation.
virtual const Champ_Inc_base & inconnue() const =0
Sources les_sources
Probleme_base & probleme()
Returns the problem associated with the equation.
virtual void associer_sch_tps_base(const Schema_Temps_base &)
Associates the time scheme with the equation.
Schema_Temps_base & schema_temps()
Returns the time scheme associated with the equation.
virtual void discretiser()
Discretizes the equation.
Champs_compris champs_compris_
Domaine_dis_base & domaine_dis()
Returns the discretized domain associated with the equation.
Base class for an incompressible fluid and its properties:
Definition Fluide_base.h:36
Milieu_base This class is the base of the (physical) medium hierarchy.
Definition Milieu_base.h:50
Convection_Diffusion_std & equation()
A character string (Nom) in uppercase.
Definition Motcle.h:26
friend class Entree
Definition Objet_U.h:71
const Nom & que_suis_je() const
Returns the string identifying the class.
Definition Objet_U.cpp:104
virtual Entree & readOn(Entree &)
Reads an Objet_U from an input stream. Virtual method to override.
Definition Objet_U.cpp:289
virtual Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
Definition Objet_U.cpp:278
class Operateur Generic class of the operator hierarchy.
Definition Operateur.h:39
virtual void completer()
Updates the references of the objects associated with the operator.
Helper class to factorize the readOn method of Objet_U classes.
Definition Param.h:112
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Definition Process.cpp:466
Base class for output streams.
Definition Sortie.h:52
void typer(const Nom &, const Equation_base &)
Types the source by computing the required type name from the provided parameters.
Definition Source.cpp:52
_SIZE_ dimension(int d) const
Definition TRUSTTab.tpp:133
const Motcle & domaine_application() const override
Returns "indeterminate" Navier_Stokes_standard for example overrides this method.
void associer_modele_turbulence(const Modele_turbulence_scal_Fluctuation_Temperature &)
void discretiser() override
Discretizes the equation.
void associer_milieu_base(const Milieu_base &) override
int nombre_d_operateurs() const override
surcharge de la methode d'Equation_base.
int lire_motcle_non_standard(const Motcle &, Entree &) override
Reads non-simple-type parameters of an Objet_U from an input stream.
void completer() override
Completes the construction (initialization) of objects associated with the equation.
const Champ_Inc_base & inconnue() const override
renvoie le champ inconnue.
const Operateur & operateur(int) const override
surcharge de la methode d'Equation_base.