16#include <Sortie_libre_Gradient_Pression_libre_VEF.h>
17#include <Domaine_Cl_dis_base.h>
18#include <Navier_Stokes_std.h>
19#include <Champ_Uniforme.h>
20#include <distances_VEF.h>
21#include <Champ_P0_VEF.h>
22#include <Milieu_base.h>
23#include <Domaine_VEF.h>
39 le_champ_front.typer(
"Champ_front_uniforme");
40 le_champ_front->valeurs().resize(1,
dimension);
41 le_champ_front->fixer_nb_comp(1);
42 le_champ_ext.typer(
"Champ_front_uniforme");
43 le_champ_ext->valeurs().resize(1,
dimension);
49 Cerr <<
"Sortie_libre_Gradient_Pression_libre_VEF::completer()" << finl;
58 pression_interne = pression;
61 int nb_faces_loc = le_bord.
nb_faces();
65 Cerr <<
"Sortie_libre_Gradient_Pression_libre_VEF::completer() ok" << finl;
82 int nb_faces_loc = le_bord.
nb_faces();
84 int nfin = ndeb + nb_faces_loc;
86 coeff.resize(nb_faces_loc);
88 for (face = ndeb; face < nfin; face++)
90 int elem = face_voisins(face, 0);
92 coeff[face - ndeb] = distance_2D(face, elem, mon_dom_VEF);
95 elem = face_voisins(face, 1);
96 coeff[face - ndeb] = -distance_2D(face, elem, mon_dom_VEF);
100 for (face = ndeb; face < nfin; face++)
102 int elem = face_voisins(face, 0);
104 coeff[face - ndeb] = distance_3D(face, elem, mon_dom_VEF);
107 elem = face_voisins(face, 1);
108 coeff[face - ndeb] = -distance_3D(face, elem, mon_dom_VEF);
120 int nb_faces_loc = le_bord.
nb_faces();
121 int nfin = ndeb + nb_faces_loc;
123 assert(pression_interne);
124 for (
int face = ndeb; face < nfin; face++)
137 const IntTab& face_voisins = mon_dom_VEF.
face_voisins();
140 const IntTab& elem_faces = mon_dom_VEF.
elem_faces();
141 const DoubleTab& face_normales = mon_dom_VEF.
face_normales();
144 double Pimp, diff, grad;
146 int elem1, elem2, face_adj, face_face_adj;
149 double a2 =
coeff[face];
153 elem1 = face_voisins(face, 0);
155 for (face_adj = 0; face_adj <
dimension; face_adj++)
157 face_face_adj = elem_faces(elem1, face_adj);
159 elem2 = face_voisins(face_face_adj, 0);
164 for (
int comp = 0; comp <
dimension; comp++)
166 grad = diff * face_normales(face_face_adj, comp);
182 Cerr <<
"Sortie_libre_Gradient_Pression_libre_VEF::flux_impose(int , int )" << finl;
183 Cerr <<
"Only the normal component of the gradient can be imposed" << finl;
192 double d_rho = rho.
valeurs()(0, 0);
193 if (le_champ_front->valeurs().size() == 1)
194 return le_champ_front->valeurs()(0, 0) / d_rho;
195 else if (le_champ_front->valeurs().line_size() == 1)
196 return le_champ_front->valeurs()(face, 0) / d_rho;
198 Cerr <<
"Sortie_libre_Gradient_Pression_libre_VEF::Grad_P_lib_VEF() error" << finl;
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.
std::vector< Nom > supp_discs
virtual void mettre_a_jour(double temps)
Performs a time update of the boundary condition.
Domaine_Cl_dis_base & domaine_Cl_dis()
Returns the domain of discretized boundary conditions to which the object belongs.
std::vector< Motcle > app_domains
virtual int initialiser(double temps)
Initialization at the beginning of the calculation.
virtual Frontiere_dis_base & frontiere_dis()
Returns the discretized boundary to which the boundary conditions apply.
class Domaine_Cl_dis_base Domaine_Cl_dis_base objects represent discretized boundary conditions
virtual double face_normales(int face, int comp) 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.
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
Domaine_dis_base & domaine_dis()
Returns the discretized domain associated with the equation.
int num_premiere_face() const
Milieu_base This class is the base of the (physical) medium hierarchy.
virtual const Equation_base & equation(const std::string &nom_inc) const
virtual const Champ_base & masse_volumique() const
Returns the mass density of the medium (const version).
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.
Champ_Inc_base & pression()
Neumann_sortie_libre This class represents an open boundary without imposed velocity.
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.
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
DoubleVect trace_pression_int
virtual double Grad_P_lib_VEF(int) const
int initialiser(double temps) override
Initialization at the beginning of the calculation.
void mettre_a_jour(double temps) override
Performs a time update of the boundary condition.
double flux_impose(int) const override
Returns the value of the imposed flux on the i-th component of the field representing the flux at the...
void completer() override
DOES NOTHING must be overridden in derived classes.
Base class for output streams.