# Distributed Fault Detection and Isolation Approach for Oil Pipelines
## 4 Case Study: FDI System for Oil Pipeline
### Mathematical Modeling of Oil Pipeline  
The mathematical modeling of the processes involved is needed for the design of distributed fault detection and isolation systems [8; 9]. This mathematical modeling may \begin{table}
\begin{tabular}{l c c c} \hline
**No.** & **Pump Type** & **Q-H Equation** & **P.s.h., m** \\ \hline
1. & II 2500-230 & \(\Delta H=251-0.812\cdot 10^{-5}Q^{2}\) & 40 \\
2. & II 3600-230 & \(\Delta H=285-0.640\cdot 10^{-5}Q^{2}\) & 40 \\
3. & II 5000-210 & \(\Delta H=236-0.480\cdot 10^{-5}Q^{2}\) & 40 \\ \hline \end{tabular}
\end{table} 
Table 2: Characteristics of pumping stations. Figure 4: A view of the oil pipeline under study. Figure 5: Diagram of the oil pipeline under study. differ in complexity depending on the intended applications; see, for example, [40; 41; 42; 43; 44]. In general, the oil flow within a pipe is governed by the fundamental laws of mechanics and thermodynamics and constitutes a fluid flow system [4; 45]. The mathematical modeling of the oil pipeline under study is developed by applying the basic fundamental equations of fluid flow, which are the continuity equation, the momentum equation, and the energy equation [4; 45]. The continuity equation of the transported oil in the pipeline is based on the law of conservation of mass, and it is represented as [45]:  
\[\frac{\partial\rho S}{\partial t}+\frac{\partial\rho vS}{\partial x}=0 \tag{2}\]  
where \(\rho\), \(v\) are the density, and the velocity of oil, \(S\) is the pipeline cross-section area, \(x\) is the coordinate along the pipeline axis, and \(t\) is the time. The momentum equation which describes the force balance on the fluid within the pipeline is presented as [18]:  
\[\rho\left(\frac{\partial v}{\partial t}+v\frac{\partial v}{\partial x}\right) =-\frac{\partial p}{\partial x}-\frac{4}{d}\tau_{w}-\rho g\sin\alpha(x) \tag{3}\]  
where \(p\) is the pressure, \(d\) is the pipeline internal diameter, \(g\) is the gravity acceleration; \(\tau_{w}\) is the tangential stress at the pipeline internal surface, and \(\alpha(x)\) is the slope of the pipeline axis to the horizontal. The equation of mechanical energy balance is written as [46]:  
\[\frac{\partial}{\partial t}\left(\frac{\alpha_{k}v^{2}}{2}\right)+v\frac{ \partial}{\partial x}\left(\frac{\alpha_{k}v^{2}}{2}+P(\rho)+gz\right)=vgi \tag{4}\]  
where \(z\) is the geometric head, \(i\) is the hydraulic gradient, and \(P(\rho)\) is a function of the pressure such that:  
\[dP=\frac{dp}{\rho},P(\rho)=\int\frac{dp}{\rho},\frac{1}{\rho}\cdot\frac{ \partial p}{\partial x}=\frac{\partial P(\rho)}{\partial x} \tag{5}\]  
and \(\alpha_{k}=f(\rho,v,v,d)\), where \(v\) is the kinematic viscosity of the oil flow rate. The equation of total energy balance is represented as [47]:  
\[\frac{\partial}{\partial t}\left[\left(\frac{\alpha_{k}v^{2}}{2}+e_{in}\right) \rho S\right]+\frac{\partial}{\partial x}\left[\left(\frac{\alpha_{k}v^{2}}{ 2}+J\right)\rho vS\right]=\tau dq_{n}-\rho vgS\frac{\mathrm{d}z}{\mathrm{d}x} \tag{6}\]  
where \(e_{in}\) is the internal energy, \(J=e_{in}+p/\rho\) is the enthalpy or heat content, \(q_{n}\) is the heat flux. Equations (2)-(4) and (6) are the set of one-dimensional, partial differential equations used for mathematical modeling of oil flow within the pipeline. In stationary flow, all parameters of the transported oil at each cross-sectionof the pipeline remain constant, which is independent of time. Therefore, for the stationary flow, the basic equations describing the oil flow are the following:  
The continuity Equation (2) leads to the equation [18]:  
\[\frac{\mathrm{d}\rho vS}{\mathrm{d}x}=0 \tag{7}\]  
which means that the mass flow rate \(\dot{M}=\rho vS\) of the transported oil stays constant.