610
Views
1
CrossRef citations to date
0
Altmetric
Research Article

State estimation problem for the detection of valve closure in gas pipelines

ORCID Icon, ORCID Icon & ORCID Icon
Pages 2186-2206 | Received 04 Feb 2020, Accepted 23 Mar 2021, Published online: 09 Apr 2021

Abstract

The undesired and unexpected closure of valves in pipelines is the most frequent failure that causes interruptions in the transport of natural gas. This work aims at the detection of valve closures by solving a state estimation problem with the Particle Filter method. The gas flow problem in the duct is solved with a Weighted Average Flux – Total Variation Diminishing scheme, while state variables are estimated with simulated measurements of pressure, velocity and temperature at different points along the pipeline. Two versions of the particle filter method are implemented in this work for the solution of the state estimation problem, namely, the Sampling Importance Resampling (SIR) and the Auxiliary Sampling Importance Resampling (ASIR) algorithms. Accurate estimations were obtained with both algorithms for configurations involving pipelines with one or three valves. On the other hand, the SIR algorithm required a larger number of particles than the ASIR algorithm for the same solution accuracy.

Nomenclature

A=

pipeline cross section area

Cf=

friction factor

Cp=

specific heat at constant pressure

Cv=

specific heat at constant volume

D=

pipeline diameter

e=

specific internal energy

eRMS,y=

RMS error for a specific state variable y(t), see equation (12)

f=

vector of functions that defines the state evolution model

F(t)=

valve open fraction, 0F(t)1

F(U)=

flux vector

g=

vector of functions that define the observation model

I=

number of measurements at each time instant

n=

noise vector for the observation model

N=

number of particles

p=

pressure

Q=

local heat flux imposed at the surface of the pipeline

q=

flow rate

Q=

covariance matrix of the state evolution model

R=

covariance matrix of the observation model

Rg=

gas constant

S(U)=

source term vector

T=

temperature

u=

longitudinal velocity

U=

vector of conserved variables

v=

noise vector for the evolution model

w=

particle weights

x,t=

spatial and time variables, respectively

y=

vector of state variables, see equation (6)

y=

reduced vector of state variables, see equation (7)

z=

measured data predicted with the observation model

zmeas=

measurements

Greeks

γ=

ratio of specific heats at constant pressure and constant volume (Cp/Cv)

π=

4tan1(1)

π=

probability distribution function

θ=

vector of non-dynamic parameters

ρ=

density

σ=

standard deviation

Subscripts

e=

specific internal energy

k=

time instant tk

p=

pressure

ρ=

density

T=

temperature

u=

velocity

v=

valve number

Superscripts

meas=

measurements

i=

particles

Introduction

Worldwide, natural gas is mainly transported through pipelines from production sites to treatment units, as well as from treatment units to industrial and domestic consumers.For safety reasons, automatic shutdown valves (denoted as SDVs) are installed along pipelines. These valves avoid, for example, gas scape through leakages caused by accident or illegal tampering, by automatically closing sections of the pipeline. The number and positions of SDVs along the pipeline depend on several factors, including proximity to highly populated areas. Usually, SDVs are located between 8 and 30 km apart from each other. The automatic closure of SDVs is set in accordance with the pipeline operational limits. Transients in the gas flow may cause pressure variations that result on the sudden and undesired closure of SDVs, due to unexpected modifications in the flow rates demanded by big consumers. A numerical solution for the pressure wave propagation in gas pipelines after the sudden closure of a shutdown valve was presented in [Citation1].

Automatic shutdown valves are not remotely operated or monitored, because of the high costs of dedicated sensors and actuators. Therefore, an undesired and unexpected closure of these valves is usually detected empirically by operators at pipeline operational centres, based on their own practical experiences. From the pressure and flow rate readings at measurement stations along the pipeline, operators can identify a region containing the closed SDV. In general, pressure increases and flow rate decreases upstream of the closed valve, while pressure decreases downstream. After the identification of the pipeline region where the unexpected closed SDV is possibly located, technicians are assigned for in-situ verification of all valves in this region until the closed one is found and reopen. This process may take few hours, depending on the number and distance of SDVs, as well as their location with respect to main roads, thus incurring in large financial losses and operational problems for large industrial consumers, such as power plants. Therefore, the development of numerical tools for the automatic and fast identification of the closure of SDVs, with minimum interference by the pipeline operators, is of great importance.

In this paper, we apply state estimation techniques to identify the undesired and unexpected closure of automatic shutdown valves. In state estimation problems, physical phenomena are taken into account by a state evolution model and an observation model [Citation2–14]. The information provided by these two stochastic models, as well as by the measured data, is used to sequentially estimate the desired dynamic variables in such a manner that the estimation error is statistically minimized. The Kalman filter provides the optimal solution for state estimation problems with linear models and additive Gaussian noises, by recursively applying analytic equations [Citation2–5]. The Kalman filter was applied as an observer for the control of gas pipelines in [Citation15] and to detect valve stiction in [Citation16,Citation17]. Unfortunately, many practical applications, such as the one under analysis in this work, involve nonlinear and/or non-Gaussian models, for which the original Kalman filter cannot be applied. The so-called Particle Filter methods provide a powerful and robust technique for the solution of nonlinear and/or non-Gaussian estimation problems, with results more accurate than those obtained with the available extensions of the Kalman filter [Citation2–14] for innumerous practical applications [Citation18–25]. Several algorithms for the implementation of the particle filter method can be found in the literature [Citation2–5]. In this work, two of these algorithms are compared, as applied to the estimation of SDV closures with computer simulated measurements, namely: the Sampling Importance Resampling (SIR) algorithm and the Auxiliary Sampling Importance Resampling (ASIR) algorithm [Citation2–5].

The model for the compressible fluid flow of the gas inside the pipeline is presented in the next section, which is followed by the definition of the state estimation problem and its solution based on the particle filter method. The SIR and ASIR algorithms of the particle filter are then presented and the solution of the state estimation problem is obtained with computer simulated measurements.

Mathematical formulation

Two configurations were examined in this work for a straight and horizontal pipeline without bifurcations, with length of 90 km between the compression station and the point where the gas was delivered for consumption. The diameter of the pipeline was D = 18 inch. For configuration 1, one single automatic shutdown valve was located at the position x = 45 km. For configuration 2, three automatic shutdown valves were located at positions x = 15 km, x = 45 km and x = 75 km. Sensors for temperature, pressure and flow rate were located at x = 9 km and x = 81 km. In addition, sensors were also located at x = 46 km for configuration 2. The idealized configuration 1 was used as a test case for verification purposes and for the comparison of the two particle filter algorithms examined in this work. Configuration 2 more closely reflects cases found in practice, with three SDV’s located 30 km apart. These two configurations are illustrated by Figure a and 1b, respectively.

Figure 1. Sketch of the straight pipeline for: (a) Configuration 1 with one SDV and (b) Configuration 2 with three SDVs.

Figure 1. Sketch of the straight pipeline for: (a) Configuration 1 with one SDV and (b) Configuration 2 with three SDVs.

The physical problem is modelled by the one-dimensional compressible flow of an ideal gas with constant specific heat, in an horizontal and straight pipeline. The mass, momentum and energy conservation equations for this problem can be written in vector form as [Citation26,Citation27]: (1) Ut+F(U)x=S(U)(1) where (2a-c) U[ρρuρ(e+u22)]F(U)[ρuρu2+pρu(e+u22+pρ)]S(U)1A[0ρu2CfπD2QπD](2a-c) In equations (1) and (2), U, F(U) and S(U) are the vectors of conserved variables, fluxes and source terms, respectively, while ρ is the density, u is the longitudinal velocity, e is the specific internal energy, p is the pressure, Q is the local heat flux imposed at the surface of the pipeline, A is the cross section area and Cf is the friction factor. The equations of state for an ideal gas are given by: (3a,b) p=(γ1)ρeT=pρRg(3a,b) where γ=Cp/Cv, Cv is the specific heat at constant volume, Cp is the specific heat at constant pressure, T is the temperature and Rg is the gas constant.

Several works can be found in the literature for the numerical solution of the gas flow in a single pipeline and in pipeline networks. In particular, the reader is referred to references [Citation1,Citation28–34]. Here, we apply the Total Variation Diminishing (TVD) Weighted Average Flux (WAF) scheme presented by Toro [Citation35] for the solution of equations (1) to (3), by using the Van Leer limiting function and the HLLC method for the approximate Riemann solver. Details of this finite volume scheme are omitted here for the sake of brevity, but they can be readily found in standard textbooks [Citation35,Citation36].

The analytical boundary conditions for a well-posed one-dimensional flow problem need to be specified as follows [Citation37]: (i) Subsonic Inlet: Density, ρ, needs to be prescribed. Thus, one can prescribe the sets [ρ, u] or [ρ, p], but not [p, u]. Note that one can also specify [T, p], because temperature and pressure are more easily measured, which in turn signifies that [ρ, p] are prescribed, since ρ is related to T and p by the equation of state (3b); (ii) Subsonic Outlet: One of the three variables, ρ, u or p, needs to be prescribed; (iii) Supersonic Inlet: The three variables ρ, u and p need to be prescribed; (iv) Supersonic Outlet: No variable needs to be prescribed. For the numerical integration of equations (1) to (3) with the WAF-TVD scheme, scalars need to be specified in fictitious volumes at the pipeline inlet and outlet. Extrapolations from the interior volumes to the fictitious volumes were then performed in accordance with the flow conditions, as described by [Citation35–38] and summarized by Table . For all cases, ρ and e were calculated with the equations of state (3a,b). The initial conditions for the integration of equations (1) to (3) will be described below in the section of Results and Discussions.

Table 1. Numerical boundary conditions.

The automatic shutdown valves were modelled by following [Citation39,Citation40] in accordance with the ISA standard [Citation41]. The flow rate at each valve was computed by: (4a) q=N7FpcvPupYχSGTupZ(4a) where (4b,c) Y=1χ3ϕkχtχ=ΔPPup(4b,c) In equations (4a-c), N7 = 4.17 K0.5Pa−0.5 for SI Units, Fp is a factor that accounts for the geometrical variation between the pipe and the valve, cv is the valve flow coefficient, Y is an expansion coefficient given by equation (4b), χ is the valve pressure drop (ΔP) relative to the valve upstream pressure (Pup) given by equation (4c), SG is the specific gravity of the gas with respect to air at standard conditions, Tup is the valve upstream gas temperature, Z is the gas compressibility factor, ϕk is the ratio between γ(Cp/Cv) for the gas and for air, while χt is the ratio χ (equation 4c) for the chocked flow through the valve [Citation39].

For the numerical solution of the flow problem, each shutdown valve was modelled between two control volumes with interfaces at the valve position, as shown in Figure [Citation30]. The valve flow rate was supposed proportional to the valve opening. Therefore, the flow rate given by equation (4a) was multiplied by a function of time F(t) that represented the valve opening, where 0F(t)1. By following the explicit scheme of the WAF-TVD method, the flow rate through each valve was calculated with equations (4a-c) by using the variables at the previous time step.

Figure 2. Sketch of valve between two consecutive discrete control volumes.

Figure 2. Sketch of valve between two consecutive discrete control volumes.

The numerical code developed in this work for the WAF-TVD solution of the gas flow problem was verified by using the analytic solutions for the Fanno and Rayleigh lines, as well as for the shock tube problem [Citation26,Citation27]. Relative differences between the numerical and analytic solutions were less than 0.6% with 100 volumes in the discretization, where the integration time step was automatically selected by satisfying the stability criterion of the WAF-TVD scheme [Citation35].

Real gas effects can be significant at pressures commonly observed in natural gas pipelines. On the other hand, the ideal gas model is followed here as in [Citation29], since the objective of this work is to detect the closure of shutdown valves by solving a state estimation problem. However, we note that a compressibility factor that depends on the natural gas composition could be included in the formulation to model a real gas [Citation32,Citation33].

State estimation problems and particle filters

State estimation problems involve two stochastic mathematical models: the evolution model, which represents the discrete time variation of the state variables, and the observation model, which provides a relationship between the measurements and the state variables [Citation2–14]. The state variables are given by the vector yk, which describe the system at a given time instant tk. The state evolution model and the observation model are defined by the functions fk and gk, respectively, and can be written in the following general nonlinear forms [Citation2–14]: (5a) yk=fk(yk1,θ,vk),k=1,,M(5a) (5b) zk=gk(yk,θ,nk),k=1,,M(5b) where zk is the prediction of the measurements, θ is a vector containing all the non-dynamic parameters of the model, while vk and nk represent the noises in the state evolution model and in the observation model, respectively. The objective of the state estimation problem is to obtain information about the state vector yk based on the measurements, as well as on the evolution and observation models defined by equations (5a,b), respectively, with known probability density π(y0,θ|z0)=π(y0,θ) at the initial time t = 0 [Citation2–14].

In this work, the particle filter method was applied for the solution of the present nonlinear state estimation problem. This method is a sequential Monte Carlo technique, where the posterior probability density function of the state variables is represented by a set of random samples (particles) with associated weights. We denote the particles by yki and their corresponding weights by wki,i=1,,N.

Basic steps of the particle filter method can be summarized as follows. From the distribution at the initial time, π(y0,θ|z0)=π(y0,θ), a prior information for the state variables at the subsequent time, t1, is estimated by using the state evolution model given by equation (5a). The observation model given by equation (5b) and the actual measurements, zkmeas, are then used in the likelihood function (the statistical model for the measurement errors) to compute the weights for the particles. This process is repeated for the estimation of state variables at future times, as the measured data is sequentially assimilated. Although simple, after few time steps such a recursive application of Bayes’ theorem might degenerate the particles. The degeneracy phenomenon is characterized by most of the particles with negligible weights, which implies that a large computational effort is devoted to update particles whose contribution to the approximation of the posterior density function is almost zero. The degeneracy phenomenon can be overcome with a resampling step in the particle filter, which eliminates particles with small weights and generates new particles from those with large weights [Citation2,Citation4,Citation5]. Resampling can be performed if the number of particles with large weights falls below a certain threshold number. Alternatively, resampling can be performed at every time step, such as in the Sampling Importance Resampling (SIR) algorithm [Citation4,Citation5]. Although the resampling step reduces the effects of degeneracy, it may lead to a loss of diversity and the resultant sample may contain many repeated particles [Citation2,Citation4,Citation5]. The Auxiliary Sampling Importance Resampling (ASIR) algorithm was developed with the objective to reduce sample impoverishment, by applying the resampling step at time tk1with the measurements at time tk [Citation2,Citation4,Citation5]. The resampling step is based on some point estimate μki that characterizes π(yki|yk1i,θ), which can be the mean or a sample of this distribution. The Sampling Importance Resampling (SIR) algorithm and the Auxiliary Sampling Importance Resampling (ASIR) algorithm are presented by Tables and , respectively, for the evolution of the system from time tk1to tk [Citation4,Citation5].

Table 2. Sampling importance resampling (SIR) algorithm [Citation4,Citation5].

Table 3. Auxiliary sampling importance resampling (ASIR) algorithm [Citation4,Citation5].

The SIR and ASIR algorithms of the particle filter method were applied below for the estimation of unexpected closures of shutdown valves, in the configurations presented in Figure a,b. Therefore, the vector of state variables is composed by the dependent variables of the flow model given by equations (1) to (3), as well as by the functions Fv(t) that represent the open fraction of each valve v, where v = 1 for configuration 1, and v = 1, 2 and 3 for configuration 2. In discrete form, we have: (6) y=[ρueTpF](6) where the vectors ρ, u, e, T and p contain the density, velocity, internal energy, temperature and pressure, respectively, at all finite volumes used for the discretization of the pipeline. The vector F contains the open fractions of the valves in the pipeline. Hence, F is a scalar for configuration 1 and a vector of size [3 × 1] for configuration 2.

The evolution models for (7) yk=[ρkukekTkpk](7) were given by equations (1) to (3) discretized with the WAF-TVD scheme, which are represented by the vector fk(yk1,θ) in equation (8). Uncertainties for these state variables were supposed additive, uncorrelated, Gaussian, with zero means and constant covariance matrix, Q. Therefore, for the computation of the state variables yk at a time tk, we can write (8) yk=fk(yk1,θ)+vk(8) where vk=N(0,Q).

No information was a priori assumed for the functional form of the vector F, which gives the open fractions of the valves in the pipeline. Therefore, the evolution models for these state variables were given by independent Markovian processes with Gaussian distributions, zero means and variances σv,k2, that is, (9) Fv,k=Fv,k1+σv,kφv,k(9) where φv,k is a random Gaussian number with zero mean and unitary standard deviation.

Measurements of pressure, temperature and flow rate were supposed available at the positions illustrated by Figure a,b. Flow rate measurements were considered here as velocity measurements. Therefore, the function gk(yk,θ,nk), in the observation model given by equation (5b), selected the pressure, temperature and velocity at the measurement positions from the vector of state variables yk. The measurements were supposed uncorrelated and containing additive Gaussian noises, with zero means and constant covariance matrix, R. The standard deviations in the measurements of u, T and p are given by σumeas, σTmeas and σpmeas, respectively. Therefore, the observation model can be written as (10) zk=gk(yk,θ)+nk(10) where nk=N(0,R).

With these hypotheses about the measurement errors, the likelihood function, which is used for the computation of the weights in the particle filter method, is thus given by: (11) π(zk|yk,θ)=(2π)I/2|R|1/2exp{12[zkmeasgk(yk,θ)]TR1[zkmeasgk(yk,θ)]}(11) where I is the number of measurements at each time instant, tk, and π=4tan1(1).

The vector of model parameters, θ, was supposed known in this work, but their related uncertainties were accounted for in the vectors vkand nk.

Results and discussions

For the results presented below, the time period for the analysis of the gas flow corresponded to one hour of physical time. The pipeline was considered thermally insulated, that is, Q = 0 W/m2, and the friction factor was taken as 0.005 [Citation26] for the flow of air. The pressure and the temperature imposed at the inlet boundary were 6.5 × 106 Pa and 298 K, respectively, while the velocity imposed at the outlet boundary was 6 m/s. Initial conditions were taken from the Fanno line, which resulted from the outflow velocity specified as the boundary condition when the outlet pressure was 3.8 × 106 Pa. We assumed in this work that the valve and the pipe were of the same diameter, so that Fp = 1, and, for an ideal gas, Z = 1. Moreover, for air ϕk=SG=1 and χt=0.75 [Citation39]. The valve flow coefficient was considered as cv=6.7×106m3s1Pa0.5 [Citation39].

For the solution of the state estimation problem, the measurements were supposed available every 72 s, which is in accordance with SCADA systems used in practice. Therefore, during the period of one hour, M = 50 measurements obtained with each sensor were used for the estimation of the state variables and the detection of the valve closure. The sudden closure of either one of the shutdown valves was supposed to occur at time t = 20 minutes. The full closure was assumed instantaneous. Based on sensors used in pipelines nowadays, the standard deviations for the measurements of velocity, temperature and pressure were taken as σumeas=0.2m/s, σTmeas=0.5K and σpmeas=2×104Pa, respectively. Standard deviations for the evolution models of these state variables were assumed as twice as large, in order to account for uncertainties in the model parameters, θ, that is, σu=0.4m/s, σT=1K and σp=4×104Pa. For the random walk evolution model of the valve open fraction, given by equation (9), the standard deviation σv,k was taken as 0.1Fv,k1. This quantity was selected with numerical experiments and provided stable solutions with fast response times.

The accuracies of the solutions of the state estimation problems were examined with the RMS error, which is defined for a specific state variable y(t)as: (12) eRMS,y=1Mk=1M[y¯(tk)yexact(tk)]2(12) where, at time tk, yexact(tk) is the exact value of the state variable y(t), while y¯(tk) is the mean estimated by the particle filter method with particles yki and their corresponding weights wki,i=1,,N (see Tables and ), that is, (13) y¯(tk)=i=1Nwkiyki(13) The results obtained with the SIR and ASIR algorithms are compared below by using computer simulated measurements. The simulated measurements were obtained from the numerical solution of the forward problem, by considering Gaussian uncorrelated errors with the same standard deviations of the observation model.

Configuration 1

The RMS errors for the valve open fraction (given in percentage), as well as for pressure, temperature and velocity at the measurement positions x = 9 km and x = 81 km, are presented in Table , for configuration 1 (see Figure a). These errors are presented for the results obtained with the particle filter algorithms SIR and ASIR, by using different numbers of particles. Computational times are also presented in this table and they refer to Matlab® codes run in a computer with a processor Intel® Core™i7(2600) 3.6 GHz and 8 GByte of RAM memory.

Table 4. RMS errors and computational times for configuration 1.

An analysis of Table reveals that the RMS errors obtained with the ASIR algorithm were in general smaller than those obtained with the SIR algorithm. The RMS errors of the SIR algorithm exhibited an asymptotic behaviour for more than 500 particles, but the RMS errors were practically constant in the ASIR algorithm for more than 100 particles. The RMS errors of the ASIR algorithm with only 100 particles were smaller than those of the SIR algorithm with 1000 particles. As expected, the computational times were larger for the ASIR algorithm than for the SIR algorithm, by considering the same number of particles. Such was the case because the forward problem was solved twice at each evolution of the filter with the ASIR algorithm, but solved only once with the SIR algorithm, as shown by Tables and . On the other hand, the ASIR algorithm with 100 particles was about four times faster than the SIR algorithm with 1000 particles.

Figures a and b present the exact and estimated valve open percentages (means given by equation 13), obtained with 1000 particles in the SIR algorithm and with 100 particles in the ASIR algorithm, respectively, as well as the 99% confidence intervals of the estimates. These figures show that the ASIR estimates were smoother and more accurate than those of the SIR algorithm. Differently from the estimates obtained with the SIR algorithm, the ASIR results did not exhibit sample impoverishment, which is characterized by very small confidence intervals. Such was the case because resampling was performed at the previous time by using the measurements at the current time in the sequential estimation with the ASIR algorithm (see Table ). Figure b shows that in about eight minutes of physical time the ASIR algorithm could detect the valve closure with 99% confidence. Hence, the ASIR algorithm responded fast for detecting the valve closure. We note that the accurate estimations presented by Figures a,b were obtained without any prior information regarding the valve open fraction, which was modelled by the random walk evolution model given by equation (9).

Figure 3. Valve open percentage estimated for configuration 1 with: (a) 1000 particles in the SIR algorithm and (b) 100 particles in the ASIR algorithm.

Figure 3. Valve open percentage estimated for configuration 1 with: (a) 1000 particles in the SIR algorithm and (b) 100 particles in the ASIR algorithm.

A comparison of simulated measurements and state variables estimated with the ASIR algorithm with 100 particles is presented in Figures a-f. The exact variables, which were used to generate the simulated measurements, are also presented in Figures a-f. These figures show an excellent agreement between estimated and exact variables, despite the large measurement errors considered in the analysis. Indeed, the ASIR algorithm of the particle filter was capable of providing accurate estimates even for state variables for which measurements were not available. Such fact is apparent from the analysis of Figures a-c, which present the exact and the estimated pressure, velocity and temperature along the pipeline, respectively, at the final time.

Figure 4. Simulated measurements, exact and estimated state variables obtained with 100 particles in the ASIR algorithm for configuration 1: (a) Pressure at x = 9 km, (b) Pressure at x = 81 km, (c) Velocity at x = 9 km, (d) Velocity at x = 81 km, (e) Temperature at x = 9 km, (f) Temperature at x = 81 km.

Figure 4. Simulated measurements, exact and estimated state variables obtained with 100 particles in the ASIR algorithm for configuration 1: (a) Pressure at x = 9 km, (b) Pressure at x = 81 km, (c) Velocity at x = 9 km, (d) Velocity at x = 81 km, (e) Temperature at x = 9 km, (f) Temperature at x = 81 km.

Figure 5. Exact and estimated state variables along the pipeline at the final time, obtained with 100 particles in the ASIR algorithm for configuration 1: (a) Pressure, (b) Velocity, (c) Temperature.

Figure 5. Exact and estimated state variables along the pipeline at the final time, obtained with 100 particles in the ASIR algorithm for configuration 1: (a) Pressure, (b) Velocity, (c) Temperature.

Configuration 2

For this configuration involving three shutdown valves (see Figure b), two cases were examined regarding the number of stations where measurements were assumed available for the solution of the state estimation problem, namely: (i) Two measurement stations, at x = 9 km and x = 81 km; and (ii) Three measurement stations, at x = 9 km, x = 46 km and x = 81 km. After the above comparison of the particle filter algorithms for configuration 1, only the results obtained with the ASIR algorithm are now presented for configuration 2. The results presented below were obtained with 200 particles.

We consider first the case with two measurement positions, where valve 2 was suddenly closed while the others were maintained fully open. Figures a-c present the estimated open percentages for the three valves and their related 99% confidence intervals, together with the exact functional forms used to generate the simulated measurements. We notice in Figures a-c that excellent estimates were obtained for the open percentages of valves 2 and 3. The estimated open percentage of valve 1 was oscillatory and with uncertainties larger than those for the other valves, as shown by Figure b. This behaviour resulted from the fact that valves 2 and 3 were near the measurement stations, but valve 1 was located in the middle of the pipeline and quite far from the measurement stations. However, the exact open percentage of valve 1 was found within the 99% confidence interval of the estimations obtained with the ASIR algorithm of the particle filter.

Figure 6. Exact and estimated valve open percentages obtained for valve 2 closed and the other valves fully open, in configuration 2 with two measurement stations: (a) Valve 2; (b) Valve 1; (c) Valve 3.

Figure 6. Exact and estimated valve open percentages obtained for valve 2 closed and the other valves fully open, in configuration 2 with two measurement stations: (a) Valve 2; (b) Valve 1; (c) Valve 3.

The sudden closure of valve 3 could also be accurately estimated by using the measurements of stations 1 and 2, as demonstrated by Figures a-c. On the other hand, these figures show that the open percentages estimated for valves 1 and 2 were oscillatory and tended to zero near the final time. These behaviours for valves 1 and 2 were due to the decreasing flow rate upstream of the closed valve, where the pressure tended to be constant and equal to the value assigned at the inlet boundary condition. Hence, the measurements at station 1 near the pipeline inlet gradually lost sensitivity with respect to which valve was closed and the estimated open percentages of valves 1 and 2 deteriorated. However, Figures a-c show that the estimation of the closure of valve 3 could be accurately identified in less than five minutes, while the open percentages of valves 1 and 2 tended to zero in about thirty minutes after the closure of valve 3. Moreover, the estimation of the open percentage of valve 3 was more stable than those for the other upstream valves. Therefore, in a real situation the operator could easily detect that the closures estimated for the upstream valves 1 and 2 resulted from the actual closure of valve 3.

Figure 7. Exact and estimated valve open percentages obtained for valve 3 closed and the other valves fully open, in configuration 2 with two measurement stations: (a) Valve 2; (b) Valve 1; (c) Valve 3.

Figure 7. Exact and estimated valve open percentages obtained for valve 3 closed and the other valves fully open, in configuration 2 with two measurement stations: (a) Valve 2; (b) Valve 1; (c) Valve 3.

Differently from the cases presented by Figures and , which involved the closure of valves near the measurement positions, the closure of valve 1 (with the other valves fully open) could not be accurately estimated by using the measurements from only two stations. Figures a-c compare the exact and estimated valve open percentages for valves 2, 1 and 3, respectively, when valve 1 was closed and the other valves were fully open. We notice in these figures that closures were estimated for valves 2 and 3 near the measurement points. Although the particle filter initially tended to estimate the closure of valve 1, its open percentage increased for large times and the estimates involved quite large uncertainties. Figure shows that the use of only two measurement stations, at x = 9 km and x = 81 km, did not result in an unique solution of the state estimation problem for configuration 2, when valve 1 was closed. The closures predicted for valves 2 and 3 are clearly demonstrated in Figure , which presents the estimated pressure variation along the pipeline at the final time. Figure shows that, at the final time, valve 1 was estimated as open and the pressure drop resulting from the closure of this valve was split between valves 2 and 3, which were near the measurement stations (see also Figures a-c).

Figure 8. Exact and estimated valve open percentages obtained for valve 1 closed and the other valves fully open, in configuration 2 with two measurement stations: (a) Valve 2; (b) Valve 1; (c) Valve 3.

Figure 8. Exact and estimated valve open percentages obtained for valve 1 closed and the other valves fully open, in configuration 2 with two measurement stations: (a) Valve 2; (b) Valve 1; (c) Valve 3.

Figure 9. Exact and estimated pressure along the pipeline at the final time for configuration 2, with two measurement stations, when valve 1 was closed and the other valves were fully open.

Figure 9. Exact and estimated pressure along the pipeline at the final time for configuration 2, with two measurement stations, when valve 1 was closed and the other valves were fully open.

Due to the above difficulties observed for configuration 2 when valve 1 was closed, a case was then considered with three measurement stations located at x = 9 km, x = 46 km and x = 81 km (see Figure b). The results obtained for the valve open percentages are presented in Figures a-c for this case, when valve 1 was closed while the others were fully open. The measurements taken near valve 1 provided useful information for the accurate estimation of this valve’s open percentage, as shown in Figure b. Similarly, valve 3 was accurately estimated as fully open because the measurements at station 2, near this valve, were mostly influenced by the outlet constant flow rate boundary condition. Such as for the case with two measurement stations, there was a trend to estimate valve 2 as closed at the final time, which was caused by the decreasing flow rate and because the pressure tended to become constant upstream of valve 1, after it was closed. However, the sudden closure of valve 1 could be accurately identified few minutes after this event, as shown in Figure b, but the open fraction of valve 2 gradually decreased and tended to zero only near the final time, that is, 30 minutes after the closure of valve 1 was correctly identified (see Figure a). Furthermore, Figures a and 10b show that the open percentage estimated for valve 1 was stable, but that estimated for valve 2 was oscillatory and involved large uncertainties. We note that the closure of either valve 2 or valve 3 could also be accurately identified with three measurement stations, but these results are not presented here for the sake of brevity.

Figure 10. Exact and estimated valve open percentages obtained for valve 1 closed and the other valves fully open, for configuration 2 with three measurement stations: (a) Valve 2; (b) Valve 1; (c) Valve 3.

Figure 10. Exact and estimated valve open percentages obtained for valve 1 closed and the other valves fully open, for configuration 2 with three measurement stations: (a) Valve 2; (b) Valve 1; (c) Valve 3.

Conclusions

This computational work dealt with the detection of the undesired and unexpected closure of automatic shutdown valves in a straight and horizontal pipeline, by solving a state estimation problem with the particle filter method. Two algorithms were compared in this work, namely: the Sampling Importance Resampling (SIR) algorithm and the Auxiliary Sampling Importance Resampling (ASIR) algorithm.

For the numerical simulations, pressure and temperature imposed at the inlet boundary were 6.5×106Pa and 298 K, respectively, while the velocity imposed at the outlet boundary was 6 m/s. Simulated measurements of pressure, temperature and velocity were used for the solution of the state estimation problem. The measurements were simulated by adding Gaussian random errors to the solution of the direct problem. The standard deviations for the measurements of velocity, temperature and pressure were 0.2 m/s, 0.5 K and 2×104Pa, respectively. Standard deviations for the Gaussian evolution models for these state variables were assumed as twice as large, in order to account for uncertainties in the model parameters. The evolution models for the primitive flow variables resulted from the numerical solution of the compressible flow equations in the pipeline, by using a Total Variation Diminishing (TVD) Weighted Average Flux (WAF) scheme. No information was a priori assumed available for the functional form of the open fraction of each valve, which was modelled in terms of an independent Markovian process.

Both algorithms were capable of accurately identifying the sudden closure of a single valve in the middle of a pipeline with length of 90 km and diameter of 18 inch, even with the non-informative evolution model used for the valve open fraction. The ASIR algorithm with 100 particles resulted in RMS errors smaller than those of the SIR algorithm with 1000 particles. For such numbers of particles, the computational time for the ASIR algorithm was about 25% of that for the SIR algorithm. The ASIR algorithm was then applied to a configuration involving three valves in the pipeline. The closure of the valves near the two measurement stations could be accurately detected with the ASIR algorithm. On the other hand, the pressure drop resulting from the closure of the valve in the middle of the pipeline was split between the two other valves, which were then improperly predicted as closed, when the measurements of only two stations near the pipeline ends were used in the analysis. This difficulty could be alleviated by using the measurements of a third station near the valve in the middle of the pipeline, and the closure of such valve could be accurately predicted with the ASIR algorithm of the particle filter. We note that there was a trend to estimate small open fractions for valves upstream of the closed valve. This behaviour was due to the decreasing flow rate upstream of the closed valve, where the pressure tended to be constant and equal to the value assigned at the inlet boundary condition. Hence, the measurements near the pipeline inlet gradually lost sensitivity with respect to which valve was closed. On the other hand, the estimated sudden closure of the correct valve was more stable, involved smaller uncertainties and could be predicted in a shorter time than for the other upstream valves.

The ASIR algorithm of the particle filter method was shown to be an accurate quantitative technique for the detection of the undesired and unexpected closure of automatic shutdown valves in pipelines. Consequently, operators’ judgement and decision about valve closures can be kept at a minimum level. The particle filter method does not rely only on the measured data, but also on the mathematical modelling of the physical phenomena for the flow problem, and takes into account the related uncertainties.

Disclosure statement

No potential conflict of interest was reported by the author(s).

Additional information

Funding

The support provided by CNPq and FAPERJ, agencies of the Brazilian and Rio de Janeiro state governments, is gratefully appreciated. This study was financed in part by Coordenação de Aperfeiçoamento de Pessoal de Nível Superior – Brazil (CAPES) - Finance Code 001.

References

  • Gato LMC, Henriques JCC. Dynamic behavior of high- pressure natural-gas flow in pipelines. Int J Heat Fluid Flow. 2005;26:816–825.
  • Doucet A, De Freitas N, Gordon N. Sequential Monte Carlo methods in practice. New York: Springer; 2001; 178–195.
  • Kaipio J, Somersalo E. Statistical and computational inverse problems, applied mathematical sciences 160. New York: Springer-Verlag; 2004.
  • Ristic B, Arulampalam S, Gordon N. Beyond the kalman filter. Boston: Artech House; 2004.
  • Arulampalam S, Maskell S, Gordon N, et al. A tutorial on particle filters for on-line non-linear/non-Gaussian Bayesian tracking. IEEE Trans Signal Processing. 2001;50:174–188.
  • Robert CP, Doucet A, Andrieu C. Computational advances for and from Bayesian analysis. Stat Sci. 2004;19:118–127.
  • Andrieu C, Doucet A, Singh SS, et al. Particle methods for change detection, system identification, and control. Proc IEEE. 2004;92:423–438.
  • Arulampalam MS, Maskell S, Gordon N, et al. A tutorial on particle filters for online nonlinear/non-Gaussian Bayesian tracking. IEEE Trans Signal Process. 2002;50:174–188.
  • Carpenter J, Clifford P, Fearnhead P. An improved particle filter for non-linear problems. IEEE Proc Radar Sonar Navig. 1999;146:2–7.
  • Kantas N, Doucet A, Singh SS, et al. On particle methods for parameter estimation in state-space models. Stat. Sci. 2015;30:328–351.
  • Del Moral P, Doucet A, Jasra A. Sequential Monte Carlo samplers. J R Stat Soc Ser B Stat Methodol. 2006;68:411–436.
  • Lopes HF, Carvalho CM. Online Bayesian learning in dynamic models: an illustrative introduction to particle methods. In: West M, Damien P, Dellaportas P, Polson NG, Stephens DA, editors. Bayesian dynamic modelling, Bayesian inference and Markov chain Monte Carlo: In honour of Adrian Smith. Chapter 11. Oxford: Oxford University Press; 2013. DOI:https://doi.org/10.1093/acprof:oso/9780199695607.003.0011.
  • Candy JV. Bayesian signal processing: classical, modern, and particle filtering methods. New York: John Wiley; 2008.
  • Orlande HRB, Colaço MJ, Dulikravich GS, et al. State estimation problems in heat transfer. Int J Uncertainty Quant. 2012;2:239–258.
  • Durgut I, Leblebicioglu K. Kalman-filter-based observer design around optimal control policy for gas pipelines. Int J Numer Methods Fluids. 1997;24:233–245.
  • Singhal A, Salsbury TI. A simple method for detecting valve stiction in oscillating control loops. J Process Control. 2005;15:371–382.
  • Horsh A, Isaksson AJ. A method for detection of stiction in control valves. In: Proceedings of the IFAC workshop on line Fault Detection and Supervision in the Chemical Process Industry, 1998.
  • Lamien B, Orlande HRB, Eliçabe EG. Particle filter and approximation error model for state estimation in hyperthermia. J Heat Transfer. 2016;139:12001.
  • Varon LAB, Orlande HRB, Eliçabe GE. Estimation of state variables in the hyperthermia therapy of cancer with heating imposed by radiofrequency electromagnetic waves. Int J Therm Sci. 2015;98:228–236.
  • Lamien B, Orlande HRB, Eliçabe GE. Inverse problem in the hyperthermia therapy of cancer with laser heating and plasmonic nanoparticles. Inverse Probl Sci Eng. 2015;25(4):608–631.
  • Varon LAB, Orlande HRB, Eliçabe GE. Combined parameter and state estimation in the radio frequency hyperthermia treatment of cancer. Numer Heat Transfer A: Appl. 2016;70:581–594.
  • Lamien B, Varon LAB, Orlande HRB, et al. State estimation in bioheat transfer: a comparison of particle filter algorithms. Int J Numer Methods Heat Fluid Flow. 2017;27:615–638.
  • Costa JMJ, Orlande HRB, Velho HFC, et al. Estimation of tumor size evolution using particle filters. J Comput Biol. 2015;22:150514113004000.
  • Silva WB, Rochoux M, Orlande HRB, et al. Application of particle filters to regional-scale wildfire spread. High Temperatures – High Pressures. 2014;43:435–440.
  • Colaço MJ, Orlande HRB, Da Silva W, et al. Application of two Bayesian filters to estimate unknown heat fluxes in a natural convection problem. J Heat Transfer. 2012;134:092501.
  • Anderson J. Modern compressible flow with historical perspective. New York: McGraw-Hill; 1990.
  • Anderson J. Computational fluid dynamics: The basics with applications. Singapore: McGraw-Hill; 1995.
  • Herran A, De La Cruz JM, De Andres B, et al. Modeling and simulation of a gas distribution pipeline network. Appl Math Model. 2009;33:1584–1600.
  • Nouri-Borujerdi A, Ziaei-Rad M. Simulation of compressible flow in high pressure buried gas pipelines. Int J Heat Mass Transf. 2009;52:5751–5758.
  • Ortega AJ, Pires LFG, Nieckele AO. Una alternativa para la simulación numérica del comportamiento térmico en régimen. Información Tecnológica. 2009;20:83–88.
  • Behbahani-Nejad M, Ghanbarzadeh A, Alamian R. Transient flow simulation in natural gas pipelines using the state space model. In: ASME Biennial Conference On Engineering Systems Design and Analysis, 10, 2010. Istanbul: ESDA2010, v.3,p. 409-415, 2010.
  • Chaczykowski M. Transient flow in natural gas pipeline – the effect of pipeline thermal model. Applied Mathematical Modeling. 2010;34:1051–1067.
  • Alamian R, Behbahani M, Ghanbarzadeh A. A state space model for transient flow simulation in natural gas pipelines. J Nat Gas Sci Eng. 2012;9:51–59.
  • Bazargan-Lari MR, Kerachian R, Afshar H, et al. Developing an optimal valve closing rule curve for real-time pressure control in pipes. J Mech Sci Technol. 2013;27:215–225.
  • Toro EF. Riemann solvers and numerical methods for fluid dynamics. 2nd ed. Berlin: Springer; 1999.
  • Ozisik MN, Orlande HRB, Colaco M, et al. Finite difference methods in heat transfer. 2nd ed. Boca Raton: CRC Press; 2017.
  • Yee HC. Numerical approximation of boundary conditions with applications to inviscid equations of gas dynamics. NASA Technical Memorandum 81265, 1981.
  • Laney C. Computational gasdynamics. Cambridge: Cambridge University Press; 1998.
  • Hutchison JW. ISA handbook of control valves. Research Triangle Park: Instrument Society of America – ISA; 1976.
  • Baumann HD. ISA control valve primer. Research Triangle Park: ISA – International Standard Association; 2009.
  • ANSI/ISA-75.02.01-2008. Control valve capacity test procedures. ISA – American National Standard, ANSI/ISA. ISBN: 978-1-936007-11-0, 2009.

Reprints and Corporate Permissions

Please note: Selecting permissions does not provide access to the full text of the article, please see our help page How do I view content?

To request a reprint or corporate permissions for this article, please click on the relevant link below:

Academic Permissions

Please note: Selecting permissions does not provide access to the full text of the article, please see our help page How do I view content?

Obtain permissions instantly via Rightslink by clicking on the button below:

If you are unable to obtain permissions via Rightslink, please complete and submit this Permissions form. For more information, please visit our Permissions help page.