Page 359 - Handbook Of Multiphase Flow Assurance
P. 359

358                          10.  Research methods in flow assurance

                                if rin[ks]=nhb[js,2] then
                                  snothere:=false;
                            if snothere then
                              begin                   {new point in short circuit found}
                              sfound:=true;
                              ns:=ns+1;
                              srin[ns]:=snext;        {write to short circuit array}
                              sbonds[ns]:=js;         {write to short circ. bonds list}
                              snext:=nhb[js,2];       {define next atom for search}
                              goto S2;
                              end;
                            end;
                          if nhb[js,2]=snext then
                            begin                     {another atom in bond fits}
                            snothere:=true;
                            for ks:=2 to ns do        {see if link was found already}
                              if srin[ks]=nhb[js,1] then
                                snothere:=false;
                            for ks:=1 to pf−1 do      {see if link is in the ring}

                              if rin[ks]=nhb[js,1] then
                                snothere:=false;      {avoiding test of finish position}
                            if pf <> nr then
                              for ks:=pf+1 to nr do
                                if rin[ks]=nhb[js,1] then
                                  snothere:=false;
                            if snothere then
                              begin                   {new point in short circuit found}
                              sfound:=true;
                              ns:=ns+1;
                              srin[ns]:=snext;        {write to short circuit array}
                              sbonds[ns]:=js;         {write to short circ. bonds list}
                              snext:=nhb[js,1];       {define next atom for search}
                              goto S2;
                              end;
                            end;
                          end;                        {end of loop on js over all bonds}
                    if (not sfound)and(ns<dist) then  {**may have problem here later}
                      begin
                      ns:=ns+1;
                      srin[ns]:=snext;
                      end;
                 S2:
                    if (snext=finish) and (ns=dist) and proceed then
                      begin
   354   355   356   357   358   359   360   361   362   363   364