16#include <Modele_turbulence_hyd_K_Eps_Bas_Reynolds.h>
17#include <Schema_Temps_base.h>
18#include <Fluide_base.h>
19#include <Champ_Uniforme.h>
21#include <Perf_counters.h>
44 if (mot ==
"Modele_Fonc_Bas_Reynolds")
47 mon_modele_fonc_->discretiser();
48 Cerr <<
"Low Reynolds number model type " << mon_modele_fonc_->que_suis_je() << finl;
62 const DoubleTab& tab_K_Eps = chK_Eps.
valeurs();
63 Debog::verifier(
"Modele_turbulence_hyd_K_Eps_Bas_Reynolds::calculer_viscosite_turbulente K_Eps", tab_K_Eps);
64 DoubleTab& visco_turb = la_viscosite_turbulente_->valeurs();
70 mon_modele_fonc_->Calcul_Fmu(Fmu, le_dom_dis, le_dom_Cl_dis, tab_K_Eps, ch_visco_cin);
72 Debog::verifier(
"Modele_turbulence_hyd_K_Eps_Bas_Reynolds::calculer_viscosite_turbulente Fmu", Fmu);
79 double non_prepare = 1;
80 if (visco_turb.
size() == n)
82 non_prepare =
mp_max(non_prepare);
87 visco_turb_au_format_K_eps_Bas_Re.typer(type);
90 if (visco_turb_K_eps_Bas_Re.
size() != n)
92 Cerr <<
"visco_turb_K_eps_Bas_Re size is " << visco_turb_K_eps_Bas_Re.
size() <<
" instead of " << n << finl;
96 fill_turbulent_viscosity_tab(n, tab_K_Eps, Fmu, visco_turb_K_eps_Bas_Re);
98 la_viscosite_turbulente_->affecter(visco_turb_au_format_K_eps_Bas_Re.valeur());
101 fill_turbulent_viscosity_tab(n, tab_K_Eps, Fmu, visco_turb);
103 la_viscosite_turbulente_->changer_temps(temps);
104 return la_viscosite_turbulente_;
107void Modele_turbulence_hyd_K_Eps_Bas_Reynolds::fill_turbulent_viscosity_tab(
const int n,
const DoubleTab& tab_K_Eps,
const DoubleTab& Fmu, DoubleTab& turbulent_viscosity)
109 for (
int i = 0; i < n; i++)
111 if (tab_K_Eps(i, 1) <= DMINFLOAT)
112 turbulent_viscosity[i] = 0.;
114 turbulent_viscosity[i] =
LeCmu_ * Fmu(i) * tab_K_Eps(i, 0) * tab_K_Eps(i, 0) / tab_K_Eps(i, 1);
131 statistics().begin_count(STD_COUNTERS::turbulent_viscosity, statistics().get_last_opened_counter_level()+1);
133 Debog::verifier(
"Modele_turbulence_hyd_K_Eps_Bas_Reynolds::mettre_a_jour apres calculer_viscosite_turbulente la_viscosite_turbulente", la_viscosite_turbulente_->valeurs());
134 statistics().end_count(STD_COUNTERS::turbulent_viscosity);
148 if (mon_modele_fonc_)
149 if (mon_modele_fonc_->has_champ(nom, ref_champ))
160 if (mon_modele_fonc_)
161 if (mon_modele_fonc_->has_champ(nom))
174 if (mon_modele_fonc_)
175 if (mon_modele_fonc_->has_champ(nom, ref_champ))
178 throw std::runtime_error(std::string(
"Field ") + nom.
getString() + std::string(
" not found !"));
185 if (mon_modele_fonc_)
186 mon_modele_fonc_->get_noms_champs_postraitables(nom, opt);
class Champ_Don_base base class of Given Fields (not calculated)
class Champ_Fonc_base Base class of fields that are functions of a calculated quantity
virtual DoubleTab & valeurs()=0
class Champ_base This class is the base of the fields hierarchy.
static void verifier(const char *const msg, double)
class Domaine_Cl_dis_base Domaine_Cl_dis_base objects represent discretized boundary conditions
virtual void mettre_a_jour(double temps)
Performs a time update of all boundary conditions.
class Domaine_dis_base This class is the base of the hierarchy of discretized domains.
Class defining operators and methods for all reading operation in an input flow (file,...
virtual void mettre_a_jour(double temps)
The value of the unknown at the time step has been calculated.
virtual int preparer_calcul()
Everything that does not depend on other possible problems.
virtual Domaine_Cl_dis_base & domaine_Cl_dis()
Returns the discretized boundary condition domain associated with the equation.
Schema_Temps_base & schema_temps()
Returns the time scheme associated with the equation.
virtual bool initTimeStep(double dt)
Allocation and initialization of the unknown and boundary conditions until present+dt.
Domaine_dis_base & domaine_dis()
Returns the discretized domain associated with the equation.
Base class for an incompressible fluid and its properties:
const Champ_Don_base & viscosite_cinematique() const
static void typer_lire_Modele_Fonc_Bas_Reynolds(OWN_PTR(Modele_Fonc_Bas_Reynolds_Base)&, const Equation_base &, Entree &is)
Champ_Inc_base & get_set_unknown()
const Champ_Inc_base & get_unknown() const
class Modele_turbulence_hyd_K_Eps_Bas_Reynolds
const Transport_K_Eps_Bas_Reynolds & get_eq_transport() const override
void mettre_a_jour(double) override
void controler() override
bool initTimeStep(double dt) override
int preparer_calcul() override
Prepares the computation.
bool has_champ(const Motcle &nom, OBS_PTR(Champ_base) &ref_champ) const override
virtual Champ_Fonc_base & calculer_viscosite_turbulente(double temps)
const Champ_base & get_champ(const Motcle &nom) const override
Transport_K_Eps_Bas_Reynolds & get_set_eq_transport() override
void get_noms_champs_postraitables(Noms &nom, Option opt=NONE) const override
void set_param(Param ¶m) const override
int lire_motcle_non_standard(const Motcle &, Entree &) override
Reads non-simple-type parameters of an Objet_U from an input stream.
void completer() override
DoubleTab & complete_viscosity_field(const int, const Domaine_dis_base &, Champ_Inc_base &)
std::enable_if_t<(M_TYPE==MODELE_TYPE::K_EPS||M_TYPE==MODELE_TYPE::K_EPS_REALISABLE||M_TYPE==MODELE_TYPE::K_OMEGA), void > calculate_limit_viscosity(Champ_Inc_base &, double)
Classe Modele_turbulence_hyd_RANS_K_Eps_base Classe de base des modeles de type RANS_keps.
void set_param(Param ¶m) const override
OWN_PTR(Modele_Fonc_Bas_Reynolds_Base) &associe_modele_fonction()
bool has_champ(const Motcle &nom, OBS_PTR(Champ_base) &ref_champ) const override
void get_noms_champs_postraitables(Noms &nom, Option opt=NONE) const override
OBS_PTR(Equation_base) mon_equation_
A character string (Nom) in uppercase.
class Nom: a character string for naming TRUST objects.
const std::string & getString() const
An array of character strings (VECT(Nom)).
virtual int lire_motcle_non_standard(const Motcle &motlu, Entree &is)
Reads non-simple-type parameters of an Objet_U from an input stream.
const Nom & que_suis_je() const
Returns the string identifying the class.
virtual Entree & readOn(Entree &)
Reads an Objet_U from an input stream. Virtual method to override.
virtual const Nom & le_nom() const
Returns the name of the Objet_U. Virtual method to override: returns "neant" in this implementation.
virtual Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
Helper class to factorize the readOn method of Objet_U classes.
void ajouter_non_std(const char *keyword, const Objet_U *value, Param::Nature nat=Param::OPTIONAL)
Register a keyword handled by Objet_U::lire_motcle_non_standard.
static double mp_max(double)
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
virtual int faire_un_pas_de_temps_eqn_base(Equation_base &)=0
Base class for output streams.
_SIZE_ dimension(int d) const
void completer() override
Completes the construction (initialization) of objects associated with the equation.
int controler_K_Eps()
Controle le champ inconnue K-epsilon en forcant a zero les valeurs du champ.