TrioCFD 1.9.9_beta
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 << "Error reading the boundary condition of type " << finl;
59 Cerr << "Echange_externe_impose_rayo_transp " << finl;
60 Cerr << "Expected " << les_motcles << "instead of " << motlu << finl;
62 }
63 }
64 ind++;
65 }
66
67 if (local_min_vect(h_imp_->valeurs()) < 1.e9)
68 {
69 Cerr << "Error using the boundary condition" << finl;
70 Cerr << "Echange_externe_impose_rayo_transp. This condition can only" << finl;
71 Cerr << "be used for a radiation problem to " << finl;
72 Cerr << "impose a temperature on a wall" << finl;
74 }
75
76 return is;
77}
78
80{
81 assert(!le_modele_rayo_);
82
83 // retrieve the radiation model ... !
84 const Probleme_base& this_pb = domaine_Cl_dis().equation().probleme();
85 if (sub_type(Pb_Fluide_base, this_pb)) // otherwise Pb_conduction for instance ;)
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()
Returns the domain of discretized boundary conditions to which the object belongs.
virtual void completer()
DOES NOTHING must be overridden in derived classes.
std::vector< Motcle > app_domains
virtual Frontiere_dis_base & frontiere_dis()
Returns the discretized boundary to which the boundary conditions apply.
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
Performs a time update of the boundary condition.
int initialiser(double temps) override
Initialization at the beginning of the calculation.
Classe Echange_externe_impose: This class represents the special case of the class.
int initialiser(double temps) override
Initialization at the beginning of the calculation.
virtual Champ_front_base & T_ext()
Returns the T_ext field of temperature imposed at the boundary.
void mettre_a_jour(double) override
Performs a time update of the boundary conditions.
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
Probleme_base & probleme()
Returns the problem associated with the 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
Returns the reference to the equation pointed to by MorEqn::mon_equation.
Definition MorEqn.h:62
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 const Nom & le_nom() const
Returns the name of the Objet_U. Virtual method to override: returns "neant" in this implementation.
Definition Objet_U.cpp:317
virtual Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
Definition Objet_U.cpp:278
Pb_Fluide_base This class provides a base class for.
const Nom & le_nom() const override
Returns the name of the Objet_U. Virtual method to override: returns "neant" in this implementation.
Definition Probleme_U.h:109
class Probleme_base It is a Probleme_U that is not a coupling.
virtual const Milieu_base & milieu() const
Returns the physical medium associated with the problem (const version).
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