## 3 Modelling of a Gas Network  
A large amount of NG is transported long distances through the high-pressure pipeline network. Therefore, modelling/simulating of a gas transmission system with sufficient accuracy and fast calculations methods is beneficial in understanding how the system will behave. Evaluation of the feasibility of networks to cope with new customers, as well as the ability to determine the capacity of the current network, or to forecast the response of the system to any changes in supplying nodes (decrease/outage), as well as designing new gas network systems are areas where modelling can be used. The differential equations are used depending on the working pressure of the network and the operational conditions [19]. The major equations that must be satisfied in modelling gas flow in a pipeline are:  
* Mass conservation equation (equation of continuity). * [PERSON]'s second law of motion (conservation of momentum). * Energy equation (thermodynamic first law) and the equation of state. According to forces' directions in a pipe, the governing equation has been extracted, which is shown in Figure 1 and from [PERSON]'s second law of motion-momentum Equation (3). The common equation for the steady-state flow of gas through a pipe is derived from [PERSON]'s equation of fluid flow, including changing density of gas due to the pressure drop along the pipe in the direction of flow. The equation of mass conservation from inlet Point (1) to outlet Point (2) is shown in Equation (2). \[\rho_{1}w_{1}=\rho_{2}w_{2} \tag{2}\]  
where \(\rho\) is density and \(\omega\) represents flow velocity. \[\frac{\partial\rho}{\partial t}+\frac{\partial(\rho w)}{\partial x}=0 \tag{3}\]  
[PERSON]'s second law of motion (conservation of momentum) in Equation (4):  
\[\frac{\partial(\rho w)}{\partial t}+\frac{\partial(\rho w^{2})}{\partial x}+ \frac{\partial p}{\partial x}+\frac{f\rho w|w|}{2D}+\rho gsin(\theta)=0 \tag{4}\]  
where the following terms describe each portion of Equation (4):  
\(\frac{\partial(\rho w)}{\partial t}\): inertia force (acting against the flow direction through the pipe)  
\(\frac{\partial(\rho w^{2})}{\partial x}\): convective term  
Figure 1: Forces effective on a specific volume of gas flow through a pipeline. \(\dfrac{\partial p}{\partial x}\): pressure force  
\(\dfrac{f\rho w|w|}{2D}\): shear force  
\(\rho gsin(\theta)\): force of gravity  
The variable pressure, \(p\), and displacement, \(x\), have been changed to \(p+dp\) and \(x+dx\), respectively, which have been identified in [PERSON]'s Equation (5):  
\[\dfrac{p}{\rho g}+\dfrac{w^{2}}{2g}+z=\dfrac{p+dp}{\rho g}+\dfrac{(w+dw)^{2}}{ 2g}+(z+dz)+dh_{f} \tag{5}\]  
where \"\(dh_{f}\)\" is the head losses, \(i\) and \(j\) are sending and receiving nodes, respectively, and \"\(z\)\" is pipe elevation. The first law of thermodynamics expresses the conservation of energy and for a system may be written as:  
\[\Omega-W=\Delta E \tag{6}\]  
where \"\(\Omega\)\" is the heat added to the system, \"\(W\)\" is the work done by the system, and \"\(E\)\" is the change in energy of the system. Energy associated with the mass of the system is customarily separated into three parts:  
\[E=U+\dfrac{1}{2}mw^{2}+mgz \tag{7}\]  
where \"\(U\)\" is the internal energy associated with molecular and atomic behaviour, \"\(\dfrac{1}{2}mw^{2}\)\" the kinetic energy, and \"\(mgz\)\" the potential energy associated with the height. If the rate of work \(\dfrac{dW}{dt}\) on the flow is zero, Equation (6) can be written as [46]:  
\[d\Omega=\dfrac{\partial(\rho Adx)}{\partial t}(u+\dfrac{w^{2}}{2}+gz)+\dfrac{ \partial(\rho wA)}{\partial x}(u+pv+\dfrac{w^{2}}{2}+gz)dx \tag{8}\]  
The final energy equation for gas flow in a pipeline can be expressed in two cases: firstly, an adiabatic flow (d\(\Omega\) = 0); secondly, an isothermal flow. In adiabatic flow, the rate of heat change will be zero, and in the isothermal flow, temperature will remain constant (T = constant and d\(\Omega\) \(\
eq\) 0) [47].