TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
PlaqThVDF.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 <Convection_Diffusion_Temperature.h>
17#include <Modele_turbulence_scal_base.h>
18#include <Domaine_Cl_dis_base.h>
19#include <Champ_front_calc.h>
20#include <Probleme_base.h>
21#include <Milieu_base.h>
22#include <Domaine_VDF.h>
23#include <PlaqThVDF.h>
24
25Implemente_instanciable(PlaqThVDF,"Plaque_Thermique_VDF",Echange_global_impose);
26
28{
29 return s << que_suis_je() << finl;
30}
31
33{
34 if (app_domains.size() == 0) app_domains = { Motcle("Thermique"), Motcle("Neutronique"), Motcle("fraction_massique"), Motcle("indetermine") };
35
36 s >> h;
37 le_champ_front.typer("Champ_front_calc");
38 return s;
39}
40
41void PlaqThVDF::mettre_a_jour(double )
42{
43 const Equation_base& eqn = mon_dom_cl_dis->equation();
44 const Domaine_VDF& le_dom_VDF=ref_cast(Domaine_VDF, eqn.domaine_dis());
45 const Front_VF& front= ref_cast(Front_VF,frontiere_dis());
46
47 const Milieu_base& le_milieu=eqn.probleme().milieu();
48 h/=(le_milieu.masse_volumique().valeurs()(0,0)*le_milieu.capacite_calorifique().valeurs()(0,0));
49
50 // Calcul de himp :
51 const RefObjU& modele_turbulence = eqn.get_modele(TURBULENCE);
52 if (modele_turbulence && sub_type(Modele_turbulence_scal_base,modele_turbulence.valeur()))
53 {
54 const Modele_turbulence_scal_base& modele = ref_cast(Modele_turbulence_scal_base,modele_turbulence.valeur());
55 const Turbulence_paroi_scal_base& loipar = modele.loi_paroi();
56 Champ_front_calc& ch=ref_cast(Champ_front_calc, T_ext());
57 ch.creer(eqn.probleme().le_nom(),frontiere_dis().le_nom(),eqn.inconnue().le_nom());
58 //const Milieu_base& le_milieu=eqn.probleme().milieu();
59 h_imp_.typer("Champ_front_uniforme");
60 DoubleTab& tab = h_imp_->valeurs();
61 h_imp_->fixer_nb_comp(1);
62 int nbfs2 = front.nb_faces()/2;
63 tab.resize(front.nb_faces(),1);
64 int boundary_index=-1;
65 int nb_boundaries=le_dom_VDF.domaine().nb_front_Cl();
66 for (int n_bord=0; n_bord<nb_boundaries; n_bord++)
67 {
68 if (le_dom_VDF.front_VF(n_bord).le_nom() == front.le_nom())
69 boundary_index=n_bord;
70 }
71 for(int face=0; face < nbfs2; face++)
72 {
73 // double e1 = loipar.d_equiv(face);
74 // double e2 = loipar.d_equiv(nbfs2+face);
75 int local_face=le_dom_VDF.front_VF(boundary_index).num_local_face(face);
76 int local_face2=le_dom_VDF.front_VF(boundary_index).num_local_face(nbfs2+face);
77 double e1 = loipar.equivalent_distance(boundary_index,local_face);
78 double e2 = loipar.equivalent_distance(boundary_index,local_face2);
79 tab(face,0) = tab(nbfs2+face,0) =
80 2./(1./h+e1/le_milieu.diffusivite().valeurs()(0,0)
81 +e2/le_milieu.diffusivite().valeurs()(0,0));
82 }
83 }
84 else if (sub_type(Convection_Diffusion_Temperature,eqn))
85 {
86 Champ_front_calc& ch = ref_cast(Champ_front_calc,T_ext());
88 eqn.inconnue().le_nom());
89 //const Milieu_base& le_milieu=eqn.probleme().milieu();
90 h_imp_.typer("Champ_front_uniforme");
91 DoubleTab& tab= h_imp_->valeurs();
92 tab.resize(1,1);
93 h_imp_->fixer_nb_comp(1);
94 double e1 = le_dom_VDF.dist_norm_bord(front.num_premiere_face());
95 double e2 = le_dom_VDF.dist_norm_bord(front.nb_faces()/2);
96 tab(0,0) = 2./(1./h+e1/le_milieu.diffusivite().valeurs()(0,0)
97 +e2/le_milieu.diffusivite().valeurs()(0,0));
98 }
99
100 //Calcul de T_ext :
101 const DoubleTab& Temp= eqn.inconnue().valeurs();
102 DoubleTab& tab= T_ext().valeurs();
103 tab.resize(front.nb_faces(),1);
104 int face, el1, el2;
105 int premiere = front.num_premiere_face();
106 int nbfs2=front.nb_faces()/2;
107 int derniere = premiere + nbfs2;
108 for(face=premiere; face < derniere; face++)
109 {
110 int num=face-premiere;
111 el1=le_dom_VDF.face_voisins(face,0);
112 el2=le_dom_VDF.face_voisins(face+nbfs2,1);
113 tab(num+nbfs2,0)=tab(num,0)=(Temp(el1)+Temp(el2))*0.5;
114 };
115}
DoubleTab & valeurs() override
Surcharge Champ_base::valeurs() Renvoie le tableau des valeurs.
DoubleTab & valeurs() override
Renvoie le tableau des valeurs du champ au temps courant.
virtual DoubleTab & valeurs() override
Renvoie le tableau des valeurs du champ.
void creer(const Nom &, const Nom &, const Motcle &)
Cree l'objet Champ_front_calc representant la trace d'un champ inconnue sur une frontiere a partir de...
std::vector< Motcle > app_domains
virtual Frontiere_dis_base & frontiere_dis()
Renvoie la frontiere discretisee a laquelle les conditions aux limites s'appliquent.
int nb_front_Cl() const
Definition Domaine.h:236
double dist_norm_bord(int num_face) const override
int face_voisins(int num_face, int i) const
renvoie l'element voisin de numface dans la direction i.
Definition Domaine_VF.h:418
const Front_VF & front_VF(int i) const
Definition Domaine_VF.h:112
const Domaine & domaine() const
Classe Echange_global_impose Cette classe represente le cas particulier de la classe.
virtual Champ_front_base & T_ext()
Renvoie le champ T_ext de temperature imposee a la frontiere.
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
virtual const RefObjU & get_modele(Type_modele type) const
virtual const Champ_Inc_base & inconnue() const =0
Probleme_base & probleme()
Renvoie le probleme associe a l'equation.
Domaine_dis_base & domaine_dis()
Renvoie le domaine discretise associe a l'equation.
const Nom & le_nom() const override
Renvoie le nom du champ.
int num_local_face(const int) const
Definition Front_VF.h:87
int nb_faces() const
Definition Front_VF.h:53
int num_premiere_face() const
Definition Front_VF.h:63
const Nom & le_nom() const override
Renvoie le nom de la frontiere geometrique.
virtual const Champ_Don_base & capacite_calorifique() const
Renvoie la capacite calorifique du milieu.
virtual const Champ_Don_base & diffusivite() const
Renvoie la diffusivite du milieu.
virtual const Champ_base & masse_volumique() const
Renvoie la masse volumique du milieu.
const Turbulence_paroi_scal_base & loi_paroi() const
Renvoie la loi de turbulence sur la paroi (version const).
const Nom & que_suis_je() const
renvoie la chaine identifiant la classe.
Definition Objet_U.cpp:104
virtual Entree & readOn(Entree &)
Lecture d'un Objet_U sur un flot d'entree Methode a surcharger.
Definition Objet_U.cpp:293
virtual const Nom & le_nom() const
Donne le nom de l'Objet_U Methode a surcharger : renvoie "neant" dans cette implementation.
Definition Objet_U.cpp:319
virtual Sortie & printOn(Sortie &) const
Ecriture de l'objet sur un flot de sortie Methode a surcharger.
Definition Objet_U.cpp:282
PlaqThVDF.
Definition PlaqThVDF.h:34
double h
Definition PlaqThVDF.h:40
const Nom & le_nom() const override
Donne le nom de l'Objet_U Methode a surcharger : renvoie "neant" dans cette implementation.
Definition Probleme_U.h:109
virtual const Milieu_base & milieu() const
Renvoie le milieu physique associe au probleme.
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
const Objet_U & valeur() const
Definition TRUST_Ref.h:134
const DoubleVects & equivalent_distance() const