# Pandapipes: An Open-Source Piping Grid Calculation Package for Multi-Energy Grid Simulations

^{1}

^{2}

^{*}

## Abstract

**:**

^{®}. 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.

## 1. Introduction

- 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 CO
_{2}-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.

## 2. Multi-Energy Grid Simulation: Overview of Approaches and Requirements

- 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].

## 3. Overview of Pandapipes

^{®}.

#### 3.1. Illustrating Clear Data Structure: Architecture of Pandapipes

#### 3.1.1. The Pandapipes Grid Structure

#### 3.1.2. The Pipeflow Procedure

#### 3.1.3. The Controller Architecture and Time Series Simulations

#### 3.2. Illustrating Adaptable MEG Model Setup: Introduction to Pandapipes Multi-Energy

#### 3.3. Illustrating Performance: Comparison between Pandapipes and 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^{®}

- 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.

#### 3.3.2. Comparison of Calculation Time

^{®}, 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.

^{®}, 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.

^{®}. 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.

^{®}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.

^{®}. 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.

^{®}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

_{2}-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.

#### 4.1.2. Use Case Implementation

- The simulation is performed in 15 min increments with the temperature being evaluated every 50 m. The heat pump supplies a pressure which is high enough to make sure that the fluid arrives at the consumers within one time step.
- If inertial effects were not neglected, depending on the ambient temperature and pipe insulation, the fluid temperature would continuously adopt to the steady state. By neglecting inertia, we observe a worst case where the fluid temperature instantaneously mixes with ambient temperature levels. As the primary intention in this use case is to show how the state of one grid influences the state of a coupled grid, this approach is feasible without a detailed analysis of the heating grid.

#### 4.1.3. Result Evaluation

#### 4.2. Use Case 2: Flexibility Provision of Power-To-Gas Devices

#### 4.2.1. State-of-the-Art Review

#### 4.2.2. Use Case Implementation

#### 4.2.3. Study of the Power-To-Gas Flexibility Potential

## 5. Summary and Conclusions

- With its internal architecture, pandapipes addresses the criterion of a clear data structure. Using pandas tables for input parameters and results enables an easy setup and adaptation of grid states and post-processing with the help of convenient pandas functions. Large time series simulations can be performed and results stored efficiently. The use of numpy arrays with a unified design makes the internal structure clear for developers, and parts of the calculation logic can be adapted without putting much effort into its restructuring.
- The specialized multi-energy module addresses the criterion of an adaptable MEG model setup. Models for coupling components can be chosen from the existing implementations or defined by the user himself. In the use cases, we showed the flexibility of these models, as controllers were defined for heat pumps and P2G devices that relied on results of heating and gas grid simulations. This information can be exchanged at run time of the control loop. By connecting different control strategies and types of simulations, a wide range of research questions can be addressed.
- The comparison to STANET
^{®}illustrated the performance of pandapipes, which we identified as another criterion. Comparing run times of time series simulations for different grid models between the two tools revealed that pandapipes is faster in each simulation setup. One possible reason is the handling of time series data, which is especially important in MEG simulations. The performant core makes pandapipes a perfect tool for extensive investigations, including probabilistic grid planning, time series, Monte Carlo and placement studies. Unlike with co-simulation environments, the coupling of simulations hardly adds any overhead to the simulation time. The demonstrated use cases underline how crucial performance is, as a large number of simulations had to be performed for each of the studies. Comparisons to other tools, especially open source tools such as EPANET [79], should be considered in the future.

## Author Contributions

## Funding

## Acknowledgments

## Conflicts of Interest

## Abbreviations

Symbols | Explanation | Unit |

A | area | m^{2} |

${c}_{p}$ | heat capacity | $\frac{\mathrm{J}}{\mathrm{kg}\xb7\mathrm{K}}$ |

d | pipe diameter | m |

h | height | m |

H | heating value | $\frac{\mathrm{kJ}}{\mathrm{kg}}$ |

I | current | A |

l | pipe length coordinate | m |

$\dot{m}$ | mass flow | $\frac{\mathrm{kg}}{\mathrm{s}}$ |

N | number | [-] |

p | pressure | Pa |

$\Delta p$ | pressure difference | Pa |

P | active power | W |

q | heat flow | $\frac{\mathrm{J}}{\mathrm{s}}$ |

T | temperature | K |

v | flow velocity | $\frac{\mathrm{m}}{\mathrm{s}}$ |

V | voltage | V |

x | fraction | 1 |

$\alpha $ | heat transfer coefficient | $\frac{\mathrm{W}}{{\mathrm{m}}^{2}\xb7\mathrm{K}}$ |

$\zeta $ | pressure loss coefficient | 1 |

$\eta $ | efficiency | [-] |

$\lambda $ | Darcy friction factor | 1 |

$\rho $ | fluid density | $\frac{\mathrm{kg}}{{\mathrm{m}}^{3}}$ |

Subscripts | ||

b | referring to a branch | |

$C{H}_{4}$ | methane | |

$ext$ | external | |

${H}_{2}$ | hydrogen | |

$HH$ | households | |

$max$ | maximum | |

n | referring to a node | |

${n}_{1}$ | referring to node 1 (entering a branch) | |

${n}_{2}$ | referring to node 2 (leaving a branch) | |

N | referring to the reference state | |

$NG$ | natural gas | |

$net$ | referring to the network | |

$P2G$ | power-to-gas device | |

$rn$ | at reference node | |

s | superior | |

$th$ | thermal | |

$slack$ | at slack node | |

$surface$ | referring to the surface | |

$vol$ | volumetric | |

Abbreviations | ||

CHP | Combined heat and power | |

ESMO | Energy system modeling and optimization | |

GUI | Graphical user interface | |

GS | Grid simulation | |

MEG | Multi-energy grid | |

MES | Multi-energy system | |

MV | Medium voltage | |

OPF | Optimal power flow | |

P2G | Power-to-gas | |

PGR | Power and gas grid restricted | |

PR | Power grid restricted | |

PV | Photovoltaic | |

RCR | Relative curtailment reduction | |

RES | Renewable energy sources | |

sgen | static generator |

## Appendix A. Mathematical Model Formulation in Pandapipes

- Junctions are the node representations. Their model implementation corresponds to the mass and energy flow balance as formulated in Equations (A1) and (A2). However, since there are only formulations for pressure and temperature drops in the system of equations, for at least one junction, the pressure and temperature need to be preset as boundary conditions.
- External grids represent connections to other systems. This node element fixes pressure or temperature for the connected junction to form the above stated boundary condition, thus turning it into a reference node.
- Sinks and sources are node elements which insert a mass flow entering or leaving the connected junction.
- Pipes are the main branch components, i.e., they connect two junctions, respectively. Their physical representation is explained in the following paragraphs.
- Valves are branch components that can also disconnect the two connected junctions from each other, depending on an “opened” flag. They are modeled as branches with length 0, but can still introduce a lumped pressure loss.
- Pumps are branch components that introduce a pressure lift. The pressure lift is calculated according to a characteristic that sets the operating point in dependency of the calculated flow rate.
- Circulation pumps are useful for district heating grid calculations. At the outgoing junction, the pressure is fixed and at the incoming junction the mass flow is set. This behavior corresponds to two node elements: an external grid and a sink. It is a simplified component neglecting operation limitations of a real pump.

Component | Input Parameters | Results | ||||
---|---|---|---|---|---|---|

Name | Description | Unit | Name | Description | Unit | |

Junction | ${p}_{n}$ | rated pressure | bar | p | pressure | bar |

${T}_{fluid}$ | initial temperature | K | T | temperature | K | |

h | height | m | ||||

External grid | ${p}_{set}$ | fixed pressure | bar | $\dot{m}$ | mass flow to grid | $\frac{\mathrm{kg}}{\mathrm{s}}$ |

${T}_{set}$ | fixed temperature | K | ||||

Sink/Source | $\dot{m}$ | set mass flow | $\frac{\mathrm{kg}}{\mathrm{s}}$ | $\dot{m}$ | mass flow to / from node | $\frac{\mathrm{kg}}{\mathrm{s}}$ |

C | scaling factor | - | ||||

Pipe | l | length | km | ${v}_{mean}$ | mean velocity | $\frac{\mathrm{m}}{\mathrm{s}}$ |

d | diameter | m | $\Delta p$ | pressure difference | bar | |

k | roughness | mm | ${T}_{from}$ | temperature at junction 1 | K | |

$\eta $ | loss coefficient | - | ${T}_{to}$ | temperature at junction 2 | K | |

$\alpha $ | heat transfer coefficient | $\frac{\mathrm{W}}{{\mathrm{m}}^{2}\xb7\mathrm{K}}$ | $\dot{m}$ | mass flow through pipe | $\frac{\mathrm{kg}}{\mathrm{s}}$ | |

${q}_{ext}$ | external heat flow | W | ${\dot{V}}_{N}$ | norm volume flow | $\frac{{\mathrm{m}}^{3}}{\mathrm{s}}$ | |

${T}_{ext}$ | external temperature | K | Re | Reynolds number | - | |

s | number of sections | - | $\lambda $ | Darcy friction factor | - | |

Valve | d | diameter | m | ${v}_{mean}$ | mean velocity | $\frac{\mathrm{m}}{\mathrm{s}}$ |

$opened$ | flag for flow | - | $\Delta p$ | pressure difference | bar | |

$\eta $ | loss coefficient | - | $\dot{m}$ | mass flow through valve | $\frac{\mathrm{kg}}{\mathrm{s}}$ | |

${\dot{V}}_{N}$ | norm volume flow | $\frac{{\mathrm{m}}^{3}}{\mathrm{s}}$ | ||||

Pump | $stdtype$ | pump standard type (for characteristic) | - | $\Delta p$ | pressure difference | bar |

Circulation Pump | ${p}_{set}$ | pressure set point | bar | $\Delta p$ | pressure difference | bar |

${p}_{lift}$ | pressure lift | bar | $\dot{m}$ | mass flow through pump | $\frac{\mathrm{kg}}{\mathrm{s}}$ | |

${T}_{set}$ | temperature set point | K |

## Appendix B. System Specification of the Laptop Used for the Performance Comparison between Pandapipes and STANET^{®}

Operating System | Microsoft Windows 10 (64 bit) |
---|---|

CPU | Intel Core i7-6700HQ |

system memory | 16 GB |

solid-state drive | Samsung MZ7TY256HDHP-000L7 |

graphic cards | Intel HD Graphics 530, NVIDIA GeForce 940MX |

## Appendix C. Plots Displaying Grids Used for Performance Comparison

**Figure A1.**Heat grid used for performance comparison. It comprises 20 junctions and 18 pipes, supplies 4 heat exchangers and is operated at 6 bar and 43 ℃.

**Figure A2.**Water grid used for performance comparison. It comprises 151 junctions and 149 pipes, supplies 105 sinks and is operated at 6 bar.

**Figure A3.**Reduced gas grid used for performance comparison. It comprises 1128 junctions and 1128 pipes, supplies 1506 sinks and is operated at 1 bar.

## Appendix D. Calculation Results of Performance Comparison between Pandapipes and STANET^{®}

**Table A3.**Results of the performance comparison: Average calculation time with standard deviation for the three compared grids.

Heat Grid | Water Grid | Gas Grid | |||
---|---|---|---|---|---|

total time | pandapipes | mean [s] standard deviation [s] | 3.65 $\pm 0.374$ | 4.62 $\pm 0.169$ | 9.46 $\pm 0.371$ |

STANET^{®} | mean [s] standard deviation [s] | 10.1 $\pm 0.165$ | 56.53 $\pm 0.932$ | 86.27 $\pm 0.309$ | |

simulation time | pandapipes | mean [s] standard deviation [s] | 2.96 $\pm 0.270$ | 3.87 $\pm 0.253$ | 3.56 $\pm 0.177$ |

STANET^{®} | mean [s] standard deviation [s] | 6.43 $\pm 0.114$ | 49.55 $\pm 0.206$ | 64.67 $\pm 0.811$ |

## Appendix E. Deviation between Pandapipes and STANET^{®} Results

^{®}. To avoid division by near zero values, we compare the average results and their mean deviations for pressure, velocity and temperature (only heat grid). The spread of absolute deviations is also shown in Figure A4.

Measurand in the Corresponding Grid | Average Result | Mean Deviation | Relative Deviation | |
---|---|---|---|---|

pressure [bar] | heat grid | 6.00 | 0.00065 | 0.011% |

water grid | 5.96 | 0.00015 | 0.0025% | |

gas grid | 0.94 | 2.41 × ${10}^{-5}$ | 0.0025% | |

velocity $\left[\frac{\mathrm{m}}{\mathrm{s}}\right]$ | heat grid | 0.015 | 3.76 × ${10}^{-5}$ | 0.25% |

water grid | 0.0049 | 0.00027 | 5.42% | |

gas grid | 1.45 | 0.0010 | 0.071% | |

temperature [℃] | heat grid | 47.31 | 0.42 | 0.89% |

**Figure A4.**Absolute deviations of the pandapipes compared to the STANET

^{®}results. From left to right, one can see the absolute deviations of pressure at the junctions, fluid velocity in the pipes and temperature at the junctions for each grid, respectively. The absolute temperature deviation is only displayed for the heat grid, as it is the only one where this value is derived from a heat transfer calculation.

## Appendix F. Use Case 1: Additional Information on the Peak Shaving Algorithm

**Figure A5.**Implemented control algorithms for the electric heaters inside the households (

**left**) and the central heat pump (

**right**).

## Appendix G. Use Case 2: Details of the Analyzed Grids

**Figure A6.**Overlapping area of the gas and power grid used for the analysis of flexibility provision.

**Figure A7.**Overview of the gas grid and possible connections of the P2G devices in the power and gas grid respectively.

## Appendix H. Use Case 2: Implementation of the Feed-In Restriction

## Appendix I. Use Case 2: Results for Ten Exemplary Hours

**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.

## References

- European Commission. The European Green Deal Sets Out How to Make Europe the First Climate-Neutral Continent by 2050, Boosting the Economy, Improving People’s Health and Quality of Life, Caring for Nature, and Leaving no One Behind. Available online: https://ec.europa.eu/commission/presscorner/detail/en/IP_19_6691 (accessed on 11 August 2020).
- European Commission. Communication from the Commission to the European Parliament, the Council, the European Economic and Social Committee and the Committee of the Regions: Powering a climate-neutral Economy: An EU Strategy for Energy System Integration. Available online: https://ec.europa.eu/energy/sites/ener/files/energy_system_integration_strategy_.pdf (accessed on 11 August 2020).
- European Commission. Communication from the Commission to the European Parliament, the Council, the European Economic and Social Committee and the Committee of the Regions: A Hydrogen Strategy for a Climate-Neutral Europe. Available online: https://ec.europa.eu/energy/sites/ener/files/hydrogen_strategy.pdf (accessed on 11 August 2020).
- Mancarella, P.; Andersson, G.; Pecas-Lopes, J.A.; Bell, K. Modelling of integrated multi-energy systems: Drivers, requirements, and opportunities. In Proceedings of the 19th Power Systems Computation Conference (PSCC), Genoa, Italy, 20–24 June 2016; IEEE: Piscataway, NJ, USA, 2016; pp. 1–22. [Google Scholar] [CrossRef][Green Version]
- Then, D.; Spalthoff, C.; Bauer, J.; Kneiske, T.M.; Braun, M. Impact of Natural Gas Distribution Network Structure and Operator Strategies on Grid Economy in Face of Decreasing Demand. Energies
**2020**, 13, 664. [Google Scholar] [CrossRef][Green Version] - Then, D.; Hein, P.; Kneiske, T.M.; Braun, M. Analysis of Dependencies between Gas and Electricity Distribution Grid Planning and Building Energy Retrofit Decisions. Sustainability
**2020**, 12, 5315. [Google Scholar] [CrossRef] - Kisse, J.M.; Braun, M.; Letzgus, S.; Kneiske, T.M. A GIS-Based Planning Approach for Urban Power and Natural Gas Distribution Grids with Different Heat Pump Scenarios. Energies
**2020**, 13, 4052. [Google Scholar] [CrossRef] - Dall’Anese, E.; Mancarella, P.; Monti, A. Unlocking Flexibility: Integrated Optimization and Control of Multienergy Systems. IEEE Power Energy Mag.
**2017**, 15, 43–52. [Google Scholar] [CrossRef] - Braun, M.; Krybus, I.; Becker, H.; Bolgaryn, R.; Dasenbrock, J.; Gauglitz, P.; Horst, D.; Pape, C.; Scheidler, A.; Ulffers, J. Verteilnetzstudie Hessen 2024–2034: Studie im Auftrag des Hessischen Ministeriums für Wirtschaft, Energie, Verkehr und Landesentwicklung: Abschlussbericht. Available online: https://www.energieland.hessen.de/verteilnetzstudie_hessen (accessed on 13 August 2020).
- Scheidler, A.; Bolgaryn, R.; Ulffers, J.; Dasenbrock, J.; Horst, D.; Gauglitz, P.; Pape, C.; Becker, H. DER Integration Study for the German State of Hesse–Methodology and Key Results. In Proceedings of the 25th International Conference on Electricity Distribution (CIRED 2019), Madrid, Spain, 3–6 June 2019. [Google Scholar]
- Liu, Y.; Gao, S.; Zhao, X.; Zhang, C.; Zhang, N. Coordinated Operation and Control of Combined Electricity and Natural Gas Systems with Thermal Storage. Energies
**2017**, 10, 917. [Google Scholar] [CrossRef][Green Version] - Geidl, M.; Andersson, G. Optimal Power Flow of Multiple Energy Carriers. IEEE Trans. Power Syst.
**2007**, 22, 145–155. [Google Scholar] [CrossRef] - Then, D.; Loskarn, S.; Kaiser, J.; von Appen, J.; Kneiske, T.; Buchholz, S.; Stockinger, V.; Muender, M.; Schuetz, A. Development of an electricity, heat and mobility concept at district level under consideration of sector coupling for the Lagarde Campus Bamberg. In Proceedings of the ETG Symposium on International ETG-Congress 2019, Esslingen, Germany, 8–9 May 2019; pp. 1–6. [Google Scholar]
- Asarpota, K.; Nadin, V. Energy Strategies, the Urban Dimension, and Spatial Planning. Energies
**2020**, 13, 3642. [Google Scholar] [CrossRef] - Caramizaru, A.; Uihlein, A. Energy Communities: An Overview of Energy and Social Innovation; EUR; Publications Office of the European Union: Luxembourg, 2020; Volume 30083. [Google Scholar]
- Cesena, E.A.M.; Loukarakis, E.; Good, N.; Mancarella, P. Integrated Electricity-Heat-Gas Systems: Techno-Economic Modeling, Optimization, and Application to Multienergy Districts. Proc. IEEE
**2020**, 1–19. [Google Scholar] [CrossRef] - Mancarella, P.; Chicco, G.; Capuder, T. Arbitrage opportunities for distributed multi-energy systems in providing power system ancillary services. Energy
**2018**, 161, 381–395. [Google Scholar] [CrossRef] - Mengelkamp, E.; Diesing, J.; Weinhardt, C. Tracing local energy markets: A literature review. It Inf. Technol.
**2019**, 61, 101–110. [Google Scholar] [CrossRef] - Chertkov, M.; Andersson, G. Multienergy Systems. Proc. IEEE
**2020**, 108, 1387–1391. [Google Scholar] [CrossRef] - Thurner, L.; Scheidler, A.; Schäfer, F.; Menke, J.H.; Dollichon, J.; Meier, F.; Meinecke, S.; Braun, M. Pandapower—An Open-Source Python Tool for Convenient Modeling, Analysis, and Optimization of Electric Power Systems. IEEE Trans. Power Syst.
**2018**, 33, 6510–6521. [Google Scholar] [CrossRef][Green Version] - Hagberg, A.A.; Schult, D.A.; Swart, P.J. Exploring Network Structure, Dynamics, and Function using NetworkX. In Proceedings of the 7th Python in Science Conference, Pasadena, CA, USA, 19–24 August 2008; pp. 11–15. [Google Scholar]
- Hunter, J.D. Matplotlib: A 2D Graphics Environment. Comput. Sci. Eng.
**2007**, 9, 90–95. [Google Scholar] [CrossRef] - Jordahl, K.; van den Bossche, J.; Wasserman, J.; McBride, J.; Fleischmann, M.; Gerard, J.; Tratner, J.; Perry, M.; Farmer, C.; Hjelle, G.A.; et al. Geopandas/Geopandas: v0.7.0. Zenodo
**2020**. [Google Scholar] [CrossRef] - Widl, E.; Leitner, B.; Basciotti, D.; Henein, S.; Ferhatbegovic, T.; Hofmann, R. Combined Optimal Design and Control of Hybrid Thermal-Electrical Distribution Grids Using Co-Simulation. Energies
**2020**, 13, 1945. [Google Scholar] [CrossRef][Green Version] - Drauz, S.R.; Spalthoff, C.; Würtenberg, M.; Kneikse, T.M.; Braun, M. A modular approach for co-simulations of integrated multi-energy systems: Coupling multi-energy grids in existing environments of grid planning & operation tools. In Proceedings of the 2018 Workshop on Modeling and Simulation of Cyber-Physical Energy Systems (MSCPES), Porto, Portugal, 10 April 2018; IEEE: Piscataway, NJ, USA, 2018; pp. 1–6. [Google Scholar] [CrossRef]
- Ruf, J.; Zimmerlin, M.; Sauter, P.S.; Koppel, W.; Suriyah, M.R.; Kluwe, M.; Hohmann, S.; Leibfried, T.; Kolb, T. Simulation Framework for Multi-Carrier Energy Systems with Power-to-Gas and Combined Heat and Power. In Proceedings of the 2018 53rd International Universities Power Engineering Conference (UPEC2018), Glasgow, UK, 4–7 September 2018; IEEE: Piscataway, NJ, USA, 2018; pp. 1–6. [Google Scholar] [CrossRef]
- PSS
^{®}SINCAL Modules—Customize Your Platform. Available online: https://new.siemens.com/global/en/products/energy/services/transmission-distribution-smart-grid/consulting-and-planning/pss-software/pss-sincal/pss-sincal.html (accessed on 30 May 2020). - STANET
^{®}Network Analysis-for Gas, Water, Electricity, District Heating and Sewage: The Essential Attributes of STANET^{®}. Available online: http://www.stafu.de/en/product.html (accessed on 30 May 2020). - Klein, S.A.; Beckman, W.A.; Mitchell, J.W.; Duffie, J.A.; Duffie, N.A.; Freeman, T.L.; Mitchell, J.C.; Braun, J.E.; Evans, B.L.; Kummer, J.P.; et al. TRNSYS 18—A TRaNsient SYstem Simulation Program: Volume 1: Getting Started: Documentation; Solar Energy Laboratory, University of Wisconsin-Madison and Thermal Energy System Specialists, LLC: Madison, WI, USA, 2018. [Google Scholar]
- Klein, S.A.; Beckman, W.A.; Mitchell, J.W.; Duffie, J.A.; Duffie, N.A.; Freeman, T.L.; Mitchell, J.C.; Braun, J.E.; Evans, B.L.; Kummer, J.P.; et al. TRNSYS 18—A TRaNsient SYstem Simulation Program: Volume 4: Mathematical Reference: Documentation; Solar Energy Laboratory, University of Wisconsin-Madison and Thermal Energy System Specialists, LLC: Madison, WI, USA, 2018. [Google Scholar]
- Zimmerman, R.D.; Murillo-Sanchez, C.E.; Thomas, R.J. MATPOWER: Steady-State Operations, Planning, and Analysis Tools for Power Systems Research and Education. IEEE Trans. Power Syst.
**2011**, 26, 12–19. [Google Scholar] [CrossRef][Green Version] - Brown, T.; Hörsch, J.; Schlachtberger, D. PyPSA: Python for Power System Analysis. J. Open Res. Softw.
**2018**, 6, 12. [Google Scholar] [CrossRef][Green Version] - Howells, M.; Rogner, H.; Strachan, N.; Heaps, C.; Huntington, H.; Kypreos, S.; Hughes, A.; Silveira, S.; DeCarolis, J.; Bazillian, M.; et al. OSeMOSYS: The Open Source Energy Modeling System. Energy Policy
**2011**, 39, 5850–5870. [Google Scholar] [CrossRef] - Wiese, F.; Bramstoft, R.; Koduvere, H.; Pizarro Alonso, A.; Balyk, O.; Kirkerud, J.G.; Tveten, Å.G.; Bolkesjø, T.F.; Münster, M.; Ravn, H. Balmorel open source energy system model. Energy Strategy Rev.
**2018**, 20, 26–34. [Google Scholar] [CrossRef] - Pfenninger, S.; Pickering, B. Calliope: A multi-scale energy systems modelling framework. J. Open Source Softw.
**2018**, 3, 825. [Google Scholar] [CrossRef][Green Version] - Johnston, J.; Henriquez-Auba, R.; Maluenda, B.; Fripp, M. Switch 2.0: A modern platform for planning high-renewable power systems. SoftwareX
**2019**, 10, 100251. [Google Scholar] [CrossRef] - Hilpert, S.; Kaldemeyer, C.; Krien, U.; Günther, S.; Wingenbach, C.; Plessmann, G. The Open Energy Modelling Framework (oemof)—A new approach to facilitate open science in energy system modelling. Energy Strategy Rev.
**2018**, 22, 16–25. [Google Scholar] [CrossRef][Green Version] - Pambour, K.A.; Erdener, B.C.; Bolado-Lavin, R.; Dijkema, G.P.J. SAInt—A novel quasi-dynamic model for assessing security of supply in coupled gas and electricity transmission networks. Appl. Energy
**2017**, 203, 829–857. [Google Scholar] [CrossRef] - Böckl, B.; Greiml, M.; Leitner, L.; Pichler, P.; Kriechbaum, L.; Kienberger, T. HyFlow—A Hybrid Load Flow-Modelling Framework to Evaluate the Effects of Energy Storage and Sector Coupling on the Electrical Load Flows. Energies
**2019**, 12, 956. [Google Scholar] [CrossRef][Green Version] - Clees, T.; Cassirer, K.; Hornung, N.; Klaassen, B.; Nikitin, I.; Nikitina, L.; Suter, R.; Torgovitskaia, I. MYNTS: Multi-phYsics NeTwork Simulator. In Proceedings of the 6th International Conference on Simulation and Modeling Methodologies, Technologies and Applications (SIMULTECH), Lisbon, Portugal, 29–31 July 2016; pp. 179–186. [Google Scholar] [CrossRef]
- Andresen, L.; Dubucq, P.; Peniche Garcia, R.; Ackermann, G.; Kather, A.; Schmitz, G. Status of the TransiEnt Library: Transient Simulation of Coupled Energy Networks with High Share of Renewable Energy. In Proceedings of the 11th International Modelica Conference on Linköping Electronic Conference Proceedings, Versailles, France, 21–23 September 2015; Linköping University Electronic Press: Linköping, Sweden, 2015; pp. 695–705. [Google Scholar] [CrossRef][Green Version]
- Heckel, J.P.; Becker, C. Advanced Modeling of Electric Components in Integrated Energy Systems with the TransiEnt Library. In Proceedings of the 13th International Modelica Conference on Linköping Electronic Conference Proceedings, Regensburg, Germany, 4–6 March 2019; Linköing University Electronic Press: Linköping, Sweden, 2019; pp. 759–768. [Google Scholar] [CrossRef]
- Widl, E.; Muller, W.; Basciotti, D.; Henein, S.; Hauer, S.; Eder, K. Simulation of multi-domain energy systems based on the functional mock-up interface specification. In Proceedings of the 2015 International Symposium on Smart Electric Distribution Systems and Technologies (EDST), Vienna, Austria, 8–11 September 2015; pp. 510–515. [Google Scholar] [CrossRef]
- Thurner, L. Structural Optimizations in Strategic Medium Voltage Power System Planning. Ph.D. Thesis, Universität Kassel, Kassel, Hessen, Germany, 2018. [Google Scholar]
- Thurner, L.; Scheidler, A.; Probst, A.; Braun, M. Heuristic optimisation for network restoration and expansion in compliance with the single-contingency policy. IET Gener. Transm. Distrib.
**2017**, 11, 4264–4273. [Google Scholar] [CrossRef] - Schäfer, F.; Menke, J.H.; Marten, F.; Braun, M. Time Series Based Power System Planning Including Storage Systems and Curtailment Strategies. In Proceedings of the 25th International Conference on Electricity Distribution (CIRED 2019), Madrid, Spain, 3–6 June 2019. [Google Scholar]
- Büchner, D.; Thurner, L.; Kneiske, T.M.; Braun, M. Automated Network Reinforcement including a Model for an Asset Management Strategy. In Proceedings of the International ETG Congress 2017, Bonn, Germany, 28–29 November 2017; VDE: Frankfurt am Main, Germany, 2017. [Google Scholar]
- Schäfer, F.; Menke, J.H.; Braun, M. Contingency Analysis of Power Systems with Artificial Neural Networks. In Proceedings of the 2018 IEEE International Conference on Communications, Control, and Computing Technologies for Smart Grids (SmartGridComm), Aalborg, Denmark, 29–31 October 2018; IEEE: Piscataway, NJ, USA, 2018; pp. 1–6. [Google Scholar] [CrossRef]
- Meier, F.; Tobermann, C.; Braun, M. Retrospective Optimal Power Flow for Low Discriminating Active Power Curtailment. In Proceedings of the 2019 IEEE Milan PowerTech, Milan, Italy, 23–27 June 2019; IEEE: Piscataway, NJ, USA, 2019; pp. 1–6. [Google Scholar] [CrossRef]
- Menke, J.H.; Hegemann, J.; Gehler, S.; Braun, M. Heuristic monitoring method for sparsely measured distribution grids. Int. J. Electr. Power Energy Syst.
**2018**, 95, 146–155. [Google Scholar] [CrossRef] - Jamieson, M.; Strbac, G.; Tindemans, S.; Bell, K. A Simulation Framework to Analyse Dependent Weather-Induced Faults. In Proceedings of the IET International Conference on Resilience of Transmission and Distribution Networks (RTDN 2017), Birmingham, UK, 26–28 September 2017; IET: Stevenage, UK, 2017; p. 27. [Google Scholar] [CrossRef][Green Version]
- Scheidler, A.; Thurner, L.; Braun, M. Heuristic optimisation for automated distribution system planning in network integration studies. IET Renew. Power Gener.
**2018**, 12, 530–538. [Google Scholar] [CrossRef][Green Version] - Ma, C.; Drauz, S.R.; Bolgaryn, R.; Menke, J.H.; Schäfer, F.; Dasenbrock, J.; Braun, M. A comprehensive study for evaluation of the energy losses in distribution systems with high penetration of distributed generations. In Proceedings of the 25th International Conference on Electricity Distribution (CIRED 2019), Madrid, Spain, 3–6 June 2019. [Google Scholar] [CrossRef]
- Ma, C.; Menke, J.H.; Dasenbrock, J.; Braun, M.; Haslbeck, M.; Schmid, K.H. Evaluation of energy losses in low voltage distribution grids with high penetration of distributed generation. Appl. Energy
**2019**, 256, 113907. [Google Scholar] [CrossRef] - Pandapower: Documentation. Available online: https://pandapower.readthedocs.io/en/v2.2.2/index.html (accessed on 5 June 2020).
- Geidl, M.; Koeppel, G.; Favre-Perrod, P.; Klockl, B.; Andersson, G.; Frohlich, K. Energy hubs for the future. IEEE Power Energy Mag.
**2007**, 5, 24–30. [Google Scholar] [CrossRef] - Mohammadi, M.; Noorollahi, Y.; Mohammadi-ivatloo, B.; Yousefi, H. Energy hub: From a model to a concept—A review. Renew. Sustain. Energy Rev.
**2017**, 80, 1512–1527. [Google Scholar] [CrossRef] - Lipphardt, G. Elektrische Anlagen und Netze. Available online: http://dl.icdst.org/pdfs/files1/39073822ae072cad10b2199a2a3c0f46.pdf (accessed on 18 June 2020).
- Heendeniya, C.B.; Sumper, A.; Eicker, U. The multi-energy system co-planning of nearly zero-energy districts—Status-quo and future research potential. Appl. Energy
**2020**, 267, 114953. [Google Scholar] [CrossRef] - Yu, Y.J.; Kallert, A.M.; Cronbach, D.; Kneiske, T.M.; Doderer, H.; Hoppe, F. Strom-Wärme Versorgung im Quartier—eine Analyse zukunftsfähiger Versorgungsoptionen unter technischen, wirtschaftlichen und regulatorischen Gesichtspunkten. ETG J.
**2020**, 1, 10–11. [Google Scholar] - Widl, E.; Jacobs, T.; Schwabeneder, D.; Nicolas, S.; Basciotti, D.; Henein, S.; Noh, T.; Terreros, O.; Schuelke, A.; Auer, H. Studying the potential of multi-carrier energy distribution grids: A holistic approach. Energy Int. J.
**2018**. [Google Scholar] [CrossRef] - Virtanen, P.; Gommers, R.; Oliphant, T.E.; Haberland, M.; Reddy, T.; Cournapeau, D.; Burovski, E.; Peterson, P.; Weckesser, W.; Bright, J.; et al. SciPy 1.0—Fundamental Algorithms for Scientific Computing in Python. Nat. Methods
**2020**, 17, 261–272. [Google Scholar] [CrossRef][Green Version] - Haack, J. Auswirkungen verschiedener Haushaltslastprofile auf PV-Batterie-Systeme. Master’s Thesis, Fachhochschule Flensburg, Flensburg, Germany, 2012. [Google Scholar]
- Holway, S. Simulation Based Analysis of low Temperature District Heating System Concepts for a Planned New Housing Development in Neuburg. Master’s Thesis, Universität Kassel, Kassel, Germany, 2020. [Google Scholar]
- Bundesinstitut für Bau-, Stadt- und Raumforschung. Ortsgenaue Testreferenzjahre (TRY) von Deutschland für mittlere und Extreme Witterungsverhältnisse. Available online: https://www.bbsr.bund.de/BBSR/DE/FP/ZB/Auftragsforschung/5EnergieKlimaBauen/2013/testreferenzjahre/01-start.html (accessed on 19 June 2020).
- Bundesnetzagentur. Quartalsbericht Netz- und Systemsicherheit-Gesamtes Jahr 2019. Available online: https://www.bundesnetzagentur.de/SharedDocs/Mediathek/Berichte/2020/Quartalszahlen_Gesamtjahr_2019.pdf?__blob=publicationFile&v=9 (accessed on 29 October 2020).
- Minniti, S.; Haque, N.; Nguyen, P.; Pemen, G. Local Markets for Flexibility Trading: Key Stages and Enablers. Energies
**2018**, 11, 3074. [Google Scholar] [CrossRef][Green Version] - Qadrdan, M.; Ameli, H.; Strbac, G.; Jenkins, N. Efficacy of options to address balancing challenges: Integrated gas and electricity perspectives. Appl. Energy
**2017**, 190, 181–190. [Google Scholar] [CrossRef][Green Version] - Clegg, S.; Mancarella, P. Storing renewables in the gas network: Modelling of power-to-gas seasonal storage flexibility in low-carbon power systems. IET Gener. Transm. Distrib.
**2016**, 10, 566–575. [Google Scholar] [CrossRef] - Meißner, A.C.; Dreher, A.; Knorr, K.; Vogt, M.; Zarif, H.; Jürgens, L.; Grasenack, M. A co-simulation of flexibility market based congestion management in Northern Germany. In Proceedings of the 16th International Conference on the European Energy Market (EEM), Ljubljana, Slovenia, 18–20 September 2019; pp. 1–6. [Google Scholar] [CrossRef]
- Acha, S.; Green, T.C.; Shah, N. Techno-economical tradeoffs from embedded technologies with storage capabilities on electric and gas distribution networks. In Proceedings of the 2010 IEEE Power and Energy Society General Meeting, Providence, RI, USA, 25–29 July 2010; pp. 1–8. [Google Scholar] [CrossRef]
- Clegg, S.; Mancarella, P. Integrated Electrical and Gas Network Flexibility Assessment in Low-Carbon Multi-Energy Systems. IEEE Trans. Sustain. Energy
**2016**, 7, 718–731. [Google Scholar] [CrossRef] - Zeng, Q.; Zhang, B.; Fang, J.; Chen, Z. Coordinated Operation of the Electricity and Natural Gas Systems with Bi-directional Energy Conversion. Energy Procedia
**2017**, 105, 492–497. [Google Scholar] [CrossRef] - NEW 4.0: Norddeutsche EnergieWende. Available online: https://www.new4-0.de/ (accessed on 4 July 2020).
- Kornrumpf, T.; Meese, J.; Zdrallek, M.; Neusel-Lange, N.; Roch, M. Economic dispatch of flexibility options for Grid services on distribution level. In Proceedings of the 19th Power Systems Computation Conference, Genoa, Italy, 20–24 June 2016; IEEE: Piscataway, NJ, USA, 2016; pp. 1–7. [Google Scholar] [CrossRef]
- Junker, B. Methoden zur Vorausschauenden Netzbetriebsführung Eines Verteilnetzes anhand von Photovoltaik-Einspeiseprognosen. Master’s Thesis, Universität Kassel, Kassel, Germany, 2014. [Google Scholar]
- Kisse, J. Einfluss von Wärmeerzeugern auf die Gekoppelte Planung von Strom- und Gasverteilnetzen. Master’s Thesis, Technische Universität Berlin, Berlin, Germany, 2019. [Google Scholar]
- Drauz, S.R. Synthesis of A Heat and Electrical Load Profile for Single Andmulti-Family Houses Used for Subsequent Performance Tests of a Multi-Component Energy System. Master’s Thesis, RWTH Aachen, Aachen, Germany, 2016. [Google Scholar]
- EPANET. Available online: https://www.epa.gov/water-research/epanet (accessed on 2 November 2020).
- Osiadacz, A.J.; Chaczykowski, M. Modeling and Simulation of Gas Distribution Networks in a Multienergy System Environment. Proc. IEEE
**2020**, 108, 1580–1595. [Google Scholar] [CrossRef] - Bent, R.; Sundar, K. GasPowerModels.jl: GitHub Repository. Available online: https://github.com/lanl-ansi/GasPowerModels.jl (accessed on 5 June 2020).
- Cronbach, D.; Lohmeier, D.; Drauz, S.R.; Kisse, J.M.; Trummel, T.; Diesing, M.; Kiesewetter, V. Pandapipes: Documentation. Available online: https://pandapipes.readthedocs.io/en/latest/ (accessed on 1 November 2020).
- Varoquaux, G.; Vahtras, O.; Gouillart, E.; de Buyl, P.; Burns, C.; Chauve, A.; Cimrman, R.; Combelles, C.; Gommers, R.; Espaze, A.; et al. Scipy Lecture Notes: www.scipy-lectures.org. Available online: https://scipy-lectures.org/index.html (accessed on 30 October 2020).

**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.

**Table 1.**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 | √ | √ | $\left(\surd \right)$ ** | $\left(\surd \right)$ ** | √ | OPF, (TOP) ***, LIB | |

pandapower [20] | GS | √ | √ | √ | OPF, CTRL, TOP, LIB | |||

pandapipes | GS | √ | √ | √ | √ | CTRL, TOP, LIB | ||

OSeMOSYS [33] | ESMO | √ | √ | √ | √ | √ | ||

Balmorel [34] | ESMO | $\left(\surd \right)$ * | √ | √ | √ | |||

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 | √ | √ | √ | $\left(\surd \right)$ ** | √ | ||

MYNTS [40] | MEGS | √ | √ | √ | √ | GUI, TC (all), CTRL | ||

TransiEnt [41,42] | MEGS | $\left(\surd \right)$ * | √ | √ | √ | √ | √ | TC (all), CTRL |

pandapipes multi-energy | MEGS | √ | √ | √ | √ | √ | √ | OPF, CTRL, LIB |

**Table 2.**Characteristics 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 |

**Table 3.**Maximum 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 |

**Table 4.**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. ${N}_{HH}$ stands for the number of households connected to the gas grid.

Power Grid | Gas Grid | ||
---|---|---|---|

preset voltage at slack node | ${V}_{slack}=1.01\phantom{\rule{1.0pt}{0ex}}p.u.$ | preset pressure at reference node | ${p}_{rn}=0.7\phantom{\rule{1.0pt}{0ex}}bar$ |

maximum voltage | ${V}_{max}=1.06\phantom{\rule{1.0pt}{0ex}}p.u.$ | maximum pressure P2G node | ${p}_{P2G,max}=0.75\phantom{\rule{1.0pt}{0ex}}bar$ |

maximum line loading | ${I}_{max}=0.6\phantom{\rule{2.0pt}{0ex}}{I}_{max,th}$ | maximum feed-in with methane | ${\dot{m}}_{max,P2G}={\sum}_{l=1}^{{N}_{HH}}{\dot{m}}_{l}$ |

maximum hydrogen fraction | ${x}_{{H}_{2},vol,max}=10\%$ |

**Table 5.**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 | H_{2}, CH_{4} | 1 | PR, PGR |

1 | PV, mix, wind | 1, 2, 5, 10 | CH_{4} | 2, 3, 4, 5, 6 | PR, PGR |

2 | PV, mix, wind | 1, 2, 5, 10 | CH_{4} | 1 + (2, 3, 4, 5, 6) | PR, PGR |

2 | PV, mix, wind | 1, 5, 10 | CH_{4} | (2, 3, 4) + (5, 6) | PR, PGR |

6 | PV, mix, wind | 1, 2, 5 | CH_{4} | 1 + 2 + 3 + 4 + 5 + 6 | PR, PGR |

Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |

© 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/).

## Share and Cite

**MDPI and ACS Style**

Lohmeier, D.; Cronbach, D.; Drauz, S.R.; Braun, M.; Kneiske, T.M. Pandapipes: An Open-Source Piping Grid Calculation Package for Multi-Energy Grid Simulations. *Sustainability* **2020**, *12*, 9899.
https://doi.org/10.3390/su12239899

**AMA Style**

Lohmeier D, Cronbach D, Drauz SR, Braun M, Kneiske TM. Pandapipes: An Open-Source Piping Grid Calculation Package for Multi-Energy Grid Simulations. *Sustainability*. 2020; 12(23):9899.
https://doi.org/10.3390/su12239899

**Chicago/Turabian Style**

Lohmeier, Daniel, Dennis Cronbach, Simon Ruben Drauz, Martin Braun, and Tanja Manuela Kneiske. 2020. "Pandapipes: An Open-Source Piping Grid Calculation Package for Multi-Energy Grid Simulations" *Sustainability* 12, no. 23: 9899.
https://doi.org/10.3390/su12239899