1
1
!-------------------------------------------------------------------------------
3
! This file is part of the Code_Saturne Kernel, element of the
4
! Code_Saturne CFD tool.
6
! Copyright (C) 1998-2009 EDF S.A., France
8
! contact: saturne-support@edf.fr
10
! The Code_Saturne Kernel is free software; you can redistribute it
11
! and/or modify it under the terms of the GNU General Public License
12
! as published by the Free Software Foundation; either version 2 of
13
! the License, or (at your option) any later version.
15
! The Code_Saturne Kernel is distributed in the hope that it will be
16
! useful, but WITHOUT ANY WARRANTY; without even the implied warranty
17
! of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
! GNU General Public License for more details.
20
! You should have received a copy of the GNU General Public License
21
! along with the Code_Saturne Kernel; if not, write to the
22
! Free Software Foundation, Inc.,
23
! 51 Franklin St, Fifth Floor,
24
! Boston, MA 02110-1301 USA
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.
26
21
!-------------------------------------------------------------------------------
28
23
subroutine memtri &
31
( idbia0 , idbra0 , iverif , &
32
ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
33
nnod , lndfac , lndfbr , ncelbr , &
34
nvar , nscal , nphas , &
35
ncofab , nproce , nprofa , nprofb , &
36
nideve , nrdeve , nituse , nrtuse , &
38
idt , irtp , irtpa , ipropc , ipropf , ipropb , &
29
idt , itpuco , irtp , irtpa , ipropc , &
42
32
!===============================================================================
50
40
!__________________.____._____.________________________________________________.
51
41
! name !type!mode ! role !
52
42
!__________________!____!_____!________________________________________________!
53
! idbia0 ! i ! <-- ! number of first free position in ia !
54
! idbra0 ! i ! <-- ! number of first free position in ra !
55
! iverif ! e ! <-- ! indicateur des tests elementaires !
56
! ndim ! i ! <-- ! spatial dimension !
57
! ncelet ! i ! <-- ! number of extended (real + ghost) cells !
58
! ncel ! i ! <-- ! number of cells !
59
! nfac ! i ! <-- ! number of interior faces !
60
! nfabor ! i ! <-- ! number of boundary faces !
61
! nfml ! i ! <-- ! number of families (group classes) !
62
! nprfml ! i ! <-- ! number of properties per family (group class) !
63
! nnod ! i ! <-- ! number of vertices !
64
! lndfac ! i ! <-- ! size of nodfac indexed array !
65
! lndfbr ! i ! <-- ! size of nodfbr indexed array !
66
! ncelbr ! i ! <-- ! number of cells with faces on boundary !
67
43
! nvar ! i ! <-- ! total number of variables !
68
44
! nscal ! i ! <-- ! total number of scalars !
69
! nphas ! i ! <-- ! number of phases !
70
! ncofab ! e ! <-- ! nombre de couple de cl a prevoir !
71
45
! nproce ! e ! <-- ! nombre de prop phy aux centres !
72
! nprofa ! e ! <-- ! nombre de prop phy aux faces internes !
73
! nprofb ! e ! <-- ! nombre de prop phy aux faces de bord !
74
! nideve, nrdeve ! i ! <-- ! sizes of idevel and rdevel arrays !
75
! nituse, nrtuse ! i ! <-- ! sizes of ituser and rtuser arrays !
76
! iisstd ! e ! --> ! "pointeur" sur isostd(reperage sortie !
77
46
! idt ! e ! --> ! "pointeur" sur dt !
47
! itpuco ! e ! --> ! "pointeur" sur tpucou !
78
48
! irtp, irtpa ! e ! --> ! "pointeur" sur rtp, rtpa !
79
49
! ipropc ! e ! --> ! "pointeur" sur propce !
80
! ipropf ! e ! --> ! "pointeur" sur propfa !
81
! ipropb ! e ! --> ! "pointeur" sur propfb !
82
! icoefa, b ! e ! --> ! "pointeur" sur coefa, coefb !
83
! ifrcx ! e ! --> ! "pointeur" sur frcxt !
84
! ifinia ! i ! --> ! number of first free position in ia (at exit) !
85
! ifinra ! i ! --> ! number of first free position in ra (at exit) !
86
50
!__________________.____._____.________________________________________________.
88
52
! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
91
55
! --- tableau de travail
92
56
!===============================================================================
58
!===============================================================================
60
!===============================================================================
63
use dimens, only: ndimfb
82
!===============================================================================
96
!===============================================================================
98
!===============================================================================
119
!===============================================================================
123
integer idbia0 , idbra0
125
integer ndim , ncelet , ncel , nfac , nfabor
126
integer nfml , nprfml
127
integer nnod , lndfac , lndfbr , ncelbr
128
integer nvar , nscal , nphas
129
integer ncofab , nproce , nprofa , nprofb
130
integer nideve , nrdeve , nituse , nrtuse
131
integer iisstd , ifrcx
133
92
integer irtp , irtpa
134
integer ipropc , ipropf , ipropb
135
integer icoefa , icoefb
136
integer ifinia , ifinra
140
integer idebia , idebra
141
integer iis, iphas, ippu, ippv, ippw, ivar, iprop
142
integer iipero , iiirij , imom, idtnm
143
integer idpar1 , idpar2 , iypar1, iiyplb, iiforb, iicoci
98
integer iis, ippu, ippv, ippw, ivar, iprop
145
102
!===============================================================================
150
107
!===============================================================================
160
!===============================================================================
161
! 2. PLACE MEMOIRE RESERVEE AVEC DEFINITION DE IFINIA IFINRA
162
!===============================================================================
166
! IPUCOU = 1 ne depend pas de la phase
168
! NCOFAB, NPROCE, NPROFA et NPROFB ont ete determines dans VARPOS
169
! et ne servent en tant que dimensions que dans le present
170
! sous programme. On pourrait les passer en common dans numvar.h
172
! ITYPFB, ITRIFB et ISYMPA peuvent passer en entier dans certains
173
! sous-pgm, il convient donc qu'ils soient en un seul bloc.
174
! Le meilleur moyen de s'en assurer est de referencer ce bloc par un
175
! pointeur unique independant de iphas.
177
! Le tableau des zones frontieres des faces de bord pour les
178
! physiques particulieres est de declare ci-dessous (voir PPCLIM)
183
! On regarde s'il existe au moins une periodicite de rotation
187
if (iperot.gt.0) then
192
if(itytur(iphas).eq.3) then
198
! Distance a la paroi
200
! On reserve ici idipar (distance a la paroi) : c'est oblige
201
! On reserve aussi iyppar (yplus) : on pourrait s'en passer
202
! et en faire un tableau local a reserver dans memdyp
203
! mais ca facilite la visualisation et l'initialisation
204
! de yplus pour son calcul a tous les pas de temps
206
! Distance a la paroi, tableau selon le mode de calcul
209
! Calcul par eq de diffusion
210
if(ineedy.eq.1.and.abs(icdpar).eq.1) then
214
if(ineedy.eq.1.and.abs(icdpar).eq.2) then
217
! Yplus associe (calcul par mode de diffusion et LES+VanDriest
218
! ou lagrangien+IROULE=2)
220
if(ineedy.eq.1.and.abs(icdpar).eq.1) then
222
if(itytur(iphas).eq.4) then
223
if(idries(iphas).eq.1) then
228
if (iilagr.ge.1 .and. iroule.eq.2) iypar1 = 1
231
! Stockage suppl�mentaire si on initialise le gradient
235
if(imrgra.eq.4 .or. iverif.eq.1) then
240
! Post-traitements particuliers (faces de bord)
245
if(mod(ipstdv,ipstyp).eq.0) then
255
! --> Reservation de memoire entiere
259
iitrif = iitypf + nfabor *nphas
260
iisymp = iitrif + nfabor *nphas
261
ifinia = iisymp + nfabor *nphas
264
iifapa(iphas) = ifinia
265
ifinia = iifapa(iphas) + ncelet
267
! cette valeur nulle est utilisee dans les tests
272
! Zones de face de bord : on utilise provisoirement les zones des physiques
273
! particulieres, meme sans physique particuliere
274
! -> sera modifie lors de la restructuration des zones de bord
276
if(ippmod(iphpar).ge.1 .or. iihmpr.eq.1) then
277
ifinia = iizfpp + nfabor
283
ifinia = iisstd + (nfabor+1)*nphas*iphydr
285
if(ippmod(icompf).ge.0) then
287
iifbru = iifbet + nfabor*nphas
288
ifinia = iifbru + nfabor*nphas
294
! --> Reservation de memoire reelle
297
icoefb = icoefa + ndimfb *ncofab
298
irtp = icoefb + ndimfb *ncofab
110
!===============================================================================
111
! 2. PLACE MEMOIRE RESERVEE AVEC DEFINITION DE IFINRA
112
!===============================================================================
114
! Work arrays "tpucou"
116
if (ipucou.eq.1 .or. ncpdct.gt.0) then
120
! Allocate main real arrays
299
122
irtpa = irtp + ncelet *nvar
300
123
ipropc = irtpa + ncelet *nvar
301
ipropf = ipropc + ncelet *nproce
302
ipropb = ipropf + nfac *nprofa
303
idt = ipropb + ndimfb *nprofb
305
icocgb = icocg + ncelet *9
306
icoci = icocgb + ncelbr *9
307
icocib = icoci + ncelet *9 * iicoci
308
itpuco = icocib + ncelbr *9 * iicoci
309
idipar = itpuco + ncelet *ndim*ipucou
310
iyppar = idipar + ncelet *idpar1
311
idudxy = iyppar + ncelet *iypar1
312
iwdudx = idudxy + (ncelet-ncel) * 3 * 3 * nphas * iipero
313
idrdxy = iwdudx + (ncelet-ncel) * 3 * 3 * nphas * iipero
314
iwdrdx = idrdxy + (ncelet-ncel) * 6 * 3 * nphas * iipero*iiirij
315
ifrcx = iwdrdx + (ncelet-ncel) * 6 * 3 * nphas * iipero*iiirij
316
iyplbr = ifrcx + ncelet*ndim*nphas*iphydr
317
iforbr = iyplbr + nfabor*nphas*iiyplb
318
ifinra = iforbr + nfabor*ndim*iiforb
320
! On rajoute des tableaux pour le k-omega SST si necessaire
321
! En k-omega, on a besoin de calculer 2 Sij.Sij pour etre utilise
322
! dans PHYVAR et dans TURBKW. On reserve un tableau pour divU en meme temps.
323
! Les pointeurs IS2KW et IDVUKW sont fonction de IPHAS
326
is2kw(iphas) = ifinra
327
idvukw(iphas) = ifinra
328
if (iturb(iphas).eq.60) then
329
idvukw(iphas) = is2kw(iphas) + ncelet
330
ifinra = idvukw(iphas) + ncelet
334
! En ALE ou maillage mobile, on reserve des tableaux supplementaires
335
! de position initiale
336
if (iale.eq.1.or.imobil.eq.1) then
338
ifinra = ixyzn0 + ndim*nnod
343
! En ALE, on reserve des tableaux supplementaires
344
! de deplacement et de type de faces de bord
347
iialty = iimpal + nnod
348
ifinia = iialty + nfabor
351
ifinra = idepal + ndim*nnod
360
CALL IASIZE('MEMTRI',IFINIA)
363
CALL RASIZE('MEMTRI',IFINRA)
124
idt = ipropc + ncelet *nproce
125
itpuco = idt + ncelet
126
ifinra = itpuco + ncelet *ndim*iipuco
367
128
!===============================================================================
368
129
! 3. CORRESPONDANCE POUR POST-TRAITEMENT
378
139
! IPPROC a ete complete au prealable dans VARPOS
383
ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
385
ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
387
ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
389
ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
391
if (itytur(iphas).eq.2) then
393
ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
395
ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
396
elseif(itytur(iphas).eq.3) then
398
ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
400
ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
402
ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
404
ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
406
ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
408
ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
410
ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
411
elseif(iturb(iphas).eq.50) then
413
ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
415
ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
417
ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
419
ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
420
elseif(iturb(iphas).eq.60) then
422
ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
142
ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
144
ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
146
ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
148
ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
150
if (itytur.eq.2) then
152
ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
154
ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
155
elseif(itytur.eq.3) then
157
ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
159
ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
161
ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
163
ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
165
ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
167
ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
169
ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
170
elseif(itytur.eq.5) then
172
ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
174
ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
176
ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
179
ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
180
elseif(iturb.eq.51) then
424
182
ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
184
elseif(iturb.eq.60) then
186
ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
188
ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
189
elseif(iturb.eq.70) then
191
ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
429
194
if (iale.eq.1) then