TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Echange_externe_impose_rayo_transp.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 <Echange_externe_impose_rayo_transp.h>
17#include <Pb_Fluide_base.h>
18#include <Front_VF.h>
19
20Implemente_instanciable(Echange_externe_impose_rayo_transp, "Paroi_Echange_externe_impose_rayo_transp", Echange_externe_impose);
21// XD paroi_echange_externe_impose_rayo_transp paroi_echange_externe_impose paroi_echange_externe_impose_rayo_transp INHERITS_BRACE Radiation External type exchange condition with a heat exchange coefficient and an imposed external temperature.
22
23
25
27{
28 if (app_domains.size() == 0)
29 app_domains = { Motcle("Thermique"), Motcle("indetermine") };
30
31 Motcle motlu;
32 Motcles les_motcles(2);
33 {
34 les_motcles[0] = "h_imp";
35 les_motcles[1] = "T_ext";
36 }
37
38 int ind = 0;
39 while (ind < 2)
40 {
41 is >> motlu;
42 int rang = les_motcles.search(motlu);
43
44 switch(rang)
45 {
46 case 0:
47 {
48 is >> h_imp_;
49 break;
50 }
51 case 1:
52 {
53 is >> le_champ_front;
54 break;
55 }
56 default:
57 {
58 Cerr << "Erreur a la lecture de la condition aux limites de type " << finl;
59 Cerr << "Echange_externe_impose_rayo_transp " << finl;
60 Cerr << "On attendait " << les_motcles << "a la place de " << motlu << finl;
62 }
63 }
64 ind++;
65 }
66
67 if (local_min_vect(h_imp_->valeurs()) < 1.e9)
68 {
69 Cerr << "Erreur sur l'utilisation de la condition a la limite" << finl;
70 Cerr << "Echange_externe_impose_rayo_transp. Celle ci ne peut" << finl;
71 Cerr << "etre utilisee pour un probleme de rayonnement que pour " << finl;
72 Cerr << "imposer une temperature sur une paroi" << finl;
74 }
75
76 return is;
77}
78
80{
81 assert(!le_modele_rayo_);
82
83 // on recupere le modele rayo ... !
84 const Probleme_base& this_pb = domaine_Cl_dis().equation().probleme();
85 if (sub_type(Pb_Fluide_base, this_pb)) // sinon Pb_conduction par exemple ;)
86 {
87 if (this_pb.milieu().is_rayo_transp())
88 {
89 le_modele_rayo_ = ref_cast(Pb_Fluide_base, this_pb).get_mod_rayo_transp();
90
91 if (le_modele_rayo_->nom_pb_rayonnant() != this_pb.le_nom())
92 error_pb_name(que_suis_je(), this_pb.le_nom(), le_modele_rayo_->nom_pb_rayonnant());
93 }
94 else
95 error_non_rad_bc(que_suis_je(), this_pb.le_nom(), frontiere_dis().frontiere().le_nom(), "paroi_echange_externe_impose");
96 }
97
99}
100
106
108{
109 const Front_VF& front_vf = ref_cast(Front_VF, frontiere_dis());
110 for (int numfa = 0; numfa < front_vf.nb_faces(); numfa++)
111 teta_i_[numfa] = T_ext(numfa);
112}
113
Domaine_Cl_dis_base & domaine_Cl_dis()
Renvoie le domaine des conditions aux limites discretisee dont l'objet fait partie.
virtual void completer()
NE FAIT RIEN A surcharger dans les classes derivees.
std::vector< Motcle > app_domains
virtual Frontiere_dis_base & frontiere_dis()
Renvoie la frontiere discretisee a laquelle les conditions aux limites s'appliquent.
void error_non_rad_bc(const Nom &nom_class, const Nom &nom_pb, const Nom &nom_bord, const Nom &other_type)
void preparer_surface(const Frontiere_dis_base &, const Domaine_Cl_dis_base &)
void error_pb_name(const Nom &nom_class, const Nom &nom_pb, const Nom &nom_pb_ray)
void mettre_a_jour(double) override
Effectue une mise a jour en temps de la condition aux limites.
int initialiser(double temps) override
Initialisation en debut de calcul.
Classe Echange_externe_impose: Cette classe represente le cas particulier de la classe.
int initialiser(double temps) override
Initialisation en debut de calcul.
virtual Champ_front_base & T_ext()
Renvoie le champ T_ext de temperature imposee a la frontiere.
void mettre_a_jour(double) override
Effectue une mise a jour en temps des conditions aux limites.
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
Probleme_base & probleme()
Renvoie le probleme associe a l'equation.
class Front_VF
Definition Front_VF.h:36
int nb_faces() const
Definition Front_VF.h:53
virtual bool is_rayo_transp() const
Definition Milieu_base.h:83
const Equation_base & equation() const
Renvoie la reference sur l'equation pointe par MorEqn::mon_equation.
Definition MorEqn.h:62
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 const Nom & le_nom() const
Donne le nom de l'Objet_U Methode a surcharger : renvoie "neant" dans cette implementation.
Definition Objet_U.cpp:319
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
const Nom & le_nom() const override
Donne le nom de l'Objet_U Methode a surcharger : renvoie "neant" dans cette implementation.
Definition Probleme_U.h:109
classe Probleme_base C'est un Probleme_U qui n'est pas un couplage.
virtual const Milieu_base & milieu() const
Renvoie le milieu physique associe au probleme.
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