TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Transport_K_ou_Eps_non_std.cpp
1/****************************************************************************
2* Copyright (c) 2015 - 2016, 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_ou_Eps_non_std.h>
17#include <Fluide_base.h>
18#include <Probleme_base.h>
19#include <Param.h>
20
21Implemente_base(Transport_K_ou_Eps_non_std,"Transport_K_ou_Eps_non_std",Transport_K_ou_Eps_base);
22
23/*! @brief
24 *
25 * @param (Sortie& is) un flot de sortie
26 * @return (Sortie&) le flot de sortie modifie
27 */
29{
30 return is << que_suis_je() << "\n";
31
32}
33
34/*! @brief Simple appel a Equation_base::readOn(Entree&)
35 *
36 * @param (Entree& is) un flot d'entree
37 * @return (Entree&) le flot d'entree modifie
38 */
40{
42 return is;
43}
44
49
51{
52 if (mot=="diffusion")
53 {
54 Cerr << "Reading and typing of the diffusion operator : " << finl;
55 terme_diffusif.associer_diffusivite(diffusivite_pour_transport());
57 return 1;
58 }
59 else if (mot=="convection")
60 {
61 Cerr << "Reading and typing of the convection operator : " << finl;
62 const Champ_base& vit_transp = vitesse_pour_transport();
63 associer_vitesse(vit_transp);
64 terme_convectif.associer_vitesse(vit_transp);
65 is >> terme_convectif;
66 return 1;
67 }
68 else
70}
71
72// Retour: int
73// Signification: le nombre d'operateurs de l'equation
74// Contraintes: toujours egal a 2
76{
77 return 2;
78}
79
80/*! @brief renvoie terme_diffusif si i=0 renvoie terme_convectif si i=1
81 *
82 * exit si i>1
83 *
84 */
86{
87 switch(i)
88 {
89 case 0:
90 return terme_diffusif;
91 case 1:
92 return terme_convectif;
93 default :
94 Cerr << "Error for "<<que_suis_je()<<"::operateur("<<i<<") !! " << finl;
95 Cerr << que_suis_je()<<" has " << nombre_d_operateurs() <<" operators "<<finl;
96 Cerr << "and you are trying to access the " << i <<" th one."<< finl;
98 }
99 // Pour les compilos!!
100 return terme_diffusif;
101}
102
103/*! @brief renvoie terme_diffusif si i=0 renvoie terme_convectif si i=1
104 *
105 * exit si i>1
106 *
107 */
109{
110 switch(i)
111 {
112 case 0:
113 return terme_diffusif;
114 case 1:
115 return terme_convectif;
116 default :
117 Cerr << "Error for "<<que_suis_je()<<"::operateur("<<i<<") !! " << finl;
118 Cerr << que_suis_je()<<" has " << nombre_d_operateurs() <<" operators "<<finl;
119 Cerr << "and you are trying to access the " << i <<" th one."<< finl;
121 }
122 // Pour les compilos!!
123 return terme_diffusif;
124}
125
127{
128 const Fluide_base& fluide_inc = ref_cast(Fluide_base,le_fluide.valeur());
129 return fluide_inc.viscosite_cinematique();
130}
131
133{
134 const Champ_base& vitesse_transportante = probleme().equation(0).inconnue();
135 return vitesse_transportante;
136}
class Champ_Don_base base class of Given Fields (not calculated)
class Champ_base This class is the base of the fields hierarchy.
Definition Champ_base.h:43
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
virtual const Champ_Inc_base & inconnue() const =0
Probleme_base & probleme()
Returns the problem associated with the equation.
int lire_motcle_non_standard(const Motcle &, Entree &) override
Reads non-simple-type parameters of an Objet_U from an input stream.
Base class for an incompressible fluid and its properties:
Definition Fluide_base.h:36
const Champ_Don_base & viscosite_cinematique() const
Definition Fluide_base.h:56
A character string (Nom) in uppercase.
Definition Motcle.h:26
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
virtual const Equation_base & equation(int) const =0
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
Operateur_Conv terme_convectif
void associer_vitesse(const Champ_base &)
Operateur_Diff terme_diffusif
Entree & lire_op_diff_turbulent(Entree &is)
Classe de base pour l'equation de transport des modeles k_Epsilon dans une approche ou K et Epsilon s...
void set_param(Param &param) const override
Classe Transport_K_ou_Eps_non_std Classe de base pour les equations de transport.
virtual const Champ_Don_base & diffusivite_pour_transport() const
int lire_motcle_non_standard(const Motcle &, Entree &) override
Reads non-simple-type parameters of an Objet_U from an input stream.
void set_param(Param &titi) const override
const Operateur & operateur(int) const override
renvoie terme_diffusif si i=0 renvoie terme_convectif si i=1
virtual const Champ_base & vitesse_pour_transport() const