16#include <Sortie_libre_Gradient_Pression_impose.h>
17#include <Domaine_Cl_dis_base.h>
18#include <Navier_Stokes_std.h>
19#include <Champ_Uniforme.h>
20#include <Milieu_base.h>
21#include <Champ_P0_VDF.h>
22#include <Domaine_VDF.h>
38 le_champ_ext.typer(
"Champ_front_uniforme");
39 le_champ_ext->valeurs().resize(1,
dimension);
45 Cerr <<
"Sortie_libre_Gradient_Pression_impose::completer()" << finl;
53 const DoubleVect& face_surfaces = domaine_vdf.
face_surfaces();
55 le_dom_VDF = domaine_vdf;
56 pression_interne = pression;
59 int nb_faces_loc = le_bord.
nb_faces();
63 coeff.resize(nb_faces_loc);
66 for (face = ndeb; face < ndeb + nb_faces_loc; face++)
67 if (face_voisins(face, 0) != -1)
68 coeff[face - ndeb] = volumes_entrelaces[face] / face_surfaces[face];
70 coeff[face - ndeb] = -volumes_entrelaces[face] / face_surfaces[face];
72 Cerr <<
"Sortie_libre_Gradient_Pression_impose::completer() ok" << finl;
82 int nb_faces_loc = le_bord.
nb_faces();
84 assert(pression_interne);
85 for (
int face = ndeb; face < ndeb + nb_faces_loc; face++)
91 if (le_champ_front->valeurs().size() == 1)
93 else if (le_champ_front->valeurs().line_size() == 1)
96 Cerr <<
"Sortie_libre_Gradient_Pression_impose::flux_impose error" << finl;
105 Cerr <<
"Sortie_libre_Gradient_Pression_impose::flux_impose(int , int )" << finl;
106 Cerr <<
"Only the normal component of the gradient can be imposed" << finl;
117 double d_rho = rho.
valeurs()(0, 0);
118 if (le_champ_front->valeurs().size() == 1)
119 return le_champ_front->valeurs()(0, 0) / d_rho;
120 else if (le_champ_front->valeurs().line_size() == 1)
121 return le_champ_front->valeurs()(face, 0) / d_rho;
123 Cerr <<
"Sortie_libre_Gradient_Pression_impose::grad_P_imp() error" << finl;
129 int elem = le_dom_VDF->face_voisins(face, 0);
131 elem = le_dom_VDF->face_voisins(face, 1);
132 double d_rho = tab_rho(elem);
133 if (le_champ_front->valeurs().size() == 1)
134 return le_champ_front->valeurs()(0, 0) / d_rho;
135 else if (le_champ_front->valeurs().line_size() == 1)
136 return le_champ_front->valeurs()(face, 0) / d_rho;
138 Cerr <<
"Sortie_libre_Gradient_Pression_impose::grad_P_imp() error" << finl;
DoubleTab & valeurs() override
Overrides Champ_base::valeurs() Returns the array of values.
class Champ_P0_VDF Class representing a P0 discrete field per element associated with a discretized d...
virtual DoubleTab & valeurs()=0
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 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 const DoubleVect & face_surfaces() const
DoubleVect & volumes_entrelaces()
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.
class Sortie_libre_Gradient_Pression_impose
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...
DoubleVect trace_pression_int
void mettre_a_jour(double) override
Performs a time update of the boundary condition.
virtual double grad_P_imp(int) const
Base class for output streams.