TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Op_Diff_Turbulent_PolyMAC_MPFA_Elem.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 <Op_Diff_Turbulent_PolyMAC_MPFA_Elem.h>
17#include <Op_Diff_Turbulent_PolyMAC_MPFA_Face.h>
18#include <Probleme_base.h>
19
20Implemente_instanciable( Op_Diff_Turbulent_PolyMAC_MPFA_Elem, "Op_Diff_Turbulent_PolyMAC_MPFA_Elem|Op_Diff_Turbulente_PolyMAC_MPFA_Elem", Op_Diff_PolyMAC_MPFA_Elem );
21
23
25{
26 //lecture de la correlation de diffusivite turbulente
27 Correlation_base::typer_lire_correlation(corr_, equation().probleme(), "transport_turbulent", is);
30 return is;
31}
32
33void Op_Diff_Turbulent_PolyMAC_MPFA_Elem::get_noms_champs_postraitables(Noms& nom,Option opt) const
34{
37}
38
39void Op_Diff_Turbulent_PolyMAC_MPFA_Elem::creer_champ(const Motcle& motlu)
40{
43}
44
45void Op_Diff_Turbulent_PolyMAC_MPFA_Elem::mettre_a_jour(double temps)
46{
49}
50
52{
55 nu_constant_ = 0; // if pb_hydraulique with mu champ_uniforme : fgrad is not the same!
56}
57
58void Op_Diff_Turbulent_PolyMAC_MPFA_Elem::modifier_mu(DoubleTab& mu) const
59{
60 if (!corr_) return; //rien a faire
61
62 const Operateur_base& op_qdm = equation().probleme().equation(0).operateur(0).l_op_base();
63 if (!sub_type(Op_Diff_Turbulent_PolyMAC_MPFA_Face, op_qdm))
64 {
65 Cerr << "Error in " << que_suis_je() << ": no turbulent momentum diffusion found!" << finl;
67 }
68
69 const Correlation_base& corr_visc_qdm = ref_cast(Op_Diff_Turbulent_PolyMAC_MPFA_Face, op_qdm).correlation();
70 if (!corr_ || !sub_type(Viscosite_turbulente_base, corr_visc_qdm))
71 {
72 Cerr << "Error in " << que_suis_je() << ": no turbulent viscosity correlation found!" << finl;
74 }
75
76 // on calcule d_t_
77 DoubleTab& diff_turb = ref_cast_non_const(DoubleTab, nu_ou_lambda_turb_);
78 assert (diff_turb.dimension_tot(0) == mu.dimension_tot(0) && diff_turb.line_size() == mu.line_size());
79 diff_turb = 0.; // XXX : pour postraitement et pour n'a pas avoir la partie laminaire
80
81 for (int i = 0; i < diff_turb.dimension_tot(0); i++)
82 for (int j = 0; j < diff_turb.line_size(); j++)
83 diff_turb(i,j) -= mu(i,j);
84
85 // remplissage par la correlation : ICI c'est LAMBDA_T ET PAS ALPHA_T => W/mK et pas m2/s
86 ref_cast(Transport_turbulent_base, corr_.valeur()).modifier_mu(ref_cast(Convection_Diffusion_std, equation()),
87 ref_cast(Viscosite_turbulente_base, corr_visc_qdm),
88 mu);
89
91
92 for (int i = 0; i < diff_turb.dimension_tot(0); i++)
93 for (int j = 0; j < diff_turb.line_size(); j++)
94 diff_turb(i,j) += mu(i,j);
95}
virtual void creer_champ(const Motcle &motlu)=0
virtual void get_noms_champs_postraitables(Noms &nom, Option opt=NONE) const =0
static void typer_lire_correlation(OWN_PTR(Correlation_base)&, const Probleme_base &, const Nom &, Entree &)
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
Probleme_base & probleme()
Renvoie le probleme associe a l'equation.
virtual const Operateur & operateur(int) const =0
const Equation_base & equation() const
Renvoie la reference sur l'equation pointe par MorEqn::mon_equation.
Definition MorEqn.h:62
Une chaine de caractere (Nom) en majuscules.
Definition Motcle.h:26
Un tableau de chaine de caracteres (VECT(Nom)).
Definition Noms.h:26
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
void mettre_a_jour(double t) override
DOES NOTHING - to override in derived classes.
void completer() override
Associe l'operateur au domaine_dis, le domaine_Cl_dis, et a l'inconnue de son equation.
: class Op_Diff_Turbulent_PolyMAC_MPFA_Elem
void associer_proto(const Probleme_base &, Champs_compris &)
void mettre_a_jour_proto_elem(const double temps)
void creer_champ_proto_elem(const Motcle &motlu)
void completer_proto_elem(const Operateur_Diff_base &op)
void get_noms_champs_postraitables_proto(const Nom &, Noms &nom, Option opt) const
Champs_compris champs_compris_
virtual void completer()
Associe l'operateur au domaine_dis, le domaine_Cl_dis, et a l'inconnue de son equation.
virtual Operateur_base & l_op_base()=0
virtual const Equation_base & equation(int) const =0
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_tot(int) const override
Definition TRUSTTab.tpp:160
int line_size() const
Definition TRUSTVect.tpp:67
virtual void echange_espace_virtuel(IsExchangeBlocking exchange_type=IsExchangeBlocking::DefaultBlocking, const std::string kernel_name="noname")