+ All Categories
Home > Documents > A Com Put Able Algorithm for Ensuring Segregation in a Complex Piping Network

A Com Put Able Algorithm for Ensuring Segregation in a Complex Piping Network

Date post: 06-Apr-2018
Category:
Upload: lewist57
View: 216 times
Download: 0 times
Share this document with a friend

of 6

Transcript
  • 8/2/2019 A Com Put Able Algorithm for Ensuring Segregation in a Complex Piping Network

    1/6

    J. Opf Res. Soc. Vol. 39, No.1, pp. 55--60, 1988Printed in Great Britain. All rights reserved 0160-5682/88 $3.00 +0.00Copyright 1988 OJ'lerational Research Society Ltd

    A Computable Algorithm for EnsuringSegregation in a Complex Piping Network

    J. C. HINESFaculty of Mathematical Studies, University of Southampton

    Given a number of proposed routes through a large network of pipes and valves, it was desired to testwhether each route was separated from all others by at least two closed valves. An algorithm to test agiven combination of valves settings is described. It has been coded in two different computer languages.Key words: computer, data-base, network, piping, segregation

    BACKGROUNDThe problem is concerned with a large and complex piping network inside a petrochemical plant.The network is used for moving a number of liquefied hydrocarbon gases, and the terminatingpoints consist of the storage vessels, processing plants and links outside the plant, such as roadand rail loading equipment and the marine terminal. There are sufficient linkages that it is possibleto connect any terminating point with any other, and the variety of operations is such that a verylarge number of these options are used. The problem is made more complex because manymovements are taking place simultaneously. When a movement has been completed, that part ofthe network can be emptied and used, in part or in whole, for some other movement.The task of the operating group requires that they select a route for each movement whichprovides complete segregation from all other movements. The hydrocarbon streams are of highvalue, and any mixing is liable to decrease their value. This problem would be trivial if valves neverleaked, because the existence of a single dosed valve in every line connecting two routes wouldbe sufficient to ensure complete segregation. As commercial valves may leak slightly when dosed,it has been normal practice to define complete segregation as meaning at least two dosed valvesin series between any two movements at every possible connection. This makes the problem moredifficult.The complexity of the network is such that mistakes are sometimes made. I t was thereforeproposed that some system should be evolved which would detect all cases where there wasinsufficient segregation. The intention was that the user should be able to test planned routeingsbefore implementing them, and errors detected.

    DEFINITIONSFor the purposes of the algorithm which is about to be described, some definitions will beconvenient. A valve is regarded as being part of a stream if the material can flow through it. Thusa valve can be part of a stream only if it is open. I t is regarded as being connected to a stream

    if only one flange is wetted by it and is therefore dosed. Thus a valve which is part of more thanone stream represents a cross-over, and a valve which is connected to two streams represents singlevalve separation. These are the only two error coftditions which can exist. A valve is regarded asbeing an original member of a stream if it was used to define the route of that stream in the firstplace. I t is not an original member if it is found to be part of the stream later.

    TWO SUB-PROBLEMSThe problem subdivides into two sub-problems. One is to evolve some way of organizing thedata which describes the network and the streams, and the other is to evolve the processingalgorithm which will handle the data.

    55

  • 8/2/2019 A Com Put Able Algorithm for Ensuring Segregation in a Complex Piping Network

    2/6

    Journal of the Operational Research Society Vol. 39, No. 1THE NOTATION AND COMPUTER LANGUAGE

    It was recognized from the beginning that the algorithm would ultimately be coded in a comlanguage. It was also recognized that it would be desirable to select a language which was inuse in the company so that the ability to do maintenance or enhancement work would nrestricted to a few individuals. This in itself suggested a data notation and organization bethe major language already in use handles relational data-bases. The data were therefore orgainto tables in third normal form. The programming could have been done using conventprogramming in lower-level languages like COBOL or FORTRAN, but the effort and time whave been much greater.This is not the proper place for a treatise on data-bases, relational algebra or third normal These are covered by Date! and Martin. 2 There is a further advantage of using a high-level language which is used in the algorithmmay not be generally familiar. Some computer languages do not permit a variable to exist wihaving a value. For example, a numerical variable may be automatically initialized to a valzero until the program overrides it. Some languages do not have this limitation. It is possibdeclare the existence of a variable without assigning a value to it, or even to remove a valuhave it unassigned, much as a pigeon-hole can contain a message but does not have to coone in order to exist.

    THE NETWORK DESCRIPTIONIf we consider the network when completely empty and with no streams passing throuconsists only of valves and of connections. The valves can be open or closed. At this staappears that the system can be defined using only two tables.

    Valve-identifier, valve statusV alve-identifier, connected-valve-identifier

    This uses the convention that the keyes) of the table (=file) are underlined. Thus it is neceonly to specify the valve identifier to determine whether a valve is open or closed. Theredifficulty with the second table. If there is a connection between two valves, say those witidentifiers 1 and 2, it could be defined by making an entry of 1, 2 in the second table or anof 2, 1. Thus the absence of an entry 1, 2 would not necessarily mean that there is no connebetween the two valves. Providing both entries would obviously be tautology. The problemovercome by distinguishing between the two keys of that table, so that it became

    Smaller-valve- identifier, Larger-valve-iden tifier,where smaller and larger refer to the value of the identifier, not the size of the valve. Tconnection between values 1 and 2 is shown by an entry of 1, 2, and an entry of 2, 1 becimpossible.

    THE ROUTEING DESCRIPTIONI t would be possible to define the routeings through the network merely by including a fie

    the valves table which contains the identity of the stream to which the valve is attached. Thithe drawback of providing a sequence which is unordered with respect to the streams.For example, a valves table might look like:

    Valve-identifier12478

    13

    Valve-statusOpenClosedClosedOpenOpenOpen56

    Stream212

  • 8/2/2019 A Com Put Able Algorithm for Ensuring Segregation in a Complex Piping Network

    3/6

    J. C. H i n e s ~ S e g r e g a t i o n in a Complex Piping NetworkNote that the values of valves 2, 4 and 13 are not set; that is, the table 'does not know' whetherthe valves are part of a stream or not.The algorithm needs to be able to say that some valves are part of, or connected to, a stream,even though they were not specified as such at the outset. It will therefore change the contents ofthe stream column of the valves table for some rows as it proceeds. It might have been possibleto arrange a processing sequence using such a table, which would have ensured the explorationof all connections to valves which were found to be part of a stream. However, it was judged tobe rather confusing to have to jump to and fro through such a table. The same objection appliesto a table of the form:

    Stream-identifier, Valve-identifieras a new entry might be inserted either before or after the valve being c o n s i d ~ r e d at the time ofprocessing.The solution adopted was to use a table with the structure

    Stream-identifier, Seguence-number, Valve-identifier.It is not necessary for the sequence numbers to indicate the flow sequence. They are merely toensure that any new valve is added by the algorithm at the end of the list for that stream.

    ADDITIONAL VALVE DATAAs the object of the exercise is to detect valves which represent errors, by virtue of being singleclosed-valve separations or of being cross-overs (no closed valve), it is desirable to include a

    field in the valve table which will contain the error, if one exists. For the sake of the user, afurther field is included which flags whether the stream was originally defined by him as partof the stream or whether it was marked subsequently by the processing algorithm. This is notneeded by the algorithm itself, but can help the user to trace the reason for an error. This can beuseful where there is a long unplanned link between two streams, as only one valve in it willbe marked.Thus the valve table now becomes:

    Valve-identifier, valve-status, stream-identifier, original-member, error.Of these, the last three fields should start empty before any processing is done. If the computerlanguage employed provides for a null field, this can be used; otherwise some unambiguous markermeaning that there is nothing there can be used.

    USER INPUTThe user must specify his candidate routeings by loading the stream table with the streamo identifier, the sequence number and the valve identifier. It is not necessary, although it may beconvenient, that the valves should be specified in any particular order. It is necessary that the valvesin a stream should be kept together and in ascending order of sequence number.

    THE PROCESSING ALGORITHMHaving defined the data by reference to its needs, the time has come when the details of the

    algorithm must be exposed. The basic concept is to proceed through the network, just as a streammight, examining each part of the network in turn, until brought up everywhere by reaching closedvalves or other streams. So, considering any valve which is already known to be part of a stream,the procedure is as follows.Find the first valve connected to the valve being considered. If it is already marked as being partof, or connected to, the same stream, there is no problem, and no further processing is necessary.If the connected valve has not been looked at before, it will not have any value assigned to thecolumn for its stream. This column should therefore be set with the identifier of the stream beingconsidered. If the valve is open, it is also part of the stream, and valves on the far side of it must

    57

  • 8/2/2019 A Com Put Able Algorithm for Ensuring Segregation in a Complex Piping Network

    4/6

    Journal of the Operational Research Society Vol. 39, No.1

    o

    o8

    o 4C 5

    2o

    o9

    o 6o 7

    FIG. 1. The demonstration network.

    3o

    o10

    also be considered. The algorithm must therefore add this valve to the stream table, and this enthat the valves connected to it will be examined in due course.This is the reason for the structure of the stream table. I t makes it possible to find the lastin the stream table which is part of the same stream, and to create a new entry with a seqnumber one larger. The new entry will be inserted at this point. Processing then returns to thewhere it was.If the algorithm finds a valve whose stream is already set with a stream identifier whichthe same as that of the stream being considered, it is clearly an error. I t should not be poto arrive at the same valve from two different streams. I f he valve is open, it represents a cross

    if it is closed, it represents a single valve separation. In either case, the error field of the vaset, and processing continues with the next valve connected to the subject valve in the stream. Wthis is finished, it proceeds through all the remaining valves which are part of the stream, whoriginally defined as such or not. Each stream is processed in turn.

    AN EXAMPLEConsider the very simple network shown in Figure 1. This contains 10 valves, whose idenand status are shown. In fact, only valve 5 is closed. The connections table for this network is sin Table 1. The user specifies that stream A shall pass through valves 1, 2, 3, and that streshall pass through valves 9, 8, 10. These are put in an odd sequence merely to demonstratit does not affect the basic workings of the algorithm. These are marked as originally part ofrespective streams, but valves 4, 5, 6, 7 are not yet marked at all.Processing starts with valve 1. This is connected to valve 2, but this is part of the same s

    so nothing need be done. Valve 1 is also connected to valve 4, and this has not been markedany stream identifier. I t is therefore marked. As valve 4 is open, it is part of the stream, so aentry is made in the stream table, reading A, 4, 4.Processing now continues with valve 2. This is connected to valve 3, which presents no proand to valve 4, which is now already marked with stream identifier A. Valve 2 is also connto unmarked valve 6, which is therefore marked with stream identifier A. Valve 6 is opeanother entry is made to the stream table, reading A, 5,6. Valve 3 adds nothing to the informso processing continues with the fourth in sequence of the valves in stream A, i.e. valve 4

    TABLE 1. Connections tableSmaller- Larger-valve-identifier valve-identifier

    I 2I 42 32 42 63 64 55 85 96 77 97 108 99 1058

  • 8/2/2019 A Com Put Able Algorithm for Ensuring Segregation in a Complex Piping Network

    5/6

    1. C. Hines-Segregation in a Complex Piping NetworkTABLE 2. Original content of stream table

    Stream-identifier Sequence no. Valve-identifierA I IA 2 2A 3 3B I 9B 2 8B 3 10

    is connected to valves 1 and 2, but these are already marked with stream identifier A, so noaction is required. Valve 4 is also connected to valve 5, and this has no stream marking. I t istherefore marked but, as it is closed, it is not part of the stream and it is not added to thestream table.The next valve, 6, does nothing to valves 2 and 3 but is connected to valve 7, and so marks itand creates yet another entry in the stream table. Valve 7 itself is the next to be processed, passesby valve 6 but now encounters valve 9, which is already marked as belonging to stream B. Valve7 is therefore marked as a cross-over error. The connection from valve 7 to valve 10 changesnothing, so the processing of stream A is complete.Starting with the first valve in stream B, valve 9, we come to valve 5. This is already markedas connected to stream A, but it is closed. We have therefore arrived at the same valve by twodifferent routes. Valve 5 is marked as a single separation. Note that processing must have arrivedat a different side of valve 5 this time because all the routes of stream A were explored fully beforestarting on stream B. If the new entries had been put at the end of the table, it would be possibleto arrive at the same side of a closed valve by two different routes, and so class it as a single-valveseparation, even though there may be many closed valves on the 'far' side of it (Table 2).Processing valves 8 and 10 adds no new information, so the final form of the valve table is shownin Table 3. Valve 3 has been marked with a 1 as a single-valve separation, and valve 7 as the valveat which the cross-over between the two streams was detected. Valves 4, 5, 6 have been markedas valves which are part of a stream but not originally declared as such, but valve 5, althoughconnected to valve A and a single-valve separation from an unidentified other stream, is not markedas either originally part or not originally part of any stream.COMPUTER IMPLEMENTATIONS

    The algorithm has been coded and tested in two languages. One is NOMAD2, the relationaldata-base manager owned by Dun and Bradstreet Computing Services; the other is Knowledgemanfrom Micro Data Base Systems Inc., which runs on an IBM Personal Computer. It would bepossible to code it in many other languages, but the ease with which a search through a table forthe right record can be written made these attractive.OTHER POSSIBILITIES

    The original real problem involves a network which is sufficiently large (around 600 valves and2000 connections) that lists of the tables will be daunting to a user. I t was therefore intended tobe linked to a graphical display system which includes zooming, panning and scrolling, so that theTABLE 3. Final form of valve table

    Valve-identifier Status Stream Originally-part ErrorI 0 A Y2 0 A Y3 0 A Y4 0 A N5 C A6 0 A N7 0 A N X8 0 B Y9 0 B Y10 0 B Y

    59

  • 8/2/2019 A Com Put Able Algorithm for Ensuring Segregation in a Complex Piping Network

    6/6

    Journal of the Operational Research Society Vol. 39, No.1user can see the network with the errors highlighted by changing the colours in which theare displayed. The user can alter the drawing to 'open' or 'close' valves, and the data a r ~ thento the processing algorithm for another cycle until the user is satisfied. This is a topic ointerest to computer scientists, and need not be pursued here.Operational research is more concerned with optimizing, and it would be possible to loan optimum route if such could be defined. One possible definition is to look for the rbetween two defined terminations which does not prejudice any of the existing routeings andinvolves changing the minimum number of valves. It could be argued that this is a short-strategy, and that it would be preferable to find the solution which maximizes the flexibilitystill more routes. This definition lacks precision but is 'likely to be one with greater appealeast some of the users of the algorithm. In any case, it is left to other workers to devel

    REFERENCES1. C. J. DATE, An Introduction to Data-Base Systems, Addison-Wesley, Reading, Mass.2. J. MARTIN, Computer Data-Base Organisation. Prentice-Hall, Englewood Cliffs, N.J.

    60


Recommended