TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Transport_K_Eps_Bas_Reynolds.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_K_Eps_Bas_Reynolds.h>
17#include <Modele_turbulence_hyd_K_Eps_Bas_Reynolds.h>
18#include <Les_Pb_Turb.h>
19#include <Modele_turbulence_scal_Fluctuation_Temperature_W.h>
20#include <Param.h>
21#include <Fluide_base.h>
22
23Implemente_instanciable(Transport_K_Eps_Bas_Reynolds,"Transport_K_Epsilon_Bas_Reynolds",Transport_K_Eps_non_std);
24
25// printOn et readOn
26
28{
29 return s << que_suis_je() << "\n";
30}
31
33{
34 // Lecture des attributs de l'equation
36 return is;
37}
38
40{
41 // Ajout automatique du terme source
42 if (les_sources.est_vide())
43 {
44 Source t;
45 Source& so=les_sources.add(t);
46 const Probleme_base& pb = probleme();
47 Cerr << "Construction and typing for the source term of the Transport_K_Eps_Bas_Reynolds equation." << finl;
48 if (sub_type(Pb_Hydraulique_Turbulent,pb) || sub_type(Pb_Thermohydraulique_Turbulent_QC,pb))
49 {
50 Nom typ = "Source_Transport_K_Eps_Bas_Reynolds";
51 so.typer(typ,*this);
52 }
53 else if (sub_type(Pb_Thermohydraulique_Turbulent,pb))
54 {
55 const Equation_base& eqTemp = probleme().equation(1);
56 const Modele_turbulence_scal_base& le_mod_turb_th = ref_cast(Modele_turbulence_scal_base,eqTemp.get_modele(TURBULENCE).valeur());
57 if ( sub_type(Modele_turbulence_scal_Fluctuation_Temperature_W,le_mod_turb_th) )
58 {
59 Nom typ = "Source_Transport_K_Eps_Bas_Reynolds_anisotherme_W";
60 so.typer(typ,*this);
61 }
62 else
63 {
64 Nom typ = "Source_Transport_K_Eps_Bas_Reynolds_anisotherme";
65 so.typer(typ,*this);
66 }
67 // Cerr << "pb = " << probleme().que_suis_je() << finl;
68 // Cerr << "Eq de temp = " << eqTemp.que_suis_je() << finl;
69 // Cerr << "modele turb en temperature = " << eqTemp.modele_turbulence() << finl;
70
71 }
72 else if (sub_type(Pb_Hydraulique_Concentration_Turbulent,pb))
73 {
74 Nom typ = "Source_Transport_K_Eps_Bas_Reynolds_aniso_concen";
75 so.typer(typ,*this);
76 }
78 {
79 Nom typ = "Source_Transport_K_Eps_Bas_Reynolds_aniso_therm_concen";
80 so.typer(typ,*this);
81 }
82 else
83 {
84 Cerr<<"The equation "<<que_suis_je()<<" cannot be associated to a problem "<<pb.que_suis_je()<<finl;
85 abort();
86 }
87 so->associer_eqn(*this);
88 }
90}
91
93{
94 const Equation_base& eqn_hydr = modele.equation();
95 associer(eqn_hydr);
96 associer_milieu_base(eqn_hydr.milieu());
97 associer_vitesse(eqn_hydr.inconnue());
98 mon_modele = ref_cast(Modele_turbulence_hyd_K_Eps_Bas_Reynolds,modele);
99 RefObjU le_modele;
100 le_modele = mon_modele.valeur();
101 liste_modeles_.add_if_not(le_modele);
102 discretiser();
103}
104
106{
107 le_fluide = ref_cast(Fluide_base, un_milieu);
108}
109
111{
112 static Motcle domaine = "Transport_Keps_Bas_Re";
113 return domaine;
114}
115
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 const RefObjU & get_modele(Type_modele type) const
virtual const Champ_Inc_base & inconnue() const =0
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.
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
Classe Modele_turbulence_hyd_2_eq_base Classe de base des modeles de type RANS a deux equations.
class Modele_turbulence_hyd_K_Eps_Bas_Reynolds
Equation_base & equation()
Returns the equation associated with the turbulence model.
Base class for scalar turbulence models coupled to a Navier-Stokes convection-diffusion equation.
A character string (Nom) in uppercase.
Definition Motcle.h:26
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31
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
Turbulent hydraulics problem with species transport (one or more concentrations).
Turbulent hydraulics problem.
Turbulent thermohydraulics problem with species transport (one or more concentrations).
Turbulent thermohydraulics problem for a quasi-compressible fluid.
Turbulent thermohydraulics problem.
class Probleme_base It is a Probleme_U that is not a coupling.
virtual const Equation_base & equation(int) const =0
static void abort()
Abort routine for TRUST on a fatal error.
Definition Process.cpp:573
Base class for output streams.
Definition Sortie.h:52
Source Generic class of the source term hierarchy. A Source object can.
Definition Source.h:33
void typer(const Nom &, const Equation_base &)
Types the source by computing the required type name from the provided parameters.
Definition Source.cpp:52
const Objet_U & valeur() const
Definition TRUST_Ref.h:134
void associer_vitesse(const Champ_base &)
void associer(const Equation_base &)
void associer_milieu_base(const Milieu_base &) override
Associe un milieu physique a l'equation.
void associer_modele_turbulence(const Modele_turbulence_hyd_2_eq_base &) override
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.
void discretiser() override
Discretizes the equation.
Classe Transport_K_Eps_non_std Classe de base pour les equations de transport.