TrioCFD 1.9.9_beta
TrioCFD documentation
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 Composite medium representing a multiphase fluid and its properties:
27 *
28 * - kinematic viscosity, (mu)
29 * - dynamic viscosity, (nu)
30 * - density, (rho)
31 * - diffusivity, (alpha)
32 * - thermal conductivity,(lambda)
33 * - heat capacity, (Cp)
34 * - thermal expansion coefficient (beta_co)
35 *
36 * @sa Milieu_base
37 */
39{
40 Declare_instanciable(Milieu_composite);
41public :
42 int check_unknown_range() const override;
43 int initialiser(const double temps) override;
44
45 bool initTimeStep(double dt) override;
46 bool has_saturation(int k, int l) const;
47 bool has_interface(int k, int l) const;
48 inline bool has_saturation() const { return has_saturation_; }
49 inline bool has_interface() const { return has_interface_; }
50
51 void discretiser(const Probleme_base& pb, const Discretisation_base& dis) override;
52 void abortTimeStep() override;
53 void preparer_calcul() override;
54 void mettre_a_jour(double temps) override;
55 void associer_equation(const Equation_base* eqn) const override;
56
57 Interface_base& get_interface(int k, int l) const;
58 Saturation_base& get_saturation(int k, int l) const;
59
60 const Fluide_base& get_fluid(const int i) const;
61 Fluide_base& get_fluid(const int i) ;
62 inline const Noms& noms_phases() const { return noms_phases_; }
63
65
66protected :
69 double t_init_ = -1.;
70 bool has_saturation_ = false, has_interface_ = false;
71 bool res_en_T_ = true; // by default resolution in T
73 std::vector<std::vector<Interface_base *>> tab_interface_;
76
77 std::pair<std::string, int> check_fluid_name(const Nom& name);
78 virtual void mettre_a_jour_tabs();
79 static void calculer_masse_volumique(const Objet_U& obj, DoubleTab& val, DoubleTab& bval, tabs_t& deriv);
80 static void calculer_energie_interne(const Objet_U& obj, DoubleTab& val, DoubleTab& bval, tabs_t& deriv);
81 static void calculer_enthalpie(const Objet_U& obj, DoubleTab& val, DoubleTab& bval, tabs_t& deriv);
82 static void calculer_temperature_multiphase(const Objet_U& obj, DoubleTab& val, DoubleTab& bval, tabs_t& deriv);
83};
84
85#endif /* Milieu_composite_included */
class Champ_Don_base base class of Given Fields (not calculated)
class Discretisation_base This class represents a spatial discretization scheme, which
class Equation_base The role of an equation is the calculation of one or more fields....
Base class for an incompressible fluid and its properties:
Definition Fluide_base.h:36
void calculer_temperature_multiphase() const
Composite medium representing a multiphase fluid and its properties:
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
Performs a time update of the medium and therefore of its characteristic parameters.
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
Initializes the fluid parameters.
const Fluide_base & get_fluid(const int i) const
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31
An array of character strings (VECT(Nom)).
Definition Noms.h:26
Objet_U()
Default constructor: assigns a unique identifier to the object (object_id_) and registers the object ...
Definition Objet_U.cpp:54
class Probleme_base It is a Probleme_U that is not a coupling.