xref: /phasta/phSolver/incompressible/asiq.f (revision 595995161822a203c8467e0e4a253d7bd7d6df32)
1        subroutine AsIq (y,       x,       shp,
2     &                   shgl,    ien,     xmudmi,
3     &                   qres,    rmass    )
4c
5c----------------------------------------------------------------------
6c
7c This routine computes and assembles the data corresponding to the
8c interior elements for the global reconstruction of the diffusive
9c flux vector.
10c
11c input:
12c     y     (numnp,ndof)        : Y variables
13c     x     (numnp,nsd)         : nodal coordinates
14c     shp   (nen,nintg)         : element shape-functions
15c     shgl  (nsd,nen,nintg)     : element local shape-function gradients
16c     ien   (npro)              : nodal connectivity array
17c
18c output:
19c     qres  (numnp,nsd,nsd)  : residual vector for diffusive flux
20c     rmass  (numnp)            : lumped mass matrix
21c
22c----------------------------------------------------------------------
23c
24        use turbsa      ! access to d2wall
25        include "common.h"
26c
27        dimension y(nshg,ndof),               x(numnp,nsd),
28     &            shp(nshl,ngauss),         shgl(nsd,nshl,ngauss),
29     &            ien(npro,nshl),      dwl(npro,nenl),
30     &            qres(nshg,idflx),    rmass(nshg)
31c
32        dimension yl(npro,nshl,ndof),          xl(npro,nenl,nsd),
33     &            ql(npro,nshl,idflx),  rmassl(npro,nshl),
34     &            xmudmi(npro,ngauss)
35c
36        dimension sgn(npro,nshl)
37c
38c.... create the matrix of mode signs for the hierarchic basis
39c     functions.
40c
41        do i=1,nshl
42           where ( ien(:,i) < 0 )
43              sgn(:,i) = -one
44           elsewhere
45              sgn(:,i) = one
46           endwhere
47        enddo
48
49c
50c.... gather the variables
51c
52
53        call localy(y,      yl,     ien,    ndof,   'gather  ')
54        call localx (x,      xl,     ien,    nsd,    'gather  ')
55        if (iRANS .eq. -2) then ! kay-epsilon
56           call localx (d2wall,   dwl,     ien,    1,     'gather  ')
57        endif
58c
59c.... get the element residuals
60c
61        ql     = zero
62        rmassl = zero
63
64        call e3q  (yl,         dwl,      shp,      shgl,
65     &             xl,         ql,       rmassl,
66     &             xmudmi,     sgn  )
67
68c
69c.... assemble the diffusive flux residual
70c
71        call local (qres,   ql,  ien,  idflx,  'scatter ')
72        call local (rmass,  rmassl, ien,  1,          'scatter ')
73c
74c.... end
75c
76        return
77        end
78
79
80c
81c----------------------------------------------------------------------
82c
83c This routine computes and assembles the data corresponding to the
84c interior elements for the global reconstruction of the diffusive
85c flux vector.
86c
87c----------------------------------------------------------------------
88        subroutine AsIqSclr (y,       x,       shp,
89     &                       shgl,    ien,     qres,
90     &                       rmass    )
91c
92        use turbsa      ! access to d2wall
93        include "common.h"
94c
95        dimension y(nshg,ndof),             x(numnp,nsd),
96     &            shp(nshl,ngauss),         shgl(nsd,nshl,ngauss),
97     &            ien(npro,nshl),      dwl(npro,nenl),
98     &            qres(nshg,nsd),           rmass(nshg)
99c
100        dimension yl(npro,nshl,ndof),       xl(npro,nenl,nsd),
101     &            ql(npro,nshl,nsd),        rmassl(npro,nshl)
102c
103        dimension sgn(npro,nshl)
104
105        if (ipord .gt. 1) then
106           call getsgn(ien,sgn)
107        endif
108c
109c.... gather the variables
110c
111        call localy(y,      yl,     ien,    ndof,   'gather  ')
112        call localx (x,      xl,     ien,    nsd,    'gather  ')
113        if (iRANS .eq. -2) then ! kay-epsilon
114           call localx (d2wall,   dwl,     ien,    1,     'gather  ')
115        endif
116c
117c.... get the element residuals
118c
119        ql     = zero
120        rmassl = zero
121
122        call e3qSclr  (yl,      dwl,    shp,    shgl,
123     &                 xl,      ql,     rmassl,
124     &                 sgn             )
125
126c
127c.... assemble the temperature diffusive flux residual
128c
129        call local (qres,   ql,  ien,  nsd,  'scatter ')
130        call local (rmass,  rmassl, ien,  1, 'scatter ')
131c
132c.... end
133c
134        return
135        end
136
137