Page 365 - Handbook Of Multiphase Flow Assurance
P. 365

364                          10.  Research methods in flow assurance

                    end;                                {end of j–loop}
                   if(not found)and(nr<nmax) then
                    begin
                    nr:=nr+1;
                    closed:=false;
                    rin[nr]:=nnext;
                    Choice;
                    end;

                 1:if found and (nr<nmax) then           {found next link – exit j–loop}
                    begin
                    if nr>=2 then                       {if more than 2 molecules, }
                      begin                             {then check for ring closure}
                      closed:=false;
                      for j:=1 to n do
                        if ((nhb[j,1]=rin[1])and(nhb[j,2]=nnext))or
                            ((nhb[j,2]=rin[1])and(nhb[j,1]=nnext)) then
                          begin
                          closed:=true;                 {nnext closed ring, add it to rin}
                          nbond:=j;
                          nr:=nr+1;
                          rin[nr]:=nnext;
                          bonds[nr]:=nbond;
                          Choice;
                          end;
                      end;

                    short:=false;                       {check for ring short–cicuitedness}
                    if closed and(nr>3) then            {for rings of size 4 or more}
                      begin
                      npass:=0;
                      for j:=1 to nr do                 {count number of passes through PBC}
                        if pass[bonds[j]]<>0 then
                          npass:=npass+1;
                      if npass=1 then short:=true;      {one pass means ring is pass–chain}
                      if npass=2 then
                        begin
                      npb:=false;
                      for j:=1 to nr do
                        if pass[bonds[j]]<>0 then
                         if npb then
                            npass2:=pass[bonds[j]]
                          else
                            begin
                            npb:=true;
   360   361   362   363   364   365   366   367   368   369   370