16#include <Convection_Diffusion_Temperature_base.h>
17#include <Echange_contact_VDF.h>
18#include <Op_Diff_VDF_base.h>
19#include <Champ_front_calc.h>
20#include <Eval_Diff_VDF.h>
21#include <Pb_Multiphase.h>
41 iter_->associer_champ_convecte_ou_inc(cc,
nullptr);
43 iter_->set_convective_op_pb_type(
false , is_pb_multi);
44 iter_->set_multiscalar_diff(
equation().diffusion_multi_scalaire());
50 iter_->associer_correlation_flux_parietal(pbm.
get_correlation(
"Flux_parietal"));
51 iter_->creer_champ_T_paroi_pour_flux_parietal();
60 return (
bool(iter_)) ? iter_->impr(os) : 0;
78 for (
int n_bord = 0; n_bord < zvdf.
nb_front_Cl(); n_bord++)
101 Matrice_Morse* mat = matrices.count(nom_inco) ? matrices.at(nom_inco) :
nullptr;
107 const DoubleTab& xv = zvdf.
xv();
111 int face, nb_faces = zvdf.
nb_faces();
112 double db_diffusivite;
114 if ((nom_eq ==
"Navier_Stokes_standard") || (nom_eq ==
"Navier_Stokes_QC") || (nom_eq ==
"Navier_Stokes_FT_Disc") || (nom_eq ==
"QDM_Multiphase"))
118 const DoubleTab& tab_diffusivite = ch_diff.
valeurs();
120 const int N = tab_diffusivite.
dimension(1);
122 if (tab_diffusivite.
size() == 1) diffu_tot = tab_diffusivite(0, 0);
123 else diffu_tot = tab_diffusivite;
125 for (face = 0; face < nb_faces; face++)
126 for (
int n = 0; n < N; n++)
129 const int elem1 = face_voisins(face, 0), elem2 = face_voisins(face, 1);
131 if (elem1 == -1) db_diffusivite = diffu_tot(elem2, n);
132 else if (elem2 == -1) db_diffusivite = diffu_tot(elem1, n);
133 else db_diffusivite = 0.5 * (diffu_tot(elem2, n) + diffu_tot(elem1, n));
135 double r = xv(face, 0);
138 if (mat) (*mat)(N * face + n, N * face + n) += db_diffusivite * volumes_entrelaces(face) / (r * r);
139 secmem(face, n) -= inco(face, n) * db_diffusivite * volumes_entrelaces(face) / (r * r);
150 Cerr <<
"Problem in Op_Diff_VDF_base::ajoute_terme_pour_axi with the equation type" << finl;
151 Cerr <<
"No other case than Navier_Stokes_std has been foreseen" << finl;
174 double dt_stab = DMAXFLOAT;
182 int rho_comme_diff = 0;
189 for (
int elem = 0; elem < zone_VDF.
nb_elem(); elem++)
194 const double l = zone_VDF.
dim_elem(elem, d);
197 for (
int n = 0; n < diffu.
dimension(1); n++)
199 double alpha_loc = diffu(Cdiffu ? 0 : elem, n);
203 alpha_loc/= rho(elem, rho_comme_diff * n);
205 const double dt_loc = (alp ? (*alp)(elem, n) : 1.0) * 0.5 / ((alpha_loc + DMINFLOAT) * h);
206 if (dt_loc < dt_stab) dt_stab = dt_loc;
DoubleTab & valeurs() override
Returns the array of field values at the current time.
virtual DoubleTab & valeurs()=0
class Champ_base This class is the base of the fields hierarchy.
class Champ_front_calc Derived class of Champ_front_var representing
const Equation_base & equation() const
Returns the equation associated with the unknown whose trace is taken.
class Cond_lim Generic class used to represent any class
const Cond_lim & les_conditions_limites(int) const
Returns the i-th boundary condition.
double dim_elem(int, int) const
int orientation(int) const override
inline DoubleVect& Domaine_VDF::porosite_face() {
int nb_faces() const
Returns the total number of faces.
DoubleVect & volumes_entrelaces()
double xv(int num_face, int k) const
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,...
class Equation_base The role of an equation is the calculation of one or more fields....
virtual const Champ_Inc_base & inconnue() const =0
virtual const Operateur & operateur(int) const =0
virtual const Champ_base & get_diffusivite() const final
const Nom & le_nom() const override
Returns the name of the field.
Matrice_Morse class - Represents a (sparse) matrix M, not necessarily square,.
const Equation_base & equation() const
Returns the reference to the equation pointed to by MorEqn::mon_equation.
A character string (Nom) in uppercase.
class Nom: a character string for naming TRUST objects.
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.
class Op_Diff_VDF_base Classe de base des operateurs de diffusion VDF
int impr(Sortie &os) const override
DOES NOTHING - to override in derived classes.
double calculer_dt_stab_(const Domaine_VDF &zone_VDF) const
void init_op_ext() const override
void ajoute_terme_pour_axi(matrices_t, DoubleTab &, const tabs_t &) const
DoubleTab & calculer(const DoubleTab &, DoubleTab &) const override
Computes the diffusion contribution and stores it in resu.
void completer() override
Associates the operator with the domaine_dis, the domaine_Cl_dis, and the unknown of its equation.
Op_Diff_VDF_base(const Iterateur_VDF_base &iter_base)
Operateur_Diff_base This class is the base of the hierarchy of operators representing.
std::vector< const Operateur_Diff_base * > op_ext
virtual const Champ_base & diffusivite() const =0
virtual const Champ_base & diffusivite_pour_pas_de_temps() const
Returns the field corresponding to the true diffusivity of the medium used for the time step computat...
virtual void completer()
Associates the operator with the domaine_dis, the domaine_Cl_dis, and the unknown of its equation.
const std::string & nom_inconnue() const
virtual DoubleTab & ajouter(const DoubleTab &, DoubleTab &) const
virtual Operateur_base & l_op_base()=0
Multiphase thermohydraulics problem of type "3*N equations":
int has_correlation(std::string nom_correlation) const
const Correlation_base & get_correlation(std::string nom_correlation) const
static double mp_min(double)
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Base class for output streams.
virtual const Champ_base & get_champ_masse_volumique() const
Returns the density field.
virtual int has_champ_masse_volumique() const
Returns 1 if the density field has been associated, 0 otherwise.
_SIZE_ dimension(int d) const