TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Pb_Couple_rayo_semi_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 <Source_rayo_semi_transp_base.h>
17#include <Pb_Couple_rayo_semi_transp.h>
18#include <Pb_rayo_semi_transp.h>
19#include <Fluide_base.h>
20
21Implemente_instanciable(Pb_Couple_rayo_semi_transp, "Pb_Couple_rayo_semi_transp", Probleme_Couple);
22
24
26
28{
29 // 1er truc a faire
30 int nb_pb_ray = 0;
31 for (int l = 0; l < nb_problemes(); l++)
32 {
33 Probleme_base& le_pb = ref_cast(Probleme_base, probleme(l));
34
35 if (!sub_type(Pb_rayo_semi_transp, le_pb))
36 if (sub_type(Fluide_base, le_pb.milieu()))
37 if (ref_cast(Fluide_base, le_pb.milieu()).is_rayo_semi_transp())
38 nb_pb_ray++;
39 }
40
41 if (nb_pb_ray > 1)
42 {
43 Cerr << "Pb_Couple_rayo_semi_transp::initialize - We can only treat 1 semi-transparent problem at present. You defined " << nb_pb_ray << " !!!" << finl;
45 }
46 else if (nb_pb_ray == 0)
47 Process::exit("Pb_Couple_rayo_semi_transp::initialize - It seems you forgot to define the radiation properties in your medium !!!\n");
48
49 // on associe le pb fluide au pb_rayo
50 for (int l = 0; l < nb_problemes(); l++)
51 {
52 Probleme_base& le_pb = ref_cast(Probleme_base, probleme(l));
53
54 if (!sub_type(Pb_rayo_semi_transp, le_pb))
55 if (sub_type(Fluide_base, le_pb.milieu()))
56 if (ref_cast(Fluide_base, le_pb.milieu()).is_rayo_semi_transp())
57 {
58 pb_rayo_semi_transp_->associer_probleme_fluide(le_pb);
59 break;
60 }
61 }
62
63 pb_rayo_semi_transp_->discretise_longueur_rayo();
64
66 Probleme_base& le_pb = pb_rayo_semi_transp_->probleme_fluide();
67 // Associer le pb rayo aux sources de rayonnement
68 for (int i = 0; i < le_pb.nombre_d_equations(); i++)
69 {
70 Sources& les_sources = le_pb.equation(i).sources();
71 for (int j = 0; j < les_sources.size(); j++)
72 {
73 Source& la_source = les_sources[j];
74 if (sub_type(Source_rayo_semi_transp_base, la_source.valeur()))
75 {
76 Source_rayo_semi_transp_base& source_rayo = ref_cast(Source_rayo_semi_transp_base, la_source.valeur());
77 Cerr << "Association pb rayo semi transp au terme source rayo" << finl;
78 source_rayo.associer_pb_rayo_semi_transp(pb_rayo_semi_transp_.valeur());
79 }
80 }
81 }
82
83 pb_rayo_semi_transp_->eq_rayo().resoudre(presentTime());
84 pb_rayo_semi_transp_->calculer_flux_radiatif();
85
86 for (int i = 0; i < nb_problemes(); i++)
87 {
88 Probleme_base& pb = ref_cast(Probleme_base, probleme(i));
89 for (int j = 0; j < pb.nombre_d_equations(); j++)
91 }
92}
93
95{
96 if (sub_type(Pb_rayo_semi_transp, ob))
97 {
98 Cerr << "association du pb rayo semi transp au pb couple" << finl;
99 if (pb_rayo_semi_transp_)
100 Process::exit("Attention : on ne peut associer qu'un pb de rayonnement a un Pb_Couple_rayo_semi_transp !!! \n");
101
102 pb_rayo_semi_transp_ = ref_cast(Pb_rayo_semi_transp, ob);
103 ajouter(pb_rayo_semi_transp_.valeur());
104
105 return 1;
106 }
107 else
109}
double presentTime() const override
Returns the present time.
const Probleme_U & probleme(int i) const
Definition Couplage_U.h:127
int nb_problemes() const
Definition Couplage_U.h:117
virtual int calculer_coeffs_echange(double temps)
Calcul des coefficients d'echange pour les problemes couples thermiques.
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
Sources & sources()
Renvoie les termes sources asssocies a l'equation.
virtual Domaine_Cl_dis_base & domaine_Cl_dis()
Renvoie le domaine des conditions aux limite discretisee associee a l'equation.
classe Fluide_base Cette classe represente un d'un fluide incompressible ainsi que
Definition Fluide_base.h:38
classe Objet_U Cette classe est la classe de base des Objets de TRUST
Definition Objet_U.h:73
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
classe derivee de Probleme_Couple Cette classe couple, outre des Probleme_base, un pb de
int associer_(Objet_U &) override
Associe l'Objet_U a un autre Objet_U Methode virtuelle a surcharger.
void initialize() override
This method is called once at the beginning, before any other one of the interface Problem.
Le Pb_rayo_semi_transp est un Probleme_base qui a 4 particularites : * Son equation doit etre typee e...
classe Probleme_Couple C'est la classe historique de couplage de TRUST.
void initialize() override
This method is called once at the beginning, before any other one of the interface Problem.
int associer_(Objet_U &) override
Surcharge Objet_U::associer_(Objet_U&) Associe un objet au probleme couple, en verifiant le type.
void ajouter(Probleme_base &)
Ajoute un probleme a la liste des problemes couples.
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.
virtual int nombre_d_equations() const =0
virtual const Equation_base & equation(int) const =0
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
classe Source_rayo_semi_transp_base Classe de base de la hierarchie des termes sources de l'eqution d...
virtual void associer_pb_rayo_semi_transp(Pb_rayo_semi_transp &)
classe Source Classe generique de la hierarchie des sources, un objet Source peut
Definition Source.h:33
class Sources Sources represente une liste de Source.
Definition Sources.h:31