16#include <Perte_Charge_VEF.h>
17#include <Schema_Temps_base.h>
18#include <Domaine_VEF.h>
19#include <Fluide_Incompressible.h>
20#include <Probleme_base.h>
22#include <Champ_Uniforme.h>
23#include <Sous_Domaine.h>
24#include <Sous_domaine_VF.h>
25#include <Sous_domaine_dis_base.h>
26#include <Champ_P1NC.h>
27#include <Check_espace_virtuel.h>
28#include <Champ_Don_Fonc_xyz.h>
29#include <Champ_Don_Fonc_txyz.h>
34Perte_Charge_VEF::Perte_Charge_VEF():implicite_(1) { }
47 param.lire_avec_accolades_depuis(is);
48 Cerr <<
"Parsing function " <<
lambda.getString() <<
" ... ";
50 Cerr <<
" Ok" << finl;
51 if (diam_hydr->nb_comp()!=1)
53 Cerr <<
"The diam_hydr field must be defined with one component" << finl;
83 else if (mot==
"sous_domaine")
91 Cerr <<
"Keyword \"" << mot <<
"\" not understood when reading a "
106double valeur_a_la_face(
const Champ_Don_base& le_ch,
const IntTab& f_e,
int f)
109 double s = 0.0, val = 0.0;
110 for (
int i = 0, e; i < 2; i++)
111 if ((e = f_e(f, i)) > -1)
125 const DoubleTab& xv=zvef.
xv() ;
126 const DoubleTab& vit=la_vitesse->valeurs();
146 for (
int face=0; face<max_faces; face++)
157 u[dim]=vit(la_face,dim);
158 norme_u+=u[dim]*u[dim];
160 norme_u=sqrt(norme_u) ;
164 pos[i]=xv(la_face,i);
166 const double nu_valeur = nu_constant ? nu.
valeurs()(0,0) : (nu_xyz ? nu.
valeur_a_compo(pos,0) : ::valeur_a_la_face(nu, f_e, la_face));
167 const double dh_valeur = dh_constant ? diam_hydr->valeurs()(0,0) : (dh_xyz ? diam_hydr->valeur_a_compo(pos,0) : ::valeur_a_la_face(diam_hydr, f_e, la_face));
170 double reynolds=norme_u*dh_valeur/nu_valeur;
172 if (reynolds < 1.e-10)
182 double coeff_ortho,coeff_long,u_l;
183 coeffs_perte_charge(u,pos,t,norme_u,dh_valeur,nu_valeur,reynolds,coeff_ortho,coeff_long,u_l,v_valeur);
188 resu(la_face,dim)-=(coeff_ortho* u[dim] + (coeff_long-coeff_ortho)* u_l*v_valeur[dim])*volume;
204 const DoubleTab& xv=le_dom_VEF->xv() ;
205 const DoubleTab& vit=la_vitesse->
valeurs();
233 assert_espace_virtuel_vect(nu.
valeurs());
235 for (
int face=0; face<max_faces; face++)
251 u[dim]=vit(la_face,dim);
252 norme_u+=u[dim]*u[dim];
254 norme_u=sqrt(norme_u) ;
258 pos[i]=xv(la_face,i);
260 const double nu_valeur = nu_constant ? nu.
valeurs()(0,0) : (nu_xyz ? nu.
valeur_a_compo(pos,0) : ::valeur_a_la_face(nu, f_e, la_face));
261 const double dh_valeur = dh_constant ? diam_hydr->valeurs()(0,0) : (dh_xyz ? diam_hydr->valeur_a_compo(pos,0) : ::valeur_a_la_face(diam_hydr, f_e, la_face));
264 reynolds=norme_u*dh_valeur/nu_valeur;
266 if (reynolds < 1.e-10)
276 double coeff_ortho,coeff_long,u_l;
277 coeffs_perte_charge(u,pos,t,norme_u,dh_valeur,nu_valeur,reynolds,coeff_ortho,coeff_long,u_l,v_valeur);
282 matrice.
coef(n0,n0) += (coeff_ortho + (coeff_long-coeff_ortho)* v_valeur[dim]*v_valeur[dim])*volume;
317 Cerr <<
"Cannot find the discretized sub-domain associated with " <<
nom_sous_domaine << finl;
class Champ_Don_Fonc_txyz This class represents a data field that is a function
class Champ_Don_Fonc_xyz This class represents a data field that is a function
class Champ_Don_base base class of Given Fields (not calculated)
DoubleTab & valeurs() override
Overrides Champ_base::valeurs() Returns the array of values.
virtual double valeur_a_compo(const DoubleVect &position, int ncomp) const
Computes the point value of the component "compo" of the field at the point with coordinates pos.
const Sous_Domaine_t & ss_domaine(int i) const
class Domaine_Cl_dis_base Domaine_Cl_dis_base objects represent discretized boundary conditions
int nb_faces() const
Returns the total number of faces.
DoubleVect & volumes_entrelaces()
double xv(int num_face, int k) const
int face_voisins(int num_face, int i) const
Returns the neighbouring element of num_face in direction i.
class Domaine_dis_base This class is the base of the hierarchy of discretized domains.
int nombre_de_sous_domaines_dis() const
const Sous_domaine_dis_base & sous_domaine_dis(int i) 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.
Schema_Temps_base & schema_temps()
Returns the time scheme associated with the equation.
Base class for an incompressible fluid and its properties:
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.
A character string (Nom) in uppercase.
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 int est_egal_a(const Objet_U &) const
Returns 1 if x and *this are the same instance (same memory address).
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.
void ajouter_non_std(const char *keyword, const Objet_U *value, Param::Nature nat=Param::OPTIONAL)
Register a keyword handled by Objet_U::lire_motcle_non_standard.
Factorizes the common functionality of several pressure drop operators in VEF, velocity at faces.
int lire_motcle_non_standard(const Motcle &, Entree &) override
Reads non-simple-type parameters of an Objet_U from an input stream.
DoubleTab & calculer(DoubleTab &) const override
virtual void set_param(Param ¶m) const override
void contribuer_a_avec(const DoubleTab &, Matrice_Morse &) const override
Copy of ajouter except the last line.
void associer_pb(const Probleme_base &) override
Associates le_fluide and la_vitesse.
DoubleTab & ajouter(DoubleTab &) const override
Calls perte_charge for each face where needed.
Nom nom_sous_domaine
Name of the sub-domain, initialized in readOn().
virtual void coeffs_perte_charge(const DoubleVect &u, const DoubleVect &pos, double t, double norme_u, double dh, double nu, double reynolds, double &coeff_ortho, double &coeff_long, double &u_l, DoubleVect &v_valeur) const =0
Called for each face by ajouter().
void associer_domaines(const Domaine_dis_base &, const Domaine_Cl_dis_base &) override
Associates le_dom_VEF and le_dom_Cl_VEF.
void completer() override
Updates internal references of the Source_base object.
bool sous_domaine
Is the term restricted to a sub-domain?
class Probleme_base It is a Probleme_U that is not a coupling.
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.
double temps_courant() const
Returns the current time.
Base class for output streams.
Source_base A Source_base object is a term appearing on the right-hand side of an.
virtual void completer()
Updates internal references of the Source_base object.
This abstract class contains the geometrical subdomain information common to finite-volume methods (V...
const IntTab & les_faces() const
double volumes_entrelaces(int) const
Returns the interlaced volume restricted to the sub-domain. face is the index in the les_faces_ array...
const Sous_Domaine & sous_domaine() const