TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Echange_externe_radiatif.cpp
1/****************************************************************************
2* Copyright (c) 2025, 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_radiatif.h>
17
18Implemente_instanciable(Echange_externe_radiatif, "Echange_externe_radiatif|Paroi_echange_externe_radiatif", Echange_externe_impose);
19
20// XD echange_externe_radiatif condlim_base echange_externe_radiatif INHERITS_BRACE Combines radiative $(sigma * eps *
21// XD_CONT (T^4 - T_ext^4))$ and convective $(h * (T - T_ext))$ heat transfer boundary conditions, where sigma is the
22// XD_CONT Stefan-Boltzmann constant, eps is the emi
23// XD attr h_imp chaine(into=["h_imp","t_ext","emissivite"]) h_imp REQ Heat exchange coefficient value (expressed in
24// XD_CONT W.m-2.K-1).
25// XD attr himpc front_field_base himpc REQ Boundary field type.
26// XD attr emissivite chaine(into=["emissivite","h_imp","t_ext"]) emissivite REQ Emissivity coefficient value.
27// XD attr emissivitebc front_field_base emissivitebc REQ Boundary field type.
28// XD attr t_ext chaine(into=["t_ext","h_imp","emissivite"]) t_ext REQ External temperature value (expressed in oC or
29// XD_CONT K).
30// XD attr ch front_field_base ch REQ Boundary field type.
31// XD attr temp_unit chaine(into=["temperature_unit"]) temp_unit REQ Temperature unit
32// XD attr temp_unit_val chaine(into=["kelvin","celsius"]) temp_unit_val REQ Temperature unit
33
34Sortie& Echange_externe_radiatif::printOn(Sortie& s) const { return s << que_suis_je() << finl; }
35
37{
38 if (app_domains.size() == 0)
39 app_domains = { Motcle("Thermique") };
40
41 if (supp_discs.size() == 0)
42 supp_discs = { Nom("VDF"), Nom("VEFPreP1B")};
43
44 Motcle motlu, T_unit;
45 Motcles les_motcles(4);
46 {
47 les_motcles[0] = "emissivite";
48 les_motcles[1] = "h_imp";
49 les_motcles[2] = "T_ext";
50 les_motcles[3] = "Temperature_unit";
51 }
52
53 int ind = 0;
54 while (ind < 4)
55 {
56 s >> motlu;
57 int rang = les_motcles.search(motlu);
58
59 switch(rang)
60 {
61 case 0:
62 {
63 s >> emissivite_;
64 break;
65 }
66 case 1:
67 {
68 s >> h_imp_;
69 break;
70 }
71 case 2:
72 {
73 s >> le_champ_front;
74 break;
75 }
76 case 3:
77 {
78 s >> T_unit;
79
80 if (T_unit == "CELSIUS")
81 {
82 // TODO FIXME LATER
83 Cerr << "Error in Echange_externe_radiatif::readOn !!! This boundary condition requires temperature in Kelvin !" << finl;
84 Cerr << "Please update your data file ..." << finl;
86 t_en_kelvin_ = false;
87 }
88 else if (T_unit == "KELVIN")
89 t_en_kelvin_ = true;
90 else
91 {
92 Cerr << "Unkown option in Echange_externe_radiatif::readOn !!!" << finl;
93 Cerr << " - Temperature_unit can either be CELSIUS or KELVIN !!!" << finl;
95 }
96
97 break;
98 }
99 default:
100 {
101 Cerr << "Error while reading BC of type Echange_externe_radiatif " << finl;
102 Cerr << "we expected a keyword among: " << les_motcles << " instead of " << motlu << finl;
103 exit();
104 }
105 }
106 ind++;
107 }
108
109 return s;
110}
std::vector< Nom > supp_discs
std::vector< Motcle > app_domains
Classe Echange_externe_impose: Cette classe represente le cas particulier de la classe.
classe Echange_externe_radiatif: Combines radiative (sigma * eps * (T^4 - T_ext^4)) and convective (h...
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
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 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