TrioCFD 1.9.9_beta
TrioCFD documentation
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 //reading the turbulent viscosity correlation
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; //nothing to do
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) //scalar nu
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) //diagonal anisotropic nu
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) //full anisotropic nu
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
Returns the array of field values at the current time.
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
Returns the mass density of the medium (const version).
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
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
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_Face
void mettre_a_jour(double temps) 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.
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()
Multiphase thermohydraulics problem of type "3*N equations":
static void abort()
Abort routine for TRUST on a fatal error.
Definition Process.cpp:573
Base class for output streams.
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")