~ubuntu-branches/ubuntu/precise/code-saturne/precise

« back to all changes in this revision

Viewing changes to users/cplv/uscpiv.f90

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2011-11-24 00:00:08 UTC
  • mfrom: (6.1.9 sid)
  • Revision ID: package-import@ubuntu.com-20111124000008-2vo99e38267942q5
Tags: 2.1.0-3
Install a missing file

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 
3
3
!VERS
4
4
 
5
 
 
6
 
!     This file is part of the Code_Saturne Kernel, element of the
7
 
!     Code_Saturne CFD tool.
8
 
 
9
 
!     Copyright (C) 1998-2009 EDF S.A., France
10
 
 
11
 
!     contact: saturne-support@edf.fr
12
 
 
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.
17
 
 
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.
22
 
 
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.
 
6
!
 
7
! Copyright (C) 1998-2011 EDF S.A.
 
8
!
 
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
 
12
! version.
 
13
!
 
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
 
17
! details.
 
18
!
 
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.
28
22
 
29
23
!-------------------------------------------------------------------------------
30
24
 
31
25
subroutine uscpiv &
32
26
!================
33
27
 
34
 
 ( idbia0 , idbra0 ,                                              &
35
 
   ndim   , ncelet , ncel   , nfac   , nfabor , nfml   , nprfml , &
36
 
   nnod   , lndfac , lndfbr , ncelbr ,                            &
37
 
   nvar   , nscal  , nphas  ,                                     &
38
 
   nideve , nrdeve , nituse , nrtuse ,                            &
39
 
   ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
40
 
   ipnfac , nodfac , ipnfbr , nodfbr ,                            &
41
 
   idevel , ituser , ia     ,                                     &
42
 
   xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
43
 
   dt     , rtp    , propce , propfa , propfb , coefa  , coefb  , &
44
 
   rdevel , rtuser , ra     )
 
28
 ( nvar   , nscal  ,                                              &
 
29
   dt     , rtp    , propce , propfa , propfb , coefa  , coefb  )
45
30
 
46
31
!===============================================================================
47
 
! PURPOSE  :
 
32
! Purpose:
48
33
! --------
49
34
 
50
35
! Initialisation of transported variables for extended physics :
63
48
! Physical properties are stored in PROPCE(cell center)
64
49
!  PROPFA(inner face) and PROPFB(boundary face)
65
50
!  e.g.
66
 
!  PROPCE(IEL, IPPROC(IROM  (IPHAS))) is ROM(IEL,IPHAS) mean density kg/m3
 
51
!  PROPCE(IEL, IPPROC(IROM  )) is ROM(IEL) mean density kg/m3
67
52
!  PROPFA(IFAC,IPPROF(IFLUMA(IVAR ))) is FLUMAS(IFAC,IVAR) convective flux
68
53
!                                                        of variable IVAR
69
54
!  PROPFB(......                      .................................
139
124
!__________________.____._____.________________________________________________.
140
125
! name             !type!mode ! role                                           !
141
126
!__________________!____!_____!________________________________________________!
142
 
! idbia0           ! i  ! <-- ! number of first free position in ia            !
143
 
! idbra0           ! i  ! <-- ! number of first free position in ra            !
144
 
! ndim             ! i  ! <-- ! spatial dimension                              !
145
 
! ncelet           ! i  ! <-- ! number of extended (real + ghost) cells        !
146
 
! ncel             ! i  ! <-- ! number of cells                                !
147
 
! nfac             ! i  ! <-- ! number of interior faces                       !
148
 
! nfabor           ! i  ! <-- ! number of boundary faces                       !
149
 
! nfml             ! i  ! <-- ! number of families (group classes)             !
150
 
! nprfml           ! i  ! <-- ! number of properties per family (group class)  !
151
 
! nnod             ! i  ! <-- ! number of vertices                             !
152
 
! lndfac           ! i  ! <-- ! size of nodfac indexed array                   !
153
 
! lndfbr           ! i  ! <-- ! size of nodfbr indexed array                   !
154
 
! ncelbr           ! i  ! <-- ! number of cells with faces on boundary         !
155
127
! nvar             ! i  ! <-- ! total number of variables                      !
156
128
! nscal            ! i  ! <-- ! total number of scalars                        !
157
 
! nphas            ! i  ! <-- ! number of phases                               !
158
 
! nideve, nrdeve   ! i  ! <-- ! sizes of idevel and rdevel arrays              !
159
 
! nituse, nrtuse   ! i  ! <-- ! sizes of ituser and rtuser arrays              !
160
 
! ifacel(2, nfac)  ! ia ! <-- ! interior faces -> cells connectivity           !
161
 
! ifabor(nfabor)   ! ia ! <-- ! boundary faces -> cells connectivity           !
162
 
! ifmfbr(nfabor)   ! ia ! <-- ! boundary face family numbers                   !
163
 
! ifmcel(ncelet)   ! ia ! <-- ! cell family numbers                            !
164
 
! iprfml           ! ia ! <-- ! property numbers per family                    !
165
 
!  (nfml, nprfml)  !    !     !                                                !
166
 
! maxelt           !  e ! <-- ! max number of cells and faces (int/boundary)   !
167
 
! lstelt(maxelt)   ! ia ! --- ! work array                                     !
168
 
! ipnfac(nfac+1)   ! ia ! <-- ! interior faces -> vertices index (optional)    !
169
 
! nodfac(lndfac)   ! ia ! <-- ! interior faces -> vertices list (optional)     !
170
 
! ipnfbr(nfabor+1) ! ia ! <-- ! boundary faces -> vertices index (optional)    !
171
 
! nodfac(lndfbr)   ! ia ! <-- ! boundary faces -> vertices list (optional)     !
172
129
! icodcl           ! ia ! --> ! boundary condition code                        !
173
130
!  (nfabor, nvar)  !    !     ! = 1  -> Dirichlet                              !
174
131
!                  !    !     ! = 2  -> flux density                           !
178
135
!                  !    !     ! = 9  -> free inlet/outlet (velocity)           !
179
136
!                  !    !     !         inflowing possibly blocked             !
180
137
! itrifb(nfabor    ! ia ! <-- ! indirection for boundary faces ordering)       !
181
 
!  (nfabor, nphas) !    !     !                                                !
182
138
! itypfb           ! ia ! --> ! boundary face types                            !
183
 
!  (nfabor, nphas) !    !     !                                                !
184
 
! idevel(nideve)   ! ia ! <-- ! integer work array for temporary developpement !
185
 
! ituser(nituse    ! ia ! <-- ! user-reserved integer work array               !
186
 
! ia(*)            ! ia ! --- ! main integer work array                        !
187
 
! xyzcen           ! ra ! <-- ! cell centers                                   !
188
 
!  (ndim, ncelet)  !    !     !                                                !
189
 
! surfac           ! ra ! <-- ! interior faces surface vectors                 !
190
 
!  (ndim, nfac)    !    !     !                                                !
191
 
! surfbo           ! ra ! <-- ! boundary faces surface vectors                 !
192
 
!  (ndim, nfavor)  !    !     !                                                !
193
 
! cdgfac           ! ra ! <-- ! interior faces centers of gravity              !
194
 
!  (ndim, nfac)    !    !     !                                                !
195
 
! cdgfbo           ! ra ! <-- ! boundary faces centers of gravity              !
196
 
!  (ndim, nfabor)  !    !     !                                                !
197
 
! xyznod           ! ra ! <-- ! vertex coordinates (optional)                  !
198
 
!  (ndim, nnod)    !    !     !                                                !
199
 
! volume(ncelet)   ! ra ! <-- ! cell volumes                                   !
200
139
! dt(ncelet)       ! ra ! <-- ! time step (per cell)                           !
201
140
! rtp, rtpa        ! ra ! <-- ! calculated variables at cell centers           !
202
141
!  (ncelet, *)     !    !     !  (at current and preceding time steps)         !
215
154
!                  !    !     ! for velocities           ( vistl+visct)*gradu  !
216
155
!                  !    !     ! for pressure                         dt*gradp  !
217
156
!                  !    !     ! for scalars    cp*(viscls+visct/sigmas)*gradt  !
218
 
! w1,2,3,4,5,6     ! ra ! --- ! work arrays                                    !
219
 
!  (ncelet)        !    !     !  (computation of pressure gradient)            !
220
 
! coefu            ! ra ! --- ! tab de trav                                    !
221
 
!  (nfabor, 3)     !    !     !  (computation of pressure gradient)            !
222
 
! rdevel(nrdeve)   ! ra ! <-> ! tab reel complementaire developemt             !
223
 
! rdevel(nideve)   ! ra ! <-- ! real work array for temporary developpement    !
224
 
! rtuser(nituse    ! ra ! <-- ! user-reserved real work array                  !
225
 
! ra(*)            ! ra ! --- ! main real work array                           !
226
157
!__________________!____!_____!________________________________________________!
227
158
 
228
159
!     Type: i (integer), r (real), s (string), a (array), l (logical),
230
161
!     mode: <-- input, --> output, <-> modifies data, --- work array
231
162
!===============================================================================
232
163
 
 
164
!===============================================================================
 
165
! Module files
 
166
!===============================================================================
 
167
 
 
168
use paramx
 
169
use pointe
 
170
use numvar
 
171
use optcal
 
172
use cstphy
 
173
use cstnum
 
174
use entsor
 
175
use parall
 
176
use period
 
177
use ppppar
 
178
use ppthch
 
179
use coincl
 
180
use cpincl
 
181
use ppincl
 
182
use ppcpfu
 
183
use mesh
 
184
 
 
185
!===============================================================================
 
186
 
233
187
implicit none
234
188
 
235
 
!===============================================================================
236
 
!     Common blocks
237
 
!===============================================================================
238
 
 
239
 
include "paramx.h"
240
 
include "pointe.h"
241
 
include "numvar.h"
242
 
include "optcal.h"
243
 
include "cstphy.h"
244
 
include "cstnum.h"
245
 
include "entsor.h"
246
 
include "parall.h"
247
 
include "period.h"
248
 
include "ppppar.h"
249
 
include "ppthch.h"
250
 
include "coincl.h"
251
 
include "cpincl.h"
252
 
include "ppincl.h"
253
 
include "ppcpfu.h"
254
 
 
255
 
!===============================================================================
256
 
 
257
 
integer          idbia0 , idbra0
258
 
integer          ndim   , ncelet , ncel   , nfac   , nfabor
259
 
integer          nfml   , nprfml
260
 
integer          nnod   , lndfac , lndfbr , ncelbr
261
 
integer          nvar   , nscal  , nphas
262
 
integer          nideve , nrdeve , nituse , nrtuse
263
 
 
264
 
integer          ifacel(2,nfac) , ifabor(nfabor)
265
 
integer          ifmfbr(nfabor) , ifmcel(ncelet)
266
 
integer          iprfml(nfml,nprfml), maxelt, lstelt(maxelt)
267
 
integer          ipnfac(nfac+1), nodfac(lndfac)
268
 
integer          ipnfbr(nfabor+1), nodfbr(lndfbr)
269
 
integer          idevel(nideve), ituser(nituse), ia(*)
270
 
 
271
 
double precision xyzcen(ndim,ncelet)
272
 
double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
273
 
double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
274
 
double precision xyznod(ndim,nnod), volume(ncelet)
 
189
integer          nvar   , nscal
 
190
 
275
191
double precision dt(ncelet), rtp(ncelet,*), propce(ncelet,*)
276
192
double precision propfa(nfac,*), propfb(nfabor,*)
277
193
double precision coefa(nfabor,*), coefb(nfabor,*)
278
 
double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
279
 
 
280
194
 
281
195
! VARIABLES LOCALES
282
196
 
283
 
integer          idebia, idebra
284
 
integer          iel, ige, mode, icla, icha, iphas
 
197
integer          iel, ige, mode, icla, icha
285
198
integer          ioxy
286
199
 
287
200
double precision t1init, h1init, coefe(ngazem)
290
203
double precision xkent, xeent, d2s3
291
204
double precision wmh2o,wmco2,wmn2,wmo2,dmas
292
205
 
 
206
integer, allocatable, dimension(:) :: lstelt
 
207
 
293
208
!===============================================================================
294
209
 
295
210
 
311
226
! 1.  Local variables initialisation
312
227
!===============================================================================
313
228
 
314
 
idebia = idbia0
315
 
idebra = idbra0
 
229
! Allocate a temporary array for cells selection
 
230
allocate(lstelt(ncel))
 
231
 
316
232
 
317
233
d2s3 = 2.d0/3.d0
318
234
 
323
239
 
324
240
if ( isuite.eq.0 ) then
325
241
 
326
 
  iphas = 1
327
 
 
328
242
! --> Initialisation of k and epsilon (exemple)
329
243
 
330
244
  xkent = 1.d-10
332
246
 
333
247
! ---- TURBULENCE
334
248
 
335
 
  if (itytur(iphas).eq.2) then
336
 
 
337
 
    do iel = 1, ncel
338
 
      rtp(iel,ik(iphas))  = xkent
339
 
      rtp(iel,iep(iphas)) = xeent
340
 
    enddo
341
 
 
342
 
  elseif (itytur(iphas).eq.3) then
343
 
 
344
 
    do iel = 1, ncel
345
 
      rtp(iel,ir11(iphas)) = d2s3*xkent
346
 
      rtp(iel,ir22(iphas)) = d2s3*xkent
347
 
      rtp(iel,ir33(iphas)) = d2s3*xkent
348
 
      rtp(iel,ir12(iphas)) = 0.d0
349
 
      rtp(iel,ir13(iphas)) = 0.d0
350
 
      rtp(iel,ir23(iphas)) = 0.d0
351
 
      rtp(iel,iep(iphas))  = xeent
352
 
    enddo
353
 
 
354
 
  elseif (iturb(iphas).eq.50) then
355
 
 
356
 
    do iel = 1, ncel
357
 
      rtp(iel,ik(iphas))   = xkent
358
 
      rtp(iel,iep(iphas))  = xeent
359
 
      rtp(iel,iphi(iphas)) = d2s3
360
 
      rtp(iel,ifb(iphas))  = 0.d0
361
 
    enddo
362
 
 
363
 
  elseif (iturb(iphas).eq.60) then
364
 
 
365
 
    do iel = 1, ncel
366
 
      rtp(iel,ik(iphas))   = xkent
367
 
      rtp(iel,iomg(iphas)) = xeent/cmu/xkent
 
249
  if (itytur.eq.2) then
 
250
 
 
251
    do iel = 1, ncel
 
252
      rtp(iel,ik)  = xkent
 
253
      rtp(iel,iep) = xeent
 
254
    enddo
 
255
 
 
256
  elseif (itytur.eq.3) then
 
257
 
 
258
    do iel = 1, ncel
 
259
      rtp(iel,ir11) = d2s3*xkent
 
260
      rtp(iel,ir22) = d2s3*xkent
 
261
      rtp(iel,ir33) = d2s3*xkent
 
262
      rtp(iel,ir12) = 0.d0
 
263
      rtp(iel,ir13) = 0.d0
 
264
      rtp(iel,ir23) = 0.d0
 
265
      rtp(iel,iep)  = xeent
 
266
    enddo
 
267
 
 
268
  elseif (iturb.eq.50) then
 
269
 
 
270
    do iel = 1, ncel
 
271
      rtp(iel,ik)   = xkent
 
272
      rtp(iel,iep)  = xeent
 
273
      rtp(iel,iphi) = d2s3
 
274
      rtp(iel,ifb)  = 0.d0
 
275
    enddo
 
276
 
 
277
  elseif (iturb.eq.60) then
 
278
 
 
279
    do iel = 1, ncel
 
280
      rtp(iel,ik)   = xkent
 
281
      rtp(iel,iomg) = xeent/cmu/xkent
 
282
    enddo
 
283
 
 
284
  elseif (iturb.eq.70) then
 
285
 
 
286
    do iel = 1, ncel
 
287
      rtp(iel,inusa) = cmu*xkent**2/xeent
368
288
    enddo
369
289
 
370
290
  endif
374
294
 
375
295
! ---- Computation of H1INIT and H2INIT
376
296
 
377
 
  t1init = t0(iphas)
378
 
  t2init = t0(iphas)
 
297
  t1init = t0
 
298
  t2init = t0
379
299
 
380
300
! ------ Transported variables for the solid phase
381
301
!         initialy lacking
397
317
    enddo
398
318
  enddo
399
319
 
400
 
! ------ Transported variables for the mix (solid+carrying gas)²
 
320
! ------ Transported variables for the mix (solid+carrying gas)^2
401
321
 
402
322
  do ige = 1, ngazem
403
323
    coefe(ige) = zero
477
397
      rtp(iel,isca(iyco2)) = oxyco2(ioxy)*wmco2/dmas
478
398
 
479
399
    endif
 
400
 
 
401
    if ( ieqnox.eq.1 ) then
 
402
      rtp(iel,isca(iyhcn )) = 0.d0
 
403
      rtp(iel,isca(iyno  )) = 0.d0
 
404
      rtp(iel,isca(itaire)) = 293.d0
 
405
    endif
 
406
 
480
407
  enddo
481
408
 
482
409
endif
495
422
!----
496
423
! END
497
424
!----
 
425
 
 
426
! Deallocate the temporary array
 
427
deallocate(lstelt)
 
428
 
498
429
return
499
430
end subroutine