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 usray3 &
35
ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
36
nnod , lndfac , lndfbr , ncelbr , &
37
nvar , nscal , iphas , iappel , &
38
nideve , nrdeve , nituse , nrtuse , &
39
ifacel , ifabor , ifmfbr , ifmcel , iprfml , itypfb , &
40
ipnfac , nodfac , ipnfbr , nodfbr , izfrdp , &
41
idevel , ituser , ia , &
42
xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
28
( nvar , nscal , iappel , &
43
31
dt , rtp , rtpa , propce , propfa , propfb , &
44
ck , w1 , w2 , w3 , w4 , w5 , w6 , &
48
34
!===============================================================================
52
! SOUS-PROGRAMME DU MODULE DE RAYONNEMENT :
53
! -----------------------------------------
56
! Coefficient d'absorption
57
! -------------------------
59
! Il est indispensable de renseigner la valeur du coefficient
60
! d'absorption du fluide CK.
62
! Pour un milieu transparent, le coefficient doit etre
65
! DANS LE CAS DU MODELE P-1 ON VERIFIE QUE LA LONGUEUR OPTIQUE
66
! DU MILIEU EST AU MINIMUM DE L'ORDRE DE L'UNITE
70
! Pour les physiques particulieres (Combustion, charbon...)
72
! il est INTERDIT de fournir le COEFFICIENT D'ABSORPTION ici.
75
! Voir le sous-programme PPCABS
38
! Absorption coefficient for radiative module
39
! ----------------------
41
! It is necessary to define the value of the fluid's absorption
44
! For a transparent medium, the coefficient should be set to 0.d0.
46
! In the case of the P-1 model, we check that the optical length is at
47
! least of the order of 1.
51
! For specific physics (Combustion, coal, ...),
53
! it is Forbidden to define the absorption coefficient here.
56
! See subroutine ppcabs.
78
58
!-------------------------------------------------------------------------------
80
60
!__________________.____._____.________________________________________________.
81
61
! name !type!mode ! role !
82
62
!__________________!____!_____!________________________________________________!
83
! idbia0 ! i ! <-- ! number of first free position in ia !
84
! idbra0 ! i ! <-- ! number of first free position in ra !
85
! ndim ! i ! <-- ! spatial dimension !
86
! ncelet ! i ! <-- ! number of extended (real + ghost) cells !
87
! ncel ! i ! <-- ! number of cells !
88
! nfac ! i ! <-- ! number of interior faces !
89
! nfabor ! i ! <-- ! number of boundary faces !
90
! nfml ! i ! <-- ! number of families (group classes) !
91
! nprfml ! i ! <-- ! number of properties per family (group class) !
92
! nnod ! i ! <-- ! number of vertices !
93
! lndfac ! i ! <-- ! size of nodfac indexed array !
94
! lndfbr ! i ! <-- ! size of nodfbr indexed array !
95
! ncelbr ! i ! <-- ! number of cells with faces on boundary !
96
63
! nvar ! i ! <-- ! total number of variables !
97
64
! nscal ! i ! <-- ! total number of scalars !
98
! iphas ! i ! <-- ! phase number !
99
! nideve, nrdeve ! i ! <-- ! sizes of idevel and rdevel arrays !
100
! nituse, nrtuse ! i ! <-- ! sizes of ituser and rtuser arrays !
101
! ifacel(2, nfac) ! ia ! <-- ! interior faces -> cells connectivity !
102
! ifabor(nfabor) ! ia ! <-- ! boundary faces -> cells connectivity !
103
! ifmfbr(nfabor) ! ia ! <-- ! boundary face family numbers !
104
! ifmcel(ncelet) ! ia ! <-- ! cell family numbers !
105
! iprfml ! ia ! <-- ! property numbers per family !
106
! (nfml, nprfml) ! ! ! !
107
65
! itypfb ! ia ! <-- ! boundary face types !
108
! (nfabor, nphas) ! ! ! !
109
! ipnfac(nfac+1) ! ia ! <-- ! interior faces -> vertices index (optional) !
110
! nodfac(lndfac) ! ia ! <-- ! interior faces -> vertices list (optional) !
111
! ipnfbr(nfabor+1) ! ia ! <-- ! boundary faces -> vertices index (optional) !
112
! nodfbr(lndfbr) ! ia ! <-- ! boundary faces -> vertices list (optional) !
113
! izfrdp(nfabor ! te ! <-- ! numero de zone pour les faces de bord !
114
! idevel(nideve) ! ia ! <-> ! integer work array for temporary development !
115
! ituser(nituse) ! ia ! <-> ! user-reserved integer work array !
116
! ia(*) ! ia ! --- ! main integer work array !
117
! xyzcen ! ra ! <-- ! cell centers !
118
! (ndim, ncelet) ! ! ! !
119
! surfac ! ra ! <-- ! interior faces surface vectors !
120
! (ndim, nfac) ! ! ! !
121
! surfbo ! ra ! <-- ! boundary faces surface vectors !
122
! (ndim, nfabor) ! ! ! !
123
! cdgfac ! ra ! <-- ! interior faces centers of gravity !
124
! (ndim, nfac) ! ! ! !
125
! cdgfbo ! ra ! <-- ! boundary faces centers of gravity !
126
! (ndim, nfabor) ! ! ! !
127
! xyznod ! ra ! <-- ! vertex coordinates (optional) !
128
! (ndim, nnod) ! ! ! !
129
! volume(ncelet) ! ra ! <-- ! cell volumes !
66
! izfrdp(nfabor ! ia ! <-- ! zone number for boundary faces !
130
67
! dt(ncelet) ! ra ! <-- ! time step (per cell) !
131
68
! rtp, rtpa ! ra ! <-- ! calculated variables at cell centers !
132
69
! (ncelet, *) ! ! ! (at current and previous time steps) !
133
70
! propce(ncelet, *)! ra ! <-- ! physical properties at cell centers !
134
71
! propfa(nfac, *) ! ra ! <-- ! physical properties at interior face centers !
135
72
! propfb(nfabor, *)! ra ! <-- ! physical properties at boundary face centers !
136
! ck (ncelet) ! tr ! --> ! coefficient d'absorption du milieu !
137
! ! ! ! (nul si transparent) !
138
! rdevel(nrdeve) ! ra ! <-> ! real work array for temporary development !
139
! w1...6(ncelet ! tr ! --- ! tableau de travail !
140
! rtuser(nrtuse) ! ra ! <-> ! user-reserved real work array !
141
! ra(*) ! ra ! --- ! main real work array !
73
! ck(ncelet) ! ra ! --> ! medium's absorption coefficient !
74
! ! ! ! (zero if transparent) !
142
75
!__________________!____!_____!________________________________________________!
144
77
! Type: i (integer), r (real), s (string), a (array), l (logical),
146
79
! mode: <-- input, --> output, <-> modifies data, --- work array
147
80
!===============================================================================
82
!===============================================================================
84
!===============================================================================
102
!===============================================================================
151
!===============================================================================
153
!===============================================================================
171
!===============================================================================
175
integer idbia0 , idbra0
176
integer ndim , ncelet , ncel , nfac , nfabor
177
integer nfml , nprfml
178
integer nnod , lndfac , lndfbr , ncelbr
179
integer nvar , nscal , iphas , iappel
180
integer nideve , nrdeve , nituse , nrtuse
182
integer ifacel(2,nfac) , ifabor(nfabor)
183
integer ifmfbr(nfabor) , ifmcel(ncelet)
184
integer iprfml(nfml,nprfml) , itypfb(nfabor)
185
integer ipnfac(nfac+1), nodfac(lndfac)
186
integer ipnfbr(nfabor+1), nodfbr(lndfbr),izfrdp(nfabor)
187
integer idevel(nideve), ituser(nituse), ia(*)
189
double precision xyzcen(ndim,ncelet)
190
double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
191
double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
192
double precision xyznod(ndim,nnod), volume(ncelet)
108
integer nvar , nscal , iappel
110
integer itypfb(nfabor)
111
integer izfrdp(nfabor)
193
113
double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
194
114
double precision propce(ncelet,*)
195
115
double precision propfa(nfac,*), propfb(nfabor,*)
197
double precision w1(ncelet), w2(ncelet), w3(ncelet)
198
double precision w4(ncelet), w5(ncelet), w6(ncelet)
200
118
double precision ck(ncelet)
202
double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
205
120
! Local variables
207
integer idebia , idebra , iel, ifac, iok
122
integer iel, ifac, iok
208
123
double precision vv, sf, xlc, xkmin, pp
210
125
!===============================================================================
246
160
!===============================================================================
247
! 0 - GESTION MEMOIRE
161
! 0 - Memory management
248
162
!===============================================================================
253
! Indicateur d'arret (pour savoir si des faces ont ete oubliees)
165
! Stop flag (to determine if faces were forgotten)
256
168
!===============================================================================
257
! COEFFICIENT D'ABSORPTION DU MILIEU (m-1)
259
! DANS LE CAS DES PHYSIQUES PARTICULIERES (COMBUSTION GAZ/CHARBON/ELEC/FIOUL)
261
! CK NE DOIT PAS ETRE FOURNI
263
! (il est determine automatiquement, eventuellement a partir
264
! du fichier parametrique)
266
! DANS LES AUTRES CAS
267
! CK DOIT ETRE COMPLETE (IL EST NUL PAR DEFAUT)
169
! Absorption coefficient of the medium (m-1)
171
! In the case of specific physics (gas/coal/fuel combustion, elec)
173
! Ck must not be defined here
175
! (it is determined automatically, possibly from the parametric file)
177
! In other cases, Ck must be defined (it is zero by default)
270
178
!===============================================================================
275
if( ippmod(iphpar).le.1 ) then
180
if (ippmod(iphpar).le.1) then
281
!--> MODELE P1 : Controle standard des valeurs du coefficient
282
! d'absorption. Ce coefficient doit assurer une
283
! longueur optique au minimum de l'ordre de l'unite.
186
!--> P1 model: standard control of absorption coefficient values.
187
! this coefficient must ensure an optical length
188
! at least of the order of 1.
285
190
if (iirayo.eq.2) then
289
! Calcul de la longueur caract�ristique du domaine de calcul
194
! Compute characteristic length of calculation domain
291
196
do ifac = 1,nfabor
293
surfbo(1,ifac)**2 + &
294
surfbo(2,ifac)**2 + &
197
sf = sf + sqrt(surfbo(1,ifac)**2 + surfbo(2,ifac)**2 + surfbo(3,ifac)**2)
297
199
if (irangp.ge.0) then
324
! Arret en fin de pas de temps si epaisseur optique trop grande
325
! (ISTPP1 = 1 permet d'arreter proprement a la fin du pas de temps
226
! Stop at the end of the time step if the optical thickness is too big
227
! (istpp1 = 1 allows stopping cleanly at the end of the current time step).
327
228
pp = xnp1mx/100.0d0
328
229
if (dble(iok).gt.pp*dble(ncel)) then
329
write(nfecra,3000) xkmin, dble(iok)/dble(ncel)*100.d0, &
230
write(nfecra,3000) xkmin, dble(iok)/dble(ncel)*100.d0, xnp1mx
344
245
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
346
'@ @@ ATTENTION : RAYONNEMENT APPROXIMATION P-1 (USRAY3) ',/,&
349
'@ LA LONGUEUR OPTIQUE DU MILIEU SEMI-TRANSPARENT ',/,&
350
'@ DOIT AU MOINS ETRE DE L''ORDRE DE L''UNITE POUR ETRE ',/,&
351
'@ DANS LE DOMAINE D''APPLICATION DE L''APPROXIMATION P-1',/,&
352
'@ CELA NE SEMBLE PAS ETRE LE CAS ICI. ',/,&
354
'@ LE COEFFICIENT D''ABSORPTION MINIMUM POUR ASSURER CETTE ',/,&
355
'@ LONGUEUR OPTIQUE EST XKMIN = ',E10.4 ,/,&
356
'@ CETTE VALEUR N''EST PAS ATTEINTE POUR ', E10.4,'% ',/,&
357
'@ DES CELLULES DU MAILLAGE. ',/,&
358
'@ LE POURCENTAGE DE CELLULES DU MAILLAGE POUR LESQUELLES ',/,&
359
'@ ON ADMET QUE CETTE CONDITION SOIT VIOLEE EST IMPOSE ',/,&
360
'@ PAR DEFAUT OU DANS USINI1 A XNP1MX = ', E10.4,'% ',/,&
362
'@ Le calcul est interrompu. ',/,&
364
'@ Verifier les valeurs du coefficient d''absorption CK ',/,&
365
'@ dans PPCABS, USRAY3 ou Fichier thermochimie. ',/,&
247
'@ @@ WARNING: P1 radiation approximation (usray3) ',/,&
250
'@ The optical length of the semi-transparent medium ',/,&
251
'@ must be at least of the order of one to be in the ',/,&
252
'@ domain of validity of the P-1 approximation. ',/,&
253
'@ This does not seem to be the case here. ',/,&
255
'@ The minimum absorption coefficient to ensure this ',/,&
256
'@ optical length is XKmin = ', e10.4 ,/,&
257
'@ This value is not reached for ', e10.4,'% ',/,&
258
'@ of the meshe''s cells. ',/,&
259
'@ The percentage of mesh cells for which we allow this ',/,&
260
'@ condition not to be rspected is set by default in ',/,&
261
'@ usini1 to xnp1mx = ', e10.4,'% ',/,&
263
'@ The calculation is interrupted. ',/,&
265
'@ Check the values of the absorption coefficient Ck ',/,&
266
'@ in ppcabs, usray3 or the thermochemistry data file. ',/,&
367
268
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&