1. Introduction
Considering the new strategic view on the policy area “Clean Energy” within the European Green Deal [1]—a roadmap towards a sustainable economy developed by the European Commission—the energy infrastructure in Europe is expected to change drastically over the next years. On the one hand, the Hydrogen Strategy [2] is meant to promote the emergence of a hydrogen infrastructure that complements and partially replaces the existing natural gas infrastructure. The Energy System Integration Strategy [3], on the other hand, aims at an increased interconnection of energy sectors and markets. It describes an energy infrastructure design that allows consumer needs to be satisfied through different energy carriers, thereby increasing its overall efficiency and resilience. These targeted changes will increase the complexity of the energy system as a whole.
As of today, different energy infrastructures are designed and operated independently from each other. Unlocking the potential of sector integration requires a “new, holistic approach for both large-scale and local infrastructure planning” [3]. Methods and tools for infrastructure design need to reflect the increased complexity in order to address many challenges on all scales and in all parts of the energy system design [4]. Challenges will occur in the following fields:
Assessment of supply options with different energy infrastructures: With increasing interconnection of infrastructures, how energy is supplied to end consumers can vary greatly. For instance, Then et al. [5] gave an overview of studies on the controversial role of the natural gas infrastructure and elaborated on the effects that a decline in energy demand can have on grid charges. In [6], they put forward that increasing grid charges could accelerate gas grid defection as a self-induced effect. Kisse et al. [7] investigated the effects that changes in heating technologies for residential buildings have on investments into electrical and gas grid expansion as well as on CO2-emissions. To improve the prediction of suitable supply scenarios for network operators in a multi-energy system (MES), methods and models have to consider all energy infrastructures in a combined optimization approach.
Grid integration and expansion in coupled energy infrastructures: The progressive electrification and renewable generation increases both load and generation in distribution grids. All new devices and power plants must be integrated on the respective voltage level which often spurs network operators to expand or re-design their power grids. In the future, this planning process needs to address the increasing interconnection to other infrastructures and new opportunities for trading flexibility or storing energy [8]. Approaches should consider the possibility to rededicate parts of the infrastructure to other carriers or even dismantle infrastructure that is no longer required [2,5]. It is crucial to identify suitable investment paths toward a future supply infrastructure taking into account the longevity and high capital expenditure of infrastructure assets. These challenges also have to be reflected by large-scale grid integration and expansion studies (e.g., [9,10]).
Analysis and optimization of operation strategies: Sector coupling facilities, such as combined heat and power (CHP) plants, heat pumps or power-to-gas (P2G) devices, are expected to deliver ancillary services for power system operation (e.g., frequency support, voltage support, congestion management, etc.). Although such services are mainly required in the power grid, operation strategies should be optimized by respecting the operational constraints of all connected infrastructures. For example, Liu et al. [11] analyzed different operation modes of CHP plants and how they influence power and gas grid constraints. In [12], an optimal power flow (OPF) implementation is presented that includes constraints from the gas grid as side conditions.
Urban planning: The planning phase of new districts offers great potential for low-cost decarbonized energy supply by implementing small MESs with optimized grid infrastructure [13]. To address arising challenges of urban planning, the spatial and energy infrastructure planning need to be interconnected [14]. Forming so-called energy communities with high shares of renewable energy sources (RES) and local trading capabilities can play an important role in increasing energy efficiency and is therefore incentivized by the European Union [15]. In such small systems, choosing and optimizing the operation strategy is crucial in order to use energy locally or to offer ancillary services to the external power grid [16].
Market design: If sector coupling facilities deliver flexibilities or other ancillary services, they also need to be remunerated. Mancarella et al. [17] suggested an approach to determine the profitability of MES, which deliver ancillary services, by considering the revenue and the cost of energy shifting. With an increased interest in local energy markets [18] comes a need to analyze approaches with respect to the technical and economic performance. For such analyses, the complex state of the whole MES and market mechanisms need to be modeled.
The challenges described above require powerful tools for coupled multi-energy grid (MEG) simulation and optimization. Several modeling and optimization approaches are presented in [19] (and the references cited therein). In this work, we introduce the open source tool pandapipes which is meant to simulate stationary and quasi-stationary flows in pipes, considering hydraulic and thermal properties of the flowing fluid. It complements the open source power system analysis tool pandapower [20], as it is based on the same structure and implements similar core methods, such as the Newton–Raphson solver. The two tools can be combined into a powerful and easy-to-use MEG simulation environment with the help of the pandapipes multi-energy module. As both tools are published under the terms of a 3-clause BSD license, they can be used by anyone for any purpose free of charge. Since pandapipes is based on Python, this tool can be combined with any other Python package for further analysis. For instance, there are interfaces to NetworkX [21] for topology analysis, to matplotlib [22] for plotting and to geopandas [23] for processing geographical information. All these characteristics enhance the potential of pandapipes to automate processes and easily adapt models and simulation setups. Therefore, pandapipes is well suited to address the challenges of energy infrastructure analysis and planning. Since the coupling with pandapower is very simple, many use cases that have already been addressed with pandapower can be adopted to an integrated approach.
In the present work, we want to evaluate the innovative potential of pandapipes. Section 2 gives an overview over different approaches to MEG simulation and derives three criteria to be addressed by a dedicated tool: clear data structure, adaptable MEG model setup and performance. Section 3 introduces pandapipes and describes its structure and model implementations, thereby illustrating how these criteria are addressed. Section 4 demonstrates two use cases that were implemented with the help of pandapipes. In the first use case, we analyze local peak shaving strategies with the help of a heat pump connected to a district heating grid. We show that operation strategies and their effect on all involved networks can be examined by applying the combination of pandapower and pandapipes. In the second use case, we analyze the potential of P2G devices to reduce congestion in a power grid without violating constraints of the connected gas grid. The presented simulation approach enables large-scale analyses on the effectiveness of P2G devices in different configurations to find a suitable system design. Section 5 concludes on how pandapipes enhances the toolbox of researchers working in the field of MEG analysis and gives insights into possible enhancements to further simplify MEG simulations and to address other types of problems.
2. Multi-Energy Grid Simulation: Overview of Approaches and Requirements
Approaches for the simulation of coupled energy infrastructures can have different levels of detail, making them especially suitable for specific use cases. Thus, a large tool landscape has evolved, of which Table 1 shows an excerpt. We characterize the tools by licensing, modeled infrastructures, model detail and the possibility to conduct coupled simulations, i.e., simulations of power, gas and district heating grids based on a single interlinked model in one simulation run. Of special interest for the research community are open source tools, as they are customizable, automatable and mostly free of charge. Commercial tools usually have a strong focus on the user interface and usability. We distinguish three tool categories: grid simulation (GS) tools, energy system modeling and optimization (ESMO) tools and MEG simulation tools.
The characteristic of GS tools is that they offer detailed grid models, sometimes even for different infrastructures, but they cannot be coupled within the simulation. ESMO tools analyze power flows between defined areas with a strong focus on energy balancing. Therefore, they precisely model power plants and devices with their control strategies and characteristics such as efficiency or ramp rates. As they do not provide detailed grid models, they can easily integrate all infrastructures within one simulation. Such tools can be used for optimal power system design or power plant deployment planning, i.e., in a flexibility market model used for power balancing.
None of those tools offers sophisticated models for integrated infrastructures, as either the grid model is simplified, or a coupled simulation is not possible. For the simulation of MEGs, two approaches are prominent: Combining dedicated tools with the help of a co-simulation platform and integrating all models in one tool. As pointed out in [24], the main advantage of a co-simulation approach is the possibility of integrating any tool, while leaving the development to the respective experts. Furthermore, distributed simulations can be performed online so that participants can exclude exchange of internal data. Nevertheless, there are also downsides to this approach: Firstly, exchanging data between two or more tools via an external interface is time consuming and usually acts as a bottleneck for complex simulations resolved in space and time. Moreover, the design, functionality and licensing of coupled tools might introduce difficulties for the user to set up the model. Most co-simulation approaches are tailor-made [25] and those with a wider scope might not fit for specific applications [26]. In recent years, dedicated tools were developed for addressing problems in the field of MEG simulation and to overcome the previously mentioned problems of co-simulation. Tools that enable the user to easily run simulations with models for all infrastructure types are rare and have not yet found their way into the open source community, as shown in Table 1.
The main challenge of setting up MEG simulations lies in the complexity of the addressed problems [43]. Therefore, a tool that is designed to solve a multitude of different problems in this field must focus on tackling this challenge, especially considering that user experience might differ greatly. A consistent design is crucial, and the first simple models should be very easy to build, while complex models should be solved efficiently. From these requirements, we derive three criteria that should be addressed by a dedicated tool:
Clear Data Structure: Mastering the complexity of MEG simulations is only possible if the data is contained in a clearly structured database that allows storing large amounts of data. This is true for the model data of the coupled grids as well as the output data, especially from time series simulations. Many tool descriptions highlight the way data are stored and handled due to convenience and efficiency [20,32,35].
Adaptable MEG Model Setup: The construction and adaptation of a full simulation model should be simple and efficient. This requires pre-defined, but adaptable models for grid components and sector coupling facilities with their physical properties and respective control strategies. Extensive component libraries are important parts of tools in the area of MEG simulation [38,41]. A permissive open source license is a good precondition to encourage model development [32]. The coupling of simulations for different infrastructures should be as simple as choosing which grids to couple and defining the models for coupling facilities. Different simulation types should be available and combinable, e.g., steady-state, transient or OPF, in order to address different levels of detail of specific use cases.
Performance: In research, the evaluation of many different setups and use cases is of interest. When performing large-scale studies (e.g., [10]), the simulation time plays an important role to be considered in the design of the tool. From the user’s point of view, it should also be considered that spending a lot of time waiting for calculations to finish can be very inconvenient and inefficient. Model efficiency and simulation speed is therefore also addressed by many tools [20,31,38,40].
As most of the MEG simulation tools introduced in Table 1 are closed-source or based on proprietary software, these criteria are hard to analyze, but some publications give hints. SAInt implements an OPF formulation considering AC power flow equations, transient gas grid equations and coupling terms and is mainly used to analyze outages in coupled transmission grids. A lot of emphasis is put on an increased performance by using a specialized solver. HyFlow implements a power transport formulation for power, gas and heat grids, linked by simplified coupling terms and solved with a Newton–Raphson approach. The field of application is the analysis of power balancing using a cellular approach. MYNTS uses an expression tree formulation of component equations for automatic differentiation, which are solved with non-linear programming solvers. Its main field of application is the evaluation of supply scenarios for gas transport grids, but also coupling terms can be implemented with the generic approach. TransiEnt is a modelica library that defines transient and steady-state equations for the calculation of MES. Its modular approach and different levels of simulation detail allow different simulation setups. Applications have shown the interconnection of operation strategies for different components.
Next to TransiEnt, pandapipes is with its specialized multi-energy module the only MEG simulation tool with an open-source license. Unlike the former, it can even be used without any proprietary software required. It was developed along practical use cases and designed to fulfill the three aforementioned criteria. The multi-energy module integrates pandapipes and pandapower to address challenges in the field of coupled MEG planning and operation. Pandapower has already shown to be well suited as a tool for solving automated planning problems [44], thereby considering different effects such as restoration [45], operation strategies [46] or asset management [47]. It was also used for testing new approaches to contingency analysis [48], curtailment minimization of distributed generators [49], state estimation [50] and fault occurrence evaluation [51]. Its special potential lies in the application within studies that analyze large grid areas in an automated approach, such as grid integration studies [10,52] or energy loss studies [53,54]. Due to its similar design and performance, pandapipes can perform similar studies for piping grids and in combination with pandapower also for MEGs.
3. Overview of Pandapipes
In the previous section, we introduce three criteria for an MEG simulation tool. In the following, we illustrate how pandapipes meets those criteria through a comprehensible design and an efficient calculation method. We introduce the pandapipes grid data structure and the controller architecture, demonstrate how this architecture can be used to build up multi-energy grid simulation models and finally compare the performance of the pipe flow calculation with calculation times of the popular proprietary software STANET®.
3.1. Illustrating Clear Data Structure: Architecture of Pandapipes
In pandapipes, nodes and edges of a network are defined by component models. Every component model introduces equations, describing the physical properties that are solved for. The equations are assembled into a nonlinear system of equations that comply with Kirchhoff’s laws. This system of equations is solved with the Newton–Raphson method. As a result, pandapipes provides pressure values at all nodes in the network and the corresponding flow velocities along the different edges. If a heat grid is modeled, pandapipes also determines temperature values at the nodes. Further properties can be derived from these dependent variables.
3.1.1. The Pandapipes Grid Structure
Different parameters have to be provided by the user to properly set up the mentioned system of equations. The grid model data are stored in a dedicated data structure; the pandapipes net container is shown in Figure 1. It contains pandas tables for different components and additional parameters required to run a simulation, which is an analogy of the pandapower structure. There are two main types of tables: component tables and result tables. Component tables contain all the modeled grid elements with their respective nameplate parameters. For example, the pipe component table contains the two connected junctions along with the parameters length, diameter, roughness and an additional loss coefficient. Those values are required for the hydraulic state simulation. Furthermore, it is possible to set an external heat source or sink, an external temperature and a heat transfer coefficient for the heat transfer calculation. Result tables contain the simulation results for the given component. For some components it is also useful to record geo-information in a separate table. An overview of existing component models in pandapipes is given in Appendix A.
Properties of the operating fluid, such as density for different temperatures and pressures, are stored in the grid container as well. They can be freely defined by the user or chosen from an included fluid library. Other stored parameters are standard types for components, as pumps or pipes, and further options to be set by the user. The available component models are held in a list for each pandapipes net for the internal process. Other internal data include an internal array structure and lookup tables for the conversion between the component tables and the internal structure.
3.1.2. The Pipeflow Procedure
After defining the input data inside the component tables, the calculation can be started by calling the pipeflow function. Figure 2 shows the procedure of the calculation. With the help of the component models, all component tables are transferred to an internal numpy array structure, which is more efficient than the pandas structure, and equations are introduced for the derivatives of the state variables. A connectivity check makes sure that disconnected grid areas are excluded from the calculation. Afterwards, the hydraulic state variables are solved for with the help of a Newton–Raphson solver, which usually requires several iterations to converge. For heat grids, a subsequent heat transfer calculation also uses a Newton–Raphson solver to calculate the node temperatures. In the end, the state variables and derived results are transferred to the result tables.
The most important equations are introduced by branch components which define the pressure loss and the heat transfer model. Node components implement a mass flow or power balance. The mathematics behind the component models in pandapipes and how they are set up into a system of nonlinear equations is presented in Appendix A. In the current version of pandapipes, it is possible to calculate hydraulic properties for compressible and incompressible media and to perform a subsequent heat transfer calculation for incompressible media.
3.1.3. The Controller Architecture and Time Series Simulations
Typically, not only one stationary state is of interest, but instead the grid state has to be observed over a specified period of time, for example a representative day or a full year. For this purpose, pandapipes provides a dedicated function that starts a loop over the time period, as shown in Figure 3. The resolution can be defined by the user and should be chosen such that steady-state simulations are applicable. Typical increments range between minutes and one hour. Since each time step is calculated separately, there is no limitation in the number of time steps, and the simulation time scales linearly. Connected devices can be modeled with the help of time series data stored in a file or through a dedicated control scheme. Time series data are loaded in every time step and handed over to the grid structure in the time step initialization. For the implementation of control schemes, a controller architecture is implemented in pandapipes that is based on pandapower (cf. [55]). Controllers can be used to control process variables (e.g., the pressure at a specific node) by setting reference variables (e.g., the feed-in at this node). As they are implemented as Python classes, a new controller class can inherit properties, especially the interface to the data structure, from a controller parent class. Developers who need to introduce a new model can thus focus on the physical modeling. In every time step of the time series loop, an internal control loop is started that iterates over the controllers and performs several pipe flows until all controllers are converged.
3.2. Illustrating Adaptable MEG Model Setup: Introduction to Pandapipes Multi-Energy
The coupling points of energy infrastructures are facilities such as CHP plants, heat pumps or P2G devices. As their specific models are usually not inherent to a grid calculation, they need to be implemented in a separate structure. In the relevant literature, the concept of energy hubs is prominent in modeling such facilities [56,57]. An energy hub is a generic formulation of a unit that stores or converts energy between different infrastructures. The energy conversion and storage must follow rules which are usually defined by a control scheme.
For this purpose, the multi-energy module of pandapipes extends the controller architecture to couple different grids with the help of special coupling controllers. It defines a superordinate MEG structure containing several grids along multi-energy controllers that can model the energy transfer between them, as shown in Figure 4. For example, a heat pump can be modeled as a unit that converts electrical energy as an input from a power grid into a heat flow as an output to a heat grid. With the help of a heat pump characteristic and the heat grid temperature as second input, an operating point with its coefficient of performance can be calculated. If it is used to control the temperature at the outlet node, several control iterations with successive pipe flow calculations can be necessary to set the power correctly. As the controllers exchange data with the connected grids for the purpose of controlling certain variables, it is easily possible for them to also ensure a correct model of the energy transfer. Thus, they serve as energy hub model implementations as well.
The described approach differs from those used in other MEG simulation tools, as the equations of components in different infrastructures are not summed up in a single system matrix or problem formulation. Therefore, it allows for a high degree of flexibility; nevertheless, it leaves power balance checks to the controller implementations and might lead to a slightly lower performance. Although different calculations for different infrastructures are necessary, such as in an approach using a co-simulation platform, all calculations are performed within the same environment, and no communication interface between different tools is required. This drastically reduces the communication overhead and simplifies the model setup. Moreover, the co-simulation is only performed on the inner structure of the model; a user does not need to learn the specifics of different tools that are plugged together, as pandapipes and pandapower implement an analogous user interface.
In the case of MEG simulations, time series studies are of special interest, as the coupling facilities can be used to shift power peaks in time. Time series simulations also allow analyzing the effectiveness of a certain control scheme. For this purpose, the multi-energy module defines a specialized time series simulation setup for MEGs. In each time step, the controllers of the individual grids are called along with the multi-energy controllers for coupling. Several simulations of each grid might be required until all controllers converge. The multi-energy grid model is the core of the MEG simulation environment based on pandapipes and pandapower. This simulation environment can serve as basis for a framework to tackle challenges in the field of planning and operation analysis of MEGs.
3.3. Illustrating Performance: Comparison between Pandapipes and STANET®
Studies that analyze the operation and design of MEGs usually require a large number of evaluations in different configurations. Furthermore, these studies often require time series simulations as mentioned previously. Therefore, a detailed study of different configurations of an MEG setup can easily require several thousands to millions of single simulation steps, demanding a highly performant core. This requirement can be satisfied by the use of pandapipes. To analyze the performance of pandapipes, we compare it to STANET®, one of the leading piping grid simulation tools available on the German market.
3.3.1. Simulation Setup for the Performance Comparison between Pandapipes and STANET®
As performance comparisons are highly dependent on the given setup, our goal is to create an environment with an equal base for both tools. The following calculations are all run on an ordinary laptop with the specifications given in Table A2 of Appendix B. For the performance comparison, we conduct time series calculations for one entire day in increments of 15 min (96 time steps) for three grids of different sizes. We repeat the calculation 20 times to minimize the effect of outlier results. The following three grids, shown in Appendix C, are analyzed:
The district heating grid (Figure A1) consists of four heat exchangers and is operated at 6 bar and 43 °C. The demand of each heat exchanger is constant over time. No fluid supply is required, as the grid is considered to be a closed system. Solely the pump ensures a circulation of the fluid and provides the required heat supply.
The water grid (Figure A2) comprises 105 sinks and is operated at 6 bar as well. To increase the complexity, each sink follows an individual time series.
The gas grid (Figure A3) is derived from grid data in [7] by removing gas service pipes and aggregating sinks at close-by junctions. It is operated at 1 bar and consists of 1506 sinks, each of which is assigned to one of 132 representative profile types.
The intention of creating three diverse grids is to cover many aspects affecting the performance in an efficient way, while being aware that this approach cannot identify all aspects of simulation performance individually. One of the relevant aspects is the considered energy carrier. For example, simulating a district heating grid in pandapipes always requires a subsequent heat transfer simulation in addition to the hydraulic simulation, as can be seen in the flowchart in Figure 2. This is usually not necessary for simulations of water and gas grids. Therefore, all three simulation options that can be modeled with pandapipes are represented in this work: hydraulic calculation of compressible and incompressible media and the additional heat transfer calculation of incompressible media.
Another aspect that we consider as relevant is the number of different components integrated in a grid model. Therefore, the water grid comprises all components that can be modeled in pandapipes, except for the heat exchanger.
Additionally, the number of nodes and branches has a significant effect on the simulation speed. The three grids were chosen to compare different orders of magnitude of model size, i.e., numbers of nodes and branches.
A last effect we identified is the meshing degree. Therefore, the district heating and water grid have up to 30% higher meshing degrees compared to the gas grid.
We did not investigate the effect of the number of time steps explicitly. However, as each time step is simulated independently, i.e., previous time step results are not used as solver initialization, one can assume that the pure simulation time is increasing linearly with the number of time steps.
An overview of relevant grid characteristics is given in Table 2. It shows that the water grid has the highest number of different component types. The district heating and gas grid contain the same number of component types, but the types differ as well as the model size. The meshing degree of the water grid is slightly higher compared to the district heating grid and much higher compared to the gas grid. The table also shows that the total number of components installed in the different grids increases at a disproportionately low rate, whereas the number of profiles increases at a disproportionately high rate with model size.
3.3.2. Comparison of Calculation Time
The performance results are displayed in Figure 5, retrieved from 20 simulation runs of 96 time steps for each grid conducted in pandapipes and STANET®, respectively. The average results are represented by the colored bars. The standard deviation is not visualized, as the differences are marginal. The average calculation time and corresponding standard deviation can be found in Table A3 of Appendix D.
We distinguish between the pure simulation time and the total time. While the simulation time just comprises the required time for the pipe flow calculations, the total time additionally includes the overhead time such as loading profiles and saving results. In each bar plot, the average simulation time is represented by the lower number while the total time by the number above.
For both tools, an increasing model size also leads to an increase of the total simulation time, but with different characteristics. In the case of STANET®, both overhead and pure simulation time increase with the number of nodes and branches. Pandapipes, in contrast, reveals a similar overhead time in the case of the heat and water grid, while it is much bigger for the gas grid simulation. The pure simulation time shows that the solver requires more time for the smaller water grid than for the much bigger gas grid. This anomaly can be led back to the number of solver iterations to reach convergence. While, in the case of the gas grid, usually two to three iterations are required, the solver is called seven to eight times in the case of the water grid. This behavior can probably be explained by the higher meshing degree. As each Newton step of the dependent variables influences more other dependent variables, the number of solver iterations increases for meshed grids. For a closer look at the mathematical model formulation, refer to Appendix A.
A comparison of both tools reveals that pandapipes is always faster than STANET®. While, in the case of the smallest grid, pandapipes is only three times faster, the difference becomes more predominant with model size, making pandapipes up to nine times faster in the case of the gas grid. One reason can be found in the additional overhead such as the graphical user interface (GUI) which STANET® provides.
However, comparing the pure simulation times with one another, the solver alone also claims more time in case of STANET® compared to pandapipes. One of the main reasons we identified might be the readout speed of the profile data. In our examinations, the time spent to read the data from the disc is almost negligible, as we choose a very efficient method. This fact, however, shifts as soon as another data format such as .csv is used, slowing down pandapipes massively. In STANET®, the used format is .dbf, which might cause the big performance difference.
Another reason might be additional implementations in the case of STANET®. For example, it considers the temperature dependency of the dynamic viscosity, which is still neglected in pandapipes. However, the absolute deviations between the pandapipes and STANET® results, visualized in Figure A4 of Appendix E, emphasize that both results still match well.
Furthermore, additional reasons can be causal for the diverging simulation speed, including system dependencies or the investigated grid; both we only analyzed to a limited degree. Furthermore, our look below the hood of STANET® was only possible as far as the manual took us, as the software itself is closed source. Therefore, our conclusions are limited by the information in the instruction book. However, in all our investigations, we tried to be as transparent and unbiased as possible.
4. Solving Problems of Coupled Multi-Energy Grid Simulation with Pandapipes Multi-Energy
4.1. Use Case 1: Local Peak Shaving Strategies to Support the Supply of District Heating Grids
4.1.1. Introduction to the Problem
One of the main reasons for coupling infrastructures on district scale is that the synergies between them can drive energy reduction and reduce overall costs by shifting excess power from one energy carrier to another. This energy shift relies on sophisticated control strategies, which requires time series simulations in the design phase [59].
In the InnoNEX project [60], operation strategies were developed to convert and store available excess power generated by photovoltaic (PV) plants as thermal energy. The excess energy supplied a centrally aligned heat pump connected to a district heating grid, as well as electric heaters installed in the domestic hot water storages of consumer households. In this way, the excess power could be used to cover peak loads occurring at a later time. A detailed model of the district heating grid enabled the evaluation of temperature levels and thus thermal losses in the grid. Nevertheless, no model was created for the electrical grid, which made it impossible to react to certain events such as the overloading of lines. Thus, the state of the electrical network was not respected by the operation strategy.
A similar, but more complex simulation setup, consisting of different tools combined in a co-simulation framework and coupled with an optimization tool, was used in [24,61]. The tools are used to maximize self-consumption from RES and minimize CO2-emissions and electricity imports to the district. Typically, a co-simulation approach acts as a performance bottleneck. This is different with pandapipes multi-energy, where all models are included in one tool, thereby simplifying the model setup.
In the use case we analyze, the heat energy—consisting of the demand for space heating and domestic hot water—for a small neighborhood is supplied by a district heating grid fed by a centrally positioned heat pump. The operation of the heat pump depends on the status of the power grid. Therefore, a coupling model between the electrical and district heating grid has to be provided. We assume that the heat pump has access to a low temperature heat source, so that an inlet temperature of 45 °C or alternatively 55 °C can be supplied. However, legal regulations for legionella require a minimum temperature of the domestic hot water of 55 °C.
Every building connected to the district heating grid has a domestic hot water storage. The storage extracts heat from the heating grid using a heat exchanger. To lift the temperature from the district heating grid temperature level to the required temperature of at least 55 °C, an electric heater is placed inside the storage.
All buildings are equipped with PV plants whose primary purpose is the electrical supply of household appliances. If excess power is available, it can be used by the electric heaters inside the storages. Further excess power is then fed into the electrical distribution grid. Because of their ability to both create and consume power, the households are also called prosumers throughout this use case.
The heat pump heats its storage to 55 °C if the prosumers provide sufficient renewable power to cover the heat pump’s electrical demand. Otherwise, the provided heat pump temperature is 45 °C and the required power is supplied partially by excess PV feed-in and power drawn from the connected distribution grid. As an additional constraint, the temperature of the heat pump can only be raised if this operation mode does not lead to a line overloading in the connected electrical grid. If a line overloading occurs even at a provided temperature of 45 °C, the heat pump enters a power saving mode, where nearly no mass flow is provided and no power is consumed.
The neighborhood consists of 12 buildings. The topologies of the power and district heating grid are shown in Figure 6. A detailed flow chart of the implemented control strategies for the electric heaters and the heat pump can be found in Appendix F.
4.1.2. Use Case Implementation
Both pandapower and pandapipes only have access to a small set of components, such as sinks and sources. More detailed components, such as the required prosumers and the heat pump, have to be modeled as controllers.
Figure 7 shows a sketch of the prosumer controller and its components. As depicted, each water storage is connected to the pandapipes district heating grid via a heat exchanger. In every time step, the mass flow and inlet temperature (, ) are extracted and used as an input to simulate the water storage temperature. If activated, the electric heater is powered with a constant value of 1 kW. The amount of extracted heat by the water storage heat exchanger and the heat required for space heating is transferred to the pandapipes net ().
Besides, the controller is connected to a static generator (sgen) component in the power grid model. Depending on the sign of the power variable, this component may represent a producer or a consumer. In each time iteration, the current excess power is determined by the prosumer controller according to Equation (1) and transferred to the sgen component. Here, PV(t) denotes the power provided by the PV plant and load(t) denotes the electrical demand of all devices in the household except the electric heater heating the water storage. The latter is described with the variable . If is negative, the available PV power is not sufficient to cover the electrical demand. In this case, power has to be fed in by the power grid. [Formula omitted. See PDF]
In the case of direct hydrogen feed-in, some more considerations have to be taken into account due to blending. On the one hand, the energy content of the mixed fluid must equal the energy content of the natural gas transported without blending. This correlation is given in Equation (A15), in which the subscript refers to the transported natural gas and to hydrogen. In the use case, the natural gas is a mixture of high calorific gases (H-Gas), which is typical of German gas grids. Using the higher calorific value is a simplification, as usually the required energy content depends on the type of burners installed in the connected households, which is unknown in the case study. The P2G efficiency without methanation is set to 61 %. The required P2G power to reach a certain hydrogen mass flow is described by Equation (A16). With the given volume fraction of hydrogen and the relation between volume and mass flow via the respective density, the mass flows of hydrogen and natural gas at the feed-in point can be described by Equation (A17).
(A15)
(A16)
(A17)
When inserting Equations (A16) and (A17) into Equation (A15), the resulting maximum P2G power in dependency of the hydrogen volume fraction is given by Equation (A18).
(A18)
Appendix I. Use Case 2: Results for Ten Exemplary Hours
To demonstrate how the control loop of the coupled simulation works, we analyze the results of a configuration with a P2G device of 10 MW installed capacity at position 4 and included methanation. Figure A8 shows important simulation results in the power and gas grid for ten exemplary hours. We compare three different cases. The base case, which does not include any optimization or RES curtailment, thus leading to constraint violations in the power grid. The power grid restricted (PR) case includes RES curtailment and a P2G operation with the help of an OPF, but no feedback from the gas grid. Constraint violations in the gas grid might occur, as the P2G operation only follows the requirements of the power grid. The power and gas grid restricted (PGR) case also considers the gas grid constraints and the P2G power is reduced in case of violations, leading to a higher curtailment of RES plants. The left panels of Figure A8 show the results of the power grid. The RES feed-in has to be reduced drastically in most time steps in order to comply with the power grid constraints. Otherwise, line loading and voltage exceed the limits by far. On the right, results of the gas grid are displayed. Here, the feed-in from the P2G device has to be reduced in some time steps in order to comply with the gas grid constraints. The mass flow at the reference that represents the feed-in from the high pressure gas grid would in some time steps become negative. This does not comply with the uni-directional flow constraint. In some time steps, the maximum pressure at the connected gas grid node would also be exceeded. Only in the PGR case all constraints are satisfied at all times, which cannot be guaranteed in the PR or base case.
Figure A8
Time series over 10 h selected from one P2G study configuration. We compare three cases: the base case (index base) without flexibility provision; the power grid restricted case (index PR) with flexibility provision neglecting gas grid constraints; and the power and gas grid restricted case (index PGR) with flexibility provision and gas grid controller. All constraints are marked with a black dashed line. (a) Total power from RES; (b) maximum line loading at any line in the power grid; (c) maximum voltage at any node in the power grid; (d) mass flow feed-in from the P2G device into the gas grid; (e) mass flow feed-in by the gas reference node; and (f) maximum pressure at any node in the gas grid.
[Figure omitted. See PDF]
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Figures and Tables
Figure 1. The pandapipes net and stored data, divided into the groups component tables, result tables, calculation parameters and internal data. The shown data in each group are not exhaustive.
Figure 2. Flowchart of the pipeflow procedure including hydraulic and heat transfer calculation. The pandapipes net tables serve as interface for the user, while internally an array structure is used for performance reasons.
Figure 3. Flowchart of the time series and controller calculation and how the pipe flow is embedded in the process.
Figure 4. Overview of the internal structure of the MEG simulation environment based on the pandapipes multi-energy module. It defines a multi-energy grid model consisting of different grids that can be simulated with pandapipes and pandapower functions. These grids are coupled with multi-energy controllers which can vary set points to adjust control variables, as well as model the energy transfer between the coupled grids.
Figure 5. Calculation time results for three exemplary grids modeled in pandapipes and STANET®. The plots display the average values from 20 simulation runs. A comparison is conducted between the pure simulation time (pipe flow) and the total time, overhead included.
Figure 6. The power grid (blue) and district heating grid (orange) set up in pandapower and pandapipes, respectively. The power grid also shows an overloaded line highlighted in green color. Besides raising the temperature, the heat pump also provides the functionality of a circulation pump.
Figure 7. Sketch of the prosumer and relevant components. Relevant data interfaces are represented by arrows.
Figure 8. The heat pump controller component and its connections with the pandapower and pandapipes grid models.
Figure 9. (Top) The storage temperature of the heat pump storage. (Middle) The Heat Pump control signal. (Bottom) Available excess power for the whole neighborhood. The green line visualizes available excess power after demand for households (hh), domestic hot water (DHW) and heat pump is subtracted.
Figure 10. (Top) The storage temperature of one building in the neighborhood. (Middle) The demand profile for domestic hot water (DHW) for the two observed days. (Bottom) Available excess power for the building. The blue line represents the generated PV output minus the demand of all household (hh) loads except the power needed to heat the drinking water storage. This heater power is considered in the orange line, which represents the total available excess power.
Figure 11. Structure of the power grid consisting of two feeders and the gas grid that partially overlaps with both feeders.
Figure 12. Setup of the P2G operation for reducing congestions in the power grid. The calculations in pandapower and pandapipes ensure that all power grid and all gas grid constraints are satisfied. For this approach, the pandapipes multi-energy grid structure and its time series and control architecture are used.
Figure 13. Analysis of the curtailed RES energy and its relative reduction by the P2G device in relation to the size (right-aligned due to the inverse behavior compared to the curtailment) for the three RES scenarios and different configurations. The simulated cases considering power grid restrictions (PR) and power and gas grid restrictions (PGR) are shown in different colors to highlight the influence of the gas grid constraints on the results. Considering gas grid constraints leads to a lower P2G employment, so that more energy from RES needs to be curtailed.
Figure 14. Influence of the installed capacity and number of P2G devices. For the configurations with devices at one, two and six positions, the relative reduction of renewable energy sources (RES) curtailment is given as distribution over all analyzed configurations.
Overview of power, gas and district heating simulation tools with their scopes and model implementations.
Infrastructures | ||||||||
---|---|---|---|---|---|---|---|---|
Tool | Type | OS | Power | Gas | District Heating | Detailed Grid Model | Coupled Simulation | Additional Features |
SINCAL [27] | GS | √ | √ | √ | √ | GUI, OPF, (TOP) *** | ||
STANET [28] | GS | √ | √ | √ | √ | GUI, TC (DH), (TOP) *** | ||
TRNSYS [29,30] | GS | √ | √ | GUI, TC (DH), CTRL | ||||
MATPOWER [31] | GS | √ | √ | √ | OPF, (TOP) ***, LIB | |||
PyPSA [32] | GS | √ | √ | ** | ** | √ | OPF, (TOP) ***, LIB | |
pandapower [20] | GS | √ | √ | √ | OPF, CTRL, TOP, LIB | |||
pandapipes | GS | √ | √ | √ | √ | CTRL, TOP, LIB | ||
OSeMOSYS [33] | ESMO | √ | √ | √ | √ | √ | ||
Balmorel [34] | ESMO | * | √ | √ | √ | |||
calliope [35] | ESMO | √ | √ | √ | √ | √ | LIB | |
Switch 2.0 [36] | ESMO | √ | √ | √ | LIB | |||
oemof [37] | ESMO | √ | √ | √ | √ | √ | TOP, LIB | |
SAInt [38] | MEGS | √ | √ | √ | √ | GUI, OPF, TC (G) | ||
HyFlow [39] | MEGS | √ | √ | √ | ** | √ | ||
MYNTS [40] | MEGS | √ | √ | √ | √ | GUI, TC (all), CTRL | ||
TransiEnt [41,42] | MEGS | * | √ | √ | √ | √ | √ | TC (all), CTRL |
pandapipes multi-energy | MEGS | √ | √ | √ | √ | √ | √ | OPF, CTRL, LIB |
* Only usable with proprietary software. ** Simplified model. *** Only connected components. OS, open source; GS, grid simulation tool; ESMO, energy system modeling and optimization tool; MEGS, multi-energy grid simulation tool; GUI, graphical user interface; OPF, optimal power flow (for power grid); TC, transient calculation; DH, district heating grid; G, gas grid; CTRL, evaluation of control strategies; TOP, analysis of grid topology; LIB, external libraries for evaluation usable (e.g., Python and MATLAB).
Table 2Characteristics of the three analyzed grids. Presented are the number of components for each component type, the number of profiles and the meshing degree.
Grids | District Heating | Water | Gas |
---|---|---|---|
# junctions | 20 | 151 | 2634 (1128 in service) |
# pipes | 18 | 149 | 2634 (1128 in service) |
# sinks | - | 105 | 1506 |
# pumps | 1 | 1 | - |
# valves | - | 44 | - |
# heat exchangers | 4 | - | - |
# external grids | - | 1 | 1 |
# profiles | - ** | 105 | 132 |
meshing degree * | 1.21 | 1.29 | 1.00 |
* The meshing degree is calculated with the formula , where stands for the number of branches (including all branch elements such as pipes, pumps, valves, etc.) and stands for the number of nodes (including all junctions minus the reference one). The formula is based on [58]. ** The values for the components are fixed over all time steps.
Table 3Maximum power and total energy over year aggregated for the RES in three different scenarios (PV, wind and mix) and for the loads in the power and gas grid.
RES (PV) | RES (wind) | RES (mix) | Electric Loads | Gas Loads | |
---|---|---|---|---|---|
maximum power [MW] | 54.6 | 68.5 | 47.2 | 17.2 | 15.8 |
total energy over year [GWh] | 77.8 | 110.0 | 94.0 | 80.7 | 38.2 |
Constraints and boundary conditions for the grid simulations. Voltage and current limits apply for the whole power grid. Pressure and hydrogen fraction limits apply only for the power-to-gas (P2G) connection node, as the respective maximum value will always occur there. stands for the number of households connected to the gas grid.
Power Grid | Gas Grid | ||
---|---|---|---|
preset voltage at slack node | preset pressure at reference node | ||
maximum voltage | maximum pressure P2G node | ||
maximum line loading | maximum feed-in with methane | ||
maximum hydrogen fraction |
Configuration setup analyzed for the P2G flexibility potential study. All combinations lead to a total of 462 different configurations to be analyzed.
P2G Devices | RES Scenario | P2G Power [MW] | Fluid | Positions | Case |
---|---|---|---|---|---|
0 | PV, mix, wind | - | - | - | base, PR |
1 | PV, mix, wind | 1–10 | H2, CH4 | 1 | PR, PGR |
1 | PV, mix, wind | 1, 2, 5, 10 | CH4 | 2, 3, 4, 5, 6 | PR, PGR |
2 | PV, mix, wind | 1, 2, 5, 10 | CH4 | 1 + (2, 3, 4, 5, 6) | PR, PGR |
2 | PV, mix, wind | 1, 5, 10 | CH4 | (2, 3, 4) + (5, 6) | PR, PGR |
6 | PV, mix, wind | 1, 2, 5 | CH4 | 1 + 2 + 3 + 4 + 5 + 6 | PR, PGR |
You have requested "on-the-fly" machine translation of selected content from our databases. This functionality is provided solely for your convenience and is in no way intended to replace human translation. Show full disclaimer
Neither ProQuest nor its licensors make any representations or warranties with respect to the translations. The translations are automatically generated "AS IS" and "AS AVAILABLE" and are not retained in our systems. PROQUEST AND ITS LICENSORS SPECIFICALLY DISCLAIM ANY AND ALL EXPRESS OR IMPLIED WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES FOR AVAILABILITY, ACCURACY, TIMELINESS, COMPLETENESS, NON-INFRINGMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Your use of the translations is subject to all use restrictions contained in your Electronic Products License Agreement and by using the translation functionality you agree to forgo any and all claims against ProQuest or its licensors for your use of the translation functionality and any output derived there from. Hide full disclaimer
© 2020 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/). Notwithstanding the ProQuest Terms and Conditions, you may use this content in accordance with the terms of the License.
Abstract
The increasing complexity of the design and operation evaluation process of multi-energy grids (MEGs) requires tools for the coupled simulation of power, gas and district heating grids. In this work, we analyze a number of applicable tools and find that most of them do not allow coupling of infrastructures, oversimplify the grid model or are based on inaccessible source code. We introduce the open source piping grid simulation tool pandapipes that—in interaction with pandapower—addresses three crucial criteria: clear data structure, adaptable MEG model setup and performance. In an introduction to pandapipes, we illustrate how it fulfills these criteria through its internal structure and demonstrate how it performs in comparison to STANET®. Then, we show two case studies that have been performed with pandapipes already. The first case study demonstrates a peak shaving strategy as an interaction of a local electricity and district heating grid in a small neighborhood. The second case study analyzes the potential of a power-to-gas device to provide flexibility in a power grid while considering gas grid constraints. These cases show the importance of performing coupled simulations for the design and analysis of future energy infrastructures, as well as why the software should fulfill the three criteria.
You have requested "on-the-fly" machine translation of selected content from our databases. This functionality is provided solely for your convenience and is in no way intended to replace human translation. Show full disclaimer
Neither ProQuest nor its licensors make any representations or warranties with respect to the translations. The translations are automatically generated "AS IS" and "AS AVAILABLE" and are not retained in our systems. PROQUEST AND ITS LICENSORS SPECIFICALLY DISCLAIM ANY AND ALL EXPRESS OR IMPLIED WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES FOR AVAILABILITY, ACCURACY, TIMELINESS, COMPLETENESS, NON-INFRINGMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Your use of the translations is subject to all use restrictions contained in your Electronic Products License Agreement and by using the translation functionality you agree to forgo any and all claims against ProQuest or its licensors for your use of the translation functionality and any output derived there from. Hide full disclaimer
Details



1 Department of Grid Planning and Grid Operation, Fraunhofer Institute for Energy Economics and Energy System Technology IEE, 34119 Kassel, Germany;
2 Department of Grid Planning and Grid Operation, Fraunhofer Institute for Energy Economics and Energy System Technology IEE, 34119 Kassel, Germany;