6
! This file is part of the Code_Saturne Kernel, element of the
7
! Code_Saturne CFD tool.
9
! Copyright (C) 1998-2009 EDF S.A., France
11
! contact: saturne-support@edf.fr
13
! The Code_Saturne Kernel is free software; you can redistribute it
14
! and/or modify it under the terms of the GNU General Public License
15
! as published by the Free Software Foundation; either version 2 of
16
! the License, or (at your option) any later version.
18
! The Code_Saturne Kernel is distributed in the hope that it will be
19
! useful, but WITHOUT ANY WARRANTY; without even the implied warranty
20
! of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
! GNU General Public License for more details.
23
! You should have received a copy of the GNU General Public License
24
! along with the Code_Saturne Kernel; if not, write to the
25
! Free Software Foundation, Inc.,
26
! 51 Franklin St, Fifth Floor,
27
! Boston, MA 02110-1301 USA
5
! This file is part of Code_Saturne, a general-purpose CFD tool.
7
! Copyright (C) 1998-2011 EDF S.A.
9
! This program is free software; you can redistribute it and/or modify it under
10
! the terms of the GNU General Public License as published by the Free Software
11
! Foundation; either version 2 of the License, or (at your option) any later
14
! This program is distributed in the hope that it will be useful, but WITHOUT
15
! ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16
! FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
19
! You should have received a copy of the GNU General Public License along with
20
! this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
21
! Street, Fifth Floor, Boston, MA 02110-1301, USA.
29
23
!-------------------------------------------------------------------------------
31
25
subroutine uselen &
34
( idbia0 , idbra0 , nummai , &
35
ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
36
nnod , lndfac , lndfbr , ncelbr , &
37
nvar , nscal , nphas , &
38
30
ncelps , nfacps , nfbrps , &
39
nideve , nrdeve , nituse , nrtuse , &
40
ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
41
ipnfac , nodfac , ipnfbr , nodfbr , &
42
31
lstcel , lstfac , lstfbr , &
43
idevel , ituser , ia , &
44
xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
45
32
dt , rtpa , rtp , propce , propfa , propfb , &
48
tracel , trafac , trafbr , rdevel , rtuser , ra )
34
tracel , trafac , trafbr )
50
36
!===============================================================================
58
44
!__________________.____._____.________________________________________________.
59
45
! nom !type!mode ! role !
60
46
!__________________!____!_____!________________________________________________!
61
! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
62
! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
63
47
! nummai ! ec ! <-- ! numero du maillage post !
64
! ndim ! e ! <-- ! dimension de l'espace !
65
! ncelet ! e ! <-- ! nombre d'elements halo compris !
66
! ncel ! e ! <-- ! nombre d'elements actifs !
67
! nfac ! e ! <-- ! nombre de faces internes !
68
! nfabor ! e ! <-- ! nombre de faces de bord !
69
! nfml ! e ! <-- ! nombre de familles d entites !
70
! nprfml ! e ! <-- ! nombre de proprietese des familles !
71
! nnod ! e ! <-- ! nombre de sommets !
72
! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
73
! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
74
! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
75
! ! ! ! face de bord !
76
48
! nvar ! e ! <-- ! nombre total de variables !
77
49
! nscal ! e ! <-- ! nombre total de scalaires !
78
! nphas ! e ! <-- ! nombre de phases !
79
50
! ncelps ! e ! <-- ! nombre de cellules du maillage post !
80
51
! nfacps ! e ! <-- ! nombre de faces interieur post !
81
52
! nfbrps ! e ! <-- ! nombre de faces de bord post !
82
! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
83
! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
84
! ifacel ! te ! <-- ! elements voisins d'une face interne !
86
! ifabor ! te ! <-- ! element voisin d'une face de bord !
88
! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
90
! ifmcel ! te ! <-- ! numero de famille d'une cellule !
92
! iprfml ! te ! <-- ! proprietes d'une famille !
93
! nfml ,nprfml ! ! ! !
94
! ipnfac ! te ! <-- ! position du premier noeud de chaque !
95
! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
96
! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
97
! (nfac+1) ! ! ! (optionnel) !
98
! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
99
! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
100
! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
101
! (nfabor+1) ! ! ! (optionnel) !
102
53
! lstcel(ncelps ! te ! <-- ! liste des cellules du maillage post !
103
54
! lstfac(nfacps ! te ! <-- ! liste des faces interieures post !
104
55
! lstfbr(nfbrps ! te ! <-- ! liste des faces de bord post !
105
! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
106
! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
107
! ia(*) ! tr ! --- ! macro tableau entier !
108
! xyzcen ! tr ! <-- ! point associes aux volumes de control !
109
! (ndim,ncelet ! ! ! !
110
! surfac ! tr ! <-- ! vecteur surface des faces internes !
111
! (ndim,nfac) ! ! ! !
112
! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
113
! (ndim,nfabor) ! ! ! !
114
! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
115
! (ndim,nfac) ! ! ! !
116
! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
117
! (ndim,nfabor) ! ! ! !
118
! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
119
! (ndim,nnod) ! ! ! !
120
! volume ! tr ! <-- ! volume d'un des ncelet elements !
122
56
! dt(ncelet) ! tr ! <-- ! pas de temps !
123
57
! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
124
58
! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
148
77
! --- tableau de travail
149
78
!===============================================================================
80
!===============================================================================
82
!===============================================================================
85
use dimens, only: ndimfb
100
!===============================================================================
153
!===============================================================================
155
!===============================================================================
172
!===============================================================================
176
integer idbia0 , idbra0
178
integer ndim , ncelet , ncel , nfac , nfabor
179
integer nfml , nprfml
180
integer nnod , lndfac , lndfbr , ncelbr
181
integer nvar , nscal , nphas
182
108
integer ncelps , nfacps , nfbrps
183
integer nideve , nrdeve , nituse , nrtuse
186
integer ifacel(2,nfac) , ifabor(nfabor)
187
integer ifmfbr(nfabor) , ifmcel(ncelet)
188
integer iprfml(nfml,nprfml)
189
integer ipnfac(nfac+1), nodfac(lndfac)
190
integer ipnfbr(nfabor+1), nodfbr(lndfbr)
191
111
integer lstcel(ncelps), lstfac(nfacps), lstfbr(nfbrps)
192
integer idevel(nideve), ituser(nituse), ia(*)
194
double precision xyzcen(ndim,ncelet)
195
double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
196
double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
197
double precision xyznod(ndim,nnod), volume(ncelet)
198
113
double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
199
114
double precision propce(ncelet,*)
200
115
double precision propfa(nfac,*), propfb(ndimfb,*)
201
116
double precision coefa(ndimfb,*), coefb(ndimfb,*)
202
117
double precision tracel(ncelps*3)
203
118
double precision trafac(nfacps*3), trafbr(nfbrps*3)
204
double precision w1(ncelet,3), w2(ncelet,3)
205
double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
207
120
! Local variables
209
122
character*32 namevr
210
integer idebia, idebra, iel , iloc
211
124
integer ivar , ivar0 , inc , iccocg
212
integer iphydp, nswrgp, imligp, iwarnp, iclimv
125
integer nswrgp, imligp, iwarnp, iclimv
214
127
integer ientla, ivarpr
215
128
double precision epsrgp, climgp, extrap
216
129
double precision rbid(1)
131
double precision, allocatable, dimension(:,:) :: grad
218
133
!===============================================================================
219
134
!===============================================================================
220
135
! 0. PAR DEFAUT, ON CONSIDERE QUE LE SOUS PROGRAMME CI-DESSOUS CONVIENT
252
166
climgp = climgr(ivar)
253
167
extrap = extrag(ivar)
259
( idebia , idebra , &
260
ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
261
nnod , lndfac , lndfbr , ncelbr , nphas , &
262
nideve , nrdeve , nituse , nrtuse , &
263
ivar0 , imrgra , inc , iccocg , nswrgp , imligp , iphydp , &
172
( ivar0 , imrgra , inc , iccocg , nswrgp , imligp , &
264
173
iwarnp , nfecra , epsrgp , climgp , extrap , &
265
ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
266
ipnfac , nodfac , ipnfbr , nodfbr , &
267
idevel , ituser , ia , &
268
xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
270
174
rtp(1,ivar), coefa(1,iclimv) , coefb(1,iclimv) , &
272
w1(1,1) , w1(1,2) , w1(1,3) , &
273
! d POTR /dx d POTR /dy d POTR /dz
274
w2(1,1) , w2(1,2) , w2(1,3) , &
275
rdevel , rtuser , ra )
305
206
extrap = extrag(ivar)
312
( idebia , idebra , &
313
ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
314
nnod , lndfac , lndfbr , ncelbr , nphas , &
315
nideve , nrdeve , nituse , nrtuse , &
316
ivar0 , imrgra , inc , iccocg , nswrgp , imligp , iphydp , &
212
( ivar0 , imrgra , inc , iccocg , nswrgp , imligp , &
317
213
iwarnp , nfecra , epsrgp , climgp , extrap , &
318
ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
319
ipnfac , nodfac , ipnfbr , nodfbr , &
320
idevel , ituser , ia , &
321
xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
323
214
rtp(1,ivar), coefa(1,iclimv) , coefb(1,iclimv) , &
325
w1(1,1) , w1(1,2) , w1(1,3) , &
326
! d POTI /dx d POTI /dy d POTI /dz
327
w2(1,1) , w2(1,2) , w2(1,3) , &
328
rdevel , rtuser , ra )
363
251
extrap = extrag(ivar)
370
( idebia , idebra , &
371
ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
372
nnod , lndfac , lndfbr , ncelbr , nphas , &
373
nideve , nrdeve , nituse , nrtuse , &
374
ivar0 , imrgra , inc , iccocg , nswrgp , imligp , iphydp , &
257
( ivar0 , imrgra , inc , iccocg , nswrgp , imligp , &
375
258
iwarnp , nfecra , epsrgp , climgp , extrap , &
376
ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
377
ipnfac , nodfac , ipnfbr , nodfbr , &
378
idevel , ituser , ia , &
379
xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
381
259
rtp(1,ivar), coefa(1,iclimv) , coefb(1,iclimv) , &
383
w1(1,1) , w1(1,2) , w1(1,3) , &
384
! d POTI /dx d POTI /dy d POTI /dz
385
w2(1,1) , w2(1,2) , w2(1,3) , &
386
rdevel , rtuser , ra )
388
263
do iloc = 1, ncelps
389
264
iel = lstcel(iloc)
390
tracel(iloc) = -propce(iel,ipcsii)*w1(iel,1)
391
tracel(iloc+ncelps) = -propce(iel,ipcsii)*w1(iel,2)
392
tracel(iloc+2*ncelps) = -propce(iel,ipcsii)*w1(iel,3)
265
tracel(iloc) = -propce(iel,ipcsii)*grad(iel,1)
266
tracel(iloc+ncelps) = -propce(iel,ipcsii)*grad(iel,2)
267
tracel(iloc+2*ncelps) = -propce(iel,ipcsii)*grad(iel,3)
425
300
extrap = extrag(ivar)
432
( idebia , idebra , &
433
ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
434
nnod , lndfac , lndfbr , ncelbr , nphas , &
435
nideve , nrdeve , nituse , nrtuse , &
436
ivar0 , imrgra , inc , iccocg , nswrgp , imligp , iphydp , &
306
( ivar0 , imrgra , inc , iccocg , nswrgp , imligp , &
437
307
iwarnp , nfecra , epsrgp , climgp , extrap , &
438
ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
439
ipnfac , nodfac , ipnfbr , nodfbr , &
440
idevel , ituser , ia , &
441
xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
443
308
rtp(1,ivar), coefa(1,iclimv) , coefb(1,iclimv) , &
444
w1(1,1) , w1(1,2) , w1(1,3) , &
445
! d Ax /dx d Ax /dy d Ax /dz
446
w2(1,1) , w2(1,2) , w2(1,3) , &
447
rdevel , rtuser , ra )
449
311
! B = rot A ( B = curl A)
451
313
do iloc = 1, ncelps
452
314
iel = lstcel(iloc)
453
315
tracel(iloc) = zero
454
tracel(iloc+ncelps) = w1(iel,3)
455
tracel(iloc+2*ncelps) = -w1(iel,2)
316
tracel(iloc+ncelps) = grad(iel,3)
317
tracel(iloc+2*ncelps) = -grad(iel,2)
470
332
extrap = extrag(ivar)
477
( idbia0 , idbra0 , &
478
ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml ,&
479
nnod , lndfac , lndfbr , ncelbr , nphas , &
480
nideve , nrdeve , nituse , nrtuse , &
481
ivar0 , imrgra , inc , iccocg , nswrgp , imligp , iphydp ,&
338
( ivar0 , imrgra , inc , iccocg , nswrgp , imligp , &
482
339
iwarnp , nfecra , epsrgp , climgp , extrap , &
483
ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
484
ipnfac , nodfac , ipnfbr , nodfbr , &
485
idevel , ituser , ia , &
486
xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume ,&
488
340
rtp(1,ivar), coefa(1,iclimv) , coefb(1,iclimv) , &
489
w1(1,1) , w1(1,2) , w1(1,3) , &
490
! d Ay /dx d Ay /dy d Ay /dz
491
w2(1,1) , w2(1,2) , w2(1,3) , &
492
rdevel , rtuser , ra )
494
343
! B = rot A (B = curl A)
496
345
do iloc = 1, ncelps
497
346
iel = lstcel(iloc)
498
tracel(iloc) = tracel(iloc) - w1(iel,3)
347
tracel(iloc) = tracel(iloc) - grad(iel,3)
499
348
tracel(iloc+ncelps) = tracel(iloc + ncelps) + zero
500
tracel(iloc+2*ncelps) = tracel(iloc+2*ncelps) + w1(iel,1)
349
tracel(iloc+2*ncelps) = tracel(iloc+2*ncelps) + grad(iel,1)
515
364
extrap = extrag(ivar)
522
( idbia0 , idbra0 , &
523
ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml ,&
524
nnod , lndfac , lndfbr , ncelbr , nphas , &
525
nideve , nrdeve , nituse , nrtuse , &
526
ivar0 , imrgra , inc , iccocg , nswrgp , imligp , iphydp ,&
370
( ivar0 , imrgra , inc , iccocg , nswrgp , imligp , &
527
371
iwarnp , nfecra , epsrgp , climgp , extrap , &
528
ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
529
ipnfac , nodfac , ipnfbr , nodfbr , &
530
idevel , ituser , ia , &
531
xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume ,&
533
372
rtp(1,ivar), coefa(1,iclimv) , coefb(1,iclimv) , &
534
w1(1,1) , w1(1,2) , w1(1,3) , &
535
! d Az /dx d Az /dy d Az /dz
536
w2(1,1) , w2(1,2) , w2(1,3) , &
537
rdevel , rtuser , ra )
539
375
! B = rot A (B = curl A)
541
377
do iloc = 1, ncelps
542
378
iel = lstcel(iloc)
543
tracel(iloc) = tracel(iloc) + w1(iel,2)
544
tracel(iloc+ncelps) = tracel(iloc+ncelps) - w1(iel,1)
379
tracel(iloc) = tracel(iloc) + grad(iel,2)
380
tracel(iloc+ncelps) = tracel(iloc+ncelps) - grad(iel,1)
545
381
tracel(iloc+2*ncelps) = tracel(iloc+2*ncelps) + zero