summaryrefslogtreecommitdiff
path: root/Dragon/src/BIVS04.f
blob: 6db43cadb7d0d832d9d5bae14921662415adb03d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
*DECK BIVS04
      SUBROUTINE BIVS04(MAXKN,MAXQF,NREG,NUN,LL4,ISPLH,IIMAX,SIDE,KN,
     1 QFR,BFR,VOL,IDL,MU,SOURCE,SYS,FUNKNO)
*
*-----------------------------------------------------------------------
*
*Purpose:
* One-speed flux calculation in mixed-dual finite element approximation
* (hexagonal geometry).
*
*Copyright:
* Copyright (C) 2002 Ecole Polytechnique de Montreal
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version
*
*Author(s): A. Hebert
*
*Parameters: input
* MAXKN   dimension of array KN.
* MAXQF   dimension of arrays QFR and BFR.
* NREG    number of hexagons in BIVAC.
* NUN     dimension of array FUNKNO.
* LL4     number of unknowns per group in BIVAC. Equal to the number
*         of finite elements (hexagons or triangles) excluding the
*         virtual elements.
* ISPLH   type of hexagonal mesh-splitting:
*         =1: hexagonal elements; >1: triangular elements.
* IIMAX   allocated dimension of array SYS.
* SIDE    side of the hexagons.
* KN      element-ordered unknown list.
* QFR     element-ordered information.
* BFR     element-ordered surface fractions.
* VOL     volume of hexagons.
* IDL     position of the average flux component associated with
*         each volume.
* MU      indices used with the compressed diagonal storage mode matrix
*         SYS.
* SOURCE  fission and diffusion sources.
* SYS     factorized system matrix.
*
*Parameters: output
* FUNKNO  neutron fluxes (surface-averaged flux are in position
*         FUNKNO(NUN)).
*
*-----------------------------------------------------------------------
*
*----
*  SUBROUTINE ARGUMENTS
*----
      INTEGER MAXKN,MAXQF,NREG,NUN,LL4,ISPLH,IIMAX,KN(MAXKN),IDL(NREG),
     1 MU(LL4)
      REAL SIDE,QFR(MAXQF),BFR(MAXQF),VOL(NREG),SOURCE(LL4),SYS(IIMAX),
     1 FUNKNO(NUN)
*
      IF(ISPLH.EQ.1) THEN
         DS=SQRT(3.0)*SIDE
         FACT=2.0/(3.0*DS)
         NSURF=6
      ELSE
         DS=SIDE/(SQRT(3.0)*REAL(ISPLH-1))
         FACT=4.0/(3.0*DS)
         NSURF=3
      ENDIF
*----
*  RESOLUTION.
*----
      DO 10 I=1,LL4
      FUNKNO(I)=SOURCE(I)
   10 CONTINUE
      CALL ALLDLS (LL4,MU,SYS,FUNKNO)
*----
*  CALCULATION OF ELEMENT-AVERAGED FLUXES.
*----
      IF(ISPLH.GT.1) THEN
         NSURF=3
         DO 20 K=1,NREG
         IF(IDL(K).NE.0) FUNKNO(IDL(K))=0.0
   20    CONTINUE
         NUM1=0
         DO 40 IND1=1,LL4
         K=KN(NUM1+NSURF+1)
         IF(VOL(K).EQ.0.0) GO TO 30
         FUNKNO(IDL(K))=FUNKNO(IDL(K))+QFR(NUM1+NSURF+1)*FUNKNO(IND1)/
     1   VOL(K)
   30    NUM1=NUM1+NSURF+1
   40    CONTINUE
      ELSE
         NSURF=6
      ENDIF
*----
*  CALCULATION OF SURFACE-AVERAGED FLUX.
*----
      FUNKNO(NUN)=0.0
      NUM1=0
      DO 70 IND1=1,LL4
      K=KN(NUM1+NSURF+1)
      IF(VOL(K).EQ.0.0) GO TO 60
      DO 50 IC=1,NSURF
      IF(BFR(NUM1+IC).GT.0.0) THEN
         FUNKNO(NUN)=FUNKNO(NUN)+FUNKNO(IND1)*BFR(NUM1+IC)
      ENDIF
   50 CONTINUE
   60 NUM1=NUM1+NSURF+1
   70 CONTINUE
      RETURN
      END