Page 356 - Handbook Of Multiphase Flow Assurance
P. 356
Computer code (Makogon, 1994, 1997) 355
begin
start1:=rin[k−1];
start2:=rin[k+1];
end;
end;
{search for bonds starting sh. circt}
nstart:=0;
for is:=1 to n do
begin
if (nhb[is,1]=start) then
if ((nhb[is,2]<>start1)and(nhb[is,2]<>start2)) then
begin {found such bond}
nstart:=nstart+1;
sbond[nstart]:=is; {record new starting bond}
end;
if (nhb[is,2]=start) then
if ((nhb[is,1]<>start1)and(nhb[is,1]<>start2)) then
begin {found such bond}
nstart:=nstart+1;
sbond[nstart]:=is; {record new starting bond}
end;
end; {search for bonds starting sh. circ.}
for is:=1 to nstart do
begin {search continuation of start bonds}
for js:=1 to nmax div 2 do
begin {reset temporary variables}
srin[js]:=0;
sbonds[js]:=0; {reset list of bonds in short circuit}
srinn[js]:=false;
srinm[js]:=0;
end;
ns:=1;
srin[ns]:=start;
sbonds[ns]:=sbond[is];
snext:=nhb[sbond[is],1];
if snext=start then
snext:=nhb[sbond[is],2];
{If length of short-circuit is same as dist, then
only point snext >start1 and/or snext > start2 can yield a successful
short circuit. Check if ring halves are of different or same size
(if nr odd −>halves can't be equal in size, even−>can be equal halves)
and compare snext to start1,2 of shorter or of both halves of the ring.
Then proceed as in main routine until ns>=dist or found finish.}