16#include <Op_Conv_PolyMAC_CDO_iterateur_base.h>
17#include <Modifier_pour_fluide_dilatable.h>
18#include <Discretisation_base.h>
19#include <Probleme_base.h>
35inline void eval_fluent(
const double psc,
const int num1,
const int num2, DoubleVect& fluent)
47 const IntTab& face_voisins = domaine_PolyMAC_CDO.
face_voisins();
48 const DoubleVect& volumes = domaine_PolyMAC_CDO.
volumes();
49 const DoubleVect& face_surfaces = domaine_PolyMAC_CDO.
face_surfaces();
51 const DoubleVect& vit = (vitesse_pour_pas_de_temps_ ? vitesse_pour_pas_de_temps_->valeurs() : vit_associe);
62 for (
int n_bord = 0; n_bord < domaine_PolyMAC_CDO.
nb_front_Cl(); n_bord++)
73 for (face = num1; face < num2; face++)
75 psc = vit[face] * face_surfaces(face);
76 if ((elem1 = face_voisins(face, 0)) != -1)
83 fluent[face_voisins(face, 1)] += psc;
89 int domaine_PolyMAC_CDO_nb_faces = domaine_PolyMAC_CDO.
nb_faces();
91 for (face = premiere_face; face < domaine_PolyMAC_CDO_nb_faces; face++)
93 psc = vit[face] * face_surfaces(face);
94 eval_fluent(psc, face_voisins(face, 0), face_voisins(face, 1), fluent);
99 diviser_par_rho_si_dilatable(fluent,
equation().milieu());
100 double dt_stab = 1.e30;
101 int domaine_PolyMAC_CDO_nb_elem = domaine_PolyMAC_CDO.
nb_elem();
103 for (
int num_poly = 0; num_poly < domaine_PolyMAC_CDO_nb_elem; num_poly++)
105 double dt_elem = volumes(num_poly) / (fluent[num_poly] + DMINFLOAT);
106 if (dt_elem < dt_stab)
122 DoubleTab& es_valeurs = espace_stockage.
valeurs();
127 const IntTab& face_voisins = domaine_PolyMAC_CDO.
face_voisins();
128 const DoubleVect& volumes = domaine_PolyMAC_CDO.
volumes();
129 const DoubleVect& face_surfaces = domaine_PolyMAC_CDO.
face_surfaces();
137 int num1, num2, face;
142 for (
int n_bord = 0; n_bord < domaine_PolyMAC_CDO.
nb_front_Cl(); n_bord++)
153 for (face = num1; face < num2; face++)
155 psc = vit[face] * face_surfaces(face);
156 if ((elem1 = face_voisins(face, 0)) != -1)
159 fluent[elem1] -= psc;
163 fluent[face_voisins(face, 1)] += psc;
169 int domaine_PolyMAC_CDO_nb_faces = domaine_PolyMAC_CDO.
nb_faces();
170 for (face = domaine_PolyMAC_CDO.
premiere_face_int(); face < domaine_PolyMAC_CDO_nb_faces; face++)
172 psc = vit[face] * face_surfaces(face);
173 eval_fluent(psc, face_voisins(face, 0), face_voisins(face, 1), fluent);
177 diviser_par_rho_si_dilatable(fluent,
equation().milieu());
179 int domaine_PolyMAC_CDO_nb_elem = domaine_PolyMAC_CDO.
nb_elem();
180 for (
int num_poly = 0; num_poly < domaine_PolyMAC_CDO_nb_elem; num_poly++)
182 es_valeurs(num_poly) = volumes(num_poly) / (fluent[num_poly] + 1.e-30);
209 iter_->associer_domaine_cl_dis(zcl);
214 return iter_->impr(os);
virtual DoubleTab & valeurs()=0
class Champ_base This class is the base of the fields hierarchy.
class Cond_lim Generic class used to represent any class
Dirichlet_entree_fluide This class represents a boundary condition imposing a quantity.
int_t nb_elem_tot() const
virtual void creer_tableau_elements(Array_base &, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT) const
Creates a parallel array of values at elements.
class Domaine_Cl_dis_base Domaine_Cl_dis_base objects represent discretized boundary conditions
const Cond_lim & les_conditions_limites(int) const
Returns the i-th boundary condition.
virtual const DoubleVect & face_surfaces() const
int nb_faces() const
Returns the total number of faces.
double volumes(int i) const
int premiere_face_int() const
A face is internal if and only if it separates two elements.
int face_voisins(int num_face, int i) const
Returns the neighbouring element of num_face in direction i.
const Domaine & domaine() const
Class defining operators and methods for all reading operation in an input flow (file,...
int num_premiere_face() const
const Equation_base & equation() const
Returns the reference to the equation pointed to by MorEqn::mon_equation.
virtual Motcle get_localisation_pour_post(const Nom &option) const
virtual void calculer_pour_post(Champ_base &espace_stockage, const Nom &option, int comp) const
A character string (Nom) in uppercase.
Neumann_sortie_libre This class represents an open boundary without imposed velocity.
class Nom: a character string for naming TRUST objects.
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 const Nom & le_nom() const
Returns the name of the Objet_U. Virtual method to override: returns "neant" in this implementation.
virtual Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
Op_Conv_PolyMAC_CDO_iterateur_base(const Iterateur_PolyMAC_CDO_base &iter_base)
double calculer_dt_stab() const override
Computes dt_stab.
void associer_domaine_cl_dis(const Domaine_Cl_dis_base &) override
virtual const Champ_base & vitesse() const =0
Motcle get_localisation_pour_post(const Nom &option) const override
void completer() override
Associates the operator with the domaine_dis, the domaine_Cl_dis, and the unknown of its equation.
int impr(Sortie &os) const override
DOES NOTHING - to override in derived classes.
void calculer_pour_post(Champ_base &espace_stockage, const Nom &option, int comp) const override
Operateur_Conv_base This class is the base of the hierarchy of operators representing.
void fixer_dt_stab_conv(double dt)
virtual void completer()
Associates the operator with the domaine_dis, the domaine_Cl_dis, and the unknown of its equation.
static double mp_min(double)
Base class for output streams.