TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Viscosite_turbulente_Smagorinsky.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 <Viscosite_turbulente_Smagorinsky.h>
17#include <Pb_Multiphase.h>
18#include <Domaine_VF.h>
19#include <Param.h>
20
21Implemente_instanciable(Viscosite_turbulente_Smagorinsky, "Viscosite_turbulente_Smago", Viscosite_turbulente_LES_base);
22// XD type_diffusion_turbulente_multiphase_smago type_diffusion_turbulente_multiphase_deriv smago BRACE LES Smagorinsky
23// XD_CONT type.
24
26
28{
29 mod_const_ = 0.18; // par default
30 Param param(que_suis_je());
31 param.ajouter("cs", &mod_const_); // XD_ADD_P floattant
32 // XD_CONT Smagorinsky's model constant. By default it is se to 0.18.
33 param.lire_avec_accolades_depuis(is);
34
35 if (mod_const_ < 0.) Process::exit("The smagorinsky's constant must be positive !");
36 else Cerr << "LES Smagorinsky model used with constant Cs = " << mod_const_ << finl;
37
38 pb_->creer_champ("taux_cisaillement"); // On en aura besoin pour le calcul de la viscosite turbulente
39
41}
42
44{
45 const DoubleTab& tc = pb_->get_champ("taux_cisaillement").valeurs();
46 assert(nu_t.dimension(0) == tc.dimension(0) && tc.dimension(1) <= nu_t.dimension(1));
47 //on met 0 pour les composantes au-dela de k.dimension(1) (ex. : vapeur dans Pb_Multiphase)
48 for (int i = 0; i < nu_t.dimension(0); i++)
49 for (int n = 0; n < nu_t.dimension(1); n++)
50 nu_t(i, n) = n < tc.dimension(1) ? mod_const_ * mod_const_ * l_(i) * l_(i) * tc(i, n) : 0; // XXX attention l_ resize comme nb_elem pas tot ...
51
53}
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
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 void echange_espace_virtuel(IsExchangeBlocking exchange_type=IsExchangeBlocking::DefaultBlocking, const std::string kernel_name="noname")
classe Viscosite_turbulente_Smagorinsky
void eddy_viscosity(DoubleTab &nu_t) const override