16#include <Sortie_libre_pression_moyenne_imposee.h>
17#include <Navier_Stokes_std.h>
18#include <Champ_Uniforme.h>
19#include <Milieu_base.h>
21#include <Domaine_VF.h>
29Sortie_libre_pression_moyenne_imposee::Sortie_libre_pression_moyenne_imposee() : d_rho(-123.) { }
38 le_champ_ext.typer(
"Champ_front_uniforme");
39 le_champ_ext->valeurs().resize(1,
dimension);
40 le_champ_front.typer(
"Champ_front_fonc");
41 le_champ_front->fixer_nb_comp(1);
59 le_champ_front->valeurs().resize(
nb_faces_, 1);
60 DoubleTab& Pimp = le_champ_front->valeurs();
82 const DoubleTab& tab_P = ref_cast(
Navier_Stokes_std,mon_dom_cl_dis->equation()).pression().valeurs();
84 int face, elem, facegl;
85 DoubleTab& Pimp = le_champ_front->valeurs();
87 double Ptot = 0, s, S = 0;
91 facegl = face +
ndeb_;
97 Ptot += s * tab_P(elem);
103 Cerr <<
"Sortie_libre_pression_moyenne_imposee pmoy= " << Ptot << finl;
107 facegl = face +
ndeb_;
111 Pimp(face, 0) = tab_P(elem) + (
Pext_ - Ptot);
129 assert(!est_egal(
d_rho, -123.));
135 if (le_champ_front->valeurs().size() == 1)
136 return le_champ_front->valeurs()(0, 0) / rho_;
137 else if (le_champ_front->valeurs().dimension(1) == 1)
138 return le_champ_front->valeurs()(i, 0) / rho_;
140 Cerr <<
"Neumann::flux_impose error" << finl;
158 assert(!est_egal(
d_rho, -123.));
164 if (le_champ_front->valeurs().dimension(0) == 1)
165 return le_champ_front->valeurs()(0, j) / rho_;
167 return le_champ_front->valeurs()(i, j) / rho_;
DoubleTab & valeurs() override
Overrides Champ_base::valeurs() Returns the array of values.
virtual DoubleTab & valeurs()=0
class Champ_base This class is the base of the fields hierarchy.
virtual void mettre_a_jour(double temps)
Performs a time update of the boundary condition.
std::vector< Motcle > app_domains
virtual Frontiere_dis_base & frontiere_dis()
Returns the discretized boundary to which the boundary conditions apply.
virtual const DoubleVect & face_surfaces() 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,...
virtual const Milieu_base & milieu() const =0
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).
Navier_Stokes_std This class carries the terms of the momentum equation.
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 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.
Sortie_libre_pression_moyenne_imposee This class derives from Neumann_sortie_libre.
void mettre_a_jour(double) override
Updates the boundary conditions.
double flux_impose(int i) 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.