16#include <Terme_Source_Qdm_lambdaup_VEF_Face.h>
17#include <Domaine_VEF.h>
18#include <Navier_Stokes_std.h>
19#include <Probleme_base.h>
20#include <Schema_Temps_base.h>
21#include <Champ_P1NC.h>
38 Motcle accouverte =
"{" , accfermee =
"}" ;
43 Cerr << motlu <<
" --> " << finl;
44 Cerr <<
"{ expected when reading lambda uprime source term " << finl;
45 Cerr <<
"The syntax of keyword Source_Qdm_lambdaup has changed, see the" << finl;
46 Cerr <<
"user manual of version 1.5.5 or later." << finl;
47 Cerr <<
"The value of lambda, which can now be variable," << finl;
48 Cerr <<
"must be preceded by a keyword:" << finl;
49 Cerr <<
"Thus, Source_Qdm_lambdaup value becomes:" <<finl;
50 Cerr <<
"Source_Qdm_lambdaup { lambda value }" <<finl;
55 les_mots[0] =
"lambda";
56 les_mots[1] =
"lambda_min";
57 les_mots[2] =
"lambda_max";
58 les_mots[3] =
"ubar_umprim_cible";
62 while(motlu!=accfermee)
65 int rang=les_mots.search(motlu);
95 <<
" not recognised in lambda uprime source term "
106 Cerr <<
"Error reading lambda in " <<
que_suis_je() << finl;
107 Cerr <<
" lambda must be defined and greater than 0 " << finl;
110 Cerr <<
"Exiting readOn " << finl;
118 for (
int i=0; i<nb_eqn; i++)
129 Cerr <<
"Lambdaup : " << eqn.
que_suis_je() << finl;
134 Cerr <<
"TRUST error in " <<
que_suis_je() << finl;
135 Cerr <<
"No hydraulic equation found in the problem" << finl;
150 static double rapport_old=1.;
151 const Domaine_VEF& domaine_VEF = le_dom_VEF.valeur();
154 const DoubleTab& vitesse=la_vitesse->valeurs();
155 DoubleTab ubar(vitesse);
156 DoubleTab uprime(vitesse);
157 const int nb_faces = domaine_VEF.
nb_faces();
162 la_vitesse->filtrer_L2(ubar);
165 double normbar_carre = local_carre_norme_vect(ubar);
166 double normprim_carre = local_carre_norme_vect(uprime);
168 double normbar = sqrt(normbar_carre);
169 double normprim = sqrt(normprim_carre);
171 double rapport=(normprim!=0?normbar/normprim:0);
173 if( (rapport <
cible) && (rapport<rapport_old) ) l*=2.;
174 if( (rapport <
cible) && (rapport>rapport_old) ) l*=1.1;
175 if( (rapport>
cible) && (rapport>rapport_old) ) l*=0.95;
178 Cerr <<
"|ubar| = " << normbar << finl;
179 Cerr <<
"|ubar|/|uprim| = " << rapport << finl;
180 Cerr <<
"lambda " <<
lambda << finl;
181 for(face=0; face<nb_faces; face++)
184 double v=volumes_entrelaces(face)*porosite_face(face);
195 double dt=la_vitesse->equation().schema_temps().pas_de_temps();
214 const Domaine_VEF& domaine_VEF = le_dom_VEF.valeur();
215 const Domaine& domaine = domaine_VEF.
domaine();
217 double dnorme_H1,norme_H1_comp,int_grad_elem,norme_grad_elem;
228 for (
int composante=0; composante<vitesse.
line_size(); composante++)
231 for (
int K=0; K<domaine.nb_elem(); K++)
237 for (
int face=0; face<domaine.nb_faces_elem(); face++)
239 face_globale = domaine_VEF.
elem_faces(K,face);
241 int_grad_elem += vitesse(face_globale,composante)*
246 norme_grad_elem += int_grad_elem*int_grad_elem;
249 norme_H1_comp += norme_grad_elem/domaine_VEF.
volumes(K);
252 dnorme_H1 += norme_H1_comp;
255 return sqrt(dnorme_H1);
260 double pas_de_temps = la_vitesse->equation().schema_temps().pas_de_temps();
267 const Domaine_VEF& domaine_VEF = le_dom_VEF.valeur();
269 const int nb_faces = domaine_VEF.
nb_faces();
275 for(; i<nb_faces; i++)
278 for(
int j=0; j<nb_compo_; j++)
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()
virtual double face_normales(int face, int comp) const
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 oriente_normale(int f, int e) const
class Domaine_dis_base This class is the base of the hierarchy of discretized domains.
const Domaine & domaine() const
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.
Domaine_dis_base & domaine_dis()
Returns the discretized domain associated with the equation.
DoubleVect & porosite_face()
const Equation_base & equation() const
Returns the reference to the equation pointed to by MorEqn::mon_equation.
Navier_Stokes_std This class carries the terms of the momentum equation.
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 Probleme_base It is a Probleme_U that is not a coupling.
virtual int nombre_d_equations() const =0
virtual const Equation_base & equation(int) const =0
static void mp_sum_for_each(T &arg1, T &arg2)
C++14 compatible mp_sum_for_each: combine multiple mp_sum calls into one collective operation Usage: ...
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Base class for output streams.
Source_base A Source_base object is a term appearing on the right-hand side of an.
void ajoute(_SCALAR_TYPE_ alpha, const TRUSTVect &y, Mp_vect_options opt=VECT_ALL_ITEMS)
class Terme_Source_Qdm_lambdaup_VEF_Face
void mettre_a_jour(double) override
DOES NOTHING - to override in derived classes.
double norme_L2(const DoubleTab &) const
DoubleTab & calculer(DoubleTab &) const override
void associer_domaines(const Domaine_dis_base &, const Domaine_Cl_dis_base &) override
double norme_L2_H1(const DoubleTab &) const
DoubleTab & ajouter(DoubleTab &) const override
double norme_H1(const DoubleTab &) const
void associer_pb(const Probleme_base &) override