16#include <Navier_Stokes_IBM_Turbulent.h>
17#include <Modele_turbulence_hyd_base.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_IBM_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;
238 if (le_modele_turbulence->has_loi_paroi_hyd())
242 le_modele_turbulence->preparer_calcul();
249 ok = ok && le_modele_turbulence->initTimeStep(dt);
259 std::vector<YAML_data> mod_turb = le_modele_turbulence->data_a_sauvegarder();
260 data.insert(data.end(), mod_turb.begin(), mod_turb.end());
273 assert(bytes % 4 == 0);
274 bytes += le_modele_turbulence->sauvegarder(os);
275 assert(bytes % 4 == 0);
291 Nom ident_modele(le_modele_turbulence->que_suis_je());
293 ident_modele +=
Nom(temps,
probleme().reprise_format_temps());
298 avancer_fichier_with_syno(is,ident_modele,field_tag_syno);
302 avancer_fichier(is,ident_modele);
304 le_modele_turbulence->reprendre(is);
317 le_modele_turbulence->completer();
318 le_modele_turbulence->loi_paroi().completer();
328 le_modele_turbulence->mettre_a_jour(temps);
336 if (le_modele_turbulence)
337 if (le_modele_turbulence->has_champ(nom, ref_champ))
348 if (le_modele_turbulence)
349 if (le_modele_turbulence->has_champ(nom))
362 if (le_modele_turbulence)
363 if (le_modele_turbulence->has_champ(nom, ref_champ))
366 throw std::runtime_error(std::string(
"Field ") + nom.
getString() + std::string(
" not found !"));
372 if (le_modele_turbulence)
373 le_modele_turbulence->get_noms_champs_postraitables(nom, opt);
379 le_modele_turbulence->imprimer(os);
384 for (
const auto &itr : liste_modeles_)
386 const RefObjU& mod = itr;
398 if (le_modele_turbulence) le_modele_turbulence->creer_champ(motlu);
class Champ_Don_base base class of Given Fields (not calculated)
class Champ_base This class is the base of the fields hierarchy.
virtual void creer_champ(const Motcle &motlu)=0
virtual void get_noms_champs_postraitables(Noms &nom, Option opt=NONE) const =0
virtual bool has_champ(const Motcle &nom, OBS_PTR(Champ_base)&ref_champ) const =0
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,...
OBS_PTR(Equation_base) eq_IBM_
int reprendre(Entree &) override
We resume the unknown from an input stream.
virtual const RefObjU & get_modele(Type_modele type) const
virtual std::vector< YAML_data > data_a_sauvegarder() const
for PDI IO: retrieve name, type and dimensions of the data to save/restore. This has to be overrode f...
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 void mettre_a_jour(double temps)
The value of the unknown at the time step has been calculated.
virtual void completer()
Completes the construction (initialization) of objects associated with the equation.
virtual void imprime_residu(SFichier &)
int sauvegarder(Sortie &) const override
We save the unknown, then the source terms to an output stream.
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.
int lire_motcle_non_standard(const Motcle &, Entree &) override
Reads non-simple-type parameters of an Objet_U from an input stream.
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.
virtual Nom expression_residu()
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
Turbulent IBM Navier-Stokes equation.
const RefObjU & get_modele(Type_modele type) const override
void get_noms_champs_postraitables(Noms &nom, Option opt=NONE) const override
const Champ_base & diffusivite_pour_pas_de_temps() const override
Nom expression_residu() override
int sauvegarder(Sortie &) const override
Saves the equation (and its turbulence model) to an output stream.
void mettre_a_jour(double) override
Performs a time update of the equation.
void imprime_residu(SFichier &) override
void completer() override
Successive calls to: Navier_Stokes_IBM::completer().
std::vector< YAML_data > data_a_sauvegarder() const override
for PDI IO: retrieve name, type and dimensions of the fields to save/restore
const Champ_base & get_champ(const Motcle &nom) const override
void creer_champ(const Motcle &motlu) override
void set_param(Param &titi) const override
int preparer_calcul() override
Prepares the computation.
void imprimer(Sortie &) const override
Prints the equation operators if the time scheme indicates it is necessary.
bool has_champ(const Motcle &nom, OBS_PTR(Champ_base) &ref_champ) const override
Entree & lire_op_diff_turbulent(Entree &is)
bool initTimeStep(double dt) override
Allocation and initialization of the unknown and boundary conditions until present+dt.
const Champ_Don_base & diffusivite_pour_transport() const override
int reprendre(Entree &) override
Restores the equation and its turbulence model from an input stream.
int lire_motcle_non_standard(const Motcle &, Entree &) override
Reads non-simple-type parameters of an Objet_U 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 preparer_calcul() override
Everything that does not depend on other possible problems.
Operateur_Diff terme_diffusif
const Champ_Inc_base & inconnue() const override
Returns the velocity (unknown field of the equation) (const version).
const Fluide_base & fluide() const
Returns the incompressible fluid (physical medium of the equation) associated with the equation.
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.
SFichier is to the C++ ofstream class what Sortie is to the C++ ostream class.
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