TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Pb_Thermohydraulique.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_Thermohydraulique.h>
17#include <Fluide_Ostwald.h>
18#include <Verif_Cl.h>
19#include <Champ_Uniforme.h>
20
21Implemente_instanciable(Pb_Thermohydraulique, "Pb_Thermohydraulique", Pb_Hydraulique);
22// XD pb_thermohydraulique Pb_base pb_thermohydraulique INHERITS_BRACE Resolution of thermohydraulic problem.
23// XD attr fluide_incompressible fluide_incompressible fluide_incompressible OPT The fluid medium associated with the
24// XD_CONT problem (only one possibility).
25// XD attr fluide_ostwald fluide_ostwald fluide_ostwald OPT The fluid medium associated with the problem (only one
26// XD_CONT possibility).
27// XD attr fluide_sodium_liquide fluide_sodium_liquide fluide_sodium_liquide OPT The fluid medium associated with the
28// XD_CONT problem (only one possibility).
29// XD attr fluide_sodium_gaz fluide_sodium_gaz fluide_sodium_gaz OPT The fluid medium associated with the problem (only
30// XD_CONT one possibility).
31// XD attr correlations bloc_lecture correlations OPT List of correlations used in specific source terms (i.e.
32// XD_CONT interfacial flux, interfacial friction, ...)
33// XD attr navier_stokes_standard navier_stokes_standard navier_stokes_standard OPT Navier-Stokes equations.
34// XD attr convection_diffusion_temperature convection_diffusion_temperature convection_diffusion_temperature OPT Energy
35// XD_CONT equation (temperature diffusion convection).
36
39
40/*! @brief Renvoie l'equation d'hydraulique de type Navier_Stokes_std si i=0 Renvoie l'equation de la thermique de type
41 *
42 * Convection_Diffusion_Temperature si i=1
43 * (version const)
44 *
45 * @param (int i) l'index de l'equation a renvoyer
46 * @return (Equation_base&) l'equation correspondante a l'index
47 */
49{
50 if (i == 0) return eq_hydraulique;
51 else if (i == 1) return eq_thermique;
52 else if (i < 2 + eq_opt_.size() && i > 1) return eq_opt_[i - 2].valeur();
53 else
54 {
55 Cerr << "Pb_Thermohydraulique::equation() : Wrong equation number" << i << "!" << finl;
57 }
58 return eq_hydraulique;
59}
60
61/*! @brief Renvoie l'equation d'hydraulique de type Navier_Stokes_std si i=0 Renvoie l'equation de la thermique de type
62 *
63 * Convection_Diffusion_Temperature si i=1
64 *
65 * @param (int i) l'index de l'equation a renvoyer
66 * @return (Equation_base&) l'equation correspondante a l'index
67 */
69{
70 if (i == 0) return eq_hydraulique;
71 else if (i == 1) return eq_thermique;
72 else if (i < 2 + eq_opt_.size() && i > 1) return eq_opt_[i - 2].valeur();
73 else
74 {
75 Cerr << "Pb_Thermohydraulique::equation() : Wrong equation number" << i << "!" << finl;
77 }
78 return eq_hydraulique;
79}
80
81/*! @brief Associe le milieu au probleme Le milieu doit etre de type fluide incompressible
82 *
83 * @param (Milieu_base& mil) le milieu physique a associer au probleme
84 * @throws mauvais type de milieu physique
85 */
87{
89 if (sub_type(Fluide_base,mil) && ref_cast(Fluide_base, mil).is_incompressible())
90 eq_thermique.associer_milieu_base(mil);
91 else if (sub_type(Fluide_Ostwald,mil))
92 eq_thermique.associer_milieu_base(mil);
93}
94
95/*! @brief Teste la compatibilite des equations de la thermique et de l'hydraulique.
96 *
97 * Le test se fait sur les conditions
98 * aux limites discretisees de chaque equation.
99 * Appel la fonction de librairie hors classe:
100 * tester_compatibilite_hydr_thermique(const Domaine_Cl_dis_base&,const Domaine_Cl_dis_base&)
101 *
102 * @return (int) code de retour propage
103 */
105{
106 const Domaine_Cl_dis_base& domaine_Cl_hydr = eq_hydraulique.domaine_Cl_dis();
107 const Domaine_Cl_dis_base& domaine_Cl_th = eq_thermique.domaine_Cl_dis();
108 return tester_compatibilite_hydr_thermique(domaine_Cl_hydr,domaine_Cl_th);
109}
110
111
112
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....
class Fluide_Ostwald
classe Fluide_base Cette classe represente un d'un fluide incompressible ainsi que
Definition Fluide_base.h:38
classe Milieu_base Cette classe est la base de la hierarchie des milieux (physiques)
Definition Milieu_base.h:50
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_Hydraulique Cette classe represente un probleme hydraulique standard dans lequel
void associer_milieu_base(const Milieu_base &) override
Associe le milieu au probleme.
Navier_Stokes_std eq_hydraulique
classe Pb_Thermohydraulique Cette classe represente un probleme de thermohydraulique standard:
void associer_milieu_base(const Milieu_base &) override
Associe le milieu au probleme Le milieu doit etre de type fluide incompressible.
Convection_Diffusion_Temperature eq_thermique
const Equation_base & equation(int) const override
Renvoie l'equation d'hydraulique de type Navier_Stokes_std si i=0 Renvoie l'equation de la thermique ...
int verifier() override
Teste la compatibilite des equations de la thermique 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