16#include <Neumann_sortie_libre.h>
17#include <Check_espace_virtuel.h>
18#include <Dirichlet_homogene.h>
19#include <Schema_Temps_base.h>
20#include <Navier_Stokes_std.h>
21#include <Op_Grad_VDF_Face.h>
22#include <communications.h>
23#include <Champ_Face_VDF.h>
24#include <Pb_Multiphase.h>
25#include <EcrFicPartage.h>
26#include <Champ_P0_VDF.h>
27#include <Matrix_tools.h>
28#include <Domaine_Cl_VDF.h>
29#include <Array_tools.h>
30#include <Option_VDF.h>
32#include <Periodique.h>
35#include <Perf_counters.h>
50 const DoubleTab& pression_P0 = la_pression_P0.
valeurs();
53 for (
int n_bord=0; n_bord<nb_bord; n_bord++)
58 int nfin = ndeb + le_bord.
nb_faces();
59 for (
int face=ndeb; face<nfin; face++)
64 if (elem0 != -1)
flux_bords_(face,ori) = (pression_P0(elem0))*n0 ;
76 const int impr_mom=le_dom_vdf->domaine().moments_a_imprimer();
77 const int impr_sum=(le_dom_vdf->domaine().bords_a_imprimer_sum().est_vide() ? 0:1);
78 const int impr_bord=(le_dom_vdf->domaine().bords_a_imprimer().est_vide() ? 0:1);
93 for (
int n_bord=0; n_bord<nb_bord; n_bord++)
97 int impr_boundary = (zvdf.
domaine().bords_a_imprimer_sum().contient(le_bord.
le_nom()) ? 1 : 0);
99 int nfin = ndeb + le_bord.
nb_faces();
101 for (face=ndeb; face<nfin; face++)
104 tab_flux_bords(0, n_bord, ori) +=
flux_bords_(face,ori) ;
112 tab_flux_bords(1, n_bord, 0) +=
flux_bords_(face,0) ;
113 tab_flux_bords(1, n_bord, 1) +=
flux_bords_(face,1) ;
126 tab_flux_bords(1, n_bord, 0) +=
flux_bords_(face,0) ;
127 tab_flux_bords(1, n_bord, 1) +=
flux_bords_(face,1) ;
128 tab_flux_bords(1, n_bord, 2) +=
flux_bords_(face,2) ;
146 for (
int n_bord=0; n_bord<nb_bord; n_bord++)
150 Flux_grad.add_col(tab_flux_bords(0, n_bord, 0));
151 Flux_grad.add_col(tab_flux_bords(0, n_bord, 1));
162 Flux_grad.add_col(tab_flux_bords(0, n_bord, 0));
163 Flux_grad.add_col(tab_flux_bords(0, n_bord, 1));
164 Flux_grad.add_col(tab_flux_bords(0, n_bord, 2));
184 const LIST(
Nom)& Liste_bords_a_imprimer = zvdf.
domaine().bords_a_imprimer();
185 if (!Liste_bords_a_imprimer.est_vide())
189 for (
int n_bord=0; n_bord<nb_bord; n_bord++)
194 int nfin = ndeb + le_bord.
nb_faces();
195 if (zvdf.
domaine().bords_a_imprimer().contient(le_bord.
le_nom()))
199 Flux_grad_face <<
"# Force par face sur " << le_bord.
le_nom() <<
" au temps ";
201 Flux_grad_face <<
" : " << finl;
203 for (face=ndeb; face<nfin; face++)
205 Flux_grad_face <<
"# Face a x= " << zvdf.
xv(face,0) <<
" y= " << zvdf.
xv(face,1);
206 if (
dimension==3) Flux_grad_face <<
" z= " << zvdf.
xv(face,2);
209 Flux_grad_face << finl;
220 if (!matrices.count(
"pression"))
return;
227 const int N = vit.
line_size(), M = press.line_size();
230 for (
int f = 0; f < zvdf.
nb_faces(); f++)
231 for (
int i = 0, e; i < 2; i++)
233 for (
int n = 0, m = 0; n < N; n++, m += (M > 1))
236 tableau_trier_retirer_doublons(sten);
244 Matrice_Morse *mat = matrices.count(
"pression") ? matrices.at(
"pression") :
nullptr;
245 const DoubleTab& inco = semi_impl.count(
"pression") ? semi_impl.at(
"pression") : (le_champ_inco ? le_champ_inco->valeurs() : ref_cast(
Navier_Stokes_std,
equation()).pression().valeurs()),
248 assert_espace_virtuel_vect(inco);
257 for (
int n_bord = 0; n_bord < zvdf.
nb_front_Cl(); n_bord++)
266 for (
int num_face = ndeb; num_face < nfin; num_face++)
267 for (
int n = 0, m = 0; n < N; n++, m += (M > 1))
269 const double P_imp = la_cl_typee.
flux_impose(num_face-ndeb, m);
275 if(mat) (*mat)(N * num_face + n, M * n0 + m) -= coef;
276 secmem(num_face, n) -= coef * (P_imp - inco(n0, m));
282 if(mat) (*mat)(N * num_face + n, M * n1 + m) += coef;
283 secmem(num_face, n) -= coef * (inco(n1, m) - P_imp);
289 for (
int f = ndeb; f < nfin; f++)
290 for (
int n = 0, m = 0; n < N; n++, m += (M > 1))
293 const double alpha_face = alp ? (vfd(f, 0) * (*alp)(n0, n) + vfd(f, 1) * (*alp)(n1, n)) / vf(f) : 1.0;
294 const double coef = face_surfaces(f) *
porosite_surf(f) * alpha_face;
295 secmem(f, n) -= coef * (inco(n1, m) - inco(n0, m));
298 else if (sub_type(
Symetrie,la_cl.valeur())) { }
304 for (
int n = 0, m = 0; n < N; n++, m += (M > 1))
308 const double alpha_face = alp ? (vfd(f, 0) * (*alp)(n0, n) + vfd(f, 1) * (*alp)(n1, n)) / vf(f) : 1.0;
309 const double coef = face_surfaces(f) *
porosite_surf(f) * alpha_face;
312 (*mat)(N * f + n, M * n0 + m) -= coef;
313 (*mat)(N * f + n, M * n1 + m) += coef;
315 secmem(f, n) -= coef * (inco(n1, m) - inco(n0, m));
DoubleTab & valeurs() override
Returns the array of field values at the current time.
class Champ_P0_VDF Class representing a P0 discrete field per element associated with a discretized d...
class Cond_lim Generic class used to represent any class
Classe Dirichlet_homogene This class is the base class of the hierarchy of homogeneous Dirichlet-type...
Dirichlet This class is the base class of the hierarchy of Dirichlet-type 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.
DoubleVect & volumes_entrelaces()
const DoubleTab & volumes_entrelaces_dir() const
double xv(int num_face, int k) const
DoubleTab calculer_xgr() const
Computes the xgr array for the computation of moments of forces at boundaries.
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.
int nb_faces_bord() const
Returns the number of faces on which boundary conditions are applied:
const Domaine & domaine() const
Sortie & syncfile() override
Triggers writing to disk of the data accumulated on the different processors since the last call to s...
Class defining operators and methods for all reading operation in an input flow (file,...
Probleme_base & probleme()
Returns the problem associated with the equation.
int num_premiere_face() const
const Nom & le_nom() const override
Returns the name of the geometric boundary.
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).
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_pa()
Neumann_sortie_libre This class represents an open boundary without imposed velocity.
virtual double flux_impose(int i) const
Returns the value of the imposed flux on the i-th component of the field representing the flux at the...
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 Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
class Op_Grad_VDF_Face This class represents the gradient operator
int impr(Sortie &os) const override
DOES NOTHING - to override in derived classes.
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 calculer_flux_bords() const override
SFichier Flux_grad_moment
void ouvrir_fichier_partage(EcrFicPartage &, const Nom &, const int flag=1) const
Opening/creation of a shared file for printing an operator. To override in derived classes.
void ouvrir_fichier(SFichier &os, const Nom &, const int flag=1) const
Opening/creation of a file for printing an operator. To override in derived classes.
static double coeff_P_neumann
Multiphase thermohydraulics problem of type "3*N equations":
class Periodique This class represents a periodic boundary condition.
const Schema_Temps_base & schema_temps() const
Returns the time scheme associated with the problem.
static void mp_sum_for_each_item(TRUSTArray< _TYPE_ > &x, int n=-1)
static int je_suis_maitre()
Returns 1 if on the master processor of the current group (i.e. me() == 0), 0 otherwise.
double temps_courant() const
Returns the current time.
void imprimer_temps_courant(SFichier &) const
Base class for output streams.
Symetrie On symmetry faces, the following properties hold:
_SIZE_ size_totale() const
virtual void echange_espace_virtuel(IsExchangeBlocking exchange_type=IsExchangeBlocking::DefaultBlocking, const std::string kernel_name="noname")