TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Flux_radiatif_base.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 <Flux_radiatif_base.h>
17#include <Front_VF.h>
18#include <Param.h>
19
20Implemente_base(Flux_radiatif_base,"Flux_radiatif_base",Neumann_paroi);
21
23{
24 return s << que_suis_je() << "\n";
25}
26
28{
29 Motcle motlu;
30 Motcles les_motcles(2);
31 {
32 les_motcles[0] = "emissivite";
33 les_motcles[1] = "A";
34 }
35
36 int ind = 0;
37 while (ind < 2)
38 {
39 is >> motlu;
40 int rang = les_motcles.search(motlu);
41
42 switch(rang)
43 {
44 case 0:
45 {
46 is >> emissivite_;
47 break;
48 }
49 case 1:
50 {
51 is >> A_;
52 break;
53 }
54 default:
55 {
56 Cerr << "Erreur a la lecture de la condition aux limites de type " << finl;
57 Cerr << "Flux_radiatif_base " << finl;
58 Cerr << "On attendait " << les_motcles << "a la place de " << motlu << finl;
60 }
61 }
62 ind++;
63 }
64
65 le_champ_front.typer("Champ_front_fonc");
67
68 flux_radiatif_.typer("Champ_front_fonc");
70
71 return is;
72}
73
75{
77 // On type le champ_front flux_radiatif_ qui est associe a la condition a la limite
78 const Front_VF& front_vf = ref_cast(Front_VF, le_champ_front->frontiere_dis());
79 int nb_comp = 1;
80
81 flux_radiatif().nommer(front_vf.le_nom());
82 DoubleTab& tab_flux = flux_radiatif().valeurs();
83 tab_flux.resize(front_vf.nb_faces(), nb_comp);
84
85 champ_front().nommer(front_vf.le_nom());
86 DoubleTab& tab = champ_front().valeurs();
87 tab.resize(front_vf.nb_faces(), nb_comp);
88 emissivite_->associer_fr_dis_base(front_vf);
89}
90
91/*! @brief Renvoie la valeur de flux imposes a la paroi radiative
92 *
93 */
95{
96 if (le_champ_front->valeurs().size() == 1)
97 return le_champ_front->valeurs()(0, 0);
98 else if (le_champ_front->valeurs().dimension(1) == 1)
99 return le_champ_front->valeurs()(i, 0);
100 else
101 Cerr << "Flux_radiatif_base::flux_impose erreur" << finl;
103 return 0.;
104}
105
106/*! @brief Renvoie la valeur de flux imposes a la paroi radiative
107 *
108 */
109double Flux_radiatif_base::flux_impose(int i, int j) const
110{
111 if (le_champ_front->valeurs().dimension(0) == 1)
112 return le_champ_front->valeurs()(0, j);
113 else
114 return le_champ_front->valeurs()(i, j);
115}
virtual DoubleTab & valeurs() override
Renvoie le tableau des valeurs du champ.
virtual void completer()
NE FAIT RIEN A surcharger dans les classes derivees.
Champ_front_base & champ_front()
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
virtual void fixer_nb_comp(int i)
Fixe le nombre de composantes du champ.
void nommer(const Nom &) override
Donne un nom au champ.
Champ_front_base & flux_radiatif()
double flux_impose(int i) const override
Renvoie la valeur de flux imposes a la paroi radiative.
void completer() override
NE FAIT RIEN A surcharger dans les classes derivees.
class Front_VF
Definition Front_VF.h:36
int nb_faces() const
Definition Front_VF.h:53
const Nom & le_nom() const override
Renvoie le nom de la frontiere geometrique.
Classe Neumann_paroi Cette condition limite correspond a un flux impose pour l'equation de.
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
void resize(_SIZE_ n, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)
Definition TRUSTTab.tpp:469