16#include <Navier_Stokes_Fluide_Dilatable_base.h>
17#include <Fluide_Dilatable_base.h>
18#include <Loi_Etat_Multi_GP_WC.h>
19#include <Schema_Temps_base.h>
20#include <Probleme_base.h>
21#include <Discret_Thyd.h>
33 divergence.set_description((Nom)
"Mass flow rate=Integral(rho*u*ndS) [kg.s-1]");
51 if (mot ==
"mass_source")
54 if (typ ==
"VEFPreP1B") typ =
"VEF";
56 typ =
Nom(
"Source_Masse_Fluide_Dilatable_") + typ;
57 Cerr <<
"Typing the mass source: " << typ << finl;
58 source_masse_.typer(typ);
59 Cerr <<
"Reading the mass source ... " << finl;
60 is >> source_masse_.valeur();
85 Cerr <<
"Navier_Stokes_Fluide_Dilatable_base::completer" << finl;
91 Cerr <<
"Error in Navier_Stokes_Fluide_Dilatable_base::completer() !! " << finl;
92 Cerr <<
"Switch to a WC problem if you want to use the mass source term ! This source term is not available for a QC problem !" << finl;
96 source_masse_->completer();
100 const int ncomp = source_masse_->nb_comp();
104 Cerr <<
"Error in Navier_Stokes_Fluide_Dilatable_base::completer() !! " << finl;
105 Cerr <<
"You can not define a mass source with " << ncomp <<
" components while using a problem of type " <<
probleme().
que_suis_je() << finl;
106 Cerr <<
"Please define a mass source with 2 components !" << finl;
113 assert(fd.loi_etat()->
que_suis_je() ==
"Loi_Etat_Multi_Gaz_Parfait_WC");
118 Cerr <<
"Error in Navier_Stokes_Fluide_Dilatable_base::completer() !! " << finl;
119 Cerr <<
"You should define " << nb_esp <<
" components for your mass source and not " << ncomp <<
" (because you have " << nb_esp <<
" species) !!!" << finl;
125 Cerr <<
"Navier_Stokes_std::completer" << finl;
134 return le_fluide->viscosite_dynamique();
139 return le_fluide->viscosite_cinematique();
191 throw std::runtime_error(std::string(
"Field ") + nom.
getString() + std::string(
" not found !"));
198 const DoubleTab& tab_rho = fluide_dil.
rho_discvit();
199 DoubleTab& rhovitesse = rho_la_vitesse_->valeurs();
211 source_masse_->changer_temps_futur(tps, i);
226 rho_la_vitesse_->nommer(
"rho_u");
class Champ_Don_base base class of Given Fields (not calculated)
DoubleTab & valeurs() override
Overrides Champ_base::valeurs() Returns the array of values.
DoubleTab & valeurs() override
Returns the array of field values at the current time.
class Champ_base This class is the base of the fields hierarchy.
class Discret_Thyd This class is the base class representing a discretization
void vitesse(const Schema_Temps_base &, Domaine_dis_base &, OWN_PTR(Champ_Inc_base)&, int nb_comp=1) const
Class defining operators and methods for all reading operation in an input flow (file,...
const Discretisation_base & discretisation() const
Returns the discretization associated with the equation.
virtual Domaine_Cl_dis_base & domaine_Cl_dis()
Returns the discretized boundary condition domain associated with the equation.
Probleme_base & probleme()
Returns the problem associated with the equation.
Schema_Temps_base & schema_temps()
Returns the time scheme associated with the equation.
Domaine_dis_base & domaine_dis()
Returns the discretized domain associated with the equation.
const Nom & le_nom() const override
Returns the name of the field.
Base class for a dilatable fluid, inheriting from Fluide_base.
const DoubleTab & rho_discvit() const
State law class for a mixture of ideal gases in the weakly compressible (WC) framework.
const Champ_Don_base & masse_molaire_especes() const
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.
void assembler_avec_inertie_impl(const Navier_Stokes_std &eqn, Matrice_Morse &mat_morse, const DoubleTab &present, DoubleTab &secmem)
DoubleTab & rho_vitesse_impl(const DoubleTab &tab_rho, const DoubleTab &vit, DoubleTab &rhovitesse) const
int impr_impl(const Navier_Stokes_std &eqn, Sortie &os) const
DoubleTab & derivee_en_temps_inco_impl(Navier_Stokes_std &, DoubleTab &res)
Computes the time derivative of the velocity unknown, i.e. the acceleration dU/dt,...
void assembler_blocs_avec_inertie(const Navier_Stokes_std &eqn, matrices_t matrices, DoubleTab &secmem, const tabs_t &semi_impl)
void assembler_impl(Matrice_Morse &mat_morse, const DoubleTab &present, DoubleTab &secmem)
Base class carrying the terms of the momentum equation for a fluid without turbulence modelling under...
bool has_champ(const Motcle &nom, OBS_PTR(Champ_base) &ref_champ) const override
void assembler_avec_inertie(Matrice_Morse &mat_morse, const DoubleTab &present, DoubleTab &secmem) override
const Champ_Inc_base & rho_la_vitesse() const override
DoubleTab & derivee_en_temps_inco(DoubleTab &) override
Returns the time derivative of the unknown I of the equation: dI/dt = M-1*(sum(operators(I) + sources...
int lire_motcle_non_standard(const Motcle &mot, Entree &is) override
Reads non-simple-type parameters of an Objet_U from an input stream.
const Champ_base & diffusivite_pour_pas_de_temps() const override
void completer() override
Completes the base equation: associates the pressure, completes the divergence, gradient and pressure...
void discretiser() override
Discretizes the equation.
const Champ_Don_base & diffusivite_pour_transport() const override
const Champ_base & vitesse_pour_transport() const override
void assembler(Matrice_Morse &mat_morse, const DoubleTab &present, DoubleTab &secmem) override
int preparer_calcul() override
Calls Equation_base::preparer_calcul(), assembles the pressure solver and initialises the pressure.
void set_param(Param ¶m) const override
const Champ_base & get_champ(const Motcle &nom) const override
int impr(Sortie &os) const override
Prints the equation operators to an output stream, unconditionally.
void assembler_blocs_avec_inertie(matrices_t matrices, DoubleTab &secmem, const tabs_t &semi_impl) override
bool initTimeStep(double dt) override
Allocation and initialization of the unknown and boundary conditions until present+dt.
bool has_source_masse() const
Navier_Stokes_std This class carries the terms of the momentum equation.
const Milieu_base & milieu() const override
Returns the physical medium of the equation (Fluide_base upcast to Milieu_base).
const Champ_Inc_base & inconnue() const override
Returns the velocity (unknown field of the equation) (const version).
int lire_motcle_non_standard(const Motcle &, Entree &) override
Reads non-simple-type parameters of an Objet_U from an input stream.
void completer() override
Completes the base equation, associates the pressure with the equation,.
bool initTimeStep(double dt) override
Allocation and initialization of the unknown and boundary conditions until present+dt.
int impr(Sortie &os) const override
Prints some information to an output stream: - maximum of div U.
void set_param(Param &titi) const override
void discretiser() override
Discretizes the equation.
int preparer_calcul() override
cf Equation_base::preparer_calcul() Assembly of the pressure solver and
OBS_PTR(Fluide_base) le_fluide
bool has_champ(const Motcle &nom, OBS_PTR(Champ_base) &ref_champ) const override
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.
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.
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
double temps_courant() const
Returns the current time.
virtual double temps_futur(int i) const =0
virtual int nb_valeurs_futures() const =0
virtual double temps_defaut() const =0
Base class for output streams.