TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Op_Dift_Multiphase_VDF_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_Dift_Multiphase_VDF_Face.h>
17#include <VDF_discretisation.h>
18#include <Pb_Multiphase.h>
19
20Implemente_instanciable_sans_constructeur(Op_Dift_Multiphase_VDF_Face,"Op_Diff_VDFTURBULENTE_Face|Op_Diff_VDFTURBULENT_Face",Op_Dift_VDF_Face_base);
21
24{
25 //reading the turbulent viscosity correlation
26 Correlation_base::typer_lire_correlation(corr_, equation().probleme(), "viscosite_turbulente", is);
30 return is;
31}
32
38
44
55
61
70
72{
73 double dt_stab, coef = -1.e10;
74 const Domaine_VDF& domaine_VDF = iter_->domaine();
75 const Champ_base& champ_diffu = diffusivite_pour_pas_de_temps();
76 const DoubleTab& diffu = diffusivite().valeurs() /* mu */, &rho = equation().milieu().masse_volumique().passe(), &diffu_dt = champ_diffu.valeurs() /* nu */;
77 //const DoubleTab* alp = sub_type(Pb_Multiphase, equation().probleme()) ? &ref_cast(Pb_Multiphase, equation().probleme()).equation_masse().inconnue().passe() : nullptr;
78 const int cN = (diffu_dt.dimension(0) == 1), cM = (diffu.dimension(0) == 1), cR = (rho.dimension(0) == 1);
79
80 double mu_turbulent, mu_physique, nu_physique;
81
82 for (int elem = 0; elem < domaine_VDF.nb_elem(); elem++)
83 {
84 double diflo = 0.;
85 double deltax = 0.;
86 for (int i = 0; i < Objet_U::dimension; i++)
87 {
88 const double h = domaine_VDF.dim_elem(elem, i);
89 //cout << "h= "<< h << endl;
90 deltax += 1. / (h * h);
91 }
92
93 for (int ncomp = 0; ncomp < nu_ou_lambda_turb_.line_size(); ncomp++)
94 {
95 mu_turbulent = rho(!cR * elem, ncomp) * nu_ou_lambda_turb_(elem, ncomp);
96 mu_physique = diffu(!cM * elem, ncomp);
97 nu_physique = diffu_dt(!cN * elem, ncomp);
98 diflo = deltax * (mu_physique + mu_turbulent) * (nu_physique / mu_physique);
99 coef = std::max(coef, diflo);
100 }
101 }
102
103 coef = Process::mp_max(coef);
104 dt_stab = 0.5 / (coef + DMINFLOAT);
105
106 return dt_stab;
107}
virtual DoubleTab & valeurs()=0
virtual DoubleTab & passe(int i=1)
Definition Champ_Proto.h:50
class Champ_base This class is the base of the fields hierarchy.
Definition Champ_base.h:43
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 Domaine_VDF
Definition Domaine_VDF.h:61
double dim_elem(int, int) const
const Domaine & domaine() const
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_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
std::enable_if_t< _TYPE_==Type_Operateur::Op_DIFT_MULTIPHASE_FACE, void > set_nut_impl(const DoubleTab &nut)
std::enable_if_t< _TYPE_==Type_Operateur::Op_DIFT_MULTIPHASE_FACE||_TYPE_==Type_Operateur::Op_DIFT_MULTIPHASE_ELEM, void > associer_corr_impl(const Correlation_base &corr)
double calculer_dt_stab() const override
Computes dt_stab.
const Champ_base & diffusivite() const override
void completer() override
Associates the operator with the domaine_dis, the domaine_Cl_dis, and the unknown of its equation.
void mettre_a_jour(double) override
DOES NOTHING - to override in derived classes.
void get_noms_champs_postraitables(Noms &nom, Option opt=NONE) const override
void creer_champ(const Motcle &motlu) 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)
void completer_Op_Dift_VDF_base()
virtual const Champ_base & diffusivite_pour_pas_de_temps() const
Returns the field corresponding to the true diffusivity of the medium used for the time step computat...
Champs_compris champs_compris_
virtual void preparer_calcul()
static double mp_max(double)
Definition Process.cpp:379
Base class for output streams.
Definition Sortie.h:52
_SIZE_ dimension(int d) const
Definition TRUSTTab.tpp:133