TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Champ_front_contact_rayo_transp_VEF.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 <Champ_front_contact_rayo_transp_VEF.h>
17#include <Schema_Temps_base.h>
18#include <Pb_Fluide_base.h>
19#include <Champ_Inc_base.h>
20#include <Pb_Conduction.h>
21#include <Equation_base.h>
22#include <Domaine_VEF.h>
23
24Implemente_instanciable(Champ_front_contact_rayo_transp_VEF, "Champ_front_contact_rayo_transp_VEF", Champ_front_contact_VEF);
25
27
29{
32}
33
35{
36 assert (!le_modele_rayo_);
37
38 // on recupere le modele rayo ... mais faut le bon probleme !
39 // XXX pas encore entrer dans Champ_front_contact_VEF::initialiser ... donc faut faire des choses a la main ici ...
41 if (pb1.milieu().is_rayo_transp()) // c'est bon on est côte fluide !!
42 {
43 assert (sub_type(Pb_Fluide_base, pb1));
44 le_modele_rayo_ =ref_cast(Pb_Fluide_base, pb1).get_mod_rayo_transp();
45 }
46 else // l'autre pb ...
47 {
49 if (pb2.milieu().is_rayo_transp()) // pb fluide trouve !!
50 {
51 assert (sub_type(Pb_Fluide_base, pb2));
52 le_modele_rayo_ =ref_cast(Pb_Fluide_base, pb2).get_mod_rayo_transp();
53 }
54 else
55 {
56 Cerr << finl << "Big issue in Champ_front_contact_rayo_transp_VEF::initialiser !!!" << finl;
57 Cerr << "It seems that you defined a radiation contact BC between the boundaries " << nom_bord1 << " and " << nom_bord2 << finl;
58 Cerr << "of problems " << nom_pb1 << " and " << nom_pb2 << " , but neither is a fluid radiation problem !!!" << finl;
59 Process::exit("Please fix your data file and use a classical paroi_contact BC for these boundaries ... \n");
60 }
61 }
62
63 int nb_faces = frontiere_dis().frontiere().nb_faces();
64 flux_radiatif_.resize(nb_faces);
65 return Champ_front_contact_VEF::initialiser(temps, inco);
66}
67
72
74{
75 if (is_conduction) // Le modele est connu par l'autre probleme
76 {
77 // Calcul du flux radiatif sur la frontiere de l'autre probleme
78 DoubleTab flux_radiatif_autre_pb;
79 int nb_faces = fr_vf_autre_pb->frontiere().nb_faces();
80 int ndeb = fr_vf_autre_pb->frontiere().num_premiere_face();
81 flux_radiatif_autre_pb.resize(nb_faces);
82 for (int fac_front = 0; fac_front < nb_faces; fac_front++)
83 flux_radiatif_autre_pb(fac_front) = le_modele_rayo_->flux_radiatif(fac_front + ndeb);
84 // Le rapatrier
85 trace_face_raccord(fr_vf_autre_pb.valeur(), flux_radiatif_autre_pb, flux_radiatif_);
86 }
87 else
88 {
89 int nb_faces = frontiere_dis().frontiere().nb_faces();
91 flux_radiatif_.resize(nb_faces);
92 for (int fac_front = 0; fac_front < nb_faces; fac_front++)
93 flux_radiatif_(fac_front) = le_modele_rayo_->flux_radiatif(fac_front + ndeb);
94 }
95}
96
101
103{
105
106 // on verifie que le couplage est bien rayonnant
107 const Nom& nom_pb_rayonnant = le_modele_rayo_->nom_pb_rayonnant();
108
109 // le pb rayonnant est aucun des 2 problemes le couplage est non rayonnant
110 if ((nom_pb_rayonnant != nom_pb1) && (nom_pb_rayonnant != nom_pb2))
111 Process::exit("Error in Champ_front_contact_rayo_transp_VEF::calculer_coeffs_echange !! You should not be here since the problem is not a radiation problem !!!");
112
113 // Calcul et stockage du flux radiatif
115 // On modifiee les gradients pour prendre en compte le flux radiatif
116 DoubleVect gradient_num_transf_autre_pb(gradient_num_transf);
117 modifie_gradients_pour_rayonnement(gradient_num_transf, gradient_num_transf_autre_pb);
118}
119
121{
122 // codage priche de Champ_front_contact_VEF::mettre_a_jour
123 const Frontiere& la_front = la_frontiere_dis->frontiere();
124 int nb_faces = la_front.nb_faces();
125
126 // On recupere les coefficients gradient_num_transf et gradient_fro_transf de l'autre probleme
127 DoubleVect gradient_num_transf_autre_pb(nb_faces);
128 DoubleVect gradient_fro_transf_autre_pb(nb_faces);
129 trace_face_raccord(fr_vf_autre_pb.valeur(), ch_fr_autre_pb->get_gradient_num_transf(), gradient_num_transf_autre_pb);
130 trace_face_raccord(fr_vf_autre_pb.valeur(), ch_fr_autre_pb->get_gradient_fro_transf(), gradient_fro_transf_autre_pb);
131
132 // Calcul et stockage du flux radiatif
133
134 // On recupere les tableaux permettant de calculer omega, le facteur d'amortissement
135 DoubleVect coeff_amort_num_autre_pb(nb_faces);
136 DoubleVect coeff_amort_denum_autre_pb(nb_faces);
137 trace_face_raccord(fr_vf_autre_pb.valeur(), ch_fr_autre_pb->get_coeff_amort_num(), coeff_amort_num_autre_pb);
138 trace_face_raccord(fr_vf_autre_pb.valeur(), ch_fr_autre_pb->get_coeff_amort_denum(), coeff_amort_denum_autre_pb);
139
140 // Calcul de la temperature de paroi
141 DoubleTab& tab = valeurs_au_temps(temps);
142 for (int fac_front = 0; fac_front < nb_faces; fac_front++)
143 {
144 // CALCUL DU TERME D'AMORTISSEMENT
145 Schema_Temps_base& sch = l_inconnue->equation().probleme().schema_temps();
146 double dt = sch.pas_de_temps();
147 double e = coeff_amort_num_autre_pb(fac_front) + coeff_amort_num(fac_front);
148 double omega = dt / (dt + e / (coeff_amort_denum_autre_pb(fac_front) + coeff_amort_denum(fac_front)));
149 // Pour l'instant on impose omega = 1 en dur
150 omega = 1;
151 // FIN DU CALCUL DU TERME D'AMORTISSEMENT
152
153 double tab_past = tab(fac_front, 0);
154
155 tab(fac_front, 0) = -(gradient_num_local(fac_front) + gradient_num_transf_autre_pb(fac_front)) / (gradient_fro_transf_autre_pb(fac_front) + gradient_fro_local(fac_front));
156
157 tab(fac_front, 0) = omega * tab(fac_front, 0) + (1 - omega) * tab_past;
158 }
159}
160
162{
164
165 // Calcul des coefficitents d'amortissement
167}
168
169void Champ_front_contact_rayo_transp_VEF::modifie_gradients_pour_rayonnement(DoubleVect& tab_gradient_num_transf, DoubleVect& gradient_num_transf_autre_pb)
170{
171 const Frontiere& la_front = la_frontiere_dis->frontiere();
172 const int nb_faces = la_front.nb_faces();
173
174 if (is_conduction)
175 {
176 for (int fac_front = 0; fac_front < nb_faces; fac_front++)
177 gradient_num_local(fac_front) = gradient_num_local(fac_front) + flux_radiatif_(fac_front);
178 }
179 else
180 {
181 for (int fac_front = 0; fac_front < nb_faces; fac_front++)
182 gradient_num_transf_autre_pb(fac_front) = gradient_num_transf_autre_pb(fac_front) - flux_radiatif_(fac_front);
183 }
184}
Classe Champ_Inc_base.
classe Champ_front_base Classe de base pour la hierarchie des champs aux frontieres.
virtual const Frontiere_dis_base & frontiere_dis() const
Renvoie la frontiere discretisee associee au champ.
classe Champ_front_contact_VEF Permet le couplage scalaire (temperature ou concentration) entre probl...
void calculer_coeffs_echange(double temps) override
NE FAIT RIEN, a surcharger Cette methode peut calculer et stocker des donnees utiles a la.
virtual void calcul_grads_locaux(double temps)
void mettre_a_jour(double temps) override
NE FAIT RIEN, a surcharger.
DoubleVect & trace_face_raccord(const Front_VF &fr_vf, const DoubleVect &y, DoubleVect &x)
int initialiser(double temps, const Champ_Inc_base &inco) override
Initialisation en debut de calcul.
void modifie_gradients_pour_rayonnement(DoubleVect &gradient_num_transf, DoubleVect &gradient_num_transf_autre_pb)
Champ_front_base & affecter_(const Champ_front_base &ch) override
void mettre_a_jour(double temps) override
NE FAIT RIEN, a surcharger.
int initialiser(double temps, const Champ_Inc_base &inco) override
Initialisation en debut de calcul.
void calculer_coeffs_echange(double temps) override
NE FAIT RIEN, a surcharger Cette methode peut calculer et stocker des donnees utiles a la.
DoubleTab & valeurs_au_temps(double temps) override
Renvoie les valeurs au temps desire.
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.
int_t num_premiere_face() const
Definition Frontiere.h:67
int_t nb_faces() const
Renvoie le nombre de faces de la frontiere.
Definition Frontiere.h:59
const Frontiere & frontiere() const
Renvoie la frontiere geometrique associee.
static Objet_U & objet(const Nom &)
Voir Interprete_bloc::objet_global() BM: la classe Interprete n'est pas le meilleur endroit pour cett...
virtual bool is_rayo_transp() const
Definition Milieu_base.h:83
class Nom Une chaine de caractere pour nommer les objets de TRUST
Definition Nom.h:31
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 Pb_Fluide_base Cette classe a pour but de disposer d une classe amont pour
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
class Schema_Temps_base
double pas_de_temps() const
Renvoie le pas de temps (delta_t) courant.
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