TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Transport_turbulent_SGDH.cpp
1/****************************************************************************
2* Copyright (c) 2026, 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.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, "Transport_turbulent_SGDH|Transport_turbulent_isotrope", Transport_turbulent_base);
24// XD type_diffusion_turbulente_multiphase_SGDH type_diffusion_turbulente_multiphase_deriv SGDH BRACE not_set
25
27{
28 return os;
29}
30
32{
33 Param param(que_suis_je());
34 double Pr_t = -1;
35 param.ajouter("Pr_t|Prandtl_turbulent|Schmitt_turbulent", &Pr_t); // XD attr Pr_t floattant Prandtl_turbulent OPT
36 // XD_CONT not_set
37 param.ajouter("sigma|sigma_turbulent", &sigma_); // XD_ADD_P floattant
38 // XD_CONT not_set
39 param.ajouter("no_alpha", &no_alpha_); // XD_ADD_P flag
40 // XD_CONT not_set
41 param.ajouter("gas_turb", &gas_turb_); // XD_ADD_P flag
42 // XD_CONT not_set
43 param.lire_avec_accolades_depuis(is);
44 if (Pr_t > 0 && sigma_ != 1) Process::exit(que_suis_je() + ": cannot specify both Pr_t and sigma!");
45 if (Pr_t > 0) sigma_ = 1. / Pr_t;
46 return is;
47}
48
49// Modifier_nu modifie mu : alpha et rho font partie du terme
51{
52 const DoubleTab& mu0 = eq.diffusivite_pour_transport().passe(),
53 &nu0 = eq.diffusivite_pour_pas_de_temps().passe(), //viscosites moleculaires
54 *alp = (sub_type(Pb_Multiphase, pb_.valeur()) && !no_alpha_) ? &pb_->get_champ("alpha").passe() : nullptr; //produit par alpha si Pb_Multiphase
55 const int cnu = nu0.dimension(0) == 1, cmu = mu0.dimension(0) == 1;
56 int i, nl = nu.dimension(0), n, N = nu.dimension(1), d, D = dimension;
57 //viscosite cinematique turbulente
58 DoubleTrav nu_t(nl, N);
59 visc_turb.eddy_viscosity(nu_t);
60 //formule pour passer de nu a mu : mu0 * sigma_ * nu_t / nu0
61 if (nu.nb_dim() == 2)
62 for (i = 0; i < nl; i++)
63 {
64 for (n = 0; n < 1; n++) //isotrope
65 nu(i, n) += (alp ? (*alp)(i, n) : 1) * mu0(!cmu * i, n) * sigma_ * nu_t(i, n) / nu0(!cnu * i, n);
66 if (gas_turb_)
67 for (n = 1; n < N; n++) //isotrope
68 nu(i, n) += (alp ? (*alp)(i, n) : 1) * mu0(!cmu * i, n) * sigma_ / nu0(!cnu * i, n) * nu_t(i, 0.) * std::min((*alp)(i,n)*10, 1.) ;
69 }
70 else if (nu.nb_dim() == 3)
71 for (i = 0; i < nl; i++)
72 for (n = 0; n < N; n++)
73 for (d = 0; d < D; d++) //anisotrope diagonal
74 nu(i, n, d) += (alp ? (*alp)(i, n) : 1) * mu0(!cmu * i, n) * sigma_ * nu_t(i, n) / nu0(!cnu * i, n);
75 else for (i = 0; i < nl; i++)
76 for (n = 0; n < N; n++)
77 for (d = 0; d < D; d++) //anisotrope complet
78 nu(i, n, d, d) += (alp ? (*alp)(i, n) : 1) * mu0(!cmu * i, n) * sigma_ * nu_t(i, n) / nu0(!cnu * i, n);
79}
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 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
classe Pb_Multiphase Cette classe represente un probleme de thermohydraulique multiphase de type "3*N...
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
int nb_dim() const
Definition TRUSTTab.h:199
_SIZE_ dimension(int d) const
Definition TRUSTTab.tpp:133
classe Transport_turbulent_SGDH 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...
virtual void eddy_viscosity(DoubleTab &nu_t) const =0