TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Modele_Launder_Sharma_VDF.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 <Modele_Launder_Sharma_VDF.h>
17#include <Domaine_VDF.h>
18#include <Champ_Uniforme.h>
19
20Implemente_instanciable(Modele_Launder_Sharma_VDF,"Modele_Launder_Sharma_VDF",Modele_Jones_Launder_VDF);
21// XD Launder_Sharmma modele_fonction_bas_reynolds_base Launder_Sharma INHERITS_BRACE Model described in ' Launder, B.
22// XD_CONT E. and Sharma, B. I. (1974), Application of the Energy-Dissipation Model of Turbulence to the Calculation of
23// XD_CONT Flow Near a Spinning Disc, Letters in Heat and Mass Transfer, Vol. 1, No. 2, pp. 131-138.'
24
25
26
27///////////////////////////////////////////////////////////////
28// Implementation des fonctions de la classe
29///////////////////////////////////////////////////////////////
30// printOn et readOn
31
33{
35 return s;
36}
37
39{
41 return is;
42}
43
45{
46 return is;
47}
48
50 const Domaine_Cl_dis_base& domaine_Cl_dis)
51{
52 // const Domaine_VDF& le_dom = ref_cast(Domaine_VDF,domaine_dis);
53 // const Domaine_Cl_VDF& le_dom_Cl = ref_cast(Domaine_Cl_VDF,domaine_Cl_dis);
54}
55
56DoubleTab& Modele_Launder_Sharma_VDF::Calcul_Fmu( DoubleTab& Fmu,const Domaine_dis_base& domaine_dis,const Domaine_Cl_dis_base& domaine_Cl_dis,const DoubleTab& K_eps_Bas_Re,const Champ_Don_base& ch_visco ) const
57{
58 double visco=-1;
59 const DoubleTab& tab_visco=ch_visco.valeurs();
60 int is_visco_const=sub_type(Champ_Uniforme,ch_visco);
61 if (is_visco_const)
62 visco=tab_visco(0,0);
63 // Cerr << " dans Jones Sharma Calc Fmu " << finl;
64 const Domaine_VDF& le_dom = ref_cast(Domaine_VDF,domaine_dis);
65 Fmu = 0;
66 int nb_elem = le_dom.nb_elem();
67 double Re;
68 int elem;
69 for (elem=0; elem< nb_elem ; elem++)
70 {
71 if (!is_visco_const)
72 visco=tab_visco[elem];
73 if (visco>0)
74 {
75 Re = K_eps_Bas_Re(elem,0)*K_eps_Bas_Re(elem,0)/(K_eps_Bas_Re(elem,1)+DMINFLOAT)/visco;
76 //Fmu[elem] = exp(-3.4/((1.+Re/50.)*(1.+Re/50.)*(1+Re/50.)));
77 Fmu[elem] = exp(-3.4/((1.+Re/50.)*(1.+Re/50.)));
78 }
79 else
80 Fmu[elem]=1.;
81 }
82 //Fmu=1;
83// Cerr<<Fmu.mp_min_vect()<<" Fmu "<<Fmu.mp_max_vect()<<finl;
84
85
86 return Fmu;
87}
88/*
89 DoubleTab& Modele_Launder_Sharma_VDF::Calcul_Fmu( DoubleTab& Fmu,const Domaine_dis_base& domaine_dis,const DoubleTab& K_eps_Bas_Re,const DoubleTab& tab_visco ) const
90 {
91 // Cerr << " dans Jones Sharma Calc Fmu " << finl;
92 const Domaine_VDF& le_dom = ref_cast(Domaine_VDF,domaine_dis);
93 Fmu = 0;
94 int nb_elem = le_dom.nb_elem();
95 int elem;
96 DoubleTab Re(nb_elem);
97 for (elem=0; elem< nb_elem ; elem++) {
98 Re(elem) = (K_eps_Bas_Re(elem,0)*K_eps_Bas_Re(elem,0))/(tab_visco(elem)*K_eps_Bas_Re(elem,1));
99 Fmu[elem] = exp(-3.4/((1.+Re(elem)/50.)*(1.+Re(elem)/50.)));
100
101 }
102
103 return Fmu;
104 }
105*/
106
107
108
109DoubleTab& Modele_Launder_Sharma_VDF::Calcul_Fmu_BiK( DoubleTab& Fmu,const Domaine_dis_base& domaine_dis,const Domaine_Cl_dis_base& domaine_Cl_dis,const DoubleTab& K_Bas_Re,const DoubleTab& eps_Bas_Re,const Champ_Don_base& ch_visco ) const
110{
111 double visco=-1;
112 const DoubleTab& tab_visco=ch_visco.valeurs();
113 int is_visco_const=sub_type(Champ_Uniforme,ch_visco);
114 if (is_visco_const)
115 visco=tab_visco(0,0);
116 // Cerr << " dans Jones Sharma Calc Fmu " << finl;
117 const Domaine_VDF& le_dom = ref_cast(Domaine_VDF,domaine_dis);
118 Fmu = 0;
119 int nb_elem = le_dom.nb_elem();
120 double Re;
121 int elem;
122 for (elem=0; elem< nb_elem ; elem++)
123 {
124 if (!is_visco_const)
125 visco=tab_visco[elem];
126 if (visco>0)
127 {
128 Re = K_Bas_Re(elem)*K_Bas_Re(elem)/(eps_Bas_Re(elem)+DMINFLOAT)/visco;
129 //Fmu[elem] = exp(-3.4/((1.+Re/50.)*(1.+Re/50.)*(1+Re/50.)));
130 Fmu[elem] = exp(-3.4/((1.+Re/50.)*(1.+Re/50.)));
131 }
132 else
133 Fmu[elem]=1.;
134 }
135 //Fmu=1;
136 Cerr<<Fmu.mp_min_vect()<<" Fmu "<<Fmu.mp_max_vect()<<finl;
137
138
139 return Fmu;
140}
141
class Champ_Don_base base class of Given Fields (not calculated)
DoubleTab & valeurs() override
Overrides Champ_base::valeurs() Returns the array of values.
Champ_Uniforme Represents a field that is constant in space and time.
class Domaine_Cl_dis_base Domaine_Cl_dis_base objects represent discretized boundary conditions
class Domaine_VDF
Definition Domaine_VDF.h:61
class Domaine_dis_base This class is the base of the hierarchy of discretized domains.
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
Entree & lire(const Motcle &, Entree &)
DoubleTab & Calcul_Fmu_BiK(DoubleTab &, const Domaine_dis_base &, const Domaine_Cl_dis_base &, const DoubleTab &, const DoubleTab &, const Champ_Don_base &) const override
DoubleTab & Calcul_Fmu(DoubleTab &, const Domaine_dis_base &, const Domaine_Cl_dis_base &, const DoubleTab &, const Champ_Don_base &) const override
void associer(const Domaine_dis_base &, const Domaine_Cl_dis_base &) override
A character string (Nom) in uppercase.
Definition Motcle.h:26
friend class Entree
Definition Objet_U.h:71
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
Base class for output streams.
Definition Sortie.h:52
_TYPE_ mp_max_vect(Mp_vect_options opt=VECT_REAL_ITEMS) const
Definition TRUSTVect.h:158
_TYPE_ mp_min_vect(Mp_vect_options opt=VECT_REAL_ITEMS) const
Definition TRUSTVect.h:159