TrioCFD 1.9.9_beta
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 //read the turbulent diffusivity correlation
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; //nothing to do
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 // compute 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: for post-processing and to exclude the laminar part
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 // fill from the correlation: HERE this is LAMBDA_T NOT ALPHA_T => W/mK not 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()
Returns the problem associated with the equation.
virtual const Operateur & operateur(int) const =0
const Equation_base & equation() const
Returns the reference to the equation pointed to by MorEqn::mon_equation.
Definition MorEqn.h:62
A character string (Nom) in uppercase.
Definition Motcle.h:26
An array of character strings (VECT(Nom)).
Definition Noms.h:26
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
void mettre_a_jour(double t) override
DOES NOTHING - to override in derived classes.
void completer() override
Associates the operator with the domaine_dis, the domaine_Cl_dis, and the unknown of its 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()
Associates the operator with the domaine_dis, the domaine_Cl_dis, and the unknown of its equation.
virtual Operateur_base & l_op_base()=0
virtual const Equation_base & equation(int) const =0
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Definition Process.cpp:466
Base class for output streams.
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")