MESSpy

Has been developed to perform techno-economic assesment of Renewable Energy Communities, but can also be used to study single-standing buildings and hydrogen-integrated energy systems.
https://github.com/pielube/messpy

Category: Energy Systems
Sub Category: Renewable Energy Integration

Last synced: about 11 hours ago
JSON representation

Repository metadata

Multi-Energy System Simulator - Python version

README.md

MESSpy - Multi-Energy System Simulator

An open-source model for simulating multy-energy systems such as Renewable Energy Communities, about hydrogen supercool things and much more.

MESS_profile

Authors

Mattia Pasqui, Alessandro Mati, Andrea Ademollo,Mattia Calabrese, Valentina Veltroni, Pietro Lubello, and Carlo Carcasci
Department of Industrial Engineering (DIEF), University of Florence (UNIFI), Italy

Overview

The Multi-Energy System Simulator has been developed to perform techno-economic assesment of Renewable Energy Communities (REC), but can also be used to study single-standing buildings and hydrogen-integrated energy systems. In its last update, it also integrates ammonia synthesis and conversion technologies.
It can simulate hourly balances of the energy flows between technologies of each location (building) inside the REC and calculate the Net Present Value of each considering the interaction with the national grid given different incentive schemes. The program has been developed to be as general as possible so it can be used to simulate a wide range of different case studies while easily changing their configuration or parameters,both technical and economic.
The code is extensively commented and can be easily used either as a black box by simply modifying the inputs and working on results or by directly modifying the code.

It's an object oriented program structured on three levels: REC, location and technologies.
Models of different technologies are avialable and still under development to include new fetures and more realistic detalis. At the current stage the following technologies can be included in the simulations:

  • Photovoltaic panels
  • Wind turbines
  • Batteries
  • Electrolyzers (PEM, Alkaline)
  • Steam Methane Reformer
  • Fuel Cells (PEM, SOFC)
  • Hydrogen tanks
  • Hydrogen compressors
  • Heat pumps
  • Boilers (NG, electric or H2)
  • CHP (combined heat and power)
  • CCGT (H2 or NH3)
  • Ammonia Synthesis Reactor (Haber-Bosch based)
  • Ammonia tanks
  • Ammonia Cracker
  • Air separator (PSA)

MESS needs the load profiles as input as a .csv file

Depending on the type of meter installed, these data is in some cases made available by the electricity/gas supplier, in others it must be requested, while sometimes it cannot be obtained. In the latter case, specific programmes are required to generate such profiles in the specific .csv format needed as one of the program inputs. There are many programmes available online, the authors recommend the following:
bottom-up model: https://github.com/RAMP-project/RAMP
bottom-up model: https://github.com/open-ideas/StROBe
top-down model: https://github.com/PasquinoFI/LoBi
top-down model: https://github.com/PasquinoFI/LoBi_residenziale_GSE

Timestep

Simulation timestep can vary from 1 to 60 minutes. The time horizon from 1 year to as many years as you want.

Requirements

The model is developed in Python 3.9, and requires the following libraries:

  • numpy
  • pandas
  • os
  • pickle (results can be saved in .pickle)
  • csv (results can be saved in csv)
  • json (input files are .json)
  • pvlib (used to download PV production series and weather data based on typical meteorological year)
  • matplotlib (used in post_process)
  • Coolprop (for thermodynamic libraries)
  • scipy (for opimization and interpolation function)

A less up-to-date but fully functional and documented fortran version is also available:
https://github.com/pielube/MESS-Fortran

Quick start

Download Anaconda from https://www.anaconda.com/download: recommended to handle virtual environments and package versions.

From Anaconda Prompt, install git, choose folder, clone repository, create the virtual environment and install Spyder (Authors usually use Spyder as IDE)

You can run examples now. Three examples analysis are available:

  • "run_test_1" A small energy community composed by two consumers and one prosumer with PV and battery. A sensisivety analysi is also carried out.
  • "run_test_2" A residential building replaces the gas boiler with a heat pump
  • "run_test_3" On-site hydrogen production plant for an industrial facility
  • "run_test_4" On-site ammonia production, storage and use in a CCGT

Choose one of these, read it and press run!

Input files

You can modify them from a python interface or simply from notepad. The "Input_test" folder contains a demonstration case study.

  • general.json defines the general input. More details can be found in rec.py prologue comments.
  • studycase.json defines the structure of the case study. Here you can define all the locations to consider, each technology inside the locations and technology's parameters. More detalis can be found in rec.py and location.py comments to the code.
  • refcase.json This file has the same structure of structure.json and defines the "buiseness as usual" case, which is used as a reference case for calculating the cash flows of the study case and performing the economic assessment.
  • energy_market.json defines economic parameters. More details can be found in the comments of economics.py
  • tech_cost.json defines economic parameters. More details can be found in the comments of economics.py

Output files

Results are saved in both .pkl and .csv

How to continue

We suggest you to create your own run_dev.py, input_dev/ and post_process_dev.py and to work on them instead of modifying the existing file used as initial test.

Related works

Citing

Please cite previous works if you use MESSpy in your research.

Contribute

This project is open-source. Interested users are therefore invited to test, comment or contribute to the tool. Submitting issues is the best way to get in touch with the development team, which will address your comment, question, or development request in the best possible way. We are also looking for contributors to the main code, willing to contibute to its capabilities, computational-efficiency, formulation, etc.

To contribute changes:

  • Fork the project on GitHub
  • Create a feature branch (e.g. named "add-this-new-feature") to work on in your fork
  • Commit your changes to the feature branch
  • Push the branch to GitHub
  • On GitHub, create a new pull request from the feature branch
  • When committing new changes, please also take care of checking code stability running run_test
  • Your name will be added to the authors list

License

Copyright 2022 MESSpy, contributors listed in Authors.

Licensed under the European Union Public Licence (EUPL), Version 1.2-or-later; you may not use this file except in compliance with the License.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.


Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: 5 days ago

Total Commits: 392
Total Committers: 5
Avg Commits per committer: 78.4
Development Distribution Score (DDS): 0.561

Commits in past year: 1
Committers in past year: 1
Avg Commits per committer in past year: 1.0
Development Distribution Score (DDS) in past year: 0.0

Name Email Commits
PasquinoFI m****i@u****t 172
Alematiale a****i@u****t 144
pielube p****o@g****m 36
unknown a****o@g****m 32
CalaMatti m****1@e****t 8

Committer domains:


Issue and Pull Request metadata

Last synced: about 1 month ago

Total issues: 18
Total pull requests: 58
Average time to close issues: 7 months
Average time to close pull requests: about 4 hours
Total issue authors: 5
Total pull request authors: 6
Average comments per issue: 0.5
Average comments per pull request: 0.0
Merged pull request: 55
Bot issues: 0
Bot pull requests: 0

Past year issues: 0
Past year pull requests: 2
Past year average time to close issues: N/A
Past year average time to close pull requests: less than a minute
Past year issue authors: 0
Past year pull request authors: 2
Past year average comments per issue: 0
Past year average comments per pull request: 0.0
Past year merged pull request: 1
Past year bot issues: 0
Past year bot pull requests: 0

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/pielube/messpy

Top Issue Authors

  • Alematiale (8)
  • pielube (5)
  • PasquinoFI (3)
  • wafab112 (1)
  • KQEFEM (1)

Top Pull Request Authors

  • Alematiale (40)
  • CalaMatti (9)
  • pielube (4)
  • PasquinoFI (3)
  • AndreAdemollo (1)
  • sbshrey (1)

Top Issue Labels

Top Pull Request Labels


Dependencies

env/requirements.txt pypi
  • CoolProp ==6.6.0
  • PyQt5 ==5.15.10
  • PyQtWebEngine ==5.15.6
  • atomicwrites ==1.4.0
  • contourpy ==1.2.1
  • cycler ==0.12.1
  • et-xmlfile ==1.1.0
  • fonttools ==4.51.0
  • h5py ==3.11.0
  • importlib_resources ==6.4.0
  • inflection ==0.5.1
  • joblib ==1.4.0
  • kiwisolver ==1.4.5
  • matplotlib ==3.8.4
  • numpy ==1.26.4
  • openpyxl ==3.1.2
  • pandas ==2.2.2
  • pillow ==10.3.0
  • ply ==3.11
  • pvlib ==0.10.4
  • pyls-spyder ==0.4.0
  • pyparsing ==3.1.2
  • pywin32 ==305.1
  • scikit-learn ==1.4.2
  • scipy ==1.13.0
  • threadpoolctl ==3.4.0
  • tzdata ==2024.1
  • webencodings ==0.5.1

Score: 5.541263545158426