TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Transport_K_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_Eps_non_std.h>
17#include <Fluide_base.h>
18#include <Probleme_base.h>
19#include <Param.h>
20
21
22// XD Transport_K_Eps_non_std Transport_K_Eps_base Transport_K_Eps_non_std BRACE Base Transport equation for non
23// XD_CONT standard k-epsilon models
24
25Implemente_base(Transport_K_Eps_non_std,"Transport_K_Eps_non_std",Transport_K_Eps_base);
26
27/*! @brief
28 *
29 * @param (Sortie& is) un flot de sortie
30 * @return (Sortie&) le flot de sortie modifie
31 */
33{
34 return is << que_suis_je() << "\n";
35
36}
37
38/*! @brief Simple appel a Equation_base::readOn(Entree&)
39 *
40 * @param (Entree& is) un flot d'entree
41 * @return (Entree&) le flot d'entree modifie
42 */
44{
46 return is;
47}
48
53
55{
56 if (mot=="diffusion")
57 {
58 Cerr << "Reading and typing of the diffusion operator : " << finl;
59 terme_diffusif.associer_diffusivite(diffusivite_pour_transport());
61 return 1;
62 }
63 else if (mot=="convection")
64 {
65 Cerr << "Reading and typing of the convection operator : " << finl;
66 const Champ_base& vit_transp = vitesse_pour_transport();
67 associer_vitesse(vit_transp);
68 terme_convectif.associer_vitesse(vit_transp);
69 is >> terme_convectif;
70 return 1;
71 }
72 else
74}
75
76// Retour: int
77// Signification: le nombre d'operateurs de l'equation
78// Contraintes: toujours egal a 2
80{
81 return 2;
82}
83
84/*! @brief renvoie terme_diffusif si i=0 renvoie terme_convectif si i=1
85 *
86 * exit si i>1
87 *
88 */
90{
91 switch(i)
92 {
93 case 0:
94 return terme_diffusif;
95 case 1:
96 return terme_convectif;
97 default :
98 Cerr << "Error for "<<que_suis_je()<<"::operateur("<<i<<") !! " << finl;
99 Cerr << que_suis_je()<<" has " << nombre_d_operateurs() <<" operators "<<finl;
100 Cerr << "and you are trying to access the " << i <<" th one."<< finl;
102 }
103 // Pour les compilos!!
104 return terme_diffusif;
105}
106
107/*! @brief renvoie terme_diffusif si i=0 renvoie terme_convectif si i=1
108 *
109 * exit si i>1
110 *
111 */
113{
114 switch(i)
115 {
116 case 0:
117 return terme_diffusif;
118 case 1:
119 return terme_convectif;
120 default :
121 Cerr << "Error for "<<que_suis_je()<<"::operateur("<<i<<") !! " << finl;
122 Cerr << que_suis_je()<<" has " << nombre_d_operateurs() <<" operators "<<finl;
123 Cerr << "and you are trying to access the " << i <<" th one."<< finl;
125 }
126 // Pour les compilos!!
127 return terme_diffusif;
128}
129
131{
132 const Fluide_base& fluide_inc = ref_cast(Fluide_base,le_fluide.valeur());
133 return fluide_inc.viscosite_cinematique();
134}
135
137{
138 const Champ_base& vitesse_transportante = probleme().equation(0).inconnue();
139 return vitesse_transportante;
140}
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 Transport_K_Eps_base Classe de base pour les equations.
virtual void set_param(Param &) const override
Classe Transport_K_Eps_non_std Classe de base pour les equations de transport.
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
virtual const Champ_Don_base & diffusivite_pour_transport() const
virtual const Champ_base & vitesse_pour_transport() const
int nombre_d_operateurs() const override
const Operateur & operateur(int) const override
renvoie terme_diffusif si i=0 renvoie terme_convectif si i=1