Page 387 - Handbook Of Multiphase Flow Assurance
P. 387
386 10. Research methods in flow assurance
endif
C
return
end
C
C-------------------------------------------------------------------
C
c Subroutine Initrotate(A1,A2,A3,v1,v2,v3,alpha)
Subroutine Initrotate
implicit real*8 (a-h,o-z)
COMMON /POTPAM/ Casqof,Co,Rsqon,Rsqoff,Rcut,Pi,Tk,Temp
common /rotate/ A1,A2,A3,v1,v2,v3,alpha
common /matrix/ r11,r12,r13,r21,r22,r23,r31,r32,r33,r41,r42,r43
c
cal=dcos(alpha)
sal=dsin(alpha)
cal1=1.d0-cal
rho=dsqrt((v1-a1)*(v1-a1)+(v2-a2)*(v2-a2)+(v3-a3)*(v3-a3))
if(rho.eq.0.d0) then
theta=0.d0
cph=1.d0
sph=0.d0
else
if(v1.eq.a1) then
if(v2.ge.a2) theta=0.5d0*pi
if(v2.lt.a2) theta=1.5d0*pi
else
theta=datan((v2-a2)/(v1-a1))
if(v1.lt.a1) theta=theta+pi
endif
cph=(v3-a3)/rho
sph=dsqrt(1.d0-cph*cph)
endif
cth=dcos(theta)
sth=dsin(theta)
cph2=cph*cph
sph2=1.d0-cph2
cth2=cth*cth
sth2=1.d0-cth2
r11=(cal*cph2+sph2)*cth2+cal*sth2
r12=sal*cph+cal1*sph2*cth*sth
r13=sph*(cph*cth*cal1-sal*sth)

