TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Transport_turbulent_GGDH.cpp
1/****************************************************************************
2* Copyright (c) 2024, 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_GGDH.h>
17#include <Param.h>
18#include <Probleme_base.h>
19
20#include <Pb_Multiphase.h>
21#include <TRUSTTrav.h>
22#include <MD_Vector_tools.h>
23
24Implemente_instanciable(Transport_turbulent_GGDH, "Transport_turbulent_GGDH|Transport_turbulent_anisotrope", Transport_turbulent_base);
25
27{
28 return os;
29}
30
32{
33 Param param(que_suis_je());
34 param.ajouter("C_s", &C_s);
35 param.lire_avec_accolades_depuis(is);
36
37 if ((C_s <0) && (dimension == 2)) C_s = 1;
38 if ((C_s <0) && (dimension == 3)) C_s = 1.5;
39
40 return is;
41}
42
44{
45 const DoubleTab& mu0 = eq.diffusivite_pour_transport().passe(), &nu0 = eq.diffusivite_pour_pas_de_temps().passe(), //molecular viscosities
46 *alp = sub_type(Pb_Multiphase, pb_.valeur()) ? &pb_->get_champ("alpha").passe() : nullptr; //multiplied by alpha if Pb_Multiphase
47 int i, nl = nu.dimension(0), n, N = nu.dimension(1), d, db, D = dimension;
48 //using turbulent viscosity: Reynolds stress tensor, factor k / eps
49 DoubleTrav Rij(0, N, D, D), k_sur_eps(0, N);
52 visc_turb.reynolds_stress(Rij), visc_turb.k_over_eps(k_sur_eps);
53 //formula to convert nu to mu: mu0 / nu0 * C_s * k / eps * <u'i u'_j>
54 for (i = 0; i < nl; i++)
55 for (n = 0; n < N; n++)
56 for (d = 0; d < D; d++)
57 for (db = 0; db < D; db++)
58 nu(i, n, d, db) += (alp ? (*alp)(i, n) : 1) * mu0(i, n) / nu0(i, n) * C_s * std::max(k_sur_eps(i, n) * Rij(i, n, d, db), visc_turb.limiteur() * nu(i, n, d, db));
59}
virtual DoubleTab & passe(int i=1)
Definition Champ_Proto.h:50
Convection_Diffusion_std This class is the base for equations modelling the 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)
Transforms v into a parallel array having the structure md.
static int dimension
Definition Objet_U.h:94
const Nom & que_suis_je() const
Returns the string identifying the class.
Definition Objet_U.cpp:104
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
Multiphase thermohydraulics problem of type "3*N equations":
Base class for output streams.
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
Generalized Gradient Diffusion Hypothesis (GGDH) turbulent transport model:
virtual void modifier_mu(const Convection_Diffusion_std &eq, const Viscosite_turbulente_base &visc_turb, DoubleTab &nu) const override
Correlations describing the effect of turbulence in another equation (thermal, turbulent quantities,...
Turbulent viscosity correlations describing the Reynolds stress tensor R_{ij} = - <u'_i u'_j>.
virtual void reynolds_stress(DoubleTab &R_ij) const =0
virtual void k_over_eps(DoubleTab &k_sur_eps) const =0