Skip to main content

An adapter to connect mosaik to pandapipes

Project description

mosaik-pandapipes

This is an adapter for using the massflow network calculation program pandapipesin a mosaik simulation.

This simulator is still work in progress. If there is a need for a specific attribute und parameter to implement, leave an issue here.

Usage

Installation

Currently, this package is not on PyPI, so you need to install it from this git repository directly.

Setup

First, add the simulator to your SIM_CONFIG:

SIM_CONFIG = {
    "Pandapipes": {"python": "mosaik_components.pandapipes:Simulator"},
    ...
}

Having created your world, you can then start an instance of the simulator via

pp_sim = world.start("Pandapipes", step_size=900)

The step_size specifies at which steps this simulator runs. If you don’t give a step size or set it to None, the simulator will run in event-based mode, i.e. whenever it receives new input.

Finally, you can create the Grid entity. There are several ways of doing this:

  • If you have a pandapowerNet instance net in your scenario and the pandapower simulator is running in the same Python instance, you can use that grid by calling

    grid = pp_sim.Grid(net=net)
    
  • If the grid is in a JSON file (in pandapower’s format), you can call

    grid = pp_sim.Grid(json=path_to_json)
    
  • Similarly, if the grid is in an Excel file,

    grid = pp_sim.Grid(xlsx=path_to_xlsx)
    

The simulator supports only one grid entity. If you want to simulate several grids, you need to start several instances of the simulator.

Identifying grid elements

The Grid entity grid will have a child entity for each supported element in the grid. You can access them via grid.children. You can filter for specific types of entities by checking the child entity's type attribute or eid.

Connecting other simulators to the grid

You can connect positive entities to source and negative to sink, or both to a storage.

Table of entity types and attributes

Entity type Attribute In/Out Description
Grid meta entity representing the entire grid
Junction a junction in the grid
p[bar] out The junction pressure [bar]
t[k] out The junction temperature [K]
Source a source in the grid
mdot_source[kg/s] in Mass flow injection [kg/s]
mdot[kg/s] out Mass flow injection [kg/s]
Sink a sink in the grid
mdot_sink[kg/s] in Drawn mass flow [kg/s]
mdot[kg/s] out Drawn mass flow [kg/s]
Storage a load in the grid
mdot_storage[kg/s] in Mass flow in stationary pipeflow calculation [kg/s]
mdot[kg/s] out Mass flow [kg/s] (> 0: charging / < 0: discharging)
Pipe apipe in the grid
Re Out Average Reynolds number
lamda Out Average valve friction factor
v_mean[m/s] Out The mean valve velocity [m/s]
Valve a valve in the grid
Re Out Average Reynolds number
lamda Out Average valve friction factor
v_mean[m/s] Out The mean valve velocity [m/s]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mosaik_pandapipes-0.1.0.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

mosaik_pandapipes-0.1.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file mosaik_pandapipes-0.1.0.tar.gz.

File metadata

  • Download URL: mosaik_pandapipes-0.1.0.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.13 Linux/5.4.109+

File hashes

Hashes for mosaik_pandapipes-0.1.0.tar.gz
Algorithm Hash digest
SHA256 732668bb4d9e7d2eb5dbd870deee67ac07616916dc5ca1a7318105a0bd79c649
MD5 28d6a82a76f07bb9a7bee76844ec6049
BLAKE2b-256 5b627b0ff8012c2302cd5bbc038e38ea90d5b2b2362f05fd8ae46b63120ed4ef

See more details on using hashes here.

File details

Details for the file mosaik_pandapipes-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mosaik_pandapipes-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a55ba1b76a7e98174b9b2fc5e478483dcbb3321223030da0ff75aaf772c74871
MD5 097cb9b1bca3c27632500254e56361ce
BLAKE2b-256 4ff895aadd0932faee6eeef08ca8b5bc7e08968cd65b4367ebe6fc20e0e2ddcc

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page