TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Temperature_imposee_paroi_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 <Temperature_imposee_paroi_H.h>
17#include <Fluide_Dilatable_base.h>
18#include <Equation_base.h>
19
20Implemente_instanciable(Temperature_imposee_paroi_H, "Paroi_temperature_imposee_H", Temperature_imposee_paroi);
21
22Sortie& Temperature_imposee_paroi_H::printOn(Sortie& s) const { return s << que_suis_je() << finl; }
23
25{
26 if (app_domains.size() == 0) app_domains = { Motcle("Thermique_H") };
27 if (supp_discs.size() == 0) supp_discs = { Nom("VEF"), Nom("EF"), Nom("EF_axi"), Nom("VEF_P1_P1"), Nom("VEFPreP1B"), Nom("PolyMAC_CDO"), Nom("PolyMAC_HFV"), Nom("PolyMAC_MPFA") };
28
29 return Dirichlet::readOn(s);
30}
31
32/*! @brief Complete les conditions aux limites.
33 *
34 */
36{
37 le_fluide = ref_cast(Fluide_Dilatable_base, mon_dom_cl_dis->equation().milieu());
39}
40
41/*! @brief Renvoie la valeur imposee sur la i-eme composante du champ a la frontiere.
42 *
43 * @param (int i) indice suivant la premiere dimension du champ
44 * @return (double) la valeur imposee sur la composante du champ specifiee
45 * @throws deuxieme dimension du champ de frontiere superieur a 1
46 */
48{
49 if (le_champ_front->valeurs().size() == 1)
50 {
51 if (modifier_val_imp == 1)
52 return le_fluide->calculer_H(le_champ_front->valeurs()(0, 0));
53 else
54 return le_champ_front->valeurs()(0, 0);
55 }
56 else if (le_champ_front->valeurs().dimension(1) == 1)
57 {
58 if (modifier_val_imp == 1)
59 return le_fluide->calculer_H(le_champ_front->valeurs()(i, 0));
60 else
61 return le_champ_front->valeurs()(i, 0);
62 }
63 else
64 Cerr << "Temperature_imposee_paroi_H::val_imp erreur" << finl;
65
66 abort();
67 return 0.;
68}
69
70/*! @brief Renvoie la valeur imposee sur la (i,j)-eme composante du champ a la frontiere.
71 *
72 * @param (int i) indice suivant la premiere dimension du champ
73 * @param (int j) indice suivant la deuxieme dimension du champ
74 * @return (double) la valeur imposee sur la composante du champ specifiee
75 */
76double Temperature_imposee_paroi_H::val_imp(int i, int j) const
77{
78 if (le_champ_front->valeurs().dimension(0) == 1)
79 {
80 if (modifier_val_imp == 1)
81 return le_fluide->calculer_H(le_champ_front->valeurs()(0, j));
82 else
83 return le_champ_front->valeurs()(0, j);
84 }
85 else
86 {
87 if (modifier_val_imp == 1)
88 return le_fluide->calculer_H(le_champ_front->valeurs()(i, j));
89 else
90 return le_champ_front->valeurs()(i, j);
91 }
92}
std::vector< Nom > supp_discs
std::vector< Motcle > app_domains
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
classe Temperature_imposee_paroi_H Impose la temperature de la paroi dans une equation de type Convec...
void completer() override
Complete les conditions aux limites.
double val_imp(int i) const override
Renvoie la valeur imposee sur la i-eme composante du champ a la frontiere.
classe Temperature_imposee_paroi Impose la temperature de la paroi dans une equation de type Convecti...