CalculiX  2.13
A Free Software Three-Dimensional Structural Finite Element Program
rhsp.f File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine rhsp (nef, lakonf, ipnei, neifa, neiel, vfa, area, advfa, xlet, cosa, volume, au, ad, jq, irow, ap, ielfa, ifabou, xle, b, xxn, neq, nzs, hfa, gradpel, bp, xxi, neij, xlen, nefa, nefb, xxicn)
 

Function/Subroutine Documentation

◆ rhsp()

subroutine rhsp ( integer  nef,
character*8, dimension(*)  lakonf,
integer, dimension(*)  ipnei,
integer, dimension(*)  neifa,
integer, dimension(*)  neiel,
real*8, dimension(0:7,*)  vfa,
real*8, dimension(*)  area,
real*8, dimension(*)  advfa,
real*8, dimension(*)  xlet,
real*8, dimension(*)  cosa,
real*8, dimension(*)  volume,
real*8, dimension(*)  au,
real*8, dimension(*)  ad,
integer, dimension(*)  jq,
integer, dimension(*)  irow,
real*8, dimension(*)  ap,
integer, dimension(4,*)  ielfa,
integer, dimension(*)  ifabou,
real*8, dimension(*)  xle,
real*8, dimension(*)  b,
real*8, dimension(3,*)  xxn,
integer  neq,
integer  nzs,
real*8, dimension(3,*)  hfa,
real*8, dimension(3,*)  gradpel,
real*8, dimension(*)  bp,
real*8, dimension(3,*)  xxi,
integer, dimension(*)  neij,
real*8, dimension(*)  xlen,
integer  nefa,
integer  nefb,
real*8, dimension(3,*)  xxicn 
)
23 !
24 ! filling the lhs and rhs to calculate the first correction to the
25 ! pressure p'
26 !
27  implicit none
28 !
29  character*8 lakonf(*)
30 !
31  integer i,nef,indexf,ipnei(*),j,neifa(*),
32  & neiel(*),iel,ifa,irow(*),ielfa(4,*),nefa,nefb,
33  & ifabou(*),neq,nzs,jq(*),iel2,indexb,knownflux,
34  & iatleastonepressurebc,j2,indexf2,neij(*)
35 !
36  real*8 coef,vfa(0:7,*),volume(*),area(*),advfa(*),xlet(*),
37  & cosa(*),ad(*),au(*),xle(*),xxn(3,*),ap(*),b(*),bp(*),
38  & hfa(3,*),xxi(3,*),gradpel(3,*),xlen(*),bp_ifa,xxicn(3,*)
39 !
40  do i=nefa,nefb
41  do indexf=ipnei(i)+1,ipnei(i+1)
42  knownflux=0
43 !
44 ! diffusion
45 !
46  ifa=neifa(indexf)
47  iel=neiel(indexf)
48  if(iel.ne.0) then
49 !
50 ! element has a neighbor across the face
51 !
52 ! correction for non-orthogonal meshes
53 !
54  j2=neij(indexf)
55  indexf2=ipnei(iel)+j2
56  bp_ifa=((gradpel(1,iel)*xxicn(1,indexf2)+
57  & gradpel(2,iel)*xxicn(2,indexf2)+
58  & gradpel(3,iel)*xxicn(3,indexf2))
59  & *xle(indexf2)
60  & -(gradpel(1,i)*xxicn(1,indexf)+
61  & gradpel(2,i)*xxicn(2,indexf)+
62  & gradpel(3,i)*xxicn(3,indexf))
63  & *xle(indexf))
64  b(i)=b(i)-ap(ifa)*bp_ifa
65  else
66 !
67 ! external face
68 !
69  iel2=ielfa(2,ifa)
70  if(iel2.lt.0) then
71  if((ifabou(-iel2+1).ne.0).and.
72  & (ifabou(-iel2+2).ne.0).and.
73  & (ifabou(-iel2+3).ne.0)) then
74 !
75 ! all velocity components given
76 !
77  knownflux=1
78  elseif(ifabou(-iel2+5).lt.0) then
79 !
80 ! sliding conditions
81 !
82  knownflux=2
83  elseif(ifabou(-iel2+4).gt.0) then
84 !
85 ! pressure given
86 !
87 !
88 ! correction for non-orthogonal meshes
89 !
90  bp_ifa=(-(gradpel(1,i)*xxicn(1,indexf)+
91  & gradpel(2,i)*xxicn(2,indexf)+
92  & gradpel(3,i)*xxicn(3,indexf))
93  & *xle(indexf))
94 !
95  b(i)=b(i)-ap(ifa)*
96  & (vfa(4,ifa)+bp_ifa)
97 c elseif((ifabou(-iel2+1).eq.0).and.
98 c & (ifabou(-iel2+2).eq.0).and.
99 c & (ifabou(-iel2+3).eq.0)) then
100 c!
101 c! outlet
102 c!
103 c knownflux=2
104  endif
105 c else
106 c!
107 c! outlet
108 c!
109 c knownflux=2
110  endif
111  endif
112 !
113 ! save coefficients for correctvfa.f
114 !
115  if((iel.eq.0).or.(i.lt.iel)) then
116  bp(ifa)=bp_ifa
117  endif
118 !
119  if(knownflux.eq.1) then
120  b(i)=b(i)+vfa(5,ifa)*area(ifa)*
121  & (vfa(1,ifa)*xxn(1,indexf)+
122  & vfa(2,ifa)*xxn(2,indexf)+
123  & vfa(3,ifa)*xxn(3,indexf))
124  elseif(knownflux.ne.2) then
125  b(i)=b(i)+vfa(5,ifa)*area(ifa)*
126  & (hfa(1,ifa)*xxn(1,indexf)+
127  & hfa(2,ifa)*xxn(2,indexf)+
128  & hfa(3,ifa)*xxn(3,indexf))
129  endif
130  enddo
131  enddo
132 !
133  return
Hosted by OpenAircraft.com, (Michigan UAV, LLC)