16#include <Modele_turbulence_scal_base.h>
17#include <Modele_turbulence_hyd_base.h>
18#include <EcritureLectureSpecial.h>
19#include <Convection_Diffusion_std.h>
20#include <Discretisation_base.h>
21#include <Probleme_base.h>
39 Cerr <<
"Reading of data for a " <<
que_suis_je() <<
" scalar turbulence model" << finl;
41 Motcle mot =
"turbulence_paroi";
43 param.lire_avec_accolades_depuis(is);
44 const Probleme_base& le_pb = mon_equation_->probleme();
47 const Modele_turbulence_hyd_base& mod_turb_hydr = ref_cast(Modele_turbulence_hyd_base, modele_turbulence.
valeur());
51 Cerr <<
"Keyword " << mot <<
" not found!" << finl;
52 Cerr <<
"A wall law must be read in the turbulence model for a scalar." << finl;
77 if (mot ==
"turbulence_paroi")
80 is >> loipar_.valeur();
82 else if (mot ==
"dt_impr_nusselt_mean_only")
84 if (loipar_->que_suis_je().contient(
"negligeable"))
85 Process::exit(
"Please remove dt_impr_nusselt option if the wall law is of Negligeable type.");
89 Nom accolade_ouverte =
"{";
90 Nom accolade_fermee =
"}";
95 for (
int b = 0; b < nbfr; b++)
101 if (motlu != accolade_ouverte)
103 Cerr << motlu <<
" is not a keyword understood by " <<
que_suis_je() <<
" in lire_motcle_non_standard" << finl;
104 Cerr <<
"A specification of kind : dt_impr_nusselt_mean_only { dt_impr periode [boundaries nb_boundaries boundary_name1 boundary_name2 ... ] } was expected." << finl;
108 if (motlu !=
"dt_impr")
110 Cerr <<
"We expected dt_impr..." << finl;
116 if (motlu != accolade_fermee)
118 if (motlu ==
"boundaries")
129 for (
int i = 0; i < nb_bords; i++)
132 boundaries_list_.add(
Nom(nom_bord_lu));
134 if (!nlistbord_dom.contient(boundaries_list_[i]))
136 Cerr <<
"Problem in the dt_impr_nusselt_mean_only instruction:" << finl;
137 Cerr <<
"The boundary named '" << boundaries_list_[i] <<
"' is not a boundary of the domain " << dom.
le_nom() <<
"." << finl;
144 if (motlu != accolade_fermee)
146 Cerr <<
"Problem in the dt_impr_nusselt_mean_only instruction:" << finl;
147 Cerr <<
"TRUST wants to read a '" << accolade_fermee <<
"' but find '" << motlu <<
"'!!" << finl;
153 Cerr << motlu <<
" is not a keyword understood by " <<
que_suis_je() <<
" in lire_motcle_non_standard" << finl;
154 Cerr <<
"A specification of kind : dt_impr_nusselt_mean_only { dt_impr periode [boundaries nb_boundaries boundary_name1 boundary_name2 ... ] } was expected." << finl;
190 Cerr <<
"Turbulence scalar model discretization" << finl;
223 loipar_->init_lois_paroi();
235 std::vector<YAML_data> data;
237 data = loipar_->data_a_sauvegarder();
249 return loipar_->sauvegarder(os);
268 mon_ident +=
Nom(temps,
"%e");
269 os << mon_ident << finl;
284 loipar_->reprendre(is);
291 loipar_->creer_champ(motlu);
300 if (loipar_->has_champ(nom, ref_champ))
312 if (loipar_->has_champ(nom))
326 if (loipar_->has_champ(nom, ref_champ))
329 throw std::runtime_error(std::string(
"Field ") + nom.
getString() + std::string(
" not found !"));
334 if (opt == DESCRIPTION)
340 loipar_->get_noms_champs_postraitables(nom, opt);
358 && dt_nusselt != DMAXFLOAT))
363 double i, j, epsilon = 1.e-8;
364 modf(temps_courant / dt_nusselt + epsilon, &i);
365 modf(temps_prec / dt_nusselt + epsilon, &j);
380 loipar_->imprimer_nusselt(os);
class Champ_base This class is the base of the fields hierarchy.
double temps() const
Returns the time of the field.
bool has_champ(const Motcle &nom, OBS_PTR(FIELD_TYPE)&ref_champ) const
Convection_Diffusion_std This class is the base for equations modelling the transport.
const Champ_Inc_base & inconnue() const override=0
class Discretisation_base This class represents a spatial discretization scheme, which
void discretiser_champ(const Motcle &directive, const Domaine_dis_base &z, const Nom &nom, const Nom &unite, int nb_comp, int nb_pas_dt, double temps, OWN_PTR(Champ_Inc_base)&champ, const Nom &sous_type=NOM_VIDE) const
const Frontiere_t & frontiere(int i) const
class Domaine_Cl_dis_base Domaine_Cl_dis_base objects represent discretized boundary conditions
const Nom & le_nom() const override
Returns the name of the Objet_U. Virtual method to override: returns "neant" in this implementation.
class Domaine_dis_base This class is the base of the hierarchy of discretized domains.
static int is_ecriture_special(int &special, int &a_faire)
Indicates whether the special format was requested in active writing by xyz save.
Class defining operators and methods for all reading operation in an input flow (file,...
class Equation_base The role of an equation is the calculation of one or more fields....
virtual const RefObjU & get_modele(Type_modele type) const
Probleme_base & probleme()
Returns the problem associated with the equation.
const Nom & le_nom() const override
Returns the name of the Objet_U. Virtual method to override: returns "neant" in this implementation.
void add(const Frontiere_32_64 &)
Adds the vertices (and faces) of the given boundary to this object (Frontiere_32_64).
bool has_loi_paroi_hyd() const
Base class for scalar turbulence models coupled to a Navier-Stokes convection-diffusion equation.
Champs_compris champs_compris_
OBS_PTR(Convection_Diffusion_std) mon_equation_
int lire_motcle_non_standard(const Motcle &, Entree &) override
Reads non-simple-type parameters of an Objet_U from an input stream.
virtual void mettre_a_jour(double)=0
virtual void completer()
Completes the turbulence model: updates object references.
Convection_Diffusion_std & equation()
const Champ_base & get_champ(const Motcle &nom) const override
void associer_eqn(const Equation_base &)
Associates the equation passed as parameter to the turbulence model.
virtual bool initTimeStep(double dt)
To be overridden in derived classes that own one or more equations. Calls preparer_pas_de_temps on th...
virtual void imprimer(Sortie &) const
Performs printing if necessary.
void get_noms_champs_postraitables(Noms &nom, Option opt=NONE) const override
int reprendre(Entree &) override
Does nothing.
bool has_champ(const Motcle &nom, OBS_PTR(Champ_base) &ref_champ) const override
virtual void associer(const Domaine_dis_base &, const Domaine_Cl_dis_base &)
Does nothing.
double dt_impr_nusselt_mean_only_
void creer_champ(const Motcle &motlu) override
int sauvegarder(Sortie &) const override
Does nothing.
LIST(Nom) boundaries_list_
int limpr_nusselt(double, double, double, double) const
Indicates whether local Nusselt values should be printed.
virtual void set_param(Param &) const override
virtual std::vector< YAML_data > data_a_sauvegarder() const
for PDI IO: retrieve name, type and dimensions of the fields to save/restore
virtual int preparer_calcul()
Does nothing.
virtual void discretiser()
Discretizes the turbulence model.
void a_faire(Sortie &) const
Writes an identity string to the output stream if necessary.
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)).
Base class for TRUST objects (Objet_U).
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.
static const Nom & nom_du_cas()
Returns a constant reference to the case name. This method is static.
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(const char *keyword, const int *value, Param::Nature nat=Param::OPTIONAL)
Register an integer parameter.
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 Nom & le_nom() const override
Returns the name of the Objet_U. Virtual method to override: returns "neant" in this implementation.
const Domaine & domaine() const
Returns the domain associated with the problem.
virtual const Equation_base & equation(int) const =0
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
double temps_courant() const
Returns the current time.
int nb_pas_dt_max_atteint() const
Returns 1 if (the number of time steps >= maximum number of time steps).
int temps_final_atteint() const
Returns 1 if the final time has been reached (or exceeded).
double pas_de_temps() const
Returns the current time step (delta_t).
int nb_pas_dt() const
Returns the number of time steps performed.
int stop_lu() const
Returns 1 if the .stop file contains a 1, returns 0 otherwise.
int stationnaire_atteint() const
int temps_cpu_max_atteint() const
double temps_precedent() const
Returns the previous time.
Base class for output streams.
const Objet_U & valeur() const
static void typer_lire_turbulence_paroi_scal(OWN_PTR(Turbulence_paroi_scal_base)&, const Modele_turbulence_scal_base &, Entree &)
Reads the characteristics of the scalar wall law from an input stream.