16#include <Loi_Paroi_Nu_Impose_VDF.h>
17#include <Champ_Uniforme.h>
18#include <Champ_Uniforme_Morceaux.h>
19#include <Champ_Fonc_Tabule.h>
20#include <Domaine_Cl_VDF.h>
21#include <Dirichlet_paroi_fixe.h>
22#include <Dirichlet_paroi_defilante.h>
23#include <Neumann_paroi.h>
25#include <Fluide_base.h>
26#include <Convection_Diffusion_std.h>
27#include <Probleme_base.h>
28#include <EcrFicPartage.h>
29#include <Modele_turbulence_scal_base.h>
50 les_mots[0] =
"nusselt";
51 les_mots[1] =
"diam_hydr";
54 Motcle motlu, accolade_fermee=
"}", accolade_ouverte=
"{";
56 assert(motlu==accolade_ouverte);
58 if(motlu == accolade_ouverte)
63 while (motlu != accolade_fermee)
65 int rang=les_mots.search(motlu);
73 Cerr <<
"Lecture et interpretation de la fonction " << tmp <<
" ... ";
93 Cerr <<
"Mot cle \"" << motlu <<
"\" non compris lors de la lecture d'un "
103 Cerr <<
"Il faut definir l'expression nusselt(Re,Pr,x,y,z,Dh)" << finl;
107 if (diam_hydr->nb_comp()!=1)
109 Cerr <<
"Il faut definir le champ diam_hydr a une composante" << finl;
125 const IntTab& face_voisins = domaine_VDF.
face_voisins();
130 const IntVect& orientation = domaine_VDF.
orientation();
131 const DoubleTab& xv=domaine_VDF.
xv() ;
132 const IntTab& elem_faces = domaine_VDF.
elem_faces();
136 const DoubleTab& tab_visco = ch_visco_cin.
valeurs();
142 visco = std::max(tab_visco(0,0),DMINFLOAT);
147 if ((!l_unif) && (local_min_vect(tab_visco)<DMINFLOAT))
150 Cerr <<
"In Loi_Paroi_Nu_Impose_VDF::calculer_scal : visco = " << tab_visco.
local_min_vect() <<
" <= 0 ? " << finl;
155 bool dh_constant=sub_type(
Champ_Uniforme,diam_hydr.valeur())?
true:
false;
156 double dh_valeur=diam_hydr->valeurs()(0,0);
168 for (
int n_bord=0; n_bord<domaine_VDF.
nb_front_Cl(); n_bord++)
175 const Cond_lim& la_cl = le_dom_Cl_dis_->les_conditions_limites(n_bord);
185 int boundary_index=-1;
187 boundary_index=n_bord;
188 assert(boundary_index >= 0);
190 for (
int num_face=ndeb; num_face<nfin; num_face++)
192 elem = face_voisins(num_face,0);
194 elem = face_voisins(num_face,1);
198 d_visco = tab_visco[elem];
202 d_alpha = alpha.
valeurs()(0,0);
206 d_alpha = alpha.
valeurs()(elem);
208 d_alpha = alpha.
valeurs()(elem,0);
210 double Pr = d_visco/d_alpha;
213 int ori = orientation(num_face);
214 int face1 = elem_faces(elem,(ori+1));
216 double Ud = 0.5*(vitesse(face1)+vitesse(face2));
220 face1 = elem_faces(elem,(ori+2));
222 double tmp =0.5*(vitesse(face1)+vitesse(face2));
230 pos[i]=xv(num_face,i);
235 dh_valeur=diam_hydr->valeur_a_compo(pos,0);
238 double Re=Ud*dh_valeur/d_visco;
242 nusselt.setVar(
"Dh",dh_valeur);
256 int global_face=num_face;
274 const IntTab& face_voisins = domaine_VDF.
face_voisins();
285 bool dh_constant=sub_type(
Champ_Uniforme,diam_hydr.valeur())?
true:
false;
286 double dh_valeur=diam_hydr->valeurs()(0,0);
289 for (
int n_bord=0; n_bord<domaine_VDF.
nb_front_Cl(); n_bord++)
291 const Cond_lim& la_cl = le_dom_Cl_dis_->les_conditions_limites(n_bord);
301 int boundary_index=-1;
303 boundary_index=n_bord;
304 assert(boundary_index >= 0);
313 Nusselt <<
"Bord " << le_bord.
le_nom() << finl;
316 Nusselt <<
"----------------------------------------------------------------------------------------------------------------------------------------------------------------" << finl;
317 Nusselt <<
"\tFace a\t\t\t\t|" << finl;
318 Nusselt <<
"----------------------------------------------------------------------------------------------------------------------------------------------------------------" << finl;
319 Nusselt <<
"X\t\t| Y\t\t\t| dist. carac. (m)\t| Nusselt (local)\t| h (Conv. W/m2/K)\t| Tf cote paroi (K)\t| Tparoi equiv.(K)" << finl;
320 Nusselt <<
"----------------|-----------------------|-----------------------|-----------------------|-----------------------|-----------------------|-----------------------" << finl;
324 Nusselt <<
"----------------------------------------------------------------------------------------------------------------------------------------------------------------" << finl;
325 Nusselt <<
"\tFace a\t\t\t\t\t\t\t|" << finl;
326 Nusselt <<
"----------------------------------------------------------------------------------------------------------------------------------------------------------------" << finl;
327 Nusselt <<
"X\t\t| Y\t\t\t| Z\t\t\t| dist. carac. (m)\t| Nusselt (local)\t| h (Conv. W/m2/K)\t| Tf cote paroi (K)\t| Tparoi equiv.(K)" << finl;
328 Nusselt <<
"----------------|-----------------------|-----------------------|-----------------------|-----------------------|-----------------------|-----------------------|-----------------------" << finl;
333 for (
int num_face=ndeb; num_face<nfin; num_face++)
337 pos[i]=domaine_VDF.
xv(num_face,i);
341 dh_valeur=diam_hydr->valeur_a_compo(pos,0);
343 double x=domaine_VDF.
xv(num_face,0);
344 double y=domaine_VDF.
xv(num_face,1);
347 elem = face_voisins(num_face,0);
349 elem = face_voisins(num_face,1);
351 lambda = conductivite.
valeurs()(0,0);
355 lambda = conductivite.
valeurs()(elem);
357 lambda = conductivite.
valeurs()(elem,0);
361 Nusselt << x <<
"\t| " << y;
364 double z=domaine_VDF.
xv(num_face,2);
365 Nusselt << x <<
"\t| " << y <<
"\t| " << z;
368 int global_face=num_face;
371 double flux = la_cl_neum.
flux_impose(num_face-ndeb);
375 << lambda/
equivalent_distance_[boundary_index](local_face) <<
"\t| " << temperature(elem) <<
"\t|" << tparoi << finl;
384 Nusselt <<
"Bord " << le_bord.
le_nom() << finl;
387 Nusselt <<
"----------------------------------------------------------------------------------------------------------------------------------------" << finl;
388 Nusselt <<
"\tFace a\t\t\t\t|" << finl;
389 Nusselt <<
"----------------------------------------------------------------------------------------------------------------------------------------" << finl;
390 Nusselt <<
"X\t\t| Y\t\t\t| dist. carac. (m)\t| Nusselt (local)\t| h (Conv. W/m2/K)\t| Tf cote paroi (K)" << finl;
391 Nusselt <<
"----------------|-----------------------|-----------------------|-----------------------|-----------------------|-----------------------" << finl;
395 Nusselt <<
"----------------------------------------------------------------------------------------------------------------------------------------" << finl;
396 Nusselt <<
"\tFace a\t\t\t\t\t\t\t|" << finl;
397 Nusselt <<
"----------------------------------------------------------------------------------------------------------------------------------------" << finl;
398 Nusselt <<
"X\t\t| Y\t\t\t| Z\t\t\t| dist. carac. (m)\t| Nusselt (local)\t| h (Conv. W/m2/K)\t| Tf cote paroi (K)" << finl;
399 Nusselt <<
"----------------|-----------------------|-----------------------|-----------------------|-----------------------|-----------------------" << finl;
404 for (
int num_face=ndeb; num_face<nfin; num_face++)
408 pos[i]=domaine_VDF.
xv(num_face,i);
412 dh_valeur=diam_hydr->valeur_a_compo(pos,0);
414 double x=domaine_VDF.
xv(num_face,0);
415 double y=domaine_VDF.
xv(num_face,1);
417 elem = face_voisins(num_face,0);
419 elem = face_voisins(num_face,1);
421 lambda = conductivite.
valeurs()(0,0);
425 lambda = conductivite.
valeurs()(elem);
427 lambda = conductivite.
valeurs()(elem,0);
430 Nusselt << x <<
"\t| " << y;
433 double z=domaine_VDF.
xv(num_face,2);
434 Nusselt << x <<
"\t| " << y <<
"\t| " << z;
436 int global_face=num_face;
440 << lambda/
equivalent_distance_[boundary_index](local_face) <<
"\t| " << temperature(elem) << finl;
447 Nusselt << 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.
class Champ_Fonc_base Base class of fields that are functions of a calculated quantity
DoubleTab & valeurs() override
Returns the array of field values at the current time.
class Cond_lim Generic class used to represent any class
Convection_Diffusion_std This class is the base for equations modelling the transport.
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.
const Cond_lim & les_conditions_limites(int) const
Returns the i-th boundary condition.
int orientation(int) const override
inline DoubleVect& Domaine_VDF::porosite_face() {
double xv(int num_face, int k) const
int elem_faces(int i, int j) const
Returns the index of the i-th face of element num_elem; the face numbering convention is.
int face_voisins(int num_face, int i) const
Returns the neighbouring element of num_face in direction i.
const Front_VF & front_VF(int i) 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
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.
virtual int nb_comp() const
Base class for an incompressible fluid and its properties:
const Champ_Don_base & viscosite_cinematique() const
int num_local_face(const int) const
int num_premiere_face() const
const Nom & le_nom() const override
Returns the name of the geometric boundary.
classe Loi_Paroi_Nu_Impose_VDF
int calculer_scal(Champ_Fonc_base &) override
void imprimer_nusselt(Sortie &) const override
virtual const Champ_Don_base & conductivite() const
Returns the conductivity of the medium (const version).
virtual const Champ_Don_base & diffusivite() const
Returns the diffusivity of the medium (const version).
Classe Neumann_paroi This boundary condition corresponds to an imposed flux for the.
virtual double flux_impose(int i) const
Returns the value of the imposed flux on the i-th component of the field representing the flux at the...
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.
virtual const Equation_base & equation(int) const =0
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.
Base class for output streams.
_TYPE_ local_min_vect(Mp_vect_options opt=VECT_REAL_ITEMS) const
DoubleVects equivalent_distance_
void ouvrir_fichier_partage(EcrFicPartage &, const Nom &) const
Opens or creates a print file for Face, d_eq, local Nu, h.