15#include <Champ_Generique_Morceau_Equation.h>
16#include <Domaine_VF.h>
17#include <Champ_Generique_refChamp.h>
18#include <Discretisation_base.h>
19#include <Operateur_base.h>
21#include <Synonyme_info.h>
23#include <Transport_K_Eps_base.h>
24#include <Modele_turbulence_hyd_K_Eps.h>
25#include <Modele_turbulence_hyd_K_Eps_Realisable.h>
26#include <Modele_turbulence_hyd_RANS_K_Eps_base.h>
27#include <Transport_K_Omega_base.h>
28#include <Modele_turbulence_hyd_K_Omega.h>
29#include <Modele_turbulence_hyd_RANS_K_Omega_base.h>
85 if (sub_type(Champ_Generique_refChamp,
get_source(0)))
88 OWN_PTR(Champ_base) espace_stockage;
90 if (sub_type(Champ_Inc_base,mon_champ))
92 const Champ_Inc_base& mon_champ_inc = ref_cast(Champ_Inc_base,mon_champ);
103 const Equation_base& eq_test = Pb.
equation(i);
111 if (mon_champ_inc.
le_nom() ==
"K_Eps" || mon_champ_inc.
le_nom() ==
"K_Omega")
113 if (not sub_type(Modele_turbulence_hyd_2_eq_base, eq_test.
get_modele(TURBULENCE).
valeur()))
115 Cerr<<
"Champ_Generique_Morceau_Equation in TriocCFD: K_Eps and K_Omega can only be used with a related RANS turbulence model"<<finl;
119 const auto& le_mod_RANS = ref_cast(Modele_turbulence_hyd_2_eq_base, eq_test.
get_modele(TURBULENCE).
valeur());
120 const auto& rans_equation = le_mod_RANS.get_eq_transport();
121 if ((rans_equation.inconnue().le_nom() == mon_champ_inc.
le_nom()))
124 ref_eq_=rans_equation;
127 Cerr <<
"Champ_Generique_Morceau_Equation in TriocCFD: K_Eps or K_Omega was probably used with the wrong RANS turbulence model." << finl;
128 Cerr <<
"Check your dataset consistency." << finl;
139 Cerr<<
"We can apply a Champ_Generique_Morceau_Equation only to an unknown field of the problem"<<finl;
151OWN_PTR(
Champ_Fonc_base)& Champ_Generique_Morceau_Equation::creer_espace_stockage(
const Nature_du_champ& nature,
164 if ((Motcle(
option_)==
"flux_bords") || (Motcle(
option_)==
"flux_surfacique_bords"))
165 directive =
"champ_face";
172 if (directive==
"pression")
191 OWN_PTR(Champ_Fonc_base) es_tmp;
192 Nature_du_champ nature;
195 if ((Motcle(
option_)==
"stabilite") || (Motcle(
option_)==
"flux_bords") || (Motcle(
option_)==
"flux_surfacique_bords"))
202 Cerr <<
"Error. Contact TRUST support." << finl;
206 espace_stockage = creer_espace_stockage(nature,
nb_comp,es_tmp);
208 DoubleTab& es_val = espace_stockage->
valeurs();
210 return espace_stockage;
215 OWN_PTR(Champ_Fonc_base) es_tmp;
216 Nature_du_champ nature;
219 if ((Motcle(
option_)==
"stabilite") || (Motcle(
option_)==
"flux_bords") || (Motcle(
option_)==
"flux_surfacique_bords"))
225 espace_stockage = creer_espace_stockage(nature,
nb_comp,es_tmp);
226 return espace_stockage;
232 motcles[0] =
"composantes";
233 motcles[1] =
"unites";
235 int rang = motcles.search(query);
255 if (Motcle(
option_)==
"stabilite")
257 else if (Motcle(
option_).debute_par(
"FLUX_"))
260 if (ref_eq_->inconnue().le_nom()==
"vitesse")
265 else if (ref_eq_->inconnue().le_nom()==
"temperature") unites[0]=
"W";
266 if (Motcle(
option_)==Motcle(
"flux_surfacique_bords"))
283 loc = Entity::ELEMENT;
290 Cerr <<
"Error of type : localisation should be specified to elem or som or face for the defined field " <<
nom_post_ << finl;
291 throw Champ_Generique_erreur(
"INVALID");
300 Motcle type_morceau, type_option;
304 type_morceau =
"diffusion";
306 type_morceau =
"convection";
308 type_morceau =
"gradient";
310 type_morceau =
"divergence";
313 Cerr<<
"This operateur number is not available."<<finl;
319 Cerr<<
"Currently the only pieces of equations considered for the postprocessing"<<finl;
320 Cerr<<
"are of type operator"<<finl;
324 if (Motcle(
option_)==
"stabilite")
326 else if (Motcle(
option_)==
"flux_bords")
328 type_option =
"flux_bords";
330 else if (Motcle(
option_)==
"flux_surfacique_bords")
332 type_option =
"flux_surfacique_bords";
336 Cerr<<
"Currently the only options considered for a piece of equation are \"stabilite\" and \"flux_bords\"."<<finl;
344 const Nom& nom_eq = ref_eq_->le_nom();
345 nom_post_source = nom_eq;
346 nom_post_source +=
"_";
347 nom_post_source += type_morceau;
348 nom_post_source +=
"_";
349 nom_post_source += type_option ;
350 if ((Motcle(
option_)==
"flux_bords") || (Motcle(
option_)==
"flux_surfacique_bords"))
353 nom_post_source += nume;
365 int nb_operateurs = ref_eq_->nombre_d_operateurs();
367 return ref_eq_->operateur_fonctionnel(
numero_morceau_-nb_operateurs).l_op_base();
374 int nb_operateurs = ref_eq_->nombre_d_operateurs();
376 return ref_eq_->operateur_fonctionnel(
numero_morceau_-nb_operateurs).l_op_base();
386 directive =
"champ_elem";
388 directive =
"champ_face";
390 directive =
"champ_sommets";
393 Cerr <<
"Error of type : localisation should be specified to elem or som or face for the defined field " <<
nom_post_ << finl;
394 throw Champ_Generique_erreur(
"INVALID");
class Champ_Fonc_base Base class of fields that are functions of a calculated quantity
Base class of generic fields having other generic fields as source. The use of the class methods reli...
const Noms get_property(const Motcle &query) const override
Returns the requested property.
void completer(const Postraitement_base &post) override
const Probleme_base & get_ref_pb_base() const override
Returns the problem that carries the target field.
const Domaine_Cl_dis_base & get_ref_zcl_dis_base() const override
Returns a ref to the discretized boundary conditions domain of the equation carrying the target field...
virtual const Champ_Generique_base & get_source(int i) const
void set_param(Param ¶m) const override
const Discretisation_base & get_discretisation() const override
Returns the discretization associated with the problem.
const Domaine_dis_base & get_ref_domaine_dis_base() const override
Returns a ref to the discretized domain on which the storage space will be evaluated.
double get_time() const override
Returns the time of the Champ_Generique_base.
class Champ_Generique_Morceau_Equation OWN_PTR(Champ_base) intended to post-process a quantity relate...
const MorEqn & morceau() const
const Noms get_property(const Motcle &query) const override
Returns the requested property.
void nommer_source() override
void completer(const Postraitement_base &post) override
void set_param(Param ¶m) const override
OWN_PTR(Champ_Fonc_base) &creer_espace_stockage(const Nature_du_champ &nature
const Motcle get_directive_pour_discr() const override
Returns the directive (champ_elem, champ_sommets, champ_face or pression) to launch the discretizatio...
const Champ_base & get_champ(OWN_PTR(Champ_base)&espace_stockage) const override
const Champ_base & get_champ_without_evaluation(OWN_PTR(Champ_base)&espace_stockage) const override
Entity get_localisation(const int index=-1) const override
Returns the type of geometric entities on which the discrete values are attached (NODE for a P1 field...
virtual const Champ_base & get_champ(OWN_PTR(Champ_base) &espace_stockage) const =0
void nommer(const Nom &nom) override
Assigns a name to the Objet_U. Virtual method to override.
virtual DoubleTab & valeurs()=0
class Champ_base This class is the base of the fields hierarchy.
virtual void completer(const Domaine_Cl_dis_base &zcl)
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
Class defining operators and methods for all reading operation in an input flow (file,...
virtual const RefObjU & get_modele(Type_modele type) const
virtual const Champ_Inc_base & inconnue() const =0
const Nom & le_nom() const override
Returns the name of the field.
class MorEqn Class that groups the functionalities of linking with an
virtual Motcle get_localisation_pour_post(const Nom &option) const
virtual void calculer_pour_post(Champ_base &espace_stockage, const Nom &option, int comp) const
A character string (Nom) in uppercase.
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 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.
Base class for all post-processing objects.
virtual int nombre_d_equations() const =0
virtual const Equation_base & equation(int) const =0
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Base class for output streams.
virtual void echange_espace_virtuel(IsExchangeBlocking exchange_type=IsExchangeBlocking::DefaultBlocking, const std::string kernel_name="noname")
const Objet_U & valeur() const