16#include <EcritureLectureSpecial.h>
17#include <Scalaire_impose_paroi.h>
18#include <Echange_global_impose.h>
19#include <Op_Conv_negligeable.h>
20#include <Energie_Multiphase.h>
21#include <Pb_Multiphase_HEM.h>
22#include <TRUSTTab_parts.h>
23#include <Champ_Uniforme.h>
24#include <Matrice_Morse.h>
25#include <Neumann_paroi.h>
26#include <Discret_Thyd.h>
27#include <Domaine_VF.h>
48 terme_convectif.set_description((Nom)
"Convective heat transfer rate=Integral(-h*u*ndS) [W] if SI units used");
51 terme_diffusif.set_description((Nom)
"Conduction heat transfer rate=Integral(lambda*grad(T)*ndS) [W] if SI units used");
55 if (sub_type(Pb_Multiphase_HEM,
probleme()))
57 bool check_source_FICC =
false;
59 for (
int ii = 0; ii <
sources().size(); ii++)
61 check_source_FICC =
true;
63 if (!check_source_FICC)
65 EChaine source_FI(
"{ flux_interfacial }");
92 Cerr <<
"Energy equation discretization " << finl;
97 l_inco_ch_->fixer_nom_compo(i,
Nom(
"temperature_") + pb.
nom_phase(i));
100 Cerr <<
"Energie_Multiphase::discretiser() ok" << finl;
127 if (
probleme().has_correlation(
"flux_parietal")
130 if (nb_comp == 1)
return;
131 Cerr <<
"Energie_Multiphase : when using a Flux_parietal correlation, only one wall temperature/heat flux "
132 <<
"can be specified at the boundary " << cl.
le_nom() <<
" . Please provide 1 component instead of " << nb_comp <<
"!" << finl;
146 static Motcle mot(
"Thermique");
185 const DoubleTab& alpha = ch_alpha.
valeurs(),
187 &en = ch_en.valeurs();
193 for (
int i = 0; i < Nl; i++)
194 for (
int n = 0; n < N; n++)
195 val(i, n) = (alpha(i, n) - pbm.
alpha_inf_phase(n)) * rho(!cR * i, n) * en(i, n);
198 DoubleTrav b_al, b_rho, b_en;
200 b_en = ch_en.valeur_aux_bords();
210 for (
int i = 0; i < Nb; i++)
211 for (
int n = 0; n < N; n++)
212 bval(i, n) = (b_al(i, n) - pbm.
alpha_inf_phase(n)) * b_rho(i, n) * b_en(i, n);
214 DoubleTab& d_a = deriv[
"alpha"];
217 for (
int i = 0; i < Nl; i++)
218 for (
int n = 0; n < N; n++)
219 d_a(i, n) = rho(!cR * i, n) * en(i, n);
222 const tabs_t d_vide = {},
223 &d_rho = pch_rho ? pch_rho->derivees() : d_vide,
224 &d_en = ch_en.derivees();
226 std::set<std::string> vars;
227 for (
auto &&d_c : d_rho)
228 vars.insert(d_c.first);
229 for (
auto &&d_c : d_en)
230 vars.insert(d_c.first);
232 for (
auto && var : vars)
234 const DoubleTab *dr = d_rho.count(var) ? &d_rho.at(var) :
nullptr,
235 *de = d_en.count(var) ? &d_en.at(var) :
nullptr;
237 DoubleTab& d_v = deriv[var];
240 for (
int i = 0; i < Nl; i++)
241 for (
int n = 0; n < N; n++)
242 d_v(i, n) = alpha(i, n) * ((dr ? (*dr)(i, n) * en(i, n) : 0) + (de ? rho(!cR * i, n) * (*de)(i, n) : 0));
254 const DoubleTab& alpha = ch_alpha.
valeurs(),
256 &en = ch_en.valeurs();
262 for (
int i = 0; i < Nl; i++)
263 for (
int n = 0; n < N; n++)
264 val(i, n) = alpha(i, n) * rho(!cR * i, n) * en(i, n);
267 DoubleTrav b_al, b_rho, b_en;
269 b_en = ch_en.valeur_aux_bords();
280 for (
int i = 0; i < Nb; i++)
281 for (
int n = 0; n < N; n++)
282 bval(i, n) = b_al(i, n) * b_rho(i, n) * b_en(i, n);
284 DoubleTab& d_a = deriv[
"alpha"];
287 for (
int i = 0; i < Nl; i++)
288 for (
int n = 0; n < N; n++)
289 d_a(i, n) = rho(!cR * i, n) * en(i, n);
292 const tabs_t d_vide = { },
293 &d_rho = pch_rho ? pch_rho->derivees() : d_vide,
294 &d_en = ch_en.derivees();
296 std::set < std::string > vars;
297 for (
auto &&d_c : d_rho)
298 vars.insert(d_c.first);
299 for (
auto &&d_c : d_en)
300 vars.insert(d_c.first);
302 for (
auto &&var : vars)
304 const DoubleTab *dr = d_rho.count(var) ? &d_rho.at(var) :
nullptr,
305 *de = d_en.count(var) ? &d_en.at(var) :
nullptr;
307 DoubleTab& d_v = deriv[var];
310 for (
int i = 0; i < Nl; i++)
311 for (
int n = 0; n < N; n++)
312 d_v(i, n) = alpha(i, n) * ((dr ? (*dr)(i, n) * en(i, n) : 0) + (de ? rho(!cR * i, n) * (*de)(i, n) : 0));
324 const DoubleTab& alpha = ch_alpha.
valeurs(),
333 for (
int i = 0; i < Nl; i++)
334 for (
int n = 0; n < N; n++)
335 val(i, n) = alpha(i, n) * rho(!cR * i, n) * h(i, n);
338 DoubleTrav b_al, b_rho, b_h ;
340 b_h = ch_h.valeur_aux_bords();
351 for (
int i = 0; i < Nb; i++)
352 for (
int n = 0; n < N; n++)
353 bval(i, n) = b_al(i, n) * b_rho(i, n) * b_h(i, n);
355 DoubleTab& d_a = deriv[
"alpha"];
358 for (
int i = 0; i < Nl; i++)
359 for (
int n = 0; n < N; n++)
360 d_a(i, n) = rho(!cR * i, n) * h(i, n);
363 const tabs_t d_vide = { },
364 &d_rho = pch_rho ? pch_rho->derivees() : d_vide,
365 &d_h = ch_h.derivees();
367 std::set < std::string > vars;
368 for (
auto &&d_c : d_rho)
369 vars.insert(d_c.first);
370 for (
auto &&d_c : d_h)
371 vars.insert(d_c.first);
373 for (
auto &&var : vars)
375 const DoubleTab *dr = d_rho.count(var) ? &d_rho.at(var) :
nullptr,
376 *dh = d_h.count(var) ? &d_h.at(var) :
nullptr;
378 DoubleTab& d_v = deriv[var];
381 for (
int i = 0; i < Nl; i++)
382 for (
int n = 0; n < N; n++)
383 d_v(i, n) = alpha(i, n) * ((dr ? (*dr)(i, n) * h(i, n) : 0) + (dh ? rho(!cR * i, n) * (*dh)(i, n) : 0));
399 champ_convecte_->associer_eqn(*
this);
401 champ_convecte_->nommer(nom_fonc.first);
402 champ_convecte_->init_champ_calcule(*
this, nom_fonc.second);
virtual int nb_valeurs_temporelles() const
Returns the number of temporal values currently kept.
DoubleTab & valeurs() override
Returns the array of field values at the current time.
DoubleTab valeur_aux_bords() const override
Returns the field value at the boundary faces.
virtual DoubleTab & valeurs()=0
class Champ_base This class is the base of the fields hierarchy.
virtual int a_un_domaine_dis_base() const
virtual DoubleTab valeur_aux_bords() const
Returns the field value at the boundary faces.
virtual DoubleTab & valeur_aux(const DoubleTab &positions, DoubleTab &valeurs) const
Causes an error! Must be overridden by derived classes.
class Cond_lim_base Base class for the hierarchy of classes that represent the different boundary con...
Operateur_Diff terme_diffusif
Operateur_Conv terme_convectif
void temperature(const Schema_Temps_base &, Domaine_dis_base &, OWN_PTR(Champ_Inc_base)&, int nb_comp=1) const
class Discret_Thyd This class is the base class representing a discretization
static void creer_champ(OWN_PTR(Champ_Inc_base)&ch, const Domaine_dis_base &z, const Nom &type, const Nom &nom, const Nom &unite, int nb_comp, int nb_ddl, int nb_pas_dt, double temps, const Nom &directive=NOM_VIDE, const Nom &nom_discretisation=NOM_VIDE)
Static method that creates an OWN_PTR(Champ_Inc_base) of the specified type.
Classe Echange_global_impose This class represents the special case of the class.
Specialisation of Convection_Diffusion_std for multiphase flows where the transported scalar is tempe...
void verifie_ch_init_nb_comp_cl(const Champ_Inc_base &ch_ref, const int nb_comp, const Cond_lim_base &cl) const override
Verifies the number of components read for a field specification.
int has_interface_blocs() const override
int impr(Sortie &os) const override
Prints the boundary fluxes to an output stream.
Operateur_Evanescence evanescence_
const Motcle & domaine_application() const override
Returns the name of the equation's application domain.
int lire_motcle_non_standard(const Motcle &, Entree &) override
Reads non-simple-type parameters of an Objet_U from an input stream.
void assembler_blocs_avec_inertie(matrices_t matrices, DoubleTab &secmem, const tabs_t &semi_impl={}) override
static void calculer_alpha_rho_e_conv(const Objet_U &obj, DoubleTab &val, DoubleTab &bval, tabs_t &deriv)
void dimensionner_blocs(matrices_t matrices, const tabs_t &semi_impl={}) const override
void init_champ_convecte() const override
static void calculer_alpha_rho_e(const Objet_U &obj, DoubleTab &val, DoubleTab &bval, tabs_t &deriv)
const Champ_Inc_base & inconnue() const override
Returns the unknown field representing the unknown (T or H) (const version).
void discretiser() override
Discretizes the equation.
static void calculer_alpha_rho_h(const Objet_U &obj, DoubleTab &val, DoubleTab &bval, tabs_t &deriv)
virtual std::pair< std::string, fonc_calc_t > get_fonc_champ_convecte() const
void set_param(Param ¶m) const override
void dimensionner_matrice_sans_mem(Matrice_Morse &matrice) override
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 void set_param(Param &titi) const override
virtual const Milieu_base & milieu() const =0
virtual void dimensionner_matrice_sans_mem(Matrice_Morse &mat_morse)
Sources & sources()
Returns the source terms associated with the equation.
virtual void assembler_blocs_avec_inertie(matrices_t matrices, DoubleTab &secmem, const tabs_t &semi_impl={})
const Discretisation_base & discretisation() const
Returns the discretization associated with the equation.
virtual void dimensionner_blocs(matrices_t matrices, const tabs_t &semi_impl={}) const
virtual int impr(Sortie &os) const
Prints the equation operators to an output stream, unconditionally.
Probleme_base & probleme()
Returns the problem associated with the equation.
virtual void verifie_ch_init_nb_comp(const Champ_Inc_base &ch_ref, const int nb_comp) const
Verification of the number of components read for the specification of a field.
int lire_motcle_non_standard(const Motcle &, Entree &) override
Reads non-simple-type parameters of an Objet_U from an input stream.
Schema_Temps_base & schema_temps()
Returns the time scheme associated with the equation.
virtual void discretiser()
Discretizes the equation.
virtual Entree & lire_sources(Entree &)
Reading of source terms in an input stream.
virtual int has_interface_blocs() const
Champs_compris champs_compris_
Domaine_dis_base & domaine_dis()
Returns the discretized domain associated with the equation.
Base class for an incompressible fluid and its properties:
const Champ_base & energie_interne() const
const Champ_base & enthalpie() const
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).
A character string (Nom) in uppercase.
Classe Neumann_paroi This boundary condition corresponds to an imposed flux for the.
class Nom: a character string for naming TRUST objects.
Base class for TRUST objects (Objet_U).
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.
Helper class to factorize the readOn method of Objet_U classes.
void ajouter_non_std(const char *keyword, const Objet_U *value, Param::Nature nat=Param::OPTIONAL)
Register a keyword handled by Objet_U::lire_motcle_non_standard.
Multiphase thermohydraulics problem of type "3*N equations":
double alpha_inf_phase(int i) const
const Nom & nom_phase(int i) const
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Scalaire_impose_paroi Imposes a scalar at the wall in a Convection-Diffusion equation for a scalar.
Base class for output streams.
void resize(_SIZE_ n, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)
_SIZE_ dimension_tot(int) const override
_SIZE_ dimension(int d) const
_SIZE_ size_reelle_ok() const