TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Pb_Hydraulique.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.h>
17#include <Fluide_Ostwald.h>
18
19Implemente_instanciable(Pb_Hydraulique,"Pb_Hydraulique",Pb_Fluide_base);
20// XD pb_hydraulique Pb_base pb_hydraulique INHERITS_BRACE Resolution of the Navier-Stokes equations.
21// XD attr fluide_incompressible fluide_incompressible fluide_incompressible REQ The fluid medium associated with the
22// XD_CONT problem.
23// XD attr correlations bloc_lecture correlations OPT List of correlations used in specific source terms (e.g.
24// XD_CONT wall-friction adaptive law).
25// XD attr navier_stokes_standard navier_stokes_standard navier_stokes_standard REQ Navier-Stokes equations.
26// XD attr Energie_cinetique_turbulente Energie_cinetique_turbulente Energie_cinetique_turbulente OPT Turbulent kinetic
27// XD_CONT Energy conservation equation for a turbulent mono-phase problem (available in TrioCFD).
28// XD attr Echelle_temporelle_turbulente Echelle_temporelle_turbulente Echelle_temporelle_turbulente OPT Turbulent
29// XD_CONT Dissipation time scale equation for a turbulent mono-phase problem (available in TrioCFD).
30// XD attr Taux_dissipation_turbulent Taux_dissipation_turbulent Taux_dissipation_turbulent OPT Turbulent Dissipation
31// XD_CONT frequency equation for a turbulent mono-phase problem (available in TrioCFD).
32
35
36/*! @brief Renvoie l'equation d'hydraulique de type Navier_Stokes_std si i=0, sort (exit) sinon.
37 *
38 * (version const)
39 *
40 * @param (int i) l'index de l'equation a renvoyer
41 * @return (Equation_base&) l'equation d'hydraulique de type Navier_Stokes_std
42 */
44{
45 if (i == 0) return eq_hydraulique;
46 else if (i < 1 + eq_opt_.size() && i > 0) return eq_opt_[i - 1].valeur();
47 else
48 {
49 Cerr << "Pb_Hydraulique::equation() : Wrong equation number" << i << "!" << finl;
51 }
52 return eq_hydraulique;
53}
54
55/*! @brief Renvoie l'equation d'hydraulique de type Navier_Stokes_std si i=0, sort (exit) sinon.
56 *
57 * @param (int i) l'index de l'equation a renvoyer
58 * @return (Equation_base&) l'equation d'hydraulique de type Navier_Stokes_std
59 */
61{
62 if (i == 0) return eq_hydraulique;
63 else if (i < 1 + eq_opt_.size() && i > 0) return eq_opt_[i - 1].valeur();
64 else
65 {
66 Cerr << "Pb_Hydraulique::equation() : Wrong equation number" << i << "!" << finl;
68 }
69 return eq_hydraulique;
70}
71
72
73
74/*! @brief Associe le milieu au probleme.
75 *
76 * Le milieu doit etre de type fluide incompressible.
77 *
78 * @param (Milieu_base& mil) le milieu physique a associer au probleme
79 * @throws le milieu n'est pas du type Fluide_base
80 */
82{
83 if (sub_type(Fluide_base,mil) && ref_cast(Fluide_base, mil).is_incompressible())
84 eq_hydraulique.associer_milieu_base(mil);
85 else if (sub_type(Fluide_Ostwald,mil))
86 {
87 Cerr << "Je suis non newto" << finl;
88 eq_hydraulique.associer_milieu_base(mil);
89 }
90 else
91 {
92 Cerr << "Un milieu de type " << mil.que_suis_je() << " ne peut etre associe a "
93 << finl;
94 Cerr << "un probleme de type Pb_Hydraulique " << finl;
95 exit();
96 }
97}
98
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
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 Cette classe represente un probleme hydraulique standard dans lequel
void associer_milieu_base(const Milieu_base &) override
Associe le milieu au probleme.
const Equation_base & equation(int) const override
Renvoie l'equation d'hydraulique de type Navier_Stokes_std si i=0, sort (exit) sinon.
Navier_Stokes_std eq_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