TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Champ_front_contact_rayo_semi_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_semi_transp_VEF.h>
17#include <Domaine_VEF.h>
18#include <Schema_Temps_base.h>
19#include <Pb_Couple_rayo_semi_transp.h>
20#include <Pb_rayo_semi_transp.h>
21
22Implemente_instanciable(Champ_front_contact_rayo_semi_transp_VEF, "Champ_front_contact_rayo_semi_transp_VEF", Champ_front_contact_VEF);
23
25{
26 return os;
27}
28
30{
33}
34
39
46
48{
49 int nb_faces = frontiere_dis().frontiere().nb_faces();
50 flux_radiatif_.resize(nb_faces);
51 int ok = Champ_front_contact_VEF::initialiser(temps, inco);
52 return ok;
53}
54
56{
57
58 if (is_conduction) // Le pb_rayo est connu par l'autre probleme
59 {
60 const Champ_front_contact_rayo_semi_transp_VEF& ch_fr_rayo = ref_cast(Champ_front_contact_rayo_semi_transp_VEF, ch_fr_autre_pb.valeur());
61 const DoubleTab& tab_fl_rad = ch_fr_rayo.pb_rayo_semi_transp().flux_radiatif(frontiere_dis().le_nom()).valeurs();
62 // Le rapatrier
63 trace_face_raccord(fr_vf_autre_pb.valeur(), tab_fl_rad, flux_radiatif_);
64 }
65 else
66 {
67 int nb_faces = frontiere_dis().frontiere().nb_faces();
68 const DoubleTab& tab_fl_rad = pb_rayo_semi_transp_->flux_radiatif(frontiere_dis().le_nom()).valeurs();
69 for (int fac_front = 0; fac_front < nb_faces; fac_front++)
70 flux_radiatif_(fac_front) = tab_fl_rad(fac_front, 0);
71 }
72}
73
75{
77
78 // Calcul des coefficitents d'amortissement
80}
81
83{
84 const Frontiere& la_front = la_frontiere_dis->frontiere();
85 int nb_faces = la_front.nb_faces();
86
87 // On recupere les coefficients gradient_num_transf et gradient_fro_transf de l'autre probleme
88 DoubleVect gradient_num_transf_autre_pb(nb_faces);
89 DoubleVect gradient_fro_transf_autre_pb(nb_faces);
90 trace_face_raccord(fr_vf_autre_pb.valeur(), ch_fr_autre_pb->get_gradient_num_transf(), gradient_num_transf_autre_pb);
91 trace_face_raccord(fr_vf_autre_pb.valeur(), ch_fr_autre_pb->get_gradient_fro_transf(), gradient_fro_transf_autre_pb);
92 double signe = -1;
93 gradient_num_transf_autre_pb *= signe;
94 gradient_fro_transf_autre_pb *= signe;
95
96 // On modifiee les gradients pour prendre en compte le flux radiatif
97 modifie_gradients_pour_rayonnement(gradient_num_transf, gradient_num_transf_autre_pb);
98
99 // On recupere les tableaux permettant de calculer omega, le facteur d'amortissement
100 DoubleVect coeff_amort_num_autre_pb(nb_faces);
101 DoubleVect coeff_amort_denum_autre_pb(nb_faces);
102 trace_face_raccord(fr_vf_autre_pb.valeur(), ch_fr_autre_pb->get_coeff_amort_num(), coeff_amort_num_autre_pb);
103 trace_face_raccord(fr_vf_autre_pb.valeur(), ch_fr_autre_pb->get_coeff_amort_denum(), coeff_amort_denum_autre_pb);
104
105 // Calcul de la temperature de paroi
106 DoubleTab& tab = valeurs_au_temps(temps);
107 for (int fac_front = 0; fac_front < nb_faces; fac_front++)
108 {
109 // CALCUL DU TERME D'AMORTISSEMENT
110 Schema_Temps_base& sch = l_inconnue->equation().probleme().schema_temps();
111 double dt = sch.pas_de_temps();
112 double e = std::max(coeff_amort_num_autre_pb(fac_front), coeff_amort_num(fac_front));
113 // double e = coeff_amort_num_autre_pb(fac_front) + coeff_amort_num(fac_front);
114 double omega = dt / (dt + e / (coeff_amort_denum_autre_pb(fac_front) + coeff_amort_denum(fac_front)));
115 omega = 1.;
116 // FIN DU CALCUL DU TERME D'AMORTISSEMENT
117 /*
118 Cerr<<"omega = "<<omega<<finl;
119 Cerr<<"gradient_num_local(fac_front) = "<<gradient_num_local(fac_front)<<finl;
120 Cerr<<"gradient_num_transf_autre_pb(fac_front) = "<<gradient_num_transf_autre_pb(fac_front)<<finl;
121 Cerr<<"gradient_fro_local(fac_front) = "<<gradient_fro_local(fac_front)<<finl;
122 Cerr<<"gradient_fro_transf_autre_pb(fac_front) = "<<gradient_fro_transf_autre_pb(fac_front)<<finl;
123 Cerr<<"flux_radiatif(fac_front) = "<<flux_radiatif(fac_front)<<finl;
124 */
125 double tab_past = tab(fac_front, 0);
126
127 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));
128
129 tab(fac_front, 0) = omega * tab(fac_front, 0) + (1 - omega) * tab_past;
130 }
132}
133
134void Champ_front_contact_rayo_semi_transp_VEF::modifie_gradients_pour_rayonnement(DoubleVect& tab_gradient_num_transf, DoubleVect& gradient_num_transf_autre_pb)
135{
136 const Frontiere& la_front = la_frontiere_dis->frontiere();
137 int nb_faces = la_front.nb_faces();
138
139 if (is_conduction)
140 {
141 for (int fac_front = 0; fac_front < nb_faces; fac_front++)
142 gradient_num_local(fac_front) = gradient_num_local(fac_front) + flux_radiatif_(fac_front);
143 }
144 else
145 {
146 for (int fac_front = 0; fac_front < nb_faces; fac_front++)
147 gradient_num_transf_autre_pb(fac_front) = gradient_num_transf_autre_pb(fac_front) + flux_radiatif_(fac_front);
148 }
149}
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.
virtual DoubleTab & valeurs() override
Renvoie le tableau des valeurs du champ.
classe Champ_front_contact_VEF Permet le couplage scalaire (temperature ou concentration) entre probl...
virtual void calcul_grads_locaux(double temps)
void verifier_scalaire_bord(double temps)
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.
int initialiser(double temps, const Champ_Inc_base &inco) override
Initialisation en debut de calcul.
void mettre_a_jour(double temps) override
NE FAIT RIEN, a surcharger.
Champ_front_base & affecter_(const Champ_front_base &ch) override
void modifie_gradients_pour_rayonnement(DoubleVect &gradient_num_transf, DoubleVect &gradient_num_transf_autre_pb)
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.
const Nom & le_nom() const override
Renvoie le nom du champ.
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.
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
const Champ_front_base & flux_radiatif(const Nom &nom_bord) const
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
virtual void echange_espace_virtuel(IsExchangeBlocking exchange_type=IsExchangeBlocking::DefaultBlocking, const std::string kernel_name="noname")