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 cscfbr &
32
ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
33
nnod , lndfac , lndfbr , ncelbr , &
34
nvar , nscal , nphas , &
35
nideve , nrdeve , nituse , nrtuse , &
36
ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
37
ipnfac , nodfac , ipnfbr , nodfbr , &
38
27
icodcl , itrifb , itypfb , &
39
idevel , ituser , ia , &
40
xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
41
28
dt , rtp , rtpa , propce , propfa , propfb , &
42
coefa , coefb , rcodcl , &
43
w1 , w2 , w3 , w4 , w5 , w6 , coefu , &
44
rdevel , rtuser , ra )
29
coefa , coefb , rcodcl )
46
31
!===============================================================================
55
40
!__________________.____._____.________________________________________________.
56
41
! name !type!mode ! role !
57
42
!__________________!____!_____!________________________________________________!
58
! idbia0 ! i ! <-- ! number of first free position in ia !
59
! idbra0 ! i ! <-- ! number of first free position in ra !
60
! ndim ! i ! <-- ! spatial dimension !
61
! ncelet ! i ! <-- ! number of extended (real + ghost) cells !
62
! ncel ! i ! <-- ! number of cells !
63
! nfac ! i ! <-- ! number of interior faces !
64
! nfabor ! i ! <-- ! number of boundary faces !
65
! nfml ! i ! <-- ! number of families (group classes) !
66
! nprfml ! i ! <-- ! number of properties per family (group class) !
67
! nnod ! i ! <-- ! number of vertices !
68
! lndfac ! i ! <-- ! size of nodfac indexed array !
69
! lndfbr ! i ! <-- ! size of nodfbr indexed array !
70
! ncelbr ! i ! <-- ! number of cells with faces on boundary !
71
43
! nvar ! i ! <-- ! total number of variables !
72
44
! nscal ! i ! <-- ! total number of scalars !
73
! nphas ! i ! <-- ! number of phases !
74
! nideve, nrdeve ! i ! <-- ! sizes of idevel and rdevel arrays !
75
! nituse, nrtuse ! i ! <-- ! sizes of ituser and rtuser arrays !
76
45
! ivar ! i ! <-- ! variable number !
77
! ifacel(2, nfac) ! ia ! <-- ! interior faces -> cells connectivity !
78
! ifabor(nfabor) ! ia ! <-- ! boundary faces -> cells connectivity !
79
! ifmfbr(nfabor) ! ia ! <-- ! boundary face family numbers !
80
! ifmcel(ncelet) ! ia ! <-- ! cell family numbers !
81
! iprfml ! ia ! <-- ! property numbers per family !
82
! (nfml, nprfml) ! ! ! !
83
! ipnfac(nfac+1) ! ia ! <-- ! interior faces -> vertices index (optional) !
84
! nodfac(lndfac) ! ia ! <-- ! interior faces -> vertices list (optional) !
85
! ipnfbr(nfabor+1) ! ia ! <-- ! boundary faces -> vertices index (optional) !
86
! nodfbr(lndfbr) ! ia ! <-- ! boundary faces -> vertices list (optional) !
87
! idevel(nideve) ! ia ! <-> ! integer work array for temporary development !
88
! ituser(nituse) ! ia ! <-> ! user-reserved integer work array !
89
! ia(*) ! ia ! --- ! main integer work array !
90
! xyzcen ! ra ! <-- ! cell centers !
91
! (ndim, ncelet) ! ! ! !
92
! surfac ! ra ! <-- ! interior faces surface vectors !
93
! (ndim, nfac) ! ! ! !
94
! surfbo ! ra ! <-- ! boundary faces surface vectors !
95
! (ndim, nfabor) ! ! ! !
96
! cdgfac ! ra ! <-- ! interior faces centers of gravity !
97
! (ndim, nfac) ! ! ! !
98
! cdgfbo ! ra ! <-- ! boundary faces centers of gravity !
99
! (ndim, nfabor) ! ! ! !
100
! xyznod ! ra ! <-- ! vertex coordinates (optional) !
101
! (ndim, nnod) ! ! ! !
102
! volume(ncelet) ! ra ! <-- ! cell volumes !
103
46
! dt(ncelet) ! ra ! <-- ! time step (per cell) !
104
47
! rtpa ! tr ! <-- ! variables de calcul au centre des !
105
48
! (ncelet,*) ! ! ! cellules (instant prec) !
110
53
! (nfabor, *) ! ! ! !
111
54
! crvexp(ncelet ! tr ! --> ! tableau de travail pour part explicit !
112
55
! crvimp(ncelet ! tr ! --> ! tableau de travail pour part implicit !
113
! dam(ncelet ! tr ! --- ! tableau de travail pour matrice !
114
! xam(nfac,*) ! tr ! --- ! tableau de travail pour matrice !
115
! w1...6(ncelet ! tr ! --- ! tableau de travail !
116
! rdevel(nrdeve) ! ra ! <-> ! real work array for temporary development !
117
! rtuser(nrtuse) ! ra ! <-> ! user-reserved real work array !
118
! ra(*) ! ra ! --- ! main real work array !
119
56
!__________________!____!_____!________________________________________________!
121
58
! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
122
59
! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
123
60
! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
124
61
! --- tableau de travail
125
!-------------------------------------------------------------------------------
62
!===============================================================================
64
!===============================================================================
66
!===============================================================================
126
79
!===============================================================================
130
!===============================================================================
132
!===============================================================================
145
!===============================================================================
149
integer idbia0 , idbra0
150
integer ndim , ncelet , ncel , nfac , nfabor
151
integer nfml , nprfml
152
integer nnod , lndfac , lndfbr , ncelbr
153
integer nvar , nscal , nphas
154
integer nideve , nrdeve , nituse , nrtuse
156
integer ifacel(2,nfac) , ifabor(nfabor)
157
integer ifmfbr(nfabor) , ifmcel(ncelet)
158
integer iprfml(nfml,nprfml)
159
integer ipnfac(nfac+1) , nodfac(lndfac)
160
integer ipnfbr(nfabor+1), nodfbr(lndfbr)
161
87
integer icodcl(nfabor,nvar)
162
integer itrifb(nfabor,nphas), itypfb(nfabor,nphas)
163
integer idevel(nideve), ituser(nituse), ia(*)
88
integer itrifb(nfabor), itypfb(nfabor)
165
double precision xyzcen(ndim,ncelet)
166
double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
167
double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
168
double precision xyznod(ndim,nnod), volume(ncelet)
169
90
double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
170
91
double precision propce(ncelet,*)
171
92
double precision propfa(nfac,*), propfb(nfabor,*)
172
93
double precision coefa(nfabor,*), coefb(nfabor,*)
173
94
double precision rcodcl(nfabor,nvar,3)
174
double precision w1(ncelet),w2(ncelet),w3(ncelet)
175
double precision w4(ncelet),w5(ncelet),w6(ncelet)
176
double precision coefu(nfabor,ndim)
177
double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
181
integer idebia , idebra , ifinia , ifinra
182
98
integer numcpl , ivarcp
183
99
integer ncesup , nfbsup
184
100
integer ncecpl , nfbcpl , ncencp , nfbncp
185
101
integer ncedis , nfbdis
186
102
integer nfbcpg , nfbdig
187
integer ilcesu , ilfbsu
188
integer ilcecp , ilfbcp , ilcenc , ilfbnc
189
integer ilocpt , icoopt , idjppt , ipndpt , idofpt
190
integer irvdis , irvfbr , ipndcp , idofcp
191
103
integer ityloc , ityvar
193
!====================================================================================
105
integer, allocatable, dimension(:) :: lcecpl , lfbcpl , lcencp , lfbncp
106
integer, allocatable, dimension(:) :: locpts
108
double precision, allocatable, dimension(:,:) :: coopts , djppts , dofpts
109
double precision, allocatable, dimension(:,:) :: dofcpl
110
double precision, allocatable, dimension(:) :: pndpts
111
double precision, allocatable, dimension(:) :: pndcpl
112
double precision, allocatable, dimension(:,:) :: rvdis , rvfbr
114
!===============================================================================
198
117
do numcpl = 1, nbrcpl
200
!======================================================================================
119
!===============================================================================
201
120
! 1. DEFINITION DE CHAQUE COUPLAGE
202
!======================================================================================
121
!===============================================================================
207
126
ncesup , nfbsup , &
208
127
ncecpl , nfbcpl , ncencp , nfbncp )
212
( idebia , idebra , &
213
ncesup , nfbsup , ncecpl , nfbcpl , ncencp , nfbncp , &
214
ilcesu , ilfbsu , ilcecp , ilfbcp , ilcenc , ilfbnc , &
129
! Allocate temporary arrays for coupling information
130
allocate(lcecpl(ncecpl), lcencp(ncencp))
131
allocate(lfbcpl(nfbcpl), lfbncp(nfbncp))
217
133
! Liste des cellules et faces de bord localis�es
221
137
ncecpl , nfbcpl , &
222
ia(ilcecp) , ia(ilfbcp) )
224
140
! Liste des cellules et faces de bord non localis�es
228
144
ncencp , nfbncp , &
229
ia(ilcenc) , ia(ilfbnc) )
232
!====================================================================================
148
deallocate(lcecpl, lcencp)
150
!===============================================================================
233
151
! 2. PREPARATION DES VARIABLES A ENVOYER SUR LES FACES DE BORD
234
!====================================================================================
152
!===============================================================================
240
158
call npdcpl(numcpl, ncedis, nfbdis)
245
( ifinia , ifinra , &
246
nfbcpl , nfbdis , nvarto(numcpl) , &
247
irvfbr , ipndcp , idofcp , &
248
irvdis , ilocpt , icoopt , idjppt , idofpt , ipndpt , &
251
call coocpl(numcpl, nfbdis, ityvar, &
253
ityloc, ia(ilocpt), ra(icoopt), &
254
ra(idjppt), ra(idofpt), ra(ipndpt))
161
! Allocate temporary arrays for geometric quantities
162
allocate(locpts(nfbdis))
163
allocate(coopts(3,nfbdis), djppts(3,nfbdis), dofpts(3,nfbdis))
164
allocate(pndpts(nfbdis))
166
! Allocate temporary arrays for variables exchange
167
allocate(rvdis(nfbdis,nvarto(numcpl)))
168
allocate(rvfbr(nfbcpl,nvarto(numcpl)))
172
( numcpl , nfbdis , ityvar , &
173
ityloc , locpts , coopts , &
174
djppts , dofpts , pndpts )
256
176
if (ityloc.eq.2) then
257
177
write(nfecra,1000)
280
( ifinia , ifinra , &
281
ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml, &
282
nnod , lndfac , lndfbr , ncelbr , &
283
nvar , nscal , nphas , &
284
201
nfbdis , ityloc , nvarcp(numcpl) , numcpl , &
285
202
nvarto(numcpl) , &
286
nideve , nrdeve , nituse , nrtuse , &
287
ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
288
ipnfac , nodfac , ipnfbr , nodfbr , &
290
idevel , ituser , ia , &
291
xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume ,&
292
204
dt , rtp , rtpa , propce , propfa , propfb , &
293
205
coefa , coefb , &
294
w1 , w2 , w3 , w4 , w5 , w6 , &
295
ra(icoopt) , ra(idjppt) , ra(ipndpt) , &
296
ra(irvdis) , ra(idofpt) , &
297
rdevel , rtuser , ra )
206
coopts , djppts , pndpts , &
213
deallocate(coopts, djppts, dofpts)
301
216
! Cet appel est sym�trique, donc on teste sur NFBDIG et NFBCPG
302
217
! (rien a envoyer, rien a recevoir)
303
218
if (nfbdig.gt.0.or.nfbcpg.gt.0) then
305
220
do ivarcp = 1, nvarto(numcpl)
309
( numcpl , nfbdis , nfbcpl , ityvar , &
310
ra(irvdis + (ivarcp-1)*nfbdis) , &
311
ra(irvfbr + (ivarcp-1)*nfbcpl) )
224
( numcpl , nfbdis , nfbcpl , ityvar , &
318
!====================================================================================
235
!===============================================================================
319
236
! 3. TRADUCTION DU COUPLAGE EN TERME DE CONDITIONS AUX LIMITES
320
!====================================================================================
237
!===============================================================================
322
239
if (nfbcpg.gt.0) then
326
( numcpl , nfbcpl , ityvar , ra(ipndcp) , ra(idofcp) )
330
( ifinia , ifinra , &
331
ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml ,&
332
nnod , lndfac , lndfbr , ncelbr , &
333
nvar , nscal , nphas , &
241
! Allocate temporary arrays for geometric quantities
242
allocate(dofcpl(3,nfbcpl))
243
allocate(pndcpl(nfbcpl))
247
( numcpl , nfbcpl , ityvar , pndcpl , dofcpl )
334
252
nvarcp(numcpl), nvarto(numcpl) , nfbcpl , nfbncp , &
335
nideve , nrdeve , nituse , nrtuse , &
336
ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
337
ipnfac , nodfac , ipnfbr , nodfbr , &
338
253
icodcl , itrifb , itypfb , &
339
ia(ilfbcp) , ia(ilfbnc) , &
340
idevel , ituser , ia , &
341
xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume ,&
342
255
dt , rtp , rtpa , propce , propfa , propfb , &
343
256
coefa , coefb , rcodcl , &
344
w1 , w2 , w3 , w4 , w5 , w6 , coefu ,&
345
ra(irvfbr) , ra(ipndcp) , ra(idofcp) , &
346
rdevel , rtuser , ra )
257
rvfbr , pndcpl , dofcpl )
260
deallocate(dofcpl, pndcpl)
266
deallocate(lfbcpl, lfbncp)
351
269
! Fin de la boucle sur les couplages