16#include <Paroi_std_hyd_EF.h>
17#include <Champ_Q1_EF.h>
18#include <Fluide_base.h>
19#include <Champ_Uniforme.h>
20#include <Dirichlet_paroi_fixe.h>
21#include <Dirichlet_paroi_defilante.h>
22#include <Periodique.h>
23#include <Static_Int_Lists.h>
26#include <EcrFicPartage.h>
27#include <Modele_turbulence_hyd_Longueur_Melange_base.h>
28#include <Neumann_sortie_libre.h>
29#include <Modele_turbulence_hyd_combinaison.h>
31#include <Paroi_rugueuse.h>
33#include <Paroi_decalee_Robin.h>
34#include <Schema_Temps_base.h>
35#include <communications.h>
36#include <Equation_base.h>
68 param.lire_avec_accolades_depuis(s);
71 mot_test =
"u_star_impose";
73 if (param.get_list_mots_lus().rang(Motcle(mot_test))!=-1)
95 uplus_.resize(le_dom_dis_->nb_faces_tot());
101 seuil_LP.resize(le_dom_dis_->nb_faces_tot());
112 Cmu_ = mon_modele_turb_hyd->get_Cmu();
119 Cerr <<
" Paroi_std_hyd_EF::calculer_hyd_BiK(DoubleTab& tab_k_eps,DoubleTab& tab_eps) " << finl;
120 Cerr <<
"Methode non definie en discretisation EF " << finl ;
127 Cerr <<
" Paroi_std_hyd_EF::calculer_hyd(DoubleTab& tab_k_eps) " << finl;
128 Cerr <<
"on ne doit pas entrer dans cette methode" << finl;
129 Cerr <<
" car elle est definie uniquement pour la LES " << finl ;
137 const Equation_base& eqn_hydr = mon_modele_turb_hyd->equation();
141 const DoubleTab& tab_visco = ch_visco_cin.
valeurs();
146 ArrOfInt nodes_face(nsom);
147 int nb_nodes_free = nsom_elem - nsom;
153 visco = std::max(tab_visco(0,0),DMINFLOAT);
161 Cerr <<
"In Paroi_std_hyd_EF::calculer_hyd : visco = " << tab_visco.
local_min_vect() <<
" <= 0 ? " << finl;
166 double dist=-1,d_visco=-1;
167 double u_plus_d_plus,u_plus,d_plus,u_star;
182 for (
int n_bord=0; n_bord<nb_bords; n_bord++)
184 const Cond_lim& la_cl = le_dom_Cl_dis_->les_conditions_limites(n_bord);
200 for (
int ind_face=ndeb; ind_face<nfin; ind_face++)
202 int num_face=le_bord.
num_face(ind_face);
203 int elem = face_voisins(num_face,0);
208 for(
int jsom=0; jsom<nsom; jsom++)
211 nodes_face[jsom] = num_som;
212 for(
int comp=0; comp<
dimension; comp++) vit_face[comp]+=vitesse(num_som,comp)/nsom;
217 for (
int i=0; i<nsom_elem; i++)
219 int node=elems(elem,i);
221 for(
int jsom=0; jsom<nsom; jsom++)
222 if (nodes_face[jsom] == node) IOK=0;
226 vit[j]+=(vitesse(node,j)-vit_face[j])/nb_nodes_free;
228 double norm_v = norm_vit_lp(vit,num_face,domaine_EF,val);
230 dist = distance_face_elem(num_face,elem,domaine_EF);
236 d_visco = (tab_visco.
nb_dim()==1 ? tab_visco(elem) : tab_visco(elem,0));
238 u_plus_d_plus = norm_v*dist/d_visco;
246 u_star = norm_v/u_plus ;
247 d_plus = u_plus_d_plus/u_plus ;
270 if((!LM) && (!COMB)) tab_nu_t(elem) =
Cmu_*k*k/(eps+DMINFLOAT);
272 uplus_(num_face) = u_plus;
282 tab_nu_t(elem) *= dist_corr;
301 double d_visco,
double dist)
305 double u_star_carre = u_star * u_star;
306 k = 0.07*yp*yp*(exp(-yp/9.))+(1./(sqrt(
Cmu_)))*pow((1.-exp(-yp/20.)),2);
309 eps = (1./(
Kappa_*pow(yp*yp*yp*yp+50625,0.25)));
310 eps *= u_star_carre*u_star_carre/d_visco;
320 if(u_plus_d_plus<1.)
return sqrt(u_plus_d_plus);
323 double u_plus = u_plus_d_plus/100.;
325 double seuil = 0.001;
332 double d_plus,u_plus2;
334 while((iter++<itmax) && (r>seuil))
336 d_plus = u_plus_d_plus/ u_plus ;
337 u_plus2 = ((1./
Kappa_)*log(1.+
Kappa_*d_plus))+A*(1.-exp(-d_plus/11.)-exp(-d_plus/3.)*d_plus/11.);
338 u_plus = 0.5*(u_plus+u_plus2);
339 r = std::fabs(u_plus-u_plus2)/u_plus;
345 if (iter >= itmax) erreur_non_convergence();
354 double upmoy,dpmoy,utaumoy;
355 double seuil_moy,iter_moy;
369 for (
int n_bord=0; n_bord<domaine_EF.
nb_front_Cl(); n_bord++)
371 const Cond_lim& la_cl = le_dom_Cl_dis_->les_conditions_limites(n_bord);
375 (la_cl->que_suis_je() ==
"Frontiere_ouverte_vitesse_imposee_ALE"))
381 Ustar <<
"Bord " << le_bord.
le_nom() << finl;
384 Ustar <<
"-------------------------------------------------------------------------------------------";
385 Ustar <<
"--------------------------------------------------------------------------------------------" << finl;
386 Ustar <<
"\tFace a\t\t\t\t|\t\t\t\t\t\t\t\t\t| TAU=Nu.Grad(Ut) [m2/s2]" << finl;
387 Ustar <<
"----------------------------------------|--------------------------------------------------";
388 Ustar <<
"---------------------|----------------------------------------------------------------------" << finl;
389 Ustar <<
"X\t\t| Y\t\t\t| u+\t\t\t| d+\t\t\t| u*\t\t\t| ||TAU||_2\t\t| |TAUx|\t\t| |TAUy|" << finl;
390 Ustar <<
"----------------|-----------------------|-----------------------|-----------------------|--";
391 Ustar <<
"---------------------|-----------------------|-----------------------|----------------------" << finl;
395 Ustar <<
"-----------------------------------------------------------------------------------------------------------------";
396 Ustar <<
"-----------------------------------------------------------------------------------------------------------------" << finl;
397 Ustar <<
"\tFace a\t\t\t\t\t\t\t|\t\t\t\t\t\t\t\t\t| TAU=Nu.Grad(Ut) [m2/s2]" << finl;
398 Ustar <<
"----------------------------------------------------------------|------------------------------------------------";
399 Ustar <<
"-----------------------|-----------------------------------------------------------------------------------------" << finl;
400 Ustar <<
"X\t\t| Y\t\t\t| Z\t\t\t| u+\t\t\t| d+\t\t\t| u*\t\t\t| ||TAU||_2\t\t| |TAUx|\t\t| |TAUy|\t\t| |TAUz|" << finl;
401 Ustar <<
"----------------|-----------------------|-----------------------|-----------------------|-----------------------|";
402 Ustar <<
"-----------------------|-----------------------|-----------------------|-----------------------|-----------------" << finl;
407 for (
int num_face=ndeb; num_face<nfin; num_face++)
409 double x=domaine_EF.
xv(num_face,0);
410 double y=domaine_EF.
xv(num_face,1);
413 Ustar << x <<
"\t| " << y;
416 double z=domaine_EF.
xv(num_face,2);
417 Ustar << x <<
"\t| " << y <<
"\t| " << z;
420 norme_L2=sqrt(norme_L2);
449 ArrOfDouble array(6);
468 Ustar <<
"-------------------------------------------------------------" << finl;
469 Ustar <<
"Calcul des valeurs moyennes (en supposant maillage regulier):" << finl;
470 Ustar <<
"<u+>= " << upmoy/compt <<
" <d+>= " << dpmoy/compt <<
" <u*>= " << utaumoy/compt <<
" seuil_LP= " << seuil_moy/compt <<
" iterations_LP= " << iter_moy/compt << finl;
472 Ustar << finl << finl;
class Champ_Don_base base class of Given Fields (not calculated)
DoubleTab & valeurs() override
Overrides Champ_base::valeurs() Returns the array of values.
DoubleTab & valeurs() override
Returns the array of field values at the current time.
class Cond_lim Generic class used to represent any class
static void verifier(const char *const msg, double)
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.
int nb_som_elem() const
Returns the number of vertices of the geometric elements that make up the domain.
double xv(int num_face, int k) const
int face_sommets(int i, int j) const
Returns the index of the i-th vertex of face num_face.
int nb_som_face() const
Returns the number of vertices per face.
int face_voisins(int num_face, int i) const
Returns the neighbouring element of num_face in direction i.
const Domaine & domaine() const
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....
virtual const Milieu_base & milieu() const =0
virtual const Champ_Inc_base & inconnue() const =0
Base class for an incompressible fluid and its properties:
const Champ_Don_base & viscosite_cinematique() const
int num_premiere_face() const
int num_face(const int) const
const Nom & le_nom() const override
Returns the name of the geometric boundary.
cette classe permet de specifier des options a la loi de paroi standard.
Mixing-length turbulence model for the Navier-Stokes equations.
Classe Modele_turbulence_hyd_combinaison Classe representant un modele de turbulence exprime a partir...
virtual void set_param(Param &) const
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.
CLASS: Paroi_hyd_base_EF Base class for hydraulic wall laws in the EF discretization.
void init_lois_paroi_hydraulique_()
void set_param(Param ¶m) const
int calculer_hyd_BiK(DoubleTab &, DoubleTab &) override
void imprimer_ustar(Sortie &) const override
int calculer_hyd(DoubleTab &) override
double calculer_u_plus(const int, const double, const double erugu)
virtual int init_lois_paroi_hydraulique()
virtual int calculer_k_eps(double &, double &, double, double, double, double)
void set_param(Param ¶m) const override
int init_lois_paroi() override
static void mp_sum_for_each_item(TRUSTArray< _TYPE_ > &x, int n=-1)
static int je_suis_maitre()
Returns 1 if on the master processor of the current group (i.e. me() == 0), 0 otherwise.
Base class for output streams.
_TYPE_ local_min_vect(Mp_vect_options opt=VECT_REAL_ITEMS) const
virtual void echange_espace_virtuel(IsExchangeBlocking exchange_type=IsExchangeBlocking::DefaultBlocking, const std::string kernel_name="noname")
const DoubleVect & tab_d_plus() const
const DoubleVect & tab_u_star() const
void ouvrir_fichier_partage(EcrFicPartage &, const Nom &) const
Opens or creates a print file for Face, uplus_, dplus_, tab_u_star, Cisaillement_paroi_.
DoubleTab Cisaillement_paroi_