TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Transport_Fluctuation_Temperature_W.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_Fluctuation_Temperature_W.h>
17#include <Modele_turbulence_scal_Fluctuation_Temperature_W.h>
18#include <Discret_Thermique.h>
19#include <Les_Pb_Turb.h>
20#include <Param.h>
21#include <Fluide_base.h>
22
23Implemente_instanciable_sans_constructeur(Transport_Fluctuation_Temperature_W,"Transport_Fluctuation_Temperature_W",Convection_Diffusion_std);
24
25
27{
28 /*
29 Noms& nom=champs_compris_.liste_noms_compris();
30 nom.dimensionner(3);
31 nom[0]="variance_temperature";
32 nom[1]="taux_dissipation_temperature";
33 nom[2]="Fluctu_Temperature";
34 */
35}
36// printOn et readOn
37
39{
40 return s << que_suis_je() << "\n";
41}
42
43/*! @brief cf Convection_Diffusion_std::readOn(is)
44 *
45 */
47{
49 if (les_sources.est_vide())
50 {
51 // Ajout automatique du terme source
52 Source t;
53 Source& so=les_sources.add(t);
54 const Probleme_base& pb = probleme();
55 Cerr << "Construction and typing for the source term of the Transport_Fluctuation_Temperature_W transport equation." << finl;
56 if (sub_type(Pb_Thermohydraulique_Turbulent,pb))
57 {
58 Nom typ = "Source_Transport_Fluctuation_Temperature_W";
59 so.typer(typ,*this);
60 }
61 so->associer_eqn(*this);
62 }
63 return is;
64}
65
70
72{
73 if (mot=="diffusion")
74 {
75 Cerr << "Reading and typing of the diffusion operator : " << finl;
76 is >> terme_diffusif;
77 return 1;
78 }
79 else
81}
82
84{
85 const Discret_Thermique& dis = ref_cast(Discret_Thermique,discretisation());
86 Cerr <<que_suis_je()<<" equation discretization" << finl;
87 dis.Fluctu_Temperature(schema_temps(),domaine_dis(),le_champ_Fluctu_Temperature);
88 champs_compris_.ajoute_champ(le_champ_Fluctu_Temperature);
90}
91
96
97/*! @brief surcharge de la methode d'Equation_base.
98 *
99 * renvoie le nombre d'operateurs.
100 *
101 */
106
107/*! @brief surcharge de la methode d'Equation_base.
108 *
109 * renvoie le ieme operateur.
110 *
111 */
113{
114 assert(i>=0);
115 assert(i<nombre_d_operateurs());
116
117 switch(i)
118 {
119 case 0:
120 {
121 return terme_diffusif;
122 }
123 case 1:
124 {
125 return terme_convectif;
126 }
127 default :
128 {
129 Cerr << "Error for Transport_Fluctuation_Temperature_W::operateur(int i)" << finl;
130 Cerr << "Transport_Fluctuation_Temperature_W has " << nombre_d_operateurs() <<" operators "<<finl;
131 Cerr << "and you are trying to access the " << i <<" th one."<< finl;
133 }
134 }
135 return terme_diffusif;
136}
137
138/*! @brief surcharge de la methode d'Equation_base.
139 *
140 * renvoie le ieme operateur.
141 *
142 */
144{
145 assert(i>=0);
146 assert(i<nombre_d_operateurs());
147
148 switch(i)
149 {
150 case 0:
151 {
152 return terme_diffusif;
153 }
154 case 1:
155 {
156 return terme_convectif;
157 }
158 default :
159 {
160 Cerr << "Error for Transport_Fluctuation_Temperature_W::operateur(int i)" << finl;
161 Cerr << "Transport_Fluctuation_Temperature_W has " << nombre_d_operateurs() <<" operators "<<finl;
162 Cerr << "and you are trying to access the " << i <<" th one."<< finl;
164 }
165 }
166 return terme_diffusif;
167}
168
169/*! @brief association entre Transport_Fluctuation_Temperature_W et Milieu_base.
170 *
171 * affecte le_Milieu_base.
172 *
173 */
175{
176 le_fluide = ref_cast(Fluide_base, un_milieu) ;
177}
178
180{
181 if(!le_fluide)
182 {
183 Cerr << "No fluid has been associated to"
184 << "Transport_Fluctuation_Temperature_W equation." << finl;
186 }
187 return le_fluide.valeur();
188}
189
191{
192 if(!le_fluide)
193 {
194 Cerr << "No fluid has been associated to"
195 << "Transport_Fluctuation_Temperature_W equation." << finl;
197 }
198 return le_fluide.valeur();
199}
200
202{
203 static Motcle domaine = "Thermique";
204 return domaine;
205}
206
217
219{
220 // Cerr << "Controler grandeur dans Transport_Fluctuation_Temperature_W" << finl;
221 static const double LIM = 1.e-10;
222 DoubleTab& fluctuation = le_champ_Fluctu_Temperature->valeurs();
223 int size=fluctuation.dimension(0);
224 for (int n=0; n<size; n++)
225 {
226 //Cerr << "t2 = " << fluctuation(n,0) << finl;
227 //Cerr << "epst = " << fluctuation(n,1) << finl;
228
229 if ( fluctuation(n,0) <= LIM)
230 fluctuation(n,0) = 0.;
231 if ( fluctuation(n,1) <= LIM)
232 fluctuation(n,1)= 0.;
233 }
234 return 1;
235 /*
236 static const double LIM = 1.e+2;
237 DoubleTab& fluctuation = le_champ_Fluctu_Temperature.valeurs();
238 int size=fluctuation.dimension(0);
239 for (int n=0; n<size; n++) {
240 if ( (fluctuation(n,0) >= LIM) || (fluctuation(n,0) <= -LIM))
241 fluctuation(n,0) = 1.e-3;
242 if ( (fluctuation(n,1) >= LIM) || (fluctuation(n,1) <= -LIM))
243 fluctuation(n,1)= 1.e-3;
244 }
245 return 1;
246 */
247
248
249}
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 Fluctu_Temperature(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 void completer()
Completes the construction (initialization) of objects associated with the equation.
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
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 Operateur & operateur(int) const override
surcharge de la methode d'Equation_base.
void completer() override
Completes the construction (initialization) of objects associated with the equation.
const Motcle & domaine_application() const override
Returns "indeterminate" Navier_Stokes_standard for example overrides this method.
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 associer_milieu_base(const Milieu_base &) override
association entre Transport_Fluctuation_Temperature_W et Milieu_base.
void associer_modele_turbulence(const Modele_turbulence_scal_Fluctuation_Temperature_W &)
void discretiser() override
Discretizes the equation.