TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Op_Diff_Turbulent_PolyMAC_MPFA_Face.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_Face.h>
17#include <PolyMAC_MPFA_discretisation.h>
18#include <Op_Diff_PolyMAC_MPFA_Face.h>
19#include <Pb_Multiphase.h>
20
21Implemente_instanciable( Op_Diff_Turbulent_PolyMAC_MPFA_Face, "Op_Diff_Turbulent_PolyMAC_MPFA_Face|Op_Diff_Turbulente_PolyMAC_MPFA_Face", Op_Diff_PolyMAC_MPFA_Face );
22
24
26{
27 //lecture de la correlation de viscosite turbulente
28 Correlation_base::typer_lire_correlation(corr_, equation().probleme(), "viscosite_turbulente", is);
31 return is;
32}
33
39
45
47{
49 nu_constant_ = 0; // if pb_hydraulique with mu champ_uniforme : fgrad is not the same!
51}
52
58
67
69{
70 if (!corr_) return; //rien a faire
71 const DoubleTab& rho = equation().milieu().masse_volumique().passe(),
72 *alpha = sub_type(Pb_Multiphase, equation().probleme()) ? &ref_cast(Pb_Multiphase, equation().probleme()).equation_masse().inconnue().passe() : nullptr;
73 int i, nl = mu.dimension(0), n, N = equation().inconnue().valeurs().line_size(), cR = rho.dimension(0) == 1, d, D = dimension;
74 if (mu.nb_dim() == 2) //nu scalaire
75 for (i = 0; i < nl; i++)
76 for (n = 0; n < N; n++)
77 mu(i, n) += (alpha ? (*alpha)(i, n) * rho(!cR * i, n) : 1.0) * nu_ou_lambda_turb_(i, n);
78 else if (mu.nb_dim() == 3) //nu anisotrope diagonal
79 for (i = 0; i < nl; i++)
80 for (n = 0; n < N; n++)
81 for (d = 0; d < D; d++)
82 mu(i, n, d) += (alpha ? (*alpha)(i, n) * rho(!cR * i, n) : 1.0) * nu_ou_lambda_turb_(i, n);
83 else if (mu.nb_dim() == 4) //nu anisotrope complet
84 for (i = 0; i < nl; i++)
85 for (n = 0; n < N; n++)
86 for (d = 0; d < D; d++)
87 mu(i, n, d, d) += (alpha ? (*alpha)(i, n) * rho(!cR * i, n) : 1.0) * nu_ou_lambda_turb_(i, n);
88 else
89 abort();
90
92}
DoubleTab & valeurs() override
Renvoie le tableau des valeurs du champ au temps courant.
virtual DoubleTab & passe(int i=1)
Definition Champ_Proto.h:50
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
virtual const Milieu_base & milieu() const =0
virtual const Champ_Inc_base & inconnue() const =0
virtual const Champ_base & masse_volumique() const
Renvoie la masse volumique du milieu.
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
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
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_Face
void mettre_a_jour(double temps) 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.
void get_noms_champs_postraitables(Noms &nom, Option opt=NONE) const override
void associer_proto(const Probleme_base &, Champs_compris &)
void mettre_a_jour_proto_face(const double temps)
void completer_proto_face(const Operateur_Diff_base &op)
void get_noms_champs_postraitables_proto(const Nom &, Noms &nom, Option opt) const
void creer_champ_proto_face(const Motcle &motlu)
Champs_compris champs_compris_
virtual void mettre_a_jour(double temps)
DOES NOTHING - to override in derived classes.
virtual void preparer_calcul()
classe Pb_Multiphase Cette classe represente un probleme de thermohydraulique multiphase de type "3*N...
static void abort()
Routine de sortie de Trio-U sur une erreur abort().
Definition Process.cpp:570
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
int line_size() const
Definition TRUSTVect.tpp:67
virtual void echange_espace_virtuel(IsExchangeBlocking exchange_type=IsExchangeBlocking::DefaultBlocking, const std::string kernel_name="noname")