16#include <Sortie_libre_Gradient_Pression_libre_VEFPreP1B.h>
17#include <Champ_P1_isoP1Bulle.h>
18#include <Domaine_Cl_dis_base.h>
19#include <Navier_Stokes_std.h>
20#include <Champ_Uniforme.h>
21#include <distances_VEF.h>
22#include <Milieu_base.h>
35 le_champ_front.typer(
"Champ_front_uniforme");
36 le_champ_front->valeurs().resize(1,
dimension);
37 le_champ_front->fixer_nb_comp(1);
38 le_champ_ext.typer(
"Champ_front_uniforme");
39 le_champ_ext->valeurs().resize(1,
dimension);
46 Cerr <<
"Sortie_libre_Gradient_Pression_libre_VEFPreP1B::completer()" << finl;
57 pression_interne = pression;
60 int nb_faces_loc = le_bord.
nb_faces();
63 int nfin = ndeb + nb_faces_loc;
65 coeff.resize(nb_faces_loc);
68 for (face = ndeb; face < nfin; face++)
70 int elem = face_voisins(face, 0);
71 coeff[face - ndeb] = distance_2D(face, elem, mon_dom_VEF) * 3.;
74 for (face = ndeb; face < nfin; face++)
76 int elem = face_voisins(face, 0);
77 coeff[face - ndeb] = distance_3D(face, elem, mon_dom_VEF) * 4.;
88 Pimp.resize(nb_faces_loc);
90 Cerr <<
"Sortie_libre_Gradient_Pression_libre_VEFPreP1B::completer() ok" << finl;
100 int nb_faces_loc = le_bord.
nb_faces();
102 int nfin = ndeb + nb_faces_loc;
106 for (face = ndeb; face < nfin; face++)
108 face_loc = face - ndeb;
109 Pimp[face_loc] = pression_interne->valeur_au_bord(face);
132 int nb_faces_loc = le_bord.
nb_faces();
134 int nfin = ndeb + nb_faces_loc;
136 int face, face_loc, j;
138 const DoubleTab& xv = mon_dom_VEF.
xv();
145 for (face = ndeb; face < nfin; face++)
147 face_loc = face - ndeb;
157 for (face = ndeb; face < nfin; face++)
162 orient += (face_normale(face, j) * face_normale(face, j));
165 orient = sqrt(orient);
169 geom(face - ndeb, j) = xv(face, j);
170 geom(face - ndeb, j) -= face_normale(face, j) / orient *
coeff(face - ndeb);
178 for (face = ndeb; face < nfin; face++)
183 orient += (face_normale(face, j) * face_normale(face, j));
186 orient = sqrt(orient);
190 geom(face - ndeb, j) = xv(face, j);
191 geom(face - ndeb, j) -= face_normale(face, j) / orient * 2. *
coeff(face - ndeb);
200 for (face = ndeb; face < nfin; face++)
202 face_loc = face - ndeb;
207 if (pre_m_un_t_m_deux == pre_m_un)
210 VPhiP = (pre_m_un_t_m_deux - pre_m_un) / (pre_m_un + pre_m_un_t_m_deux - 2 * pre_m_deux_t_m_un);
216 assert(VPhiP < 1.e12);
238 double d_rho = rho.
valeurs()(0, 0);
239 if (le_champ_front->valeurs().size() == 1)
240 return le_champ_front->valeurs()(0, 0) / d_rho;
241 else if (le_champ_front->valeurs().dimension(1) == 1)
242 return le_champ_front->valeurs()(face, 0) / d_rho;
244 Cerr <<
"Sortie_libre_Gradient_Pression_libre_VEFPreP1B::Grad_P_lib_VEFPreP1B() error" << finl;
DoubleTab & valeurs() override
Overrides Champ_base::valeurs() Returns the array of values.
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
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 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 pression_temps_moins_un
DoubleVect pression_moins_deux_temps_moins_un
void mettre_a_jour(double temps) override
Performs a time update of the boundary condition.
DoubleVect pression_temps_moins_deux
int initialiser(double temps) override
Initialization at the beginning of the calculation.
DoubleTab pression_moins_deux
DoubleVect pression_moins_un_temps_moins_un
DoubleVect pression_moins_un_temps_moins_deux
void completer() override
DOES NOTHING must be overridden in derived classes.
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...
virtual double Grad_P_lib_VEFPreP1B(int) const
DoubleTab pression_moins_un
Base class for output streams.
void resize(_SIZE_ n, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)