TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Viscosite_turbulente_WIF.cpp
1/****************************************************************************
2* Copyright (c) 2021, 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 <Viscosite_turbulente_WIF.h>
17#include <Param.h>
18#include <Probleme_base.h>
19#include <Champ_base.h>
20#include <TRUSTTab_parts.h>
21#include <TRUSTTrav.h>
22
23Implemente_instanciable(Viscosite_turbulente_WIF, "Viscosite_turbulente_WIF", Viscosite_turbulente_base);
24
26{
27 return os;
28}
29
31{
32 Param param(que_suis_je());
33 param.ajouter("limiter|limiteur", &limiter_);
34 param.ajouter("rapport_aspect_moyen|average_aspect_ratio", &gamma_);
35 param.lire_avec_accolades_depuis(is);
36 return is;
37}
38
40{
41 nu_t = 0; // no eddy viscosity here ; use ggdh for diffusion
42}
43
44void Viscosite_turbulente_WIF::reynolds_stress(DoubleTab& R_ij) const // Renvoie <u_i'u_j'>
45{
46 const DoubleTab& tab_alpha = pb_->get_champ("alpha").passe();
47 const int D = dimension;
48 const int N = tab_alpha.dimension(1);
49
50 if (N != 2)
51 Process::exit("Visocisty_turbulente_WIF is only coded for 2 phases");
52 if (D != 3)
53 Process::exit("Visocisty_turbulente_WIF is only coded for 3 dimensions");
54
55 const DoubleTab& tab_u = pb_->get_champ("vitesse").passe();
56 ConstDoubleTab_parts p_u(tab_u); //en PolyMAC_MPFA, tab_u contient (nf.u) aux faces, puis (u_i) aux elements
57 int i_part {-1};
58 for (int i = 0; i < p_u.size(); i++)
59 if (p_u[i].get_md_vector() == R_ij.get_md_vector())
60 i_part = i; //on cherche une partie ayant le meme support
61 if (i_part < 0)
62 Process::exit("Viscosite_turbulente_WIF : inconsistency between velocity and Rij!");
63
64 const DoubleTab& u = p_u[i_part]; //le bon tableau
65 DoubleTrav u_r(u.dimension(0), D);
66 DoubleTrav u_r_carre(u.dimension(0), 1);
67 for (int i = 0; i < R_ij.dimension(0); i++)
68 for (int d = 0; d < D; d++)
69 {
70 u_r(i, d) = u(i, d, 1) - u(i, d, 0); // relative speed = gas speed - liquid speed
71 u_r_carre(i, 0) += u_r(i, d)*u_r(i, d);
72 }
73
74 for (int i = 0; i < R_ij.dimension(0); i++)
75 for (int d = 0; d < D; d++)
76 for (int db = 0; db < D; db++)
77 {
78 R_ij(i, 1, d, db) = 0 ; // No WIF for gas phase
79 R_ij(i, 0, d, db) = tab_alpha(i, 1) * (3.0/20.0 * u_r_carre(i, 0) * (db==d ? 1 : 0) + (1.0/20.0 + 1.5*gamma_*gamma_*gamma_*0.25) * u_r(i, d)*u_r(i, db));
80 }
81}
82
83void Viscosite_turbulente_WIF::k_over_eps(DoubleTab& k_sur_eps) const
84{
85 k_sur_eps = 0;
86}
87
88void Viscosite_turbulente_WIF::eps(DoubleTab& eps_) const
89{
90 eps_ = 0;
91}
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
static int dimension
Definition Objet_U.h:99
const Nom & que_suis_je() const
renvoie la chaine identifiant la classe.
Definition Objet_U.cpp:104
virtual Entree & readOn(Entree &)
Lecture d'un Objet_U sur un flot d'entree Methode a surcharger.
Definition Objet_U.cpp:293
virtual Sortie & printOn(Sortie &) const
Ecriture de l'objet sur un flot de sortie Methode a surcharger.
Definition Objet_U.cpp:282
static void exit(int exit_code=-1)
Routine de sortie de TRUST dans une region Kokkos.
Definition Process.cpp:455
Classe de base des flux de sortie.
Definition Sortie.h:52
_SIZE_ dimension(int d) const
Definition TRUSTTab.tpp:133
classe Viscosite_turbulente_WIF Renvoie le tenseur de Reynolds pour une turbulence de bulles de type ...
void reynolds_stress(DoubleTab &R_ij) const override
void k_over_eps(DoubleTab &k_sur_eps) const override
void eddy_viscosity(DoubleTab &nu_t) const override
void eps(DoubleTab &eps) const override
classe Viscosite_turbulente_base correlations de viscosite turbulente decrivant le tenseur de Reynold...