30 character*81 tieset(3,*)
32 integer nef,ipkonf(*),konf(*),nface,ielfa(4,*),ipnei(*),neiel(*),
33 & ifaceq(8,6),i,j,k,indexe,kflag,index1,index2,j1,j2,nope,
34 &
nodes(4),iel1,iel2,iel3,iface,indexf,neifa(*),nf(5),ifacet(7,4),
35 & ifacew(8,5),numfaces,ied4(2,6),ied6(2,9),ied8(2,12),ifatie(*),
36 & ics,itie,neighface,ifirst_occurrence,icyclic,neij(*),jface,
37 & isolidsurf(*),nsolidsurf,iopp8(4,6),iopp6(3,5),iopp4(1,4),
38 & node,nelem,nflnei,iturbulent
40 real*8 co(3,*),coel(3,*),cofa(3,*),area(*),xxn(3,*),xxi(3,*),
41 & xle(*),xlen(*),xlet(*),xrlfa(3,*),cosa(*),xsj2(3),xi,et,
42 & shp2(7,4),xs2(3,7),xl2(3,8),xl13,volume(*),dxsj2,xl(3,8),
43 & xxj(3,*),cosb(*),dmin,cs(17,*),xn(3),theta,pi,dc,ds,dd,
44 & c(3,3),diff(3),p(3),q(3),a(3),physcon(*),dy(*),xs(3,3),
45 & aa,bb,cc,
dist,xxni(3,*),xxnj(3,*),xxicn(3,*),rf(3,*),x13(3)
49 data ifaceq /4,3,2,1,11,10,9,12,
50 & 5,6,7,8,13,14,15,16,
52 & 2,3,7,6,10,19,14,18,
53 & 3,4,8,7,11,20,15,19,
54 & 4,1,5,8,12,17,16,20/
55 data ifacet /1,3,2,7,6,5,11,
59 data ifacew /1,3,2,9,8,7,0,0,
65 data ied4 /1,2,2,3,3,1,1,4,2,4,3,4/
66 data ied6 /1,2,2,3,3,1,4,5,5,6,6,4,1,4,2,5,3,6/
67 data ied8 /1,2,2,3,3,4,4,1,5,6,6,7,7,8,8,1,1,5,2,6,3,7,4,8/
69 data iopp6 /4,5,6,1,3,2,3,6,0,1,4,0,2,5,0/
70 data iopp8 /5,6,7,8,4,3,2,1,3,4,8,7,4,1,5,8,1,2,6,5,2,3,7,6/
78 if(ipkonf(i).lt.0) cycle
79 if(lakonf(i)(1:1).ne.
'F') cycle
81 if(lakonf(i)(4:4).eq.
'8')
then 83 else if(lakonf(i)(4:4).eq.
'6')
then 90 coel(j,i)=coel(j,i)+co(j,konf(indexe+k))
92 coel(j,i)=coel(j,i)/nope
104 if(ifatie(i).ne.0)
then 107 if(tieset(1,itie)(81:81).eq.
'P')
then 108 if(ifirst_occurrence.eq.1)
then 114 elseif(tieset(1,itie)(81:81).eq.
'Z')
then 115 if(ifirst_occurrence.eq.1)
then 126 xn(k)=cs(8+k,ics)-a(k)
128 dd=dsqrt(xn(1)*xn(1)+xn(2)*xn(2)+xn(3)*xn(3))
135 theta=-2.d0*pi/cs(1,ics)
147 c(1,1)=dc+(1.d0-dc)*xn(1)*xn(1)
148 c(1,2)= (1.d0-dc)*xn(1)*xn(2)-ds*xn(3)
149 c(1,3)= (1.d0-dc)*xn(1)*xn(3)+ds*xn(2)
150 c(2,1)= (1.d0-dc)*xn(2)*xn(1)+ds*xn(3)
151 c(2,2)=dc+(1.d0-dc)*xn(2)*xn(2)
152 c(2,3)= (1.d0-dc)*xn(2)*xn(3)-ds*xn(1)
153 c(3,1)= (1.d0-dc)*xn(3)*xn(1)-ds*xn(2)
154 c(3,2)= (1.d0-dc)*xn(3)*xn(2)+ds*xn(1)
155 c(3,3)=dc+(1.d0-dc)*xn(3)*xn(3)
159 write(*,*)
'*ERROR in initialcfd' 160 write(*,*)
' kind of cyclic symmetry' 161 write(*,*)
' not known' 169 if(lakonf(iel1)(4:4).eq.
'8')
then 176 nodes(j)=konf(indexe+ifaceq(j,j1))
178 xl2(k,j)=co(k,
nodes(j))
179 cofa(k,i)=cofa(k,i)+xl2(k,j)
183 cofa(k,i)=cofa(k,i)/4.d0
188 call shape4q(xi,et,xl2,xsj2,xs2,shp2,kflag)
192 dxsj2=dsqrt(xsj2(1)*xsj2(1)+xsj2(2)*xsj2(2)+
198 else if(lakonf(iel1)(4:4).eq.
'6')
then 205 nodes(j)=konf(indexe+ifacew(j,j1))
207 xl2(k,j)=co(k,
nodes(j))
208 cofa(k,i)=cofa(k,i)+xl2(k,j)
212 cofa(k,i)=cofa(k,i)/nf(j1)
218 call shape3tri(xi,et,xl2,xsj2,xs2,shp2,kflag)
220 call shape4q(xi,et,xl2,xsj2,xs2,shp2,kflag)
225 dxsj2=dsqrt(xsj2(1)*xsj2(1)+xsj2(2)*xsj2(2)+
242 nodes(j)=konf(indexe+ifacet(j,j1))
244 xl2(k,j)=co(k,
nodes(j))
245 cofa(k,i)=cofa(k,i)+xl2(k,j)
249 cofa(k,i)=cofa(k,i)/3.d0
254 call shape3tri(xi,et,xl2,xsj2,xs2,shp2,kflag)
258 dxsj2=dsqrt(xsj2(1)*xsj2(1)+xsj2(2)*xsj2(2)+
268 index1=ipnei(iel1)+j1
270 xxn(k,index1)=xsj2(k)/dxsj2
271 xxi(k,index1)=cofa(k,i)-coel(k,iel1)
272 rf(k,i)=xxi(k,index1)
277 xle(index1)=dsqrt(xxi(1,index1)**2+xxi(2,index1)**2+
280 xxi(k,index1)=xxi(k,index1)/xle(index1)
285 cosa(index1)=xxn(1,index1)*xxi(1,index1)+
286 & xxn(2,index1)*xxi(2,index1)+
287 & xxn(3,index1)*xxi(3,index1)
294 index2=ipnei(iel2)+neij(index1)
298 if(ifatie(i).eq.0)
then 303 xxi(k,index2)=cofa(k,i)-coel(k,iel2)
304 xxn(k,index2)=-xxn(k,index1)
307 xle(index2)=dsqrt(xxi(1,index2)**2+xxi(2,index2)**2+
310 xxi(k,index2)=xxi(k,index2)/xle(index2)
315 cosa(index2)=xxn(1,index2)*xxi(1,index2)+
316 & xxn(2,index2)*xxi(2,index2)+
317 & xxn(3,index2)*xxi(3,index2)
322 xlen(index1)=xle(index2)
323 xlen(index2)=xle(index1)
326 xxj(k,index2)=coel(k,iel1)-coel(k,iel2)
332 xlet(index1)=dsqrt(xxj(1,index2)**2+xxj(2,index2)**2
334 xlet(index2)=xlet(index1)
339 xxj(k,index2)=xxj(k,index2)/xlet(index2)
340 xxj(k,index1)=-xxj(k,index2)
345 cosb(index2)=xxn(1,index1)*xxj(1,index1)+
346 & xxn(2,index1)*xxj(2,index1)+
347 & xxn(3,index1)*xxj(3,index1)
348 cosb(index1)=cosb(index2)
357 xlen(index2)=xle(index1)
365 if(tieset(1,itie)(81:81).eq.
'Z')
then 367 p(k)=coel(k,iel2)-a(k)
369 dd=p(1)*xn(1)+p(2)*xn(2)+p(3)*xn(3)
374 if(ifatie(i).gt.0)
then 380 q(k)=c(k,1)*p(1)+c(k,2)*p(2)+c(k,3)*p(3)
388 q(k)=c(1,k)*p(1)+c(2,k)*p(2)+c(3,k)*p(3)
402 xxj(k,index1)=coel(k,iel2)-coel(k,iel1)
409 xlet(index1)=dsqrt(xxj(1,index1)**2+xxj(2,index1)**2
415 xxj(k,index1)=xxj(k,index1)/xlet(index1)
420 cosb(index1)=xxn(1,index1)*xxj(1,index1)+
421 & xxn(2,index1)*xxj(2,index1)+
422 & xxn(3,index1)*xxj(3,index1)
434 dd=rf(1,i)*xxj(1,index1)+
435 & rf(2,i)*xxj(2,index1)+
436 & rf(3,i)*xxj(3,index1)
439 rf(k,i)=rf(k,i)-dd*xxj(k,index1)
442 xrlfa(2,i)=dd/xlet(index1)
443 xrlfa(1,i)=1.d0-xrlfa(2,i)
449 xxj(k,index1)=xxi(k,index1)
451 cosb(index1)=cosa(index1)
468 x13(k)=coel(k,iel1)-coel(k,iel3)
471 xl13=dsqrt(x13(1)*x13(1)+x13(2)*x13(2)+x13(3)*x13(3))
477 dd=rf(1,i)*x13(1)+rf(2,i)*x13(2)+rf(3,i)*x13(3)
480 rf(k,i)=rf(k,i)-dd*x13(k)
484 xrlfa(1,i)=1.d0-xrlfa(3,i)
504 if(ipkonf(i).lt.0) cycle
505 if(lakonf(i)(1:1).ne.
'F') cycle
508 do j=1,ipnei(i+1)-ipnei(i)
509 iface=neifa(indexf+j)
511 & area(iface)*cofa(1,iface)*xxn(1,indexf+j)
520 read(lakonf(i)(4:4),
'(i1)') nope
523 xl(k,j)=co(k,konf(indexe+j))
528 dmin=
min(dmin,(xl(1,ied4(1,j))-xl(1,ied4(2,j)))**2+
529 & (xl(2,ied4(1,j))-xl(2,ied4(2,j)))**2+
530 & (xl(3,ied4(1,j))-xl(3,ied4(2,j)))**2)
532 elseif(nope.eq.6)
then 534 dmin=
min(dmin,(xl(1,ied6(1,j))-xl(1,ied6(2,j)))**2+
535 & (xl(2,ied6(1,j))-xl(2,ied6(2,j)))**2+
536 & (xl(3,ied6(1,j))-xl(3,ied6(2,j)))**2)
540 dmin=
min(dmin,(xl(1,ied8(1,j))-xl(1,ied8(2,j)))**2+
541 & (xl(2,ied8(1,j))-xl(2,ied8(2,j)))**2+
542 & (xl(3,ied8(1,j))-xl(3,ied8(2,j)))**2)
551 if(iturbulent.gt.0)
then 553 if(dabs(physcon(5)).le.0.d0)
then 554 write(*,*)
'*ERROR in initialcfd: velocity at infinity' 555 write(*,*)
' is nonpositive;' 556 write(*,*)
' wrong *VALUES AT INFINITY' 560 if(dabs(physcon(7)).le.0.d0)
then 561 write(*,*)
'*ERROR in initialcfd: density at infinity' 562 write(*,*)
' is nonpositive;' 563 write(*,*)
' wrong *VALUES AT INFINITY' 567 if(dabs(physcon(8)).le.0.d0)
then 568 write(*,*)
'*ERROR in initialcfd: length of the ' 569 write(*,*)
' computational domain is nonpositive;' 570 write(*,*)
' wrong *VALUES AT INFINITY' 583 if(lakonf(nelem)(4:4).eq.
'8')
then 585 node=konf(indexe+ifaceq(j,jface))
590 elseif(lakonf(nelem)(4:4).eq.
'6')
then 593 node=konf(indexe+ifacew(j,jface))
600 node=konf(indexe+ifacew(j,jface))
608 node=konf(indexe+ifacet(j,jface))
618 if((lakonf(nelem)(4:4).eq.
'8').or.
619 & ((lakonf(nelem)(4:4).eq.
'6').and.(jface.gt.2)))
then 625 xs(j,1)=-xl(j,1)+xl(j,2)+xl(j,3)-xl(j,4)
626 xs(j,2)=-xl(j,1)-xl(j,2)+xl(j,3)+xl(j,4)
631 aa=xs(2,1)*xs(3,2)-xs(3,1)*xs(2,2)
632 bb=xs(1,2)*xs(3,1)-xs(3,2)*xs(1,1)
633 cc=xs(1,1)*xs(2,2)-xs(2,1)*xs(1,2)
634 dd=dsqrt(aa*aa+bb*bb+cc*cc)
638 dd=-(aa*(xl(1,1)+xl(1,2)+xl(1,3)+xl(1,4))
639 & +bb*(xl(2,1)+xl(2,2)+xl(2,3)+xl(2,4))
640 & +cc*(xl(3,1)+xl(3,2)+xl(3,3)+xl(3,4)))/4.d0
647 xs(j,1)=-xl(j,1)+xl(j,2)
648 xs(j,2)=-xl(j,1)+xl(j,3)
653 aa=xs(2,1)*xs(3,2)-xs(3,1)*xs(2,2)
654 bb=xs(1,2)*xs(3,1)-xs(3,2)*xs(1,1)
655 cc=xs(1,1)*xs(2,2)-xs(2,1)*xs(1,2)
656 dd=dsqrt(aa*aa+bb*bb+cc*cc)
660 dd=-(aa*xl(1,1)+bb*xl(2,1)+cc*xl(3,1))
667 if(lakonf(nelem)(4:4).eq.
'8')
then 669 node=konf(indexe+iopp8(j,jface))
671 & +cc*co(3,node)+dd))
673 elseif(lakonf(nelem)(4:4).eq.
'6')
then 676 node=konf(indexe+iopp6(j,jface))
678 & +cc*co(3,node)+dd))
682 node=konf(indexe+iopp6(j,jface))
684 & +cc*co(3,node)+dd))
688 node=konf(indexe+iopp8(1,jface))
690 & +cc*co(3,node)+dd))
701 xxni(k,i)=xxn(k,i)-xxi(k,i)
702 xxnj(k,i)=xxn(k,i)-xxj(k,i)
703 xxicn(k,i)=xxi(k,i)-cosa(i)*xxn(k,i)
subroutine shape3tri(xi, et, xl, xsj, xs, shp, iflag)
Definition: shape3tri.f:20
#define min(a, b)
Definition: cascade.c:31
subroutine stop()
Definition: stop.f:20
static double * dist
Definition: radflowload.c:42
subroutine shape4q(xi, et, xl, xsj, xs, shp, iflag)
Definition: shape4q.f:20
subroutine nodes(inpc, textpart, co, nk, nk_, set, istartset, iendset, ialset, nset, nset_, nalset, nalset_, istep, istat, n, iline, ipol, inl, ipoinp, inp, ipoinpc)
Definition: nodes.f:22