Patent Publication Number: US-2003225533-A1

Title: Method of detecting a boundary of a fluid flowing through a pipe

Description:
FIELD OF THE INVENTION  
       [0001] The present invention relates to a method of detecting a boundary of a fluid flowing through a pipe particularly but not exclusively to a method of detecting a slug in a pipeline.  
       BACKGROUND ART  
       [0002] The development of slugs in the oil, gas and water liquid mixture flow in multi-phase pipelines is a major and expensive problem for all oil producers. In particular, the development of slugs of liquid in the riser of multi-phase pipelines of an oil platform has a negative impact on the operation of offshore production facilities. Severe slugging can cause pollution, platform trips and plant shut down. In general, large and rapid flow changes cause overload of the fixed size catcher and separator resulting in spillage and pollution, unwanted flaring and reduce the operating capacity of the separation and compression units. This results from the relative small size of the catcher, often only 25 to 500 barrels, the need to allow larger margins for the fixed size separator, to meet the product specification, and the compression unit and to ensure safe operation with minimal flaring. Reducing the output of an oil rig or platform from its optimum for any or all of these in order to accommodate slugging flow reduces its output at the expense of revenue.  
       [0003] The slug flow starts with oil and water accumulating in the well. Gas collects behind a growing slug causing an increase in pressure such that the slug is forced to move followed by the gas. This flow appears in the horizontal pipeline as an intermittent, accelerating, concentrated mass which leaves the riser and accelerates/travels along the horizontal multi-phase flow pipeline to the limited size catcher and beyond.  
       [0004] Real time detection of slugs in their various forms has proved to be extremely difficult. The density of the pipeline contents can be measured continuously, resulting in a data stream, using a gamma ray densitometer. However, the detection of the front and rear of passing slugs within the pipeline flow, and therefore the density data streams, has previously proved an intractable problem.  
       [0005] The present invention seeks to provide a method of detecting slugs and thus help improve slug catching.  
       SUMMARY OF THE INVENTION  
       [0006] According to the present invention as provided a method of detecting a boundary of fluid flowing through a pipe, a method comprising receiving a time-varying signal corresponding to changes in content flowing through the pipe, analysing the signal in the time domain, the analysing including processing the signal to produce a processed signal, searching the processed signal for a predetermined feature so as to identify a location of the boundary if the predetermined feature is found.  
       [0007] The method may further comprise receiving another signal corresponding to changes in content flowing through the pipe, analysing the signal in a time domain the analysing including processing the another signal to produce another process signal, searching the another process signal for another predetermined feature so as to identify another location of the boundary if the another predetermined feature is found. The receiving of the signal and the another signal may comprise arranging first and second devices for producing the signals at positions along the pipe separated by a known distance.  
       [0008] The method may further comprise deriving a velocity of the boundary of the fluid from the first and second locations. Processing the signal may comprise amplifying the signal to produce an amplified signal, smoothing the amplified signal to produce a smooth signal, differentiating the smooth signal to produce a differentiated signal, further amplifying the differentiated signal to produce a processed signal. A further amplifying the differentiated signal may comprise squaring the differentiated signal while preserving a sign of the differentiated signal. Searching for the predetermined feature may include identifying locations where the processed signal has zero amplitude. Searching for the predetermined feature may include dividing the processed signal into periods between the locations where the processed signal has zero amplitude and determining a maximum magnitude value for the processed signal in each respective period. Searching for the predetermined feature may include determining a mean and a standard deviation of the maximum magnitude values and identifying which of the maximum magnitude values exceed the sum of the mean and standard deviation. The method may further comprise identifying a first boundary if the predetermined feature is found. The method may further comprise determining whether the first boundary is found within a predetermined time window and whether the first boundary meets a predefined set of criteria. The method may further comprise searching for a second predetermined feature and may include determining a threshold value and identifying where the magnitude of the signal exceeds the threshold magnitude. The method may comprise identifying a second boundary if the second predetermined feature is found. The method may further comprise determining whether the second boundary receives the first boundary. The signal may comprise converting an analogue signal into a digital signal and buffering samples of the digital signal. The analysing of the signal may comprise using a time-encoded signal processing and recognition (TESPAR) process.  
       [0009] Processing the signal may comprise filtering the signal to produce a filtered signal, for example by using a Savitzky Golay filter. Processing the signal may comprise subtracting an offset from the filtered signal so as to produce a signal for zero-crossing analysis. Searching the processed signal for a predetermined feature may include identifying locations where the signal has zero amplitude. Searching for a predetermined feature may include identifying locations where the signal has zero amplitude. Searching for the predetermined feature may further include identifying whether the signal is going from negative to positive. Identifying the location may comprise identifying a first boundary if the predetermined feature is found. The method may further comprise in determining whether the first boundary is found within the predetermined time window and whether the first boundary meets a predefined set of criteria. The method may comprise searching for a second predetermined feature that may comprise identifying the locations has zero amplitude and identifying a second boundary if the second predetermined feature is found. The method may further comprise determining whether the second boundary receives the first boundary. Searching for said predetermined feature may further include identifying whether the signal is going from positive to negative.  
       [0010] Processing the signal may include determining a distribution of magnitudes of the signal. Processing the signal may include filtering the diffuser filter signal such as linear filtering and low pass filtering. Filtering may comprise using a low pass 8 th  order Butterworth filter with a 0.5 Hz cut-off. Processing the signal may include determining a distribution of magnitude of the filtered signal. Processing the signal may include determining an off set for converting the distribution from being unipolar to being bipolar. Processing the signal may include subtracting the offset from the filtered signal to produce an offset signal. Processing the signal may include filtering the offset signal for example using a non-linear filter, in particular a 10 th  order non-linear filter. Processing of the signal to produce a processed signal may comprise removing features from the filtered signal having a short time duration. Removing the features from the filtered may comprise searching the filtered signal and identifying locations where the signal has zero amplitude. Removing the features further includes determining the duration between adjacent locations where the signal has zero amplitude. Removing the features further includes determining sign and amplitude of a signal portion between adjacent locations and adding a further signal of opposite sign and same magnitude to the signal portion if the adjacent locations are separated by less than a predetermined duration. Searching the processed signal for the predetermined feature includes identifying locations where the signal has zero amplitude. Searching for said predetermined feature may further include identifying whether the signal whether the signal is going from negative to positive. Identifying the location may comprise identifying a first boundary if said predetermined feature is found. The method may further comprise determining whether the first boundary is found within a predetermined time window. The method may further comprise determining whether the first boundary is a predetermined set of criteria. The method may comprise searching for a second predetermined feature for example by identifying the locations where the signal has zero amplitude.  
       [0011] According to the present invention, there is also provided a computer program for executing the method.  
       [0012] According to the present invention, there is also provided apparatus for detecting a boundary of fluid flowing through a pipe, the method comprising input for receiving a time-varying signal corresponding to changes in content flowing through the pipe and a processor for analysing said signal in the time domain, the processor being configured to produce a processed signal, to search the processed signal for a predetermined feature and identify a location of the boundary if said predetermined feature is found. 
     
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS  
     [0013] An embodiment of the present invention will now be described, by way of example, with reference to the following drawings in which:  
     [0014]FIG. 1 is a schematic diagram of an oil production facility;  
     [0015]FIG. 2 is a side view of a measurement apparatus and shows the pipeline in cross section;  
     [0016]FIG. 3 shows an end view of the measurement apparatus and shows the pipeline in cross section;  
     [0017]FIG. 4 is a schematic diagram of analyser apparatus;  
     [0018]FIG. 5 shows a window displayed by the analyser apparatus;  
     [0019]FIG. 6 is a processed flow diagram for initialising and running the analyser apparatus;  
     [0020]FIG. 7 is a processed flow diagram for analysing data in a first manner;  
     [0021]FIG. 8 shows a processed signal prior to being analysed;  
     [0022]FIG. 9 illustrates identification of magnitude values for a plurality of epox;  
     [0023]FIG. 10 is a processed flow diagram for analysing data in a second manner;  
     [0024]FIG. 11 illustrates a signal;  
     [0025]FIG. 12 illustrates a signal from which an offset has been subtracted;  
     [0026]FIG. 13 shows zero crossings;  
     [0027]FIG. 14 is a processed flow diagram for analysing data according to a third manner;  
     [0028]FIG. 15 shows a signal;  
     [0029]FIG. 16 shows a distribution and magnitudes of the signal;  
     [0030]FIG. 17 shows a frequency plot of said signal following filtering;  
     [0031]FIG. 18 shows a filtered signal;  
     [0032]FIG. 19 shows a distribution of magnitudes of the filtered signal;  
     [0033]FIG. 20 shows a filtered signal to which an offset has been added;  
     [0034]FIG. 21 shows a non-linear filtered signal;  
     [0035]FIG. 22 shows a distribution of magnitudes of the signal shown in FIG. 21;  
     [0036]FIG. 23 shows the non-linearly filtered signal of FIG. 21 following removal of features having a short duration and  
     [0037]FIG. 24 shows another non-linearly filtered signal obtained from a different signal. 
    
    
     PREFERRED EMBODIMENT OF THE INVENTION  
     [0038] Referring to FIG. 1, a pipeline  1  connects a well (not shown) to an oil receiving facility which includes measurement apparatus  2  and capture tank  3  for catching slugs. The measurement apparatus  2  and capture tank  3  are located on a platform  4  such as an oil rig or recovery vessel. Analyser apparatus  5  is also provided to receive signals from the measurement apparatus  2  so to provide control signals for reporting the state of the capture tank  3 .  
     [0039] Referring to FIG. 2, the measurement apparatus  2  is used to measure changes in content  6  flowing through the pipeline  1 . A common problem is the appearance of slugs  7  in a multiphase mixture of oil  8  and water  9 , and gas  10 .  
     [0040] To measure changes in the contents flowing through the pipe first and second measurement devices  11   1 ,  11   2  are employed. In this example, the measurement devices  11   1 ,  11   2  are in the form of gamma ray (γ-ray) densitometers. Each measurement device  11   1 ,  11   2  comprises a respective source  12   1 ,  12   2  of γ-rays, which produces a beam  13   1 ,  13   2  of γ-rays that pass through the pipe  1  and pipe contents  6 . The beams  13   1 ,  13   2  are attenuated by the pipe  1  and the pipe contents  6 . The beams  13   1 ,  13   2  are picked up by respective detectors  14   1 ,  14   2  which produce respective time-varying signals  15   1 ,  15   2 .  
     [0041] Referring to FIG. 3, each detector  14   1 ,  14   2  comprises a respective receiver  16   1 ,  16   2  whose output is amplified using an amplifier  17   1 ,  17   2 .  
     [0042] Referring to FIG. 4, the signals  15   1 ,  15   2  from the measurement devices  11   1 ,  11   2  are fed into the analysing apparatus  5  via ports  18   1 ,  18   2 . The signals  15   1 ,  15   2  are fed through filters  19   1 ,  19   2  to a multi-channel analog-to-digital converter card  20  which samples of the signals  15   1 ,  15   2  and feeds the samples to a processor  21 . The analyser apparatus  5  further includes random access memory (RAM)  22 , flash memory  23 , a channel output control  24  for providing an estimate of slug volume, a display  25 , in the form of a monitor, a user input  26 , preferably in the form of a keyboard and mouse, an output  27 , in the form of an RS-232 port, and storage medium  28 , such as a hard disk.  
     [0043] In this example, the analysing apparatus  5  is in the form of a personal computer executing a computer program for performing a method of slug detection. However, dedicated hardware may be used.  
     [0044] Referring to FIG. 5, the analysing apparatus includes a graphical user interface in the form of a window  29  which is displayed on the monitor  25 . The window  29  includes graphical representations  30   1 ,  30   2  of the signals  15   1 ,  15   2  (FIG. 2). Each graphical representation  30   1 ,  30   2  includes markers  31   1 ,  31   2  for indicating a front of a slug passing each measurement device  11   1 ,  11   2  (FIG. 2) and markers  32   1 ,  32   2  for indicating an end of a slug.  
     [0045] The window  29  displays slug parameters including positions  33   1 ,  33   2 ,  34   1 ,  34   2  of the markers  31   1 ,  31   2 ,  32   1 ,  32   2 , velocities  35 ,  36  of the front and end of the slug, length  37  of the slug and estimated time of arrival (ETA)  38  of the slug at catcher  3  (FIG. 1). Four values of slug length are computed using the  33   1 ,  33   2 ,  34   1 ,  34   2  of the markers  31   1 ,  31   2 ,  32   1 ,  32   2 , together with a value of slug velocity. The window  29  includes control buttons  39  for starting and stopping analysis.  
     [0046] Values for estimated time of arrival (ETA)  38  of the slug and slug volume are supplied as digital signals to a serial port  27  and to the control output  24  via a digital-to-analog output (not shown) with a 20 mA loop interface.  
     [0047] Referring to FIG. 6, a process for logging samples of the signals  15   1 ,  15   2  and analysing the signals  15   1 ,  15   2  so as to detect locations of front and end of a slug  7  (FIG. 2) and compute slug parameters is shown.  
     [0048] A user starts the process and the analyser apparatus  5  (FIG. 1) is initialised, for example by clearing buffers and resetting software flags (step S 1 ).  
     [0049] A period of “running-in” occurs. The analyser apparatus  5  receives signals  15   1 ,  15   2  from the measurement devices  11   1 ,  11   2  (FIG. 2) and samples them at known rate (step S 2 ). In this example, the sampling rate is 10 samples per second.  
     [0050] Referring also to FIG. 7, samples  15   1 ′,  15   2 ′ of the signals  15   1 ,  15   2  are stored in first and second buffers  40   1 ,  40   2  respectively (step s 3 ). In this example, each buffer  40   1 ,  40   2  is able to store 3,000 samples and is configured in a so-called “first in, first out” (FIFO) arrangement. The process continues until each buffer  40   1 ,  40   2  is filled (step S 4 ). Once the buffers  40   1 ,  40   2  are filled, then analysis of the signals  15   1 ,  15   2  can begin (step S 5 ).  
     [0051] Three different processes for detecting slugs may be used. Preferably, all three processes are used, although results of one of the processes may be selected and used.  
     [0052] Differentiated Waveform Process  
     [0053] Referring to FIG. 8, a first process for detecting slugs is shown:  
     [0054] For each signal  15   1 ,  15   2 , a graphical representation  30   1 ,  30   2  is displayed (step S 5 . 1 . 1 ). A further predetermined number of samples  15   1 ′,  15   2 ′ of the signals  15   1 ,  15   2 , herein referred to as a data set, are acquired and added to the front of each respective buffer  40   1 ,  40   2  (steps S 5 . 1 . 2  &amp; S 5 . 1 . 3 ). A corresponding number of samples are deleted from the end of each buffer  40   1 ,  40   2 . In this example, the data set comprises 10 samples corresponding to 1 second.  
     [0055] For each buffer  40   1 ,  40   2 , the signals  15   1 ,  15   2  are processed before slug detection occurs.  
     [0056] Each signal  15   1 ,  15   2  is amplified, in this case by a factor of 1,000, to produce a corresponding amplified signal (step S 5 . 1 . 4 ). The amplified signal is then smoothed to produce a smoothed signal (step S 5 . 1 . 5 ). The smoothed signal is differentiated to produce a differentiated signal (step S 5 . 1 . 6 ). The differentiated signal is then non-linearly amplified, in this case by squaring the differentiated signal and preserving its sign (step S 5 . 1 . 7 ). The result is a processed signal suitable for searching for features which correspond to and which identify slug boundaries.  
     [0057] Referring to FIG. 9, each processed signal comprises a plurality of samples  41 , in this case 3000. The processed signal is examined to identify locations where it crosses the sample axis, in other words to identify so-called “zero crossings”. The processed signal is divided into periods  42   1 ,  42   2 ,  42   3 ,  42   4 ,  42   5 , herein referred to as epochs, between the zero crossings. For each epoch  42   1 ,  42   2 ,  42   3 ,  42   4 ,  42   5 , a maximum magnitude value  43   1 ,  43   2 ,  43   3 ,  43   4 ,  43   5  is determined. This is performed using a time encoded signal processing and recognition (TESPAR) process.  
     [0058] A description of the TESPAR process is found in GB-A-2145864, which is incorporated herein by reference.  
     [0059] For each processed signal, a probability distribution function, for example a Gaussian distribution, is used to determine a standard deviation δ (step S 5 . 1 . 9 ), i.e., the set of epoch amplitudes that lie within 95% of the total set.  
     [0060] Each processed signal is examined for predefined features which are indicative of a slug boundary.  
     [0061] To identify a front of a slug, a search is made for epochs  42   1 ,  42   2 ,  42   3 ,  42   4 ,  42   5  whose maximum magnitude value  43   1 ,  43   2 ,  43   3 ,  43   4 ,  43   5  fall outside one standard deviation, i.e. whose absolute values |s|&gt;|δ|. In FIG. 9, one such sample  45  is shown whose value  43   1 , falls outside one standard deviation.  
     [0062] Each sample  45  whose value  43  falls outside one standard deviation and is positive is considered to be a front of a slug (step S 5 . 1 . 10 ).  
     [0063] A check is made whether the samples  45  corresponding to a front of a slug are found within a predetermined window of time (step S 5 . 1 . 11 ). In this example, the predetermined window of time corresponds to the latest 10 samples acquired. If no samples  45  corresponding to a front of a slug are found in the predetermined window, then process returns to step S 5 . 1 . 1  where the graphical representation  30   1 ,  30   2  (FIG. 5) are updated. Otherwise, the front of the slug is marked.  
     [0064] For each signal  15   1 ,  15   2 , checks are made as to whether the front marker is valid (S 5 . 1 . 12 ). For example, the front marker is checked to ensure that it is later in time than the currently held front markers. If the front marker is not later in time than the current marker then it is discarded. If the front marker is found to be within half a second of the currently held front marker, then the front marker is also checked to see whether the amplitude of the sample  15 ′ corresponding to the front marker, i.e. the measured density at the front of the slug, is greater than the amplitude of the sample corresponding to the current held front marker. If the front marker is found to be valid, then it becomes a new current marker (S 5 . 1 . 14 ), otherwise the process returns to step S 5 . 1 . 1 .  
     [0065] For each signal  15   1 ,  15   2 , a threshold density is calculated. The threshold density d thesh  is defined as being 60% of a difference between the density d 0  which lies in front of the slug, referred to as the “slug front porch density”, and the density d F  at the front of the slug, referred to as the “front marker density”.  
     [0066] Using a corresponding value of threshold density, each signal  15   1 ,  15   2  is searched to find the rear of the slug (step S 5 . 1 . 16 ). The search may be limited to a predetermined window, for example, the latest 10 samples. If no rear of the slug is identified then the process returns to step S 5 . 1 . 1 . If the rear of the slug is found, then the sample location becomes the rear marker. However, the rear marker may be checked. For example, if a constraint is placed that the rear marker must be found within the latest 10 samples, then the additional check comprises determining the mean values for the first 5 samples and the second 5 samples. If both calculated values of mean are below the 60% threshold d thesh  and the two subsequent means have a negative slope, then the rear marker is valid.  
     [0067] Steps S 5 . 1 . 1  to steps S 5 . 1 . 17  are performed in respect of each signal  15   1 ,  15   2  to find front and end markers  31   1 ,  31   2 ,  32   1 ,  32   2  (FIG. 5). Once front and rear markers  31   1 ,  31   2 ,  32   1 ,  32   2  have been identified, then slug characteristics can be computed (S 5 . 1 . 18 ).  
     [0068] For example, if the front of the slug is determined to be at time t 1  for the first signal  15   1  and the front of the slug is determined at time t 2  for the first signal  15   1  and the measurement devices  11   1 ,  11   2  are separated by a known distance D, then the velocity v F  of the front of the slug  7  may be calculated using:  
               v   F     =     D       t   1     -     t   2                 (   1   )                       
 
     [0069] Similarly, if the end of the slug for the first signal  15   1  occurs at time t 3  and the end of the slug occurs at time t 4  for a signal  15   2 , then the velocity of v R  for the rear of the slug is defined as:  
               v   R     =     D       t   3     -     t   4                 (   2   )                       
 
     [0070] The length L of the slug is determined by calculating lengths L 1 , L 2 , L 3 , L 4  of the slug using t 1 , t 2 , t 3 , t 4 , v F , v R  using:  
       L   1   =v   F ( t   3   −t   1 )  (3a)  
       L   2   =v   F ( t   4   −t   2 )   (3b)  
       L   3   =v   R ( t   3   −t   1 )   (3c)  
       L   4   =v   R ( t   4   −t   2 )   (3d)  
     [0071] and then:  
             L   =         L   1     +     L   2     +     L   3     +     L   4       4             (   4   )                       
 
     [0072] An estimated time T of arrival is calculated using:  
             T   =       1     v   F          S             (   5   )                       
 
     [0073] where S is the distance between the measurement apparatus  2  and the separator  3 .  
     [0074] The slug characteristics  33   1 ,  33   2 ,  34   1 ,  34   2 ,  35 ,  36 ,  37 ,  38  (FIG. 5) are displayed and are also logged onto disk  28 , for example in ASCII format together with a header file (FIG. 4) (steps S 5 . 1 . 19  &amp; S 5 . 1 . 20 )  
     [0075] A check is made whether the stop button  39  (FIG. 5) has been pressed (step S 5 . 1 . 21 ). If the stop button has been pressed, indicating that the user no longer wishes to continue, then the process ends. Otherwise, the process returns to S 5 . 1 . 1  where the signals  15   1 ,  15   2  are updated.  
     [0076] The slug volume can be used to control an input control valve (not shown) to the catcher  3  to prevent the catcher from overflowing.  
     [0077] Whole Waveform Process  
     [0078] Referring to FIG. 10, a second process for detecting slugs is shown:  
     [0079] For each signal  15   1 ,  15   2 , a graphical representation  30   1 ,  30   2  is displayed (step S 5 . 2 . 1 ). A further predetermined number of samples  15   1 ′,  15   2 ′ of the signals  15   1 ,  15   2 , herein referred to as a data set, are acquired and added to the end of each respective buffer  40   1 ,  40   2  (steps S 5 . 2 . 2  &amp; S 5 . 2 . 3 ). A corresponding number of samples are deleted from the front of each buffer  40   1 ,  40   2 . In this example, the data set comprises 10 samples.  
     [0080] For each buffer  40   1 ,  40   2 , the signals  15   1 ,  15   2  are processed before slug detection occurs.  
     [0081] Each signal  15   1 ,  15   2  is filtered using a Savitzky Golay filter (step S 5 . 2 . 4 ). The Savitzky Golay filter has the advantage of reducing noise, while preserving features of interest. The Savitzky Golay filter is described in more detail in Section 8.3.5 in “Introduction to Signal Processing” by Sophocles J. Orfanidis, p434 (Prentice Hall) [ISBN 0-13-209172-0].  
     [0082] Referring to FIGS. 11 and 12, for each signal  15   1 ,  15   2 , a density offset  46  is calculated (step S 5 . 2 . 5 ) which is subtracted from the filtered signal.  
     [0083] A method of calculating the density offset  46  will now be described:  
     [0084] A base level threshold zx is calculated by taking the mean of the samples z in a buffer  40   1 ,  40   2 , which may be described in pseudo-code as:  
       zx =mean(buf) where buf is the contents of the buffer  
     [0085] A deviation from the mean pv from the value zx is then calculated by taking the mean of the values z-zx, for values of z which are greater than zx, i.e.:  
       pv =mean(buf(find(buf&gt;= zx ) )− zx )  
     [0086] A deviation from the mean nv from the value zx is then calculated by taking the mean of the values zx−z, for values z which are less than zx, i.e.:  
       nv =mean( zx −buf(find(buf&lt; zx )))  
     [0087] The offset zz  46  is calculated by subtracting the mean deviation nv from the base threshold zx and adding the average value of the deviations pv and nv, in other words:  
       zz=zx−nv +( ( nv+pv )*0.5)  
     [0088] The result is a processed signal suitable for searching for features which correspond to and which identify slug boundaries.  
     [0089] Referring to FIGS. 12 and 13, each processed signal comprises a plurality of samples  47 , in this case 3000. The processed signal is examined to identify locations  48   1 ,  48   2 ,  48   3 ,  48   4 ,  48   5 ,  48   6  where it has zero amplitude, in other words to identify so-called “zero crossings”. This is performed using a time encoded signal processing and recognition (TESPAR) process.  
     [0090] A description of a TESPAR process is found in GB-A-2145864, which is incorporated herein by reference.  
     [0091] To identify a front of a slug, a search is made for zero crossings  48   1 ,  48   2 ,  48   3 ,  48   4 ,  48   5 , 48   6  which positive going, in other words crossing negative to positive in the direction of time (step S 5 . 2 . 8 ). In FIG. 12, zero crossings  48   2 ,  48   4 ,  48   6  are considered to be a front of a slug  
     [0092] A check is made whether the zero crossings  48   2 ,  48   4 ,  48   6  are found within a predetermined window of time (step S 5 . 2 . 9 ). In this example, the predetermined window of time corresponds to the latest  10  samples acquired. If no zero crossings  48   2 ,  48   4 ,  48   6  are found in the predetermined window, then process returns to step S 5 . 2 . 1  where the graphical representation  30   1 ,  30   2  (FIG. 5) are updated. Otherwise, the front of the slug is marked  
     [0093] For each signal  15   1 ,  15   2 , checks are made as to whether the front marker is valid (step S 5 . 2 . 10  &amp; S 5 . 2 . 11 ). For example, the front marker is checked to ensure that it is later in time than the currently held front markers. If the front marker is not later in time than the current marker then it is discarded. If the front marker is found to be within half a second of the currently held front marker, then the front marker is also checked to see whether the amplitude of the sample  15 ′ corresponding to the front marker, i.e. the measured density at the front of the slug, is greater than the amplitude of the sample corresponding to the current held front marker. If the front marker is found to be valid, then it becomes a new current marker (step S 5 . 2 . 12 ), otherwise the process returns to step S 5 . 1 . 1 .  
     [0094] To identify an end of a slug, a search is made for zero crossings  48   1 ,  48   2 ,  48   3 ,  48   4 ,  48   5 ,  48   6  which are negative going. (step S 5 . 2 . 13 ). The search may be limited to a predetermined window, for example, the latest 10 samples. If no rear of the slug is identified then the process returns to step S 5 . 2 . 1 . If the rear of the slug is found, then the sample location becomes the rear marker. However, the rear marker may be checked. For example, if a constraint is placed that the rear marker must be found within the latest 10 samples, then the additional check comprises determining the mean values for the first 5 samples and the second 5 samples. If both calculated values of mean are below the 60% threshold d thesh , then the rear marker is valid in a manner described earlier.  
     [0095] Steps S 5 . 2 . 1  to steps S 5 . 2 . 17  are performed in respect of each signal  15   1 ,  15   2  to find front and end markers  31   1 ,  31   2 ,  32   1 ,  32   2  (FIG. 5). Once front and end markers  31   1 ,  31   2 ,  32   1 ,  32   2  have been identified, then slug characteristics can be computed (S 5 . 2 . 15 ) in a manner hereinbefore described.  
     [0096] The slug characteristics  33   1 ,  33   2 ,  34   1 ,  34   2 ,  35 ,  36 ,  37 ,  38  (FIG. 5) are displayed and are also logged onto disk  28 , for example in ASCII format together with a header file (FIG. 4) (steps S 5 . 2 . 16  &amp; S 5 . 2 . 17 )  
     [0097] A check is made whether the stop button  39  (FIG. 5) has been pressed (step S 5 . 2 . 18 ). If the stop button has been pressed, indicating that the user no longer wish to continue, then the process ends. Otherwise, the process returns to S 5 . 2 . 1  where the signals  15   1 ,  15   2  are updated.  
     [0098] Process Including Non-Linear Filtering  
     [0099] Referring to FIG. 14, a third process for detecting slugs is shown.  
     [0100] For each signal  15   1 ,  15   2 , a graphical representation  30   1 ,  30   2 is displayed (step S 5 . 3 . 1 ). A further predetermined number of samples  15   1 ′,  15   2 ′ of the signals  15   1 ,  15   2 , herein referred to as a data set, are acquired and added to the end of each respective buffer  40   1 ,  40   2  (steps S 5 . 3 . 2  &amp; S 5 . 3 . 3 ). A corresponding number of samples are deleted from the end of each buffer  40   1 ,  40   2 . In this example, the data set comprises 10 samples.  
     [0101] For each buffer  40   1 ,  40   2 , a signal  15  is processed before slug detection occurs. A representation  49  of a signal  15  held in a buffer  40  before processing is shown in FIG. 15 and a corresponding distribution  50  of values of density in the buffer  40  is shown in FIG. 16 (step  5 . 3 . 4 ).  
     [0102] Referring to FIGS. 17 and 18, the signal  15  is filtered using a low-pass, 8 th  order Butterworth filter with a 0.5 Hz cut-off (step S 5 . 3 . 4 ). The filtered signal  51  is shown in the frequency- and time-domains. A corresponding bipolar distribution  52  of the filtered signal  51  is shown in FIG. 19.  
     [0103] A density offset is calculated in a similar manner to calculation of density offset  46  and which is subtracted from the filtered signal (step S 5 . 3 . 5  &amp; S 5 . 3 . 6 ).  
     [0104] The density offset is removed from the linearly filtered signal  51 , which is unipolar, to create a bipolar filtered signal  51 ′ (FIG. 20) having the same density range.  
     [0105] Referring to FIG. 21, the bipolar linearly filtered signal  51 ′ is non-linearly filtered by taking the 10 th  root of the modulus of the signal  51 ′ and retaining the sign to produce a non-linearly filtered signal  53  (step S 5 . 3 . 7 ). A corresponding density distribution  54  of the non-linearly filtered signal  53  is shown in FIG. 22.  
     [0106] Referring to FIG. 21, the non-linearly filtered signal  53  appears as a pseudo-binary signal having a high state H and a low state L. However, the signal  53  includes a short duration feature X. The signal  53  is further processed to remove short features, such as feature X (step S 5 . 3 . 8 ).  
     [0107] Zero crossings are identified. The duration between adjacent zero crossings is determined. If the duration is less than a predetermined value, for example 25 samples, then the region between the zero-crossings is considered to be a short feature. The short feature is removed by determining sign and amplitude of the portion of signal  53  between the adjacent zero-crossings and adding a further signal of opposite sign and same magnitude to said signal portion.  
     [0108] Referring to FIG. 23, a processed signal  55  is shown from which feature X has been removed.  
     [0109] Each signal  15   1 ,  15   2  is processed in the manner hereinbefore described to obtain a binary signal.  
     [0110] The front and rear of the slug are detected in a manner substantially similar that described in steps S 5 . 2 . 8  to S 5 . 2 . 18  (steps S 5 . 3 . 9  to S  5 . 3 . 18 ).  
     [0111] Referring to FIG. 23 and  24 , examples of pseudo binary signals  55 ,  56  obtained using the non-linear filtering process using first and second signal  15   1 ,  15   2  from measurement devices  11   1 ,  11   2  separated along a pipe  1  (FIG. 1) are shown. The signals  55 ,  56  show a delay in signal transition. Table I below tabulates values at which transitions occur for the first and second signals  15   1 ,  15   2  and a corresponding difference from which slug velocity may be calculated.  
                       TABLE I                       Channel 1   Channel 2   Difference                                            2   3   −1       182   188   −6       1027   1036   −9       1123   1126   −3       1265   1281   −16       1388   1394   −6           1593           1616       1843   1853   −10       1860   1871   −11       2001   2007   −3       2088   2100   −12       2466   2496   −30       2583   2592   −9       2652   2659   −7       2691   2703   −12                  
 
     [0112] It will be appreciated that many modifications may be made to the embodiment described above.