Page 429 - Handbook Of Multiphase Flow Assurance
P. 429

428                          10.  Research methods in flow assurance

                         y1(i)=y1(i)+1.D0
                         x2(i)=x2(i)-1.D0
                         y2(i)=y2(i)+1.D0
                         x3(i)=x3(i)-1.D0
                         y3(i)=y3(i)+1.D0
                       endif
                      end do
                 C modify the number of molecules in [110] slice
                      npts=npts + npts

                 C reorient the basic [110] block to align the top [110] surface with
                 C the x-y plane at position z=0 and with center at x=0, y=0
                      do i=1, npts
                 C shift the block down by 1/2 unit cell to put block center at 000
                        z1(i)=z1(i)-0.5D0
                        z2(i)=z2(i)-0.5D0
                        z3(i)=z3(i)-0.5D0
                 C rotate the [110] block around Z for +45 degrees
                        tempx=x1(i)
                        x1(i)= x1(i)*DCOS(Pi/4.D0)+y1(i)*DSIN(Pi/4.D0)
                        y1(i)=-tempx*DSIN(Pi/4.D0)+y1(i)*DCOS(Pi/4.D0)
                        tempx=x2(i)
                        x2(i)= x2(i)*DCOS(Pi/4.D0)+y2(i)*DSIN(Pi/4.D0)
                        y2(i)=-tempx*DSIN(Pi/4.D0)+y2(i)*DCOS(Pi/4.D0)
                        tempx=x3(i)
                        x3(i)= x3(i)*DCOS(Pi/4.D0)+y3(i)*DSIN(Pi/4.D0)
                        y3(i)=-tempx*DSIN(Pi/4.D0)+y3(i)*DCOS(Pi/4.D0)
                 C rotate the [110] block around Y for -90 degrees
                        D=-Pi/2.D0
                        tempx=x1(i)
                        x1(i)= x1(i)*DCOS(D)+z1(i)*DSIN(D)
                        z1(i)=-tempx*DSIN(D)+z1(i)*DCOS(D)
                        tempx=x2(i)
                        x2(i)= x2(i)*DCOS(D)+z2(i)*DSIN(D)
                        z2(i)=-tempx*DSIN(D)+z2(i)*DCOS(D)
                        tempx=x3(i)
                        x3(i)= x3(i)*DCOS(D)+z3(i)*DSIN(D)
                        z3(i)=-tempx*DSIN(D)+z3(i)*DCOS(D)
                 C shift the block down by sqrt(2)/2 unit cell to locate top at z=0
                        z1(i)=z1(i)-0.5D0*DSQRT(2.D0)
                        z2(i)=z2(i)-0.5D0*DSQRT(2.D0)
                        z3(i)=z3(i)-0.5D0*DSQRT(2.D0)
                 C shift the block by 1/2 unit cell to locate edge at x=0
                        x1(i)=x1(i)+0.5D0
                        x2(i)=x2(i)+0.5D0
   424   425   426   427   428   429   430   431   432   433   434