TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Transport_turbulent_SGDH_WIT.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 <Transport_turbulent_SGDH_WIT.h>
17#include <Param.h>
18#include <Probleme_base.h>
19
20#include <Pb_Multiphase.h>
21#include <TRUSTTrav.h>
22
23Implemente_instanciable(Transport_turbulent_SGDH_WIT, "Transport_turbulent_SGDH_WIT", Transport_turbulent_base);
24
26{
27 return os;
28}
29
31{
32 Param param(que_suis_je());
33 param.ajouter("Aspect_ratio", &gamma_); // rapport d'aspet des bulles
34 param.ajouter("Influence_area", &delta_); // paramètre modèle d'Alméras 2014 (taille du sillage)
35 param.ajouter("C_s", &C_s_); // paramètre modèle d'Alméras 2014
36 param.lire_avec_accolades_depuis(is);
37 return is;
38}
39
40// Modifier_nu modifie mu : alpha et rho font partie du terme
42 const Viscosite_turbulente_base& visc_turb,
43 DoubleTab& nu) const
44{
45 // Cette methode calcule la diffusivité nu de k_WIT avec nu = 2/3 * delta^(-3) * d_bulles / (gamma^(2/3) * alpha * ur) (voir Alméras 2014)
46 const DoubleTab& mu0 = eq.diffusivite_pour_transport().passe();
47 const DoubleTab& nu0 = eq.diffusivite_pour_pas_de_temps().passe(); //viscosites moleculaires
48 const DoubleTab& alp = pb_->get_champ("alpha").passe();
49 const DoubleTab& diam = pb_->get_champ("diametre_bulles").valeurs();
50 const DoubleTab& tab_u = pb_->get_champ("vitesse").passe();
51
52 const int nl = nu.dimension(0);
53 const int N = alp.dimension(1);
54 const int D = dimension;
55
56 // Calcul de la vitesse relative
57 DoubleTrav Rij(0, N, D, D);
59
60 ConstDoubleTab_parts p_u(tab_u); //en PolyMAC_MPFA, tab_u contient (nf.u) aux faces, puis (u_i) aux elements
61 int i_part = -1;
62 for (int i = 0; i < p_u.size(); i++)
63 if (p_u[i].get_md_vector() == Rij.get_md_vector())
64 i_part = i; //on cherche une partie ayant le meme support
65 if (i_part < 0)
66 Process::exit("Transport_turbulent_SGDH_WIT : inconsistency between velocity and Rij!");
67
68 const DoubleTab& u = p_u[i_part]; //le bon tableau
69 DoubleTrav u_r(u.dimension(0), 1);
70 for (int i = 0; i < u_r.dimension(0); i++)
71 {
72 for (int d = 0; d < D; d++)
73 u_r(i, 0) += (u(i, d, 1) - u(i, d, 0))*(u(i, d, 1) - u(i, d, 0)); // relative speed = gas speed - liquid speed
74 u_r(i, 0) = std::sqrt(u_r(i, 0));
75 }
76
77 // formule pour passer de nu a mu : mu0 / nu0 * C_s_ * temps_carac
78 for (int i = 0; i < nl; i++)
79 {
80 const double tmp1 = 1./(delta_*delta_*delta_)*diam(i, 1);
81 const double tmp2 = pow(gamma_, 2./3.)*alp(i, 1)*u_r(i,0);
82 const double temps_carac = (u_r(i, 0) != 0) ? 2./3. * tmp1 / tmp2 : 0; // si u_r=0 alors pas de WIT donc pas de diffusion du WIT
83 nu(i, 0) = mu0(i, 0) / nu0(i, 0) * C_s_ * temps_carac ; // ici mu0/nu0 = 1 car l'inconnue de l'équation est k_WIT (voir Energie_cinetique_turbulente_WIT.cpp)
84 }
85}
virtual DoubleTab & passe(int i=1)
Definition Champ_Proto.h:50
classe Convection_Diffusion_std Cette classe est la base des equations modelisant le transport
virtual const Champ_Don_base & diffusivite_pour_transport() const
virtual const Champ_base & diffusivite_pour_pas_de_temps() const
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
static void creer_tableau_distribue(const MD_Vector &, Array_base &, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)
transforme v en un tableau parallele ayant la structure md.
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
virtual const MD_Vector & get_md_vector() const
Definition TRUSTVect.h:123
classe Transport_turbulent_SGDH_WIT Transport turbulent de type SGDH:
void modifier_mu(const Convection_Diffusion_std &eq, const Viscosite_turbulente_base &visc_turb, DoubleTab &nu) const override
classe Transport_turbulent_base correlations decrivant l'effet de la turbulence dans une autre equati...
classe Viscosite_turbulente_base correlations de viscosite turbulente decrivant le tenseur de Reynold...