TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Echange_externe_impose_H.cpp
1/****************************************************************************
2* Copyright (c) 2024, 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 <Echange_externe_impose_H.h>
17#include <Fluide_Dilatable_base.h>
18#include <Equation_base.h>
19
20Implemente_instanciable(Echange_externe_impose_H, "Paroi_echange_externe_impose_H", Echange_externe_impose);
21// XD paroi_echange_externe_impose_h paroi_echange_externe_impose paroi_echange_externe_impose_h INHERITS_BRACE
22// XD_CONT Particular case of class paroi_echange_externe_impose for enthalpy equation.
23
24
25Sortie& Echange_externe_impose_H::printOn(Sortie& s) const { return s << que_suis_je() << finl; }
26
28{
29 if (app_domains.size() == 0) app_domains = { Motcle("Thermique_H") };
30
32}
33
34/*! @brief Complete les conditions aux limites.
35 *
36 */
38{
40 le_fluide = ref_cast(Fluide_Dilatable_base, mon_dom_cl_dis->equation().milieu());
42}
43
44/*! @brief Renvoie la valeur de la temperature imposee sur la i-eme composante du champ de frontiere.
45 *
46 * @param (int i) l'indice de la composante du champ de de frontiere
47 * @return (double)
48 */
50{
51 if (le_champ_front->valeurs().size() == 1)
52 {
53 if (modifier_val_imp == 1)
54 return le_fluide->calculer_H(le_champ_front->valeurs()(0, 0));
55 else
56 return le_champ_front->valeurs()(0, 0);
57 }
58 else if (le_champ_front->valeurs().dimension(1) == 1)
59 {
60 if (modifier_val_imp == 1)
61 return le_fluide->calculer_H(le_champ_front->valeurs()(i, 0));
62 else
63 return le_champ_front->valeurs()(i, 0);
64 }
65 else
66 Cerr << "Echange_impose_base::T_ext erreur" << finl;
67
68 abort();
69 return 0.;
70}
71
72/*! @brief Renvoie la valeur de la temperature imposee sur la (i,j)-eme composante du champ de frontiere.
73 *
74 * @param (int i)
75 * @param (int j)
76 * @return (double)
77 */
78double Echange_externe_impose_H::T_ext(int i, int j) const
79{
80 if (le_champ_front->valeurs().dimension(0) == 1)
81 {
82 if (modifier_val_imp == 1)
83 return le_fluide->calculer_H(le_champ_front->valeurs()(0, j));
84 else
85 return le_champ_front->valeurs()(0, j);
86 }
87 else
88 {
89 if (modifier_val_imp == 1)
90 return le_fluide->calculer_H(le_champ_front->valeurs()(i, j));
91 else
92 return le_champ_front->valeurs()(i, j);
93 }
94}
virtual void completer()
NE FAIT RIEN A surcharger dans les classes derivees.
std::vector< Motcle > app_domains
Classe Echange_externe_impose_H: Cette classe represente le cas particulier de la classe Echange_exte...
Champ_front_base & T_ext() override
Renvoie le champ T_ext de temperature imposee a la frontiere.
void completer() override
Complete les conditions aux limites.
Classe Echange_externe_impose: Cette classe represente le cas particulier de la classe.
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
virtual const Milieu_base & milieu() const =0
classe Fluide_Dilatable_base Cette classe represente un d'un fluide dilatable,
virtual const Equation_base & equation(const std::string &nom_inc) const
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
static void abort()
Routine de sortie de Trio-U sur une erreur abort().
Definition Process.cpp:570
Classe de base des flux de sortie.
Definition Sortie.h:52