16#include <Dirichlet_homogene.h>
17#include <Masse_ajoutee_base.h>
18#include <Champ_Face_base.h>
19#include <Masse_VDF_Face.h>
20#include <Pb_Multiphase.h>
21#include <Equation_base.h>
22#include <Milieu_base.h>
23#include <Domaine_Cl_VDF.h>
26#include <Domaine_VDF.h>
28#include <Matrix_tools.h>
48 assert(le_dom_Cl_VDF);
49 const Domaine_VDF& domaine_VDF = le_dom_VDF.valeur();
56 Cerr <<
"Masse_VDF_Face::appliquer: error in the size of sm" << finl;
67 for (
int n_bord = 0; n_bord < domaine_VDF.
nb_front_Cl(); n_bord++)
71 const Cond_lim& la_cl = le_dom_Cl_VDF->les_conditions_limites(n_bord);
74 const int nfin = ndeb + la_front_dis.
nb_faces();
78 for (
int f = ndeb; f < nfin; f++)
79 for (
int n = 0; n < N; n++)
81 else if (sub_type(
Symetrie, la_cl.valeur()))
83 for (
int f = ndeb; f < nfin; f++)
84 for (
int n = 0; n < N; n++)
87 for (
int f = ndeb; f < nfin; f++)
88 for (
int n = 0; n < N; n++)
89 sm(f, n) /= (volumes_entrelaces(f) * porosite_face(f));
95 for (
int f = ndeb; f < nb_faces; f++)
96 for (
int n = 0; n < N; n++)
97 sm(f, n) /= (volumes_entrelaces(f) * porosite_face(f));
130 &vfd = domaine.volumes_entrelaces_dir();
135 DoubleTrav masse(N, N), masse_e(N, N);
136 for (f = 0; f < domaine.nb_faces(); f++)
138 if (!pbm || fcl(f, 0) >= 2)
139 for (masse = 0, n = 0; n < N; n++) masse(n, n) = 1;
140 else for (masse = 0, i = 0; i < 2; i++)
141 if ((e = f_e(f, i)) >= 0)
143 for (masse_e = 0, n = 0; n < N; n++) masse_e(n, n) = (*a_r)(e, n);
144 if (corr) corr->
ajouter(&(*alpha)(e, 0), &rho(!cR * e, 0), masse_e);
145 for (n = 0; n < N; n++)
146 for (m = 0; m < N; m++) masse(n, m) += vfd(f, i) / vf(f) * masse_e(n, m);
148 for (n = 0; n < N; n++)
150 double fac = pf(f) * vf(f) / dt;
151 for (m = 0; m < N; m++) secmem(f, n) -= fac * resoudre_en_increments * masse(n, m) * inco(f, m);
153 for (m = 0; m < N; m++) secmem(f, n) += fac * masse(n, m) * passe(f, m);
154 else if (fcl(f, 0) == 3)
155 for (d = 0; d < D; d++)
156 secmem(f, n) += fac * masse(n, n) * ref_cast(
Dirichlet, cls[fcl(f, 1)].valeur()).val_imp(fcl(f, 2), N * d + n) * domaine.face_normales(f, d) / fs(f);
158 for (m = 0; m < N; m++)
159 if (masse(n, m)) (*mat)(N * f + n, N * f + m) += fac * masse(n, m);
176 const DoubleVect& fs = domaine.face_surfaces();
179 for (f = 0; f < domaine.nb_faces_tot(); f++)
180 if (fcl(f, 0) == 2 || fcl(f, 0) == 4)
181 for (n = 0; n < N; n++) x(f, n) = incr ? -vit(f, n) : 0;
182 else if (fcl(f, 0) == 3)
183 for (n = 0; n < N; n++)
184 for (x(f, n) = incr ? -vit(f, n) : 0, d = 0; d < D; d++)
185 x(f, n) += domaine.face_normales(f, d) / fs(f) * ref_cast(
Dirichlet, cls[fcl(f, 1)].valeur()).val_imp(fcl(f, 2), N * d + n);
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.
virtual DoubleTab & passe(int i=1)
class Cond_lim Generic class used to represent any class
class Conds_lim This class represents a vector of boundary conditions.
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.
class Domaine_Cl_dis_base Domaine_Cl_dis_base objects represent discretized boundary conditions
int nb_faces() const
Returns the total number of faces.
DoubleVect & volumes_entrelaces()
int premiere_face_int() const
A face is internal if and only if it separates two elements.
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
const Nom & le_nom() const override
Returns the name of the field.
int num_premiere_face() const
DoubleTab & corriger_solution(DoubleTab &x, const DoubleTab &y, int incr) const override
DoubleTab & appliquer_impl(DoubleTab &) const override
void dimensionner_blocs(matrices_t matrices, const tabs_t &semi_impl) const override
void completer() override
void ajouter_blocs(matrices_t matrices, DoubleTab &secmem, double dt, const tabs_t &semi_impl, int resoudre_en_increments) const override
void ajouter_blocs(matrices_t matrices, DoubleTab &secmem, double dt, const tabs_t &semi_impl, int resoudre_en_increments) const override
void dimensionner_blocs(matrices_t matrices, const tabs_t &semi_impl) const override
Added-mass correlation of the form: alpha_k rho_k Dv_k / Dt -> alpha_k rho_k Dv_k / Dt + sum_l ma(k,...
virtual void ajouter(const double *alpha, const double *rho, DoubleTab &a_r) const =0
Matrice_Morse class - Represents a (sparse) matrix M, not necessarily square,.
virtual const Champ_base & masse_volumique() const
Returns the mass density of the medium (const version).
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 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.
Multiphase thermohydraulics problem of type "3*N equations":
virtual Equation_base & equation_masse()
int has_correlation(std::string nom_correlation) const
const Correlation_base & get_correlation(std::string nom_correlation) const
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
void associer_masse_proto(const Solveur_Masse_base &, const Domaine_VF &)
void dimensionner_blocs_proto(matrices_t matrices, const tabs_t &semi_impl, const bool allocate, Stencil &) const
DoubleTab & appliquer_impl_proto(DoubleTab &) const
virtual DoubleTab & corriger_solution(DoubleTab &x, const DoubleTab &y, int incr=0) const
Base class for output streams.
Symetrie On symmetry faces, the following properties hold:
_SIZE_ dimension_tot(int) const override
_SIZE_ dimension(int d) const