16#include <Perte_Charge_Reguliere_VEF_P1NC.h>
17#include <Domaine_VEF.h>
18#include <Sous_Domaine.h>
19#include <Fluide_Incompressible.h>
20#include <Equation_base.h>
21#include <Probleme_base.h>
23#include <Champ_Uniforme.h>
24#include <Matrice_Morse.h>
44 Cerr <<
" Perte_Charge_Reguliere_VEF_P1NC::readOn " << finl ;
63 Cerr <<
" Perte_Charge_Reguliere_VEF_P1NC::remplir_num_faces " << finl;
65 const Domaine_VEF& domaine_VEF = le_dom_VEF.valeur();
67 const IntTab& elem_faces = domaine_VEF.
elem_faces();
69 const DoubleVect& volumes = domaine_VEF.
volumes();
70 const Sous_Domaine& le_sous_domaine = le_domaine.
ss_domaine(un_nom_sous_domaine);
71 int nb_poly_ss_domaine = le_sous_domaine.
nb_elem_tot();
89 int num_elem,num_face, face_loc;
91 for (num_elem=0; num_elem<nb_poly_ss_domaine; num_elem++)
93 num_loc[le_sous_domaine(num_elem)] = num_elem;
96 for (num_elem=0; num_elem<nb_poly_ss_domaine; num_elem++)
98 num_poly = le_sous_domaine(num_elem);
99 for (face_loc = 0; face_loc < nfe ; face_loc++)
101 num_face = elem_faces(num_poly,face_loc);
102 if (fait(num_face) ==-1)
106 for (
int i=0; i<2; i++ )
108 num_poly_vois = face_voisins(num_face,i);
109 if (num_poly_vois != -1)
110 if (num_loc[num_poly_vois] == -1)
112 corr_front_ss[nfac-1] = volumes(num_poly)/(volumes(num_poly)+volumes(num_poly_vois)) ;
128 const DoubleTab& vit = la_vitesse->valeurs();
129 const IntTab& face_voisins = domaine_VEF.
face_voisins();
132 double Cf,CK,Reynolds;
136 const DoubleTab& visco = nu.
valeurs();
143 d_visco = ch_nu.
valeurs()(0,0);
150 Cerr <<
" PQ : 17/06/08: This option has been removed from Perte_Charge_Reguliere_VEF_P1NC" << finl;
151 Cerr <<
" It is possible to recover the same functionality using the keyword: " << finl;
152 Cerr <<
" Perte_charge_anisotrope (see doc) " << finl;
159 for (
int i=0; i<nb_faces; i++)
165 n0 = face_voisins(numfa,0);
166 n1 = face_voisins(numfa,1);
167 if (numfa < premiere_face_int)
175 d_visco = 0.5*(visco[n0]+visco[n1]);
181 U_abs += vit(numfa,j)*vit(numfa,j);
184 U_abs = sqrt(U_abs) ;
187 Reynolds = U_abs*
D()/d_visco;
196 resu(numfa,direction) += CK*U_abs*vit(numfa,direction)*volumes_entrelaces(numfa)*porosite_face(numfa)*
corr_front_ss(i);
209 const DoubleTab& vit = la_vitesse->valeurs();
210 const IntTab& face_voisins = domaine_VEF.
face_voisins();
213 double Cf,CK,Reynolds;
217 const DoubleTab& visco = nu.
valeurs();
224 d_visco = ch_nu.
valeurs()(0,0);
231 Cerr <<
" PQ : 17/06/08: This option has been removed from Perte_Charge_Reguliere_VEF_P1NC" << finl;
232 Cerr <<
" It is possible to recover the same functionality using the keyword: " << finl;
233 Cerr <<
" Perte_charge_anisotrope (see doc) " << finl;
240 for (
int i=0; i<nb_faces; i++)
246 n0 = face_voisins(numfa,0);
247 n1 = face_voisins(numfa,1);
248 if (numfa < premiere_face_int)
256 d_visco = 0.5*(visco[n0]+visco[n1]);
262 U_abs += vit(numfa,j)*vit(numfa,j);
265 U_abs = sqrt(U_abs) ;
268 Reynolds = U_abs*
D()/d_visco;
279 matrice.
coef(n0bis,n0bis)-=CK*U_abs*volumes_entrelaces(numfa)*porosite_face(numfa)*
corr_front_ss(i);
class Champ_Don_base base class of Given Fields (not calculated)
DoubleTab & valeurs() override
Overrides Champ_base::valeurs() Returns the array of values.
const Sous_Domaine_t & ss_domaine(int i) const
int nb_faces_elem(int=0) const
Returns the number of faces of type i of the geometric elements that make up the domain.
DoubleVect & volumes_entrelaces()
int nb_faces_tot() const
Returns the total number of faces.
double volumes(int i) 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 premiere_face_int() const
A face is internal if and only if it separates two elements.
int face_voisins(int num_face, int i) const
Returns the neighbouring element of num_face in direction i.
const Domaine & domaine() const
Class defining operators and methods for all reading operation in an input flow (file,...
virtual const Milieu_base & milieu() const =0
Probleme_base & probleme()
Returns the problem associated with the equation.
Matrice_Morse class - Represents a (sparse) matrix M, not necessarily square,.
double coef(int i, int j) const
DoubleVect & porosite_face()
const Equation_base & equation() const
Returns the reference to the equation pointed to by MorEqn::mon_equation.
class Nom: a character string for naming TRUST objects.
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 Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
class Perte_Charge_Reguliere_VEF_P1NC
void completer() override
Updates internal references of the Source_base object.
void contribuer_a_avec(const DoubleTab &, Matrice_Morse &) const override
contribution to the implicit matrix of source terms, by default no contribution
void remplir_num_faces(Nom &)
DoubleTab & ajouter(DoubleTab &) const override
double calculer_Cf_blasius(double) const
Entree & lire_donnees(Entree &)
Reads the specifications of a regular pressure drop from an input stream.
class Perte_Charge_VEF_Face
int direction_perte_charge() const
Returns the pressure drop direction.
const Domaine & domaine() const
Returns the domain associated with the problem.
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Base class for output streams.
virtual void completer()
Updates internal references of the Source_base object.
int_t nb_elem_tot() const