The research presented in this paper is devoted to the simulation of distribution gas network assets when operated in a non-conventional way such as the injection of a fixed biomethane gas flow rate at a medium pressure tier. As this research aims to focus on the dynamics of the gas network when there is a mismatch between biomethane production and availability, a suitable fluid-dynamic model should be used.
In the following section, the mathematical procedures for the formalization of the computational model are described. The model is written as MATLAB code and the simulations are performed in a MATLAB environment.
2.1. Gas Network Model Description
Fluid network models aim at solving the fluid-dynamic of the networks by determining the pressures of each junction of the infrastructure and the gas flows within each pipeline. A network is often represented as a topological object: an oriented graph, i.e., a mathematical representation of the connections between one junction and the others, thus defining the pipelines. In the mathematical taxonomy, the junctions are called nodes or vertices and the connections (with a direction specified) are the branches or edges. In the case of fluid networks, the edges are the pipelines.
When setting up a computational model, one of the most effective ways to represent a graph (i.e., the information about the structure of a network) is by an algebraic mean: the incidence matrix. This is defined as follows:
For a network topology with n nodes and b edges (pipelines).
This algebraic structure is key for the solution of the fluid-dynamic problem for the whole network once the system of equations expressed for a single pipeline and node is linearized.
The fluid dynamics within a single pipe can be described by applying the following couple of conservation equations (here given in their 1D differential form):
Conservation of momentum
where:
: fluid density ;
: fluid velocity ;
: fluid pressure ;
: friction factor ;
: pipeline diameter ;
The 1D simplification is justified by the fact that in pipelines the x-dimension, along the length, is often greater than the cross-sectional dimensions, thus allowing to consider the phenomena occurring on the cross-sectional plane as negligible. It is worth noting that the problem does not take into account temperature (allowing to avoid the third conservation equation—of energy). It is very common to assume the isothermicity of the problem given that most of the pipelines are typically buried at least one meter underground, thus making it possible to consider the surrounding temperature as constant and a thermal equilibrium between the gas, the pipeline, and the environment.
As additional simplifying assumptions, the kinetic and the gravitational terms (the second and the last terms in Equation (2)) can be neglected as commonly assumed in literature [
26].
These assumptions are frequently adopted in the literature [
26,
27,
28], in commercial software, and by distribution system operators (DSOs) for their ordinary business operations.
The fourth term in Equation (2) is the shear force term in which
is the friction factor, which can be calculated using semi-empirical correlations as a function of the Reynolds number. In this specific case, the correlation used is the Cheng explicit formula [
29].
In order to conclude the mathematical formulation of the problem, the equation of state for real gas has been considered:
: compressibility factor ;
: Universal Gas Constant ;
: molar mass ;
: temperature ;
The compressibility factor
is determined through the GERG 2008 equation of state [
30], a multiparameter equation of state explicit in the Helmholtz free energy.
Having to apply the fluid-dynamic description given by the system of conservation equations to a problem where the knowns are pressures and gas flow rates, the equations are rewritten in terms of mass flow rates using the following definition:
Thus, the conservation equations refer to more relevant quantities (with respect to the problem).
Now regarding the conservation of mass, the transformation of the differential equation to the algebraic equation, useful to be integrated into the complete network model, is given by its application on a control volume surrounding the generic
i-th node (
Figure 1)
After the integration of Equation (4) to the control volume, the time discretization by applying the backward Euler method, the generalization to the whole network of the nodal mass balance results in the following matrix form:
where
is the identity matrix and
a diagonal matrix defined as follows:
Concerning the momentum Equation (5), its integration over an entire pipeline of length
and its time discretization by applying the backward Euler method allows writing an equation for the pressure drops as follows:
where the substitution of a variable such as
allows for a first attempt to linearize the problem, and the coefficients of the right represent two resistance coefficients representing the two physical phenomena contributing to the pressure variation along the pipeline:
; | ; |
The first (subscript I) is the inertia contribution, which is proportional to the mass flow variation during the time interval . The second is the fluid-dynamic friction (subscript F) within the pipe, quadratically proportional to the fluid velocity (and thus the mass flow).
As Equation (8) is a quadratic function of the mass flow, a linearization procedure is to be followed in order to build the full algebraic problem for the transient gas network solution. The linearization strategy has been presented in [
31]. The pipeline-linearized equation for the whole network becomes:
where
,
and
are the (
b ×
b) square diagonal matrices whose general elements (
j, j) are the coefficients of Equation (8) (and their combinations according to the linearization procedure) corresponding to the
j-th pipe. Of note is that the operator
stands for the element-wise product.
In order to refer to the vector of nodal pressures , the whole equation has to be divided by for each pipeline j.
It is worth noting that the right-hand side of Equation (9) is the known term of the equation, and it is composed of the “old” mass flow , belonging to the previous timestep, and of the “tentative new” mass flow , originated from the iterative procedure for the solution of the linearized version of the pipeline equation.
The algebraic system formed by Equations (9) and (6) accounts for b + n equations with b + n + n unknowns, these being:
b mass flow rates for each pipe;
n pressures for each node;
n mass flow rates exchanged with the external environment.
An additional set of n equations needs to be provided. This set of equations is in fact representative of the n boundaries conditions, which needs to be specified at any nodes of the network.
A general linear equation can be written to include all the possible cases of nodal control modes, which acts as boundary condition assignment in terms of mathematical formalization of the problem. The equation, in its scalar form results as:
where the coefficients
and
assume either value 0 or 1 according to the control mode of the
i-th node, and
is the set point value of pressure or exchanged mass flow for the time step
.
This equation is valid for the n node, thus providing the set of equations that were missing.
Table 1 sums up the possible nodal control mode and the corresponding boundary equations that originate.
The fluid-dynamic model of a complete gas network under non-steady state assumptions is given in the form of a linear matrix equation, which is the result of the composition of the pipeline equation, Equation (9), and the nodal balance equation, Equation (6), together with the matrix version of Equation (10), which includes all the boundary conditions of the problem. The complete problem takes the following form:
Knowing the state of the network at time step , it is possible to compute the nodal pressures, pipeline mass flows, and the nodal mass flows injected/withdrawn at time step , according to the set points at the boundaries, thus defining the subsequent state of the network. Repeating this operation for the whole simulation interval, the evolution in time of the gas network is simulated. It is worth noting that, even though the complete problem in Equation (11) has the form of an algebraic system of equations, the computation of the gas network state at time step is performed by means of an iterative procedure. The need for an iterative procedure originates from the linearization approach to simplify the non-linearity of the momentum equation. The coefficients of matrices , , and all depend on the unknown pressures and the mass flows. It is thus necessary to check for the approximation errors through the evaluation of the residuals: the solution of the ()-th iteration is substituted within the continuity equation and the momentum equation in order to evaluate the residuals of the mass and momentum equations ( and ).
One of the most common convergence criteria refers to the Euclidean norm of the residual vectors. Most stringently, one can refer to the maximum value among the elements of the vectors. The possible set tolerance is (10−3 ÷ 10−8).
2.3. Case Study Description
The case study refers to a small municipality composed of two urban agglomerations, three industrial areas, and rural areas surrounding these major consumption centers. It covers a surface of 29 km
2 with a population of approximately 6500 inhabitants and 3262 active gas meters, only 6% of which are classified as industrial users. The annual gas consumption of the area is equal to 8.25 MSm
3. Despite the proportions of the gas meters, the industrial users generate 59% of the annual gas consumption of the whole area while the remaining 41% is generated by the residential and tertiary sectors. The gas network modelled in this work corresponds to the real network asset of the case study. The authors have already used this infrastructure for previous studies, thus more details on the technical feature or the gas consumption profiling are presented in [
25]. A simplified and distorted scheme of the network topology is given in
Figure 2. Only the medium pressure tier, corresponding to gas pressure in the range [5–1.5] bar
g, will be addressed in this study. The fossil natural gas inlet node is highlighted with a yellow triangle while the green triangle indicates the location of the biomethane injection. Bullet-shaped nodes represent a user or a cluster of users (i.e., a gas exit point).
Concerning gas consumption and profiles, the only real available data consist of yearly basis gas consumption. For the sake of this case study, a higher time resolution would be desirable (at least 1 h). While the procedure of distributing the yearly gas consumption into a daily profile is regulated by the Italian energy authority through resolution 229/2012 [
32], some assumptions have been made to generate infra-daily profiles.
A set of daily gas consumption profiles have been proposed and reported in
Figure 3. The profiles are the hourly fraction of the total daily consumption. The hourly profile of each user can be obtained by multiplying the daily consumption with the profile corresponding to the user category.
The different colored bars refer to the different categories of gas usage, following the definitions given in resolution 229/2012 [
32]. There are five relevant to the case study and they are listed with a short explanation in
Table 2.
It is worth noting that the indication of seasonality is relevant for the infra-annual profiling starting from the aggregated yearly values. In fact, all seasonal-dependent categories undergo a major change in the daily gas consumption when shifting from the space heating season to the warmer season causing the typical difference between the overall network winter consumption and summer consumption. Besides this, to complete the overview of the final users’ taxonomy, for each of these gas usage categories, three additional withdrawal classes are assigned, depending on the weekly frequency of the use of gas as described in
Table 3.
The case study presented here is built around the testing of the scenario of biomethane injection. The rural area is already equipped with a biogas power plant of 1 MWe, thus an assumption is made consisting of repurposing the existing plant for biomethane production. As a result of the repurposing, the biomethane flow rate availability has been estimated to be around 260 Sm3/h, as previously mentioned. The choice of the injection node has been done by considering the shortest possible path.
2.4. Methodology
As the overall gas consumption of a distribution network usually has a remarkable variation from the winter season to the summer, while biogas and biomethane production is more or less constant in the business-as-usual scenario, issues of mismatches between production and consumption may arise, especially if the distribution networks serve smaller communities.
The case of gas accumulation within the linepack of the infrastructure is thus considered and the measures for the improvement of linepack storage are tested in this work.
At first, the pressure level set point is lowered by 1-bar steps, in order to unlock linepack capacity, considering as the maximum acceptable linepack value, the one generated by a network that is set to 5 barg as the operating pressure.
For each case, the hydraulic verification of the network is performed for both the non-injection and the injection cases. The first verification is needed to guarantee that nodal pressure does not drop below a minimum value. The second verification checks the gas accumulation curve and the network saturation time.
In the second phase, a reduction of the injected biomethane is imposed to modify the gas accumulation curve in order to determine the proper balance among biomethane injection, gas consumption, and linepack accumulation, which guarantees that the network operates within its limits.
The injection scenario determined through this analysis is then verified on a sequence of critical summer days, in which modifications of the pressure set points are also simulated to set up the case of modulating inlet pressures.