TrioCFD 1.9.9_beta
TrioCFD documentation
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 << "Error reading the boundary condition of type " << finl;
57 Cerr << "Flux_radiatif_base " << finl;
58 Cerr << "Expected " << les_motcles << "instead of " << 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 // Type the champ_front flux_radiatif_ associated with the boundary condition
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 Returns the imposed flux value at the radiative wall.
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 error" << finl;
103 return 0.;
104}
105
106/*! @brief Returns the imposed flux value at the radiative wall.
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
Returns the array of field values.
virtual void completer()
DOES NOTHING must be overridden in derived classes.
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)
Sets the number of components of the field.
void nommer(const Nom &) override
Gives a name to the field.
Champ_front_base & flux_radiatif()
double flux_impose(int i) const override
Returns the imposed flux value at the radiative wall.
void completer() override
DOES NOTHING must be overridden in derived classes.
class Front_VF
Definition Front_VF.h:36
int nb_faces() const
Definition Front_VF.h:53
const Nom & le_nom() const override
Returns the name of the geometric boundary.
Classe Neumann_paroi This boundary condition corresponds to an imposed flux for the.
const Nom & que_suis_je() const
Returns the string identifying the class.
Definition Objet_U.cpp:104
virtual Entree & readOn(Entree &)
Reads an Objet_U from an input stream. Virtual method to override.
Definition Objet_U.cpp:289
virtual Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
Definition Objet_U.cpp:278
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Definition Process.cpp:466
Base class for output streams.
Definition Sortie.h:52
void resize(_SIZE_ n, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)
Definition TRUSTTab.tpp:469