1
!-------------------------------------------------------------------------------
3
! This file is part of Code_Saturne, a general-purpose CFD tool.
5
! Copyright (C) 1998-2011 EDF S.A.
7
! This program is free software; you can redistribute it and/or modify it under
8
! the terms of the GNU General Public License as published by the Free Software
9
! Foundation; either version 2 of the License, or (at your option) any later
12
! This program is distributed in the hope that it will be useful, but WITHOUT
13
! ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14
! FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
17
! You should have received a copy of the GNU General Public License along with
18
! this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
19
! Street, Fifth Floor, Boston, MA 02110-1301, USA.
21
!-------------------------------------------------------------------------------
26
( ivar , imrgra , inc , iccocg , nswrgp , imligp , &
27
iwarnp , nfecra , epsrgp , climgp , extrap , &
29
pvar , coefav , coefbv , &
32
!===============================================================================
36
! APPEL DES DIFFERENTES ROUTINES DE CALCUL DE GRADIENT CELLULE
38
!-------------------------------------------------------------------------------
40
!__________________.____._____.________________________________________________.
41
! name !type!mode ! role !
42
!__________________!____!_____!________________________________________________!
43
! ivar ! e ! <-- ! numero de la variable !
44
! ! ! ! destine a etre utilise pour la !
45
! ! ! ! periodicite uniquement (pering) !
46
! ! ! ! on pourra donner ivar=0 si la !
47
! ! ! ! variable n'est ni une composante de !
48
! ! ! ! la vitesse, ni une composante du !
49
! ! ! ! tenseur des contraintes rij !
50
! imrgra ! e ! <-- ! methode de reconstruction du gradient !
51
! ! ! ! 0 reconstruction 97 !
52
! ! ! ! 1 moindres carres !
53
! ! ! ! 2 moindres carres support etendu !
55
! ! ! ! 3 moindres carres avec selection du !
56
! ! ! ! support etendu !
57
! inc ! e ! <-- ! indicateur = 0 resol sur increment !
59
! iccocg ! e ! <-- ! indicateur = 1 pour recalcul de cocg !
61
! nswrgp ! e ! <-- ! nombre de sweep pour reconstruction !
62
! ! ! ! des gradients !
63
! imligp ! e ! <-- ! methode de limitation du gradient !
64
! ! ! ! < 0 pas de limitation !
65
! ! ! ! = 0 a partir des gradients voisins !
66
! ! ! ! = 1 a partir du gradient moyen !
67
! iwarnp ! i ! <-- ! verbosity !
68
! nfecra ! e ! <-- ! unite du fichier sortie std !
69
! epsrgp ! r ! <-- ! precision relative pour la !
70
! ! ! ! reconstruction des gradients 97 !
71
! climgp ! r ! <-- ! coef gradient*distance/ecart !
72
! extrap ! r ! <-- ! coef extrap gradient !
73
! pvar(3,ncelet) ! tr ! <-- ! variable (vectorielle) !
74
! coefav,coefbv ! tr ! <-- ! tableaux des cond lim pour pvar !
75
! (3,nfabor) ! ! ! sur la normale a la face de bord !
76
! gradv ! tr ! --> ! gradient de la variable vectorielle !
77
! (3,3,ncelet) ! ! ! !
78
!__________________!____!_____!________________________________________________!
80
! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
81
! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
82
! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
83
! --- tableau de travail
84
!===============================================================================
86
!===============================================================================
88
!===============================================================================
99
use dimens, only: ndimfb
101
!===============================================================================
107
integer ivar , imrgra , inc , iccocg , nswrgp
108
integer imligp ,iwarnp , nfecra
109
double precision epsrgp , climgp , extrap
111
double precision pvar(*)
112
double precision coefav(*), coefbv(*)
113
double precision gradv(*)
119
integer iel, isou, jsou
121
double precision, dimension(:,:), allocatable :: pvari
122
double precision, dimension(:,:,:), allocatable :: gradvi
124
!===============================================================================
126
!===============================================================================
127
! 1. COMPUTATION OF THE GARDIENT
128
!===============================================================================
130
! the velocity and the gradient fields are interleaved
135
( ncelet , ncel , nfac , nfabor , ivar , &
136
imrgra , inc , nswrgp , &
137
iwarnp , nfecra , imligp , epsrgp , extrap , climgp , &
138
ifacel , ifabor , isympa , &
139
volume , surfac , surfbo , surfbn , pond , &
140
dist , distb , dijpf , diipb , dofij , &
141
xyzcen , cdgfac , cdgfbo , coefav , coefbv , pvar , &
145
! We interleave the velocity
149
allocate(pvari(3,ncelet))
150
allocate(gradvi(3,3,ncelet))
154
pvari(isou,iel) = pvar(iel + (isou-1)*ncelet)
160
( ncelet , ncel , nfac , nfabor , ivar , &
161
imrgra , inc , nswrgp , &
162
iwarnp , nfecra , imligp , epsrgp , extrap , climgp , &
163
ifacel , ifabor , isympa , &
164
volume , surfac , surfbo , surfbn , pond , &
165
dist , distb , dijpf , diipb , dofij , &
166
xyzcen , cdgfac , cdgfbo , coefav , coefbv , pvari , &
174
gradv(iel + (jsou-1)*ncelet + (isou-1)*3*ncelet) = gradvi(isou,jsou,iel)
180
deallocate(pvari, gradvi)