16#include <Modele_turbulence_hyd_base.h>
17#include <Turbulence_paroi_base.h>
18#include <Discretisation_base.h>
19#include <Schema_Temps_base.h>
20#include <Probleme_base.h>
21#include <Equation_base.h>
22#include <EcrFicPartage.h>
27#include <Dirichlet_paroi_defilante.h>
28#include <Dirichlet_paroi_fixe.h>
68 Cerr <<
"Reading the wall law type " << finl;
73 if (typ ==
"loi_standard_hydr_scalaire" || typ ==
"loi_paroi_2_couches_scalaire" || typ ==
"negligeable_scal")
75 Cerr <<
"The data file format has changed:" << finl;
76 Cerr <<
"Each turbulence model must have its wall law specified." << finl;
77 Cerr <<
"For example, loi_standard_hydr is for the turbulence model of the momentum equation" << finl;
78 Cerr <<
"and loi_standard_hydr_scalaire for the turbulence model of the energy equation." << typ << finl;
86 if (discr ==
"VEFPreP1B") discr =
"VEF";
89 Cerr <<
"and typing: " << typ << finl;
97 if (motlu ==
"u_star" && !champ_u_star_)
105 const Equation_base& equation = mon_modele_turb_hyd->equation();
114 if (champ_u_star_ && (nom == champ_u_star_->le_nom()))
125 if (champ_u_star_ && (nom == champ_u_star_->
le_nom()))
133 if (champ_u_star_ && nom == champ_u_star_->
le_nom())
136 DoubleTab& valeurs = champ_u_star_->valeurs();
138 const Equation_base& my_eqn = mon_modele_turb_hyd->equation();
143 for (
int n_bord = 0; n_bord < nb_front; n_bord++)
148 int nfin = ndeb + le_bord.
nb_faces();
149 for (
int num_face = ndeb; num_face < nfin; num_face++)
165 noms_compris.add(
"u_star");
166 if (opt == DESCRIPTION)
167 Cerr <<
que_suis_je() <<
" : " << noms_compris << finl;
169 nom.add(noms_compris);
191 Ustar.
ouvrir(fichier, ios::app);
209 Nom nom_fic = nom_fichier +
"." + extension;
219 fichier.
ouvrir(nom_fic, ios::app);
242 ligne =
"# Time \tMean(u*) \tMean(d+)";
244 for (
int n_bord = 0; n_bord < le_dom_dis_->nb_front_Cl(); n_bord++)
246 const Cond_lim& la_cl = le_dom_Cl_dis_->les_conditions_limites(n_bord);
247 const Nom& nom_bord = la_cl->frontiere_dis().le_nom();
259 else if (boundaries_list.size() > 0)
261 err +=
"The boundary named '";
263 err +=
"' is not of type Dirichlet_paroi_fixe or Dirichlet_paroi_defilante.\n";
264 err +=
"So TRUST will not write his u_star and d_plus means.\n\n";
294 int ndeb, nfin, size0, num_bord;
297 if (boundaries_list.size() != 0)
299 size0 = boundaries_list.size();
303 size0 = le_dom_dis_->nb_front_Cl();
305 DoubleTrav moy_bords(size0 + 1, 3);
311 for (
int n_bord = 0; n_bord < le_dom_dis_->nb_front_Cl(); n_bord++)
313 const Cond_lim& la_cl = le_dom_Cl_dis_->les_conditions_limites(n_bord);
319 if (boundaries_ == 0 || (boundaries_ == 1 && boundaries_list.
contient(le_bord.
le_nom())))
321 for (
int num_face = ndeb; num_face < nfin; num_face++)
324 double aire = le_dom_dis_->face_surfaces(num_face);
325 moy_bords(0, 0) += aire *
tab_u_star(num_face);
326 moy_bords(0, 1) += aire;
327 moy_bords(0, 2) += aire *
tab_d_plus(num_face);
328 moy_bords(num_bord + 1, 0) += aire *
tab_u_star(num_face);
329 moy_bords(num_bord + 1, 1) += aire;
330 moy_bords(num_bord + 1, 2) += aire *
tab_d_plus(num_face);
341 fichier << sch.
temps_courant() <<
" \t" << moy_bords(0, 0) / moy_bords(0, 1) <<
" \t" << moy_bords(0, 2) / moy_bords(0, 1);
345 for (
int n_bord = 0; n_bord < le_dom_dis_->nb_front_Cl(); n_bord++)
347 const Cond_lim& la_cl = le_dom_Cl_dis_->les_conditions_limites(n_bord);
351 if (boundaries_ == 0 || (boundaries_ == 1 && boundaries_list.
contient(le_bord.
le_nom())))
355 fichier <<
" \t" << moy_bords(num_bord + 1, 0) / moy_bords(num_bord + 1, 1) <<
" \t" << moy_bords(num_bord + 1, 2) / moy_bords(num_bord + 1, 1);
class Champ_base This class is the base of the fields hierarchy.
class Cond_lim Generic class used to represent any class
Dirichlet_paroi_defilante Imposes the wall velocity in an equation of type Navier_Stokes.
Dirichlet_paroi_fixe Represents a fixed wall in a Navier-Stokes type equation.
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 Cond_lim & les_conditions_limites(int) const
Returns the i-th boundary condition.
int ouvrir(const char *name, IOS_OPEN_MODE mode=ios::out) override
Opens the file with the given mode and prot parameters. These parameters are the parameters of the st...
Sortie & syncfile() override
Triggers writing to disk of the data accumulated on the different processors since the last call to s...
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....
const Discretisation_base & discretisation() const
Returns the discretization associated with the equation.
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.
int num_premiere_face() const
const Nom & le_nom() const override
Returns the name of the geometric boundary.
Base class for the turbulence model hierarchy for Navier-Stokes equations.
Equation_base & equation()
Returns the equation associated with the turbulence model.
A character string (Nom) in uppercase.
class Nom: a character string for naming TRUST objects.
bool contient(const Nom &nom) const
const Nom & le_nom() const override
Returns *this.
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.
const Nom & le_nom() const override
Returns the name of the Objet_U. Virtual method to override: returns "neant" in this implementation.
class Probleme_base It is a Probleme_U that is not a coupling.
const Discretisation_base & discretisation() const
Returns the discretization associated with the problem.
bool & reprise_effectuee()
const Schema_Temps_base & schema_temps() const
Returns the time scheme associated with the problem.
virtual const Equation_base & equation(int) const =0
static void mp_sum_for_each_item(TRUSTArray< _TYPE_ > &x, int n=-1)
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
static int je_suis_maitre()
Returns 1 if on the master processor of the current group (i.e. me() == 0), 0 otherwise.
double temps_courant() const
Returns the current time.
Base class for output streams.
virtual void echange_espace_virtuel(IsExchangeBlocking exchange_type=IsExchangeBlocking::DefaultBlocking, const std::string kernel_name="noname")
Base class for the hierarchy of wall-law models computing turbulent quantities near walls....
virtual void imprimer_premiere_ligne_ustar(int, const LIST(Nom)&, const Nom &) const
Writes header line for u* (friction velocity) statistics file.
const DoubleVect & tab_d_plus() const
const DoubleVect & tab_u_star() const
virtual void imprimer_ustar_mean_only(Sortie &, int, const LIST(Nom)&, const Nom &) const
Prints mean friction velocity (u*) statistics to a file for specified boundaries.
void ouvrir_fichier_partage(EcrFicPartage &, const Nom &) const
Opens or creates a print file for Face, uplus_, dplus_, tab_u_star, Cisaillement_paroi_.
const Champ_base & get_champ(const Motcle &nom) const override
void get_noms_champs_postraitables(Noms &nom, Option opt=NONE) const override
bool has_champ(const Motcle &nom, OBS_PTR(Champ_base) &ref_champ) const override
OWN_PTR(Champ_Fonc_base) champ_u_star_
Champs_compris champs_compris_
void creer_champ(const Motcle &motlu) override
virtual void associer(const Domaine_dis_base &, const Domaine_Cl_dis_base &)=0
void associer_modele(const Modele_turbulence_hyd_base &)
Associates a turbulence model to the object.
static void typer_lire_turbulence_paroi(OWN_PTR(Turbulence_paroi_base)&, const Modele_turbulence_hyd_base &, Entree &)
Reads the characteristics of the wall law from an input stream.