GithubHelp home page GithubHelp logo

joroeder / modeliquarree Goto Github PK

View Code? Open in Web Editor NEW

This project forked from quarree100/modeliquarree

0.0 0.0 0.0 22.8 MB

Repository for work in Quarree100 based on Modelica

License: GNU General Public License v3.0

Batchfile 0.01% Shell 0.01% Python 0.79% Modelica 99.21%

modeliquarree's Introduction

modeliquarree (Modelica-Quarree100)

Repository for work with Modelica in the project Quarree100.

district_model

This directory is for the main modelica package of Quarree100, the district model. It allows simulation of the energy system with all its major components in OpenModelica and Dymola.

Examples

This directory contains general examples for the work with OpenModelica and Python. BouncingBall.py implements several ways of connecting Python to Modelica Simulations and Functional Mock-up Units (FMUs), for example through OMPython (OpenModelica Python Interface). It uses the standard BouncingBall Modelica example project.

HP_testbench

Careful: Until issue #5 Update heatpump testbench to AixLib 0.9.1 has been resolved, this part is not fully functional!

This directory contains a Python package called hptestbench, which allows simulating heatpumps with OpenModelica or FMUs, in order to evaluate their performance and integrate the results in other workflows. The main purpose is to provide e.g. COP timeseries for use in oemof optimizations. hptestbench is designed to be a self-contained Python package. It provides the necessary files for installation from source, as well as both an OpenModelica model and an equivalent FMU. Private data required for Quarree100 and not shared on GitHub can be automatially loaded, too. hptestbench makes sure the necessary replacements are made.

Installation

After cloning the repository from GitHub, you can install the package from source with either pip:

python setup.py install

... or conda (making sure all dependency packages are installed):

conda build conda.recipe
conda install hptestbench --use-local

... or you can "install" it with conda's development mode:

conda develop .

This may be the preferred option, since it just registers a link to the Git directory. After any changes are made, no new installation is required. Since this way no dependencies are installed, you may find the file ''requirements.txt'' useful for installing those.

You can now simulate FMUs with pyfmi. If you want to simulate via OpenModelica, both OpenModelica itself and OMPython have to be installed manually (since OMPython is not available through conda).

Please note:

OMPython changed the input style for functions like setSimulationOptions(), setParameters(), etc. dramatically after v3.1.2. In order to be future-proof, this package requires the latest version from https://github.com/OpenModelica/OMPython/archive/master.zip (which is different from the version shipped with the Windows installer of OpenModelica!)

Actions

Please refer to the workflow implemented as a GitHub action for the complete installation instructions:

.github\workflows\heatpump_testbench.yml

This action serves as a test that is executed on each commit, making sure both installation and simulation are working properly.

Usage

Examples for how to use the testbench can be found in HP_testbench\conda.recipe\run_test.py and HP_testbench\hptestbench\__main__.py

import hptestbench
# Create our testbench
bench = hptestbench.testbench()

# Optionally, install a specific heat pump
bench.install_HP('Q100_air_water_001')  # optional

# Run the simulation with Modelica
bench.test_with_modelica(make_FMU=True)

# (or) Run the simulation via the functional mockup interface (FMI)
bench.test_with_FMU()

# Evaluate the results
data = bench.evaluate()
COP_mean = data['heatPump1.CoP_out'].mean()

modeliquarree's People

Contributors

jnettels avatar jwalbrunn avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.