Page 391 - Handbook Of Multiphase Flow Assurance
P. 391
390 10. Research methods in flow assurance
IF (Xij .LT.-xmaxh) Xij = Xij + xmax
endif
if(ap.eq.2) then
C We are using [111] surface - rhombic boundaries
if (Yij .GT. ymaxh) then
Yij = Yij - ymax
Xij = Xij - xmaxh
endif
if (Yij .LT.-ymaxh) then
Yij = Yij + ymax
Xij = Xij + xmaxh
endif
IF (Xij .GT. xmaxh) Xij = Xij - xmax
IF (Xij .LT.-xmaxh) Xij = Xij + xmax
endif
Rsq = Xij*Xij + Yij*Yij + Zij*Zij
Rij = DSQRT(Rsq)
Ecou = Co*Qi*atomdata(natom1,4)/Rij
C collect cutoff-dependent interactions
IF (Rij .LE. Rcut) THEN
C set itype for SPC water hydrogen
itype=5
C if oxygen, set itype for SPC water oxygen
if(i.eq.3)itype=6
R6red = (RR(Itype,natom1)*RR(Itype,natom1)/Rsq)**3
Elj = DD(Itype,natom1)*R6red*(R6red - 2.D0)
C
C ... collect hydrogen-bond interaction, if applicable
IF (iatomtype(natom1,1).eq.3) THEN
IF (I.EQ.3.and.Rsq.LT.Rsqoff) CALL HBOND(Xi,Yi,Rsq,Iw,J,Ehb)
ENDIF
C end of collecting cutoff-dependent interactions
ENDIF
Ener = Ener + Ecou + Elj + Ehb
20 CONTINUE
Esurf(j)=Esurf(j)+Ener
end do
end do
C
Epold=0.D0
do 50 i=1,nbackbone-2
do 50 j=i+2,nbackbone
50 Epold=Epold+Epoly(i,j)

