16#include <Perte_Charge_Singuliere_VDF_Face.h>
17#include <Champ_Face_VDF.h>
18#include <Equation_base.h>
19#include <Pb_Multiphase.h>
20#include <Matrice_Morse.h>
21#include <Matrix_tools.h>
22#include <Array_tools.h>
23#include <Domaine_VDF.h>
51 ref_cast(
Pb_Multiphase, mon_equation->probleme()).equation_masse().init_champ_conserve();
58 int taille_bloc = domaine_VDF.
nb_elem();
65 Cerr <<
"Error reading the data of the singular pressure drop:" << finl;
66 Cerr <<
" the surface on which you have defined a pressure drop" << finl;
67 Cerr <<
" does not entirely contain any faces of the geometry " << finl;
76 Cerr <<
"Error reading the data of the singular pressure drop: " << finl;
77 Cerr <<
" the orientation of the surface is different from the direction" << finl;
78 Cerr <<
" of the pressure drop" << finl;
88 Matrice_Morse *mat = matrices.count(nom_inco) ? matrices.at(nom_inco) :
nullptr, mat2;
90 const Domaine_VDF& domaine_VDF = le_dom_VDF.valeur();
91 Stencil stencil(0, 2);
93 for (
int f = 0; f < domaine_VDF.
nb_faces(); f++)
95 tableau_trier_retirer_doublons(stencil);
108 Matrice_Morse *mat = matrices.count(nom_inco) ? matrices.at(nom_inco) :
nullptr;
111 const Domaine_VDF& domaine_VDF = le_dom_VDF.valeur();
125 for (
int i=0; i<nb_faces; i++)
132 for (
int j = 0; j < 2; j++)
134 const int e = f_e(numfa, j);
136 if (e < 0 )
continue;
138 for (
int n = 0; n < N; n++)
139 aar_f(n) += vfd(numfa, j) / volumes_entrelaces(numfa) * (*a_r)(e, n) * (*alpha)(e, n);
145 if (numfa < ndeb_faces_int)
146 Ck = -0.5*
K()/le_dom_VDF->dist_norm_bord_axi(numfa);
148 Ck = -0.5*
K()/le_dom_VDF->dist_norm_axi(numfa);
149 for (
int n = 0; n < N; n++)
151 const double U = vit(numfa, n);
152 secmem(numfa, n) += aar_f(n) * Ck*U*std::fabs(U)*volumes_entrelaces[numfa]*porosite_surf[numfa];
156 for (
int i=0; i<nb_faces; i++)
162 for (
int j = 0; j < 2; j++)
164 const int e = f_e(numfa, j);
166 if (e < 0 )
continue;
168 for (
int n = 0; n < N; n++)
169 aar_f(n) += vfd(numfa, j) / volumes_entrelaces(numfa) * (*a_r)(e, n) * (*alpha)(e, n);
174 if (numfa < ndeb_faces_int)
175 Ck = -0.5 *
K() / le_dom_VDF->dist_norm_bord(numfa);
177 Ck = -0.5 *
K() / le_dom_VDF->dist_norm(numfa);
179 for (
int n = 0; n < N; n++)
181 const double Ud = vit(numfa, n) * porosite_surf[numfa];
182 const double U = inco(numfa, n) * porosite_surf[numfa];
184 secmem(numfa,n) += aar_f(n) * Ck * U * std::fabs(Ud) * volumes_entrelaces[numfa] * porosite_surf[numfa];
186 (*mat)(N * numfa + n, N * numfa + n) -= aar_f(n) * Ck * porosite_surf[numfa] * std::fabs(Ud) * volumes_entrelaces[numfa] * porosite_surf[numfa];
DoubleTab & passe(int i=1) override
Returns field values at instant t-i.
DoubleTab & valeurs() override
Returns the array of field values at the current time.
int orientation(int) const override
inline DoubleVect& Domaine_VDF::porosite_face() {
int nb_faces() const
Returns the total number of faces.
DoubleVect & volumes_entrelaces()
int nb_faces_tot() const
Returns the total number of faces.
const DoubleTab & volumes_entrelaces_dir() 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.
Class defining operators and methods for all reading operation in an input flow (file,...
virtual const Milieu_base & milieu() const =0
Champ_Inc_base & champ_conserve() const
virtual const Champ_Inc_base & inconnue() const =0
Probleme_base & probleme()
Returns the problem associated with the equation.
const Nom & le_nom() const override
Returns the name of the field.
Matrice_Morse class - Represents a (sparse) matrix M, not necessarily square,.
int nb_colonnes() const override
Return local number of columns (=size on the current proc).
DoubleVect & porosite_face()
const Equation_base & equation() const
Returns the reference to the equation pointed to by MorEqn::mon_equation.
const std::string & getString() const
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.
Multiphase thermohydraulics problem of type "3*N equations":
virtual Equation_base & equation_masse()
class Perte_Charge_Singuliere_VDF_Face
void dimensionner_blocs(matrices_t matrices, const tabs_t &semi_impl) const override
void ajouter_blocs(matrices_t matrices, DoubleTab &secmem, const tabs_t &semi_impl) const override
void mettre_a_jour(double temps) override
DOES NOTHING - to override in derived classes.
DoubleTab & ajouter_(const DoubleTab &, DoubleTab &) const override
void completer() override
Updates internal references of the Source_base object.
void remplir_num_faces(Entree &)
void update_K(const Equation_base &eqn, double deb, DoubleVect &bilan)
double calculate_Q(const Equation_base &eqn, const IntVect &num_faces, const IntVect &sgn) const
virtual void lire_surfaces(Entree &, const Domaine &, const Domaine_dis_base &, IntVect &, IntVect &, int lire_derniere_accolade=1)
Entree & lire_donnees(Entree &)
void mettre_a_jour(double temps) override
DOES NOTHING - to override in derived classes.
int direction_perte_charge() const
Returns the pressure drop direction.
const Domaine & domaine() const
Returns the domain associated with the problem.
static double mp_sum(double)
Computes the sum of x over all processors in the current group.
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Base class for output streams.
void set_fichier(const Nom &)
void set_description(const Nom &nom)
virtual void completer()
Updates internal references of the Source_base object.
void resize(_SIZE_, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)