16#include <Modele_turbulence_hyd_base.h>
17#include <Navier_Stokes_Turbulent.h>
18#include <Op_Diff_Turbulent_base.h>
19#include <Fluide_Incompressible.h>
20#include <Discretisation_base.h>
21#include <Schema_Temps_base.h>
22#include <Champ_Uniforme.h>
23#include <Probleme_base.h>
24#include <Discret_Thyd.h>
25#include <TRUST_2_PDI.h>
48 if (mot ==
"diffusion")
50 Cerr <<
"Reading and typing of the diffusion operator : ";
56 else if (mot ==
"modele_turbulence")
57 return typer_lire_mod_turb_hyd(is);
62int Navier_Stokes_Turbulent::typer_lire_mod_turb_hyd(
Entree& s)
64 Cerr <<
"Reading and typing of the turbulence model : ";
68 Motcle nom1(
"Modele_turbulence_hyd_");
72 if (typ.
debute_par(
"SOUS_MAILLE") || discr ==
"VDF_Hyper" || typ.
debute_par(
"LONGUEUR_MELANGE") || (typ ==
"K_Epsilon_V2"))
74 if (
dimension == 2 && discr !=
"VDF_Hyper")
76 Cerr <<
"You are solving a turbulent case in 2D with a subgrid-scale model" << finl;
77 Cerr <<
"Be careful with the interpretation of the results !!" << finl;
82 if (discr ==
"VEFPreP1B") discr =
"VEF";
85 if (nom1 ==
"MODELE_TURBULENCE_HYD_SOUS_MAILLE_LM_VEF")
87 Cerr <<
"The keyword Sous_maille_LM is now called Longueur_Melange for consistency between VDF and VEF." << finl;
88 Cerr <<
"Please update your data file." << finl;
94 le_modele_turbulence.typer(nom1);
95 le_modele_turbulence->associer_eqn(*
this);
97 s >> le_modele_turbulence.valeur();
99 le_modele_turbulence->discretiser();
101 le_modele = le_modele_turbulence.
valeur();
102 liste_modeles_.add_if_not(le_modele);
121 Motcle accouverte =
"{", accfermee =
"}";
122 Nom type =
"Op_Dift_";
126 if (discr ==
"VEFPreP1B") discr =
"VEF";
134 nb_inc =
"_Multi_inco_";
138 if (type_inco ==
"Champ_Q1_EF") type +=
"Q1";
139 else type += (type_inco.
suffix(
"Champ_"));
141 if (
axi) type +=
"_Axi";
145 if (motbidon != accouverte)
147 Cerr <<
"A { was expected while reading the turbulent diffusive term" << finl;
151 if (motbidon ==
"negligeable")
153 type =
"Op_Dift_negligeable";
159 if (motbidon != accfermee)
160 Cerr <<
" No options can be entered after negligeable " << finl;
162 else if (motbidon ==
"tenseur_Reynolds_externe")
170 if (motbidon != accfermee)
171 Cerr <<
" No options can be entered after tenseur_Reynolds_externe " << finl;
173 else if (motbidon ==
"standard")
181 else if (motbidon == accfermee)
188 else if (motbidon ==
"stab")
196 else if (motbidon ==
"option")
200 type =
"Op_Dift_EF_Q1_option";
208 if (motbidon != accfermee)
209 Cerr <<
" No options can be entered after option " << finl;
215 if (motbidon != accfermee)
216 Cerr <<
" No option are now readable for the turbulent diffusive term" << finl;
239 if (le_modele_turbulence->has_loi_paroi_hyd())
243 le_modele_turbulence->preparer_calcul();
250 ok = ok && le_modele_turbulence->initTimeStep(dt);
260 std::vector<YAML_data> mod_turb = le_modele_turbulence->data_a_sauvegarder();
261 data.insert(data.end(), mod_turb.begin(), mod_turb.end());
274 assert(bytes % 4 == 0);
275 bytes += le_modele_turbulence->sauvegarder(os);
276 assert(bytes % 4 == 0);
292 Nom ident_modele(le_modele_turbulence->que_suis_je());
294 ident_modele +=
Nom(temps,
probleme().reprise_format_temps());
299 avancer_fichier_with_syno(is,ident_modele,field_tag_syno);
303 avancer_fichier(is,ident_modele);
305 le_modele_turbulence->reprendre(is);
318 le_modele_turbulence->completer();
319 le_modele_turbulence->loi_paroi().completer();
329 le_modele_turbulence->mettre_a_jour(temps);
337 if (le_modele_turbulence)
338 if (le_modele_turbulence->has_champ(nom, ref_champ))
349 if (le_modele_turbulence)
350 if (le_modele_turbulence->has_champ(nom))
363 if (le_modele_turbulence)
364 if (le_modele_turbulence->has_champ(nom, ref_champ))
367 throw std::runtime_error(std::string(
"Field ") + nom.
getString() + std::string(
" not found !"));
373 if (le_modele_turbulence)
374 le_modele_turbulence->get_noms_champs_postraitables(nom, opt);
380 le_modele_turbulence->imprimer(os);
385 for (
const auto &itr : liste_modeles_)
387 const RefObjU& mod = itr;
class Champ_Don_base base class of Given Fields (not calculated)
class Champ_base This class is the base of the fields hierarchy.
const Nom & le_nom() const override
Returns the name of the Objet_U. Virtual method to override: returns "neant" in this implementation.
Class defining operators and methods for all reading operation in an input flow (file,...
virtual const RefObjU & get_modele(Type_modele type) const
virtual void imprimer(Sortie &os) const
Prints the equation operators if the time scheme indicates it is necessary.
const Discretisation_base & discretisation() const
Returns the discretization associated with the equation.
Nom create_polymacfamily_syno(const Nom &field_tag) const
Create a synonym of a field name in order to ensure backward compatibility with old names of the Poly...
virtual Domaine_Cl_dis_base & domaine_Cl_dis()
Returns the discretized boundary condition domain associated with the equation.
Probleme_base & probleme()
Returns the problem associated with the equation.
Schema_Temps_base & schema_temps()
Returns the time scheme associated with the equation.
Domaine_dis_base & domaine_dis()
Returns the discretized domain associated with the equation.
const Champ_Don_base & viscosite_cinematique() const
Base class for the turbulence model hierarchy for Navier-Stokes equations.
A character string (Nom) in uppercase.
int debute_par(const char *const n) const override
Navier-Stokes equation for a viscous incompressible fluid (div U = 0) with turbulence modelling.
std::vector< YAML_data > data_a_sauvegarder() const override
for PDI IO: retrieve name, type and dimensions of the fields to save/restore
void get_noms_champs_postraitables(Noms &nom, Option opt=NONE) const override
const Champ_base & diffusivite_pour_pas_de_temps() const override
const Champ_base & get_champ(const Motcle &nom) const override
void mettre_a_jour(double) override
Performs a time update of the equation.
int sauvegarder(Sortie &) const override
Saves the equation (and its turbulence model) to an output stream.
int preparer_calcul() override
Prepares the computation.
const Champ_Don_base & diffusivite_pour_transport() const override
bool has_champ(const Motcle &nom, OBS_PTR(Champ_base) &ref_champ) const override
int reprendre(Entree &) override
Restores the equation and its turbulence model from an input stream.
bool initTimeStep(double dt) override
Allocation and initialization of the unknown and boundary conditions until present+dt.
void set_param(Param &titi) 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
Successive calls to: Navier_Stokes_std::completer().
const RefObjU & get_modele(Type_modele type) const override
void imprimer(Sortie &) const override
Prints the equation operators if the time scheme indicates it is necessary.
Entree & lire_op_diff_turbulent(Entree &is)
Navier_Stokes_std This class carries the terms of the momentum equation.
Operateur_Diff terme_diffusif
int reprendre(Entree &) override
Performs a restart from an input stream.
const Champ_Inc_base & inconnue() const override
Returns the velocity (unknown field of the equation) (const version).
int lire_motcle_non_standard(const Motcle &, Entree &) override
Reads non-simple-type parameters of an Objet_U from an input stream.
const Fluide_base & fluide() const
Returns the incompressible fluid (physical medium of the equation) associated with the equation.
void mettre_a_jour(double temps) override
Performs a time update of the equation.
void completer() override
Completes the base equation, associates the pressure with the equation,.
int sauvegarder(Sortie &) const override
Calls Equation_base::sauvegarder(Sortie&) and saves the pressure to an output stream.
bool initTimeStep(double dt) override
Allocation and initialization of the unknown and boundary conditions until present+dt.
std::vector< YAML_data > data_a_sauvegarder() const override
for PDI IO: retrieve name, type and dimensions of the fields to save/restore
void get_noms_champs_postraitables(Noms &nom, Option opt=NONE) const override
void set_param(Param &titi) const override
int preparer_calcul() override
cf Equation_base::preparer_calcul() Assembly of the pressure solver and
OBS_PTR(Fluide_base) le_fluide
bool has_champ(const Motcle &nom, OBS_PTR(Champ_base) &ref_champ) const override
class Nom: a character string for naming TRUST objects.
Nom & suffix(const char *const)
Suffix extraction: Nom x("azerty");.
const std::string & getString() const
An array of character strings (VECT(Nom)).
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 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.
const Domaine & domaine() const
Returns the domain associated with the problem.
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
double temps_courant() const
Returns the current time.
Base class for output streams.
static int is_PDI_restart()
const Objet_U & valeur() const
Base class for the hierarchy of wall-law models computing turbulent quantities near walls....
virtual int init_lois_paroi()=0