TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Champ_front_fonc_gradient_VDF.cpp
1/****************************************************************************
2* Copyright (c) 2023, 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
17#include <Champ_front_fonc_gradient_VDF.h>
18#include <distances_VDF.h>
19#include <Paroi_Knudsen_non_negligeable.h>
20#include <TRUSTTrav.h>
21
22Implemente_instanciable(Champ_front_fonc_gradient_VDF,"Champ_front_fonc_gradient_VDF",Champ_front_fonc_gradient);
23
25{
27}
28
29
31{
33 return s;
34}
35
36/*! @brief Mise a jour du temps
37 *
38 */
39
41{
42 // Cerr << "Champ_front_fonc_gradient_VDF::mettre_a_jour" << finl;
43 const Front_VF& la_front=ref_cast(Front_VF, frontiere_dis());
44 int nb_faces = la_front.nb_faces();
45 int ndeb = la_front.num_premiere_face();
46
47 DoubleTab& tab=valeurs_au_temps(temps);
48
49 const Domaine_VDF& le_dom_VDF = ref_cast(Domaine_VDF,domaine_dis());
50 const IntVect& orientation = le_dom_VDF.orientation();
51 // On recupere la CL et les champs associes
52 const Paroi_Knudsen_non_negligeable& la_condition_limite=ref_cast(Paroi_Knudsen_non_negligeable,condition_limite(la_front.le_nom()));
53 const DoubleTab& la_inconnue_paroi_=la_condition_limite.vitesse_paroi();
54 const DoubleTab& k_=la_condition_limite.k();
55 const DoubleVect& la_inconnue=inconnue->valeurs();
56 int elem,iro,ori,i,j;
57 // double inconnue_moyenne1,inconnue_moyenne2;
58
59 DoubleTab la_inconnue_paroi(nb_faces,dimension);
60 DoubleVect k(nb_faces);
61 DoubleVect inconnue_moyenne(dimension-1);
62 if (la_inconnue_paroi_.dimension(0)==1)
63 for (i=0; i<nb_faces; i++)
64 for (j=0; j<dimension; j++)
65 la_inconnue_paroi(i,j)=la_inconnue_paroi_(0,j);
66 else
67 for (i=0; i<nb_faces; i++)
68 for (j=0; j<dimension; j++)
69 la_inconnue_paroi(i,j)=la_inconnue_paroi_(i,j);
70 if (k_.dimension(0)==1)
71 for (i=0; i<nb_faces; i++)
72 k(i)=k_(0,0);
73 else
74 for (i=0; i<nb_faces; i++)
75 k(i)=k_(i,0);
76 for (i=0; i<nb_faces; i++)
77 {
78 int num_face=ndeb+i;
79 double k_sur_e;
80 if (axi)
81 k_sur_e=k(i)/le_dom_VDF.dist_norm_bord_axi(num_face);
82 else
83 k_sur_e=k(i)/le_dom_VDF.dist_norm_bord(num_face);
84 elem = le_dom_VDF.face_voisins(num_face,0);
85 if ( elem == -1 )
86 elem = le_dom_VDF.face_voisins(num_face,1);
87 // Calcul de la inconnue a la paroi en fonction
88 // de l'orientation
89 ori = orientation(num_face);
90 tab(i,ori) = la_inconnue_paroi(i,ori);
91 if (dimension==2)
92 {
93 moy_2D_vit(la_inconnue,elem,ori,le_dom_VDF,inconnue_moyenne[0]);
94 iro=1-ori;
95 tab(i,iro)=(la_inconnue_paroi(i,iro)+k_sur_e*inconnue_moyenne[0])/(1+k_sur_e);
96 }
97 else if (dimension==3)
98 {
99 moy_3D_vit(la_inconnue,elem,ori,le_dom_VDF,inconnue_moyenne[0],inconnue_moyenne[1]);
100 if (ori==0)
101 {
102 iro=1;
103 tab(i,iro)=(la_inconnue_paroi(i,iro)+k_sur_e*inconnue_moyenne[0])/(1+k_sur_e);
104 iro=2;
105 tab(i,iro)=(la_inconnue_paroi(i,iro)+k_sur_e*inconnue_moyenne[1])/(1+k_sur_e);
106 }
107 else if (ori==1)
108 {
109 iro=0;
110 tab(i,iro)=(la_inconnue_paroi(i,iro)+k_sur_e*inconnue_moyenne[0])/(1+k_sur_e);
111 iro=2;
112 tab(i,iro)=(la_inconnue_paroi(i,iro)+k_sur_e*inconnue_moyenne[1])/(1+k_sur_e);
113 }
114 else if (ori==2)
115 {
116 iro=0;
117 tab(i,iro)=(la_inconnue_paroi(i,iro)+k_sur_e*inconnue_moyenne[0])/(1+k_sur_e);
118 iro=1;
119 tab(i,iro)=(la_inconnue_paroi(i,iro)+k_sur_e*inconnue_moyenne[1])/(1+k_sur_e);
120 }
121 }
122 }
124}
virtual const Frontiere_dis_base & frontiere_dis() const
Renvoie la frontiere discretisee associee au champ.
virtual const Domaine_dis_base & domaine_dis() const
class Champ_front_fonc_gradient_VDF
void mettre_a_jour(double) override
Mise a jour du temps.
class Champ_front_fonc_gradient
const Cond_lim_base & condition_limite(const Nom &)
DoubleTab & valeurs_au_temps(double temps) override
Renvoie les valeurs au temps desire.
class Domaine_VDF
Definition Domaine_VDF.h:64
double dist_norm_bord_axi(int num_face) const
int orientation(int) const override
inline DoubleVect& Domaine_VDF::porosite_face() {
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
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.
class Front_VF
Definition Front_VF.h:36
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.
static int dimension
Definition Objet_U.h:99
virtual Entree & readOn(Entree &)
Lecture d'un Objet_U sur un flot d'entree Methode a surcharger.
Definition Objet_U.cpp:293
static int axi
Definition Objet_U.h:101
virtual Sortie & printOn(Sortie &) const
Ecriture de l'objet sur un flot de sortie Methode a surcharger.
Definition Objet_U.cpp:282
classe Paroi_Knudsen_non_negligeable Impose un saut de vitesse de paroi dans une equation de type Nav...
Classe de base des flux de sortie.
Definition Sortie.h:52
_SIZE_ dimension(int d) const
Definition TRUSTTab.tpp:133
virtual void echange_espace_virtuel(IsExchangeBlocking exchange_type=IsExchangeBlocking::DefaultBlocking, const std::string kernel_name="noname")