TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Pb_Hydraulique_Concentration.cpp
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#include <Pb_Hydraulique_Concentration.h>
17#include <Fluide_Incompressible.h>
18#include <Constituant.h>
19#include <Verif_Cl.h>
20
21Implemente_instanciable(Pb_Hydraulique_Concentration,"Pb_Hydraulique_Concentration",Pb_Fluide_base);
22// XD pb_hydraulique_concentration Pb_base pb_hydraulique_concentration INHERITS_BRACE Resolution of
23// XD_CONT Navier-Stokes/multiple constituent transport equations.
24// XD attr fluide_incompressible fluide_incompressible fluide_incompressible REQ The fluid medium associated with the
25// XD_CONT problem.
26// XD attr constituant constituant constituant OPT Constituents.
27// XD attr navier_stokes_standard navier_stokes_standard navier_stokes_standard OPT Navier-Stokes equations.
28// XD attr convection_diffusion_concentration convection_diffusion_concentration convection_diffusion_concentration OPT
29// XD_CONT Constituent transport vectorial equation (concentration diffusion convection).
30
31/*! @brief Simple appel a: Pb_Fluide_base::printOn(Sortie&) Ecrit le probleme sur un flot de sortie.
32 *
33 * @param (Sortie& os) un flot de sortie
34 * @return (Sortie&) le flot de sortie modifie
35 */
37{
38 return Pb_Fluide_base::printOn(os);
39}
40
41
42/*! @brief Simple appel a: Pb_Fluide_base::readOn(Entree&) Lit le probleme a partir d'un flot d'entree.
43 *
44 * @param (Entree& is) un flot d'entree
45 * @return (Entree&) le flot d'entree modifie
46 */
48{
49 return Pb_Fluide_base::readOn(is);
50}
51
52/*! @brief Renvoie le nombre d'equation, Renvoie 2 car il y a 2 equations a un probleme
53 *
54 * hydraulique avec transport:
55 * - l'equation de Navier Stokes
56 * - une equation de convection-diffusion (eventuellement vectorielle)
57 *
58 * @return (int) le nombre d'equation
59 */
61{
62 return 2;
63}
64
65/*! @brief Renvoie l'equation d'hydraulique de type Navier_Stokes_std si i=0 Renvoie l'equation de convection-diffusion de type
66 *
67 * Convection_Diffusion_Concentration si i=1
68 * (l'equation de convection diffusion peut-etre vectorielle)
69 * (version const)
70 *
71 * @param (int i) l'index de l'equation a renvoyer
72 * @return (Equation_base&) l'equation correspondante a l'index
73 */
75{
76 if ( !( i==0 || i==1 ) )
77 {
78 Cerr << "\nError in Pb_Hydraulique_Concentration::equation() : Wrong number of equation !" << finl;
80 }
81 if (i == 0)
82 return eq_hydraulique;
83 else
84 return eq_concentration;
85}
86
87/*! @brief Renvoie l'equation d'hydraulique de type Navier_Stokes_std si i=0 Renvoie l'equation de convection-diffusion de type
88 *
89 * Convection_Diffusion_Concentration si i=1
90 * (l'equation de convection diffusion peut-etre vectorielle)
91 *
92 * @param (int i) l'index de l'equation a renvoyer
93 * @return (Equation_base&) l'equation correspondante a l'index
94 */
96{
97 if ( !( i==0 || i==1 ) )
98 {
99 Cerr << "\nError in Pb_Hydraulique_Concentration::equation() : Wrong number of equation !" << finl;
101 }
102 if (i == 0)
103 return eq_hydraulique;
104 else
105 return eq_concentration;
106}
107
108
109/*! @brief Associe un milieu au probleme, Si le milieu est de type
110 *
111 * - Fluide_Incompressible, il sera associe a l'equation de l'hydraulique
112 * - Constituant, il sera associe a l'equation de convection-diffusion
113 * Un autre type de milieu provoque une erreur
114 *
115 * @param (Milieu_base& mil) le milieu physique a associer au probleme
116 * @throws mauvais type de milieu physique
117 */
119{
120 if ( sub_type(Fluide_Incompressible,mil) )
121 eq_hydraulique.associer_milieu_base(mil);
122 else if ( sub_type(Constituant,mil) )
123 eq_concentration.associer_milieu_base(mil);
124 else
125 {
126 Cerr << "Un milieu de type " << mil.que_suis_je() << " ne peut etre associe a " << finl;
127 Cerr << "un probleme de type Pb_Hydraulique_Concentration " << finl;
128 exit();
129 }
130}
131
132
133/*! @brief Teste la compatibilite des equations de convection-diffusion et de l'hydraulique.
134 *
135 * Le test se fait sur les conditions
136 * aux limites discretisees de chaque equation.
137 * Appel la fonction de librairie hors classe:
138 * tester_compatibilite_hydr_concentration(const Domaine_Cl_dis_base&,const Domaine_Cl_dis_base&)
139 *
140 * @return (int) code de retour propage
141 */
143{
144 const Domaine_Cl_dis_base& domaine_Cl_hydr = eq_hydraulique.domaine_Cl_dis();
145 const Domaine_Cl_dis_base& domaine_Cl_co = eq_concentration.domaine_Cl_dis();
146 return tester_compatibilite_hydr_concentration(domaine_Cl_hydr,domaine_Cl_co);
147}
classe Constituant Cette classe represente le(s) constituant(s) d'un fluide.
Definition Constituant.h:30
classe Domaine_Cl_dis_base Les objets Domaine_Cl_dis_base representent les conditions aux limites
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
classe Equation_base Le role d'une equation est le calcul d'un ou plusieurs champs....
classe Fluide_Incompressible Cette classe represente un d'un fluide incompressible ainsi que
classe Milieu_base Cette classe est la base de la hierarchie des milieux (physiques)
Definition Milieu_base.h:50
const Nom & que_suis_je() const
renvoie la chaine identifiant la classe.
Definition Objet_U.cpp:104
virtual Entree & readOn(Entree &)
Lecture d'un Objet_U sur un flot d'entree Methode a surcharger.
Definition Objet_U.cpp:293
virtual Sortie & printOn(Sortie &) const
Ecriture de l'objet sur un flot de sortie Methode a surcharger.
Definition Objet_U.cpp:282
classe Pb_Fluide_base Cette classe a pour but de disposer d une classe amont pour
Classe Pb_Hydraulique_Concentration Cette classe represente un probleme d'hydraulique avec transport.
void associer_milieu_base(const Milieu_base &) override
Associe un milieu au probleme, Si le milieu est de type.
const Equation_base & equation(int) const override
Renvoie l'equation d'hydraulique de type Navier_Stokes_std si i=0 Renvoie l'equation de convection-di...
int nombre_d_equations() const override
Renvoie le nombre d'equation, Renvoie 2 car il y a 2 equations a un probleme.
Convection_Diffusion_Concentration eq_concentration
int verifier() override
Teste la compatibilite des equations de convection-diffusion et de l'hydraulique.
static void exit(int exit_code=-1)
Routine de sortie de TRUST dans une region Kokkos.
Definition Process.cpp:455
Classe de base des flux de sortie.
Definition Sortie.h:52