TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Champ_front_tangentiel_VEF.cpp
1/****************************************************************************
2* Copyright (c) 2022, 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_tangentiel_VEF.h>
17#include <Domaine_VEF.h>
18#include <TRUSTTrav.h>
19Implemente_instanciable(Champ_front_tangentiel_VEF,"Champ_front_tangentiel_VEF",Champ_front_tangentiel);
20// XD champ_front_tangentiel_vef front_field_base champ_front_tangentiel_vef NO_BRACE Field to define the tangential
21// XD_CONT velocity vector field standard at the boundary in VEF discretization.
22// XD attr mot chaine(into=["vitesse_tangentielle"]) mot REQ Name of vector field.
23// XD attr vit_tan floattant vit_tan REQ Vector field standard [m/s].
24
26{
28}
29
30
32{
35}
36
37
38// WEC : manifestement suppose qu'on est en dimension 3, que les
39// surfaces sont verticales (vecteur normal orthogonal a z) et que le
40// vecteur rotation est selon z.
41
42// Ce champ est en fait stationnaire => tout dans initialiser.
43
45{
47 return 0;
48
49 const Domaine_VEF& domaine_VEF = ref_cast(Domaine_VEF,domaine_dis());
50 const Front_VF& le_bord= ref_cast(Front_VF,frontiere_dis());
51 int premiere=le_bord.num_premiere_face();
52 // int derniere=premiere+le_bord.nb_faces();
53 const DoubleTab& face_normales = domaine_VEF.face_normales();
54 const IntTab& face_voisins = domaine_VEF.face_voisins();
55
56 int nb_cases=les_valeurs->nb_cases();
57
58 // on traite les faces sur la frontiere
59
60 DoubleTab vecteur_tang(le_bord.nb_faces(),3);
61
62 for(int i=0; i<le_bord.nb_faces(); i++)
63 {
64 int elem1=face_voisins(i+premiere,0);
65 if (elem1 == -1)
66 elem1=face_voisins(i+premiere,1);
67 int signe = domaine_VEF.oriente_normale(i+premiere,elem1);
68
69 vecteur_tang(i,2) = 0.0;
70
71 vecteur_tang (i,0) = -face_normales(i+premiere,1)*signe;
72
73 vecteur_tang (i,1) =face_normales(i+premiere,0)*signe;
74
75 double norme=0.0;
76
77 for (int k=0; k<2; k++)
78 norme += vecteur_tang(i,k)* vecteur_tang(i,k);
79
80 norme = sqrt(norme);
81
82 // Remplissage de tous les instants
83 for (int t=0; t<nb_cases; t++)
84 {
85 DoubleTab& tab=les_valeurs[t].valeurs();
86
87 tab(i,2)=0.0;
88
89 // WEC : Les indices etaient i+premiere.
90 // Supprime car manifestement un bug !!
91 // Change aussi dans le domaine_Cl_VEF
92 for(int j=0; j<2; j++)
93 {
94 tab(i,j)=vecteur_tang(i,j);
95 tab(i,j)*=vit_tang;
96 tab(i,j)=tab(i,j)/norme;
97 }
98 }
99 }
100
101 return 1;
102}
int initialiser(double temps, const Champ_Inc_base &inco) override
Initialisation en debut de calcul.
Classe Champ_Inc_base.
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_tangentiel_VEF
int initialiser(double temps, const Champ_Inc_base &inco) override
Initialisation en debut de calcul.
class Champ_front_tangentiel
class Domaine_VEF
Definition Domaine_VEF.h:54
virtual double face_normales(int face, int comp) const
Definition Domaine_VF.h:47
int oriente_normale(int f, int e) const
Definition Domaine_VF.h:194
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
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
virtual Sortie & printOn(Sortie &) const
Ecriture de l'objet sur un flot de sortie Methode a surcharger.
Definition Objet_U.cpp:282
Classe de base des flux de sortie.
Definition Sortie.h:52