TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Milieu_composite.h
1/****************************************************************************
2* Copyright (c) 2026, CEA
3* All rights reserved.
4*
5* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
6* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
9*
10* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
11* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
12* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
13*
14*****************************************************************************/
15
16#ifndef Milieu_composite_included
17#define Milieu_composite_included
18
19#include <Saturation_base.h>
20#include <Interface_base.h>
21#include <TRUST_Deriv.h>
22#include <Fluide_base.h>
23#include <vector>
24#include <set>
25
26/*! @brief Classe Milieu_composite Cette classe represente un fluide reel ainsi que
27 *
28 * ses proprietes:
29 * - viscosite cinematique, (mu)
30 * - viscosite dynamique, (nu)
31 * - masse volumique, (rho)
32 * - diffusivite, (alpha)
33 * - conductivite, (lambda)
34 * - capacite calorifique, (Cp)
35 * - dilatabilite thermique du constituant (beta_co)
36 *
37 * @sa Milieu_base
38 */
40{
41 Declare_instanciable(Milieu_composite);
42public :
43 int check_unknown_range() const override;
44 int initialiser(const double temps) override;
45
46 bool initTimeStep(double dt) override;
47 bool has_saturation(int k, int l) const;
48 bool has_interface(int k, int l) const;
49 inline bool has_saturation() const { return has_saturation_; }
50 inline bool has_interface() const { return has_interface_; }
51
52 void discretiser(const Probleme_base& pb, const Discretisation_base& dis) override;
53 void abortTimeStep() override;
54 void preparer_calcul() override;
55 void mettre_a_jour(double temps) override;
56 void associer_equation(const Equation_base* eqn) const override;
57
58 Interface_base& get_interface(int k, int l) const;
59 Saturation_base& get_saturation(int k, int l) const;
60
61 const Fluide_base& get_fluid(const int i) const;
62 Fluide_base& get_fluid(const int i) ;
63 inline const Noms& noms_phases() const { return noms_phases_; }
64
66
67protected :
70 double t_init_ = -1.;
71 bool has_saturation_ = false, has_interface_ = false;
72 bool res_en_T_ = true; // par defaut resolution en T
74 std::vector<std::vector<Interface_base *>> tab_interface_;
77
78 std::pair<std::string, int> check_fluid_name(const Nom& name);
79 virtual void mettre_a_jour_tabs();
80 static void calculer_masse_volumique(const Objet_U& obj, DoubleTab& val, DoubleTab& bval, tabs_t& deriv);
81 static void calculer_energie_interne(const Objet_U& obj, DoubleTab& val, DoubleTab& bval, tabs_t& deriv);
82 static void calculer_enthalpie(const Objet_U& obj, DoubleTab& val, DoubleTab& bval, tabs_t& deriv);
83 static void calculer_temperature_multiphase(const Objet_U& obj, DoubleTab& val, DoubleTab& bval, tabs_t& deriv);
84};
85
86#endif /* Milieu_composite_included */
classe Champ_Don_base classe de base des Champs donnes (non calcules)
classe Discretisation_base Cette classe represente un schema de discretisation en espace,...
classe Equation_base Le role d'une equation est le calcul d'un ou plusieurs champs....
classe Fluide_base Cette classe represente un d'un fluide incompressible ainsi que
Definition Fluide_base.h:38
void calculer_temperature_multiphase() const
Classe Milieu_composite Cette classe represente un fluide reel ainsi que.
void associer_equation(const Equation_base *eqn) const override
OWN_PTR(Champ_Don_base) rho_m_
std::vector< OWN_PTR(Fluide_base)> fluides_
static void calculer_enthalpie(const Objet_U &obj, DoubleTab &val, DoubleTab &bval, tabs_t &deriv)
void preparer_calcul() override
static void calculer_masse_volumique(const Objet_U &obj, DoubleTab &val, DoubleTab &bval, tabs_t &deriv)
void abortTimeStep() override
std::vector< std::vector< Interface_base * > > tab_interface_
bool has_interface() const
bool are_fluid_properties_initialised() const
const Noms & noms_phases() const
virtual void mettre_a_jour_tabs()
bool has_saturation() const
Interface_base & get_interface(int k, int l) const
bool initTimeStep(double dt) override
void discretiser(const Probleme_base &pb, const Discretisation_base &dis) override
Saturation_base & get_saturation(int k, int l) const
void mettre_a_jour(double temps) override
Effectue une mise a jour en temps du milieu, et donc de ses parametres caracteristiques.
static void calculer_energie_interne(const Objet_U &obj, DoubleTab &val, DoubleTab &bval, tabs_t &deriv)
int check_unknown_range() const override
std::pair< std::string, int > check_fluid_name(const Nom &name)
int initialiser(const double temps) override
Initialise les parametres du fluide.
const Fluide_base & get_fluid(const int i) const
class Nom Une chaine de caractere pour nommer les objets de TRUST
Definition Nom.h:31
Un tableau de chaine de caracteres (VECT(Nom)).
Definition Noms.h:26
Objet_U()
Constructeur par defaut : attribue un numero d'identifiant unique a l'objet (object_id_),...
Definition Objet_U.cpp:55
classe Probleme_base C'est un Probleme_U qui n'est pas un couplage.