Skip to content

Commit

Permalink
Merge pull request #7 from project-angus/dev
Browse files Browse the repository at this point in the history
Merge current dev to master.
  • Loading branch information
wolf-pf authored Mar 6, 2019
2 parents c14f695 + c87087c commit a0728b3
Show file tree
Hide file tree
Showing 66 changed files with 297,052 additions and 586 deletions.
19 changes: 19 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
language: python

matrix:
include:
- python: 3.5
- python: 3.7
dist: xenial
sudo: true

install:
- pip install .
- pip install coveralls

# command to run tests
script:
- nosetests --with-doctest --with-coverage -c nose.cfg

after_success:
- coveralls
Binary file removed Modellkopplung.odt
Binary file not shown.
12 changes: 8 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
~~~~~~~~~~~~~~~~~~~~
IF_PPlant_GeoStorage
~~~~~~~~~~~~~~~~~~~~
Zusammenfassung
+++++++++++++++

Software interface between power plant and storage model
Die Schnittstelle zwischen Kraftwerk und geologischem Speicher stellt eine flexible Methode zum Koppeln einer Speichersimulation mit dem Betrieb von Kraftwerksanlagen. Der Speicherbetrieb wird mit Hilfe von Entscheidungsregeln gesteuert und übergibt die Schnittstellenparameter zwischen den Modellen automatisch. Der modulare Aufbau der Softwareschnittstelle erlaubt es, zwischen unterschiedlichen Simulationsmodellen für Speicher und Kraftwerk auszuwählen.

Abstract
++++++++

The Power Plant Geostorage Interface provides a flexible method to couple the simulation of a geological storage to the operation of a power plant. The interface provides a operation control logic and exchanges the interface parameters between the sotrage and the power plant model automatically. Due to a modular architecture, it is possible to choose between different simulation models for the power plant and the geological storage.
10 changes: 10 additions & 0 deletions coupled_simulation/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
"""
.. moduleauthor:: Francesco Witte <[email protected]>
"""
__version__ = '0.0.1 dev'

from coupled_simulation import coupling as cp
from coupled_simulation import powerplant as pp
from coupled_simulation import geostorage as gs
from coupled_simulation import utilities as util
23 changes: 8 additions & 15 deletions coupling/coupling.py → coupled_simulation/coupling.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
import getopt
import pandas as pd
import numpy as np
import powerplant as pp
import geostorage as gs
from coupled_simulation import powerplant as pp, geostorage as gs
import json
import datetime
import os
Expand All @@ -31,6 +30,9 @@ def __main__(argv):
:returns: no return value
"""

if len(argv) == 0:
return

#read main input file and set control variables, e.g. paths, identifiers, ...
#path = (r'D:\Simulations\if_testcase\testcase.main_ctrl.json')
path = ''
Expand Down Expand Up @@ -204,7 +206,7 @@ def calc_timestep(powerplant, geostorage, power, p0, md, tstep):

if storage_mode == 'charging' or storage_mode == 'discharging':
# pressure check
if abs((p0_temp - p1) / p1) > md.pressure_diff_rel or abs((p0_temp- p1)) > md.pressure_diff_abs:
if abs((p0_temp - p1) / p1) > md.pressure_diff_rel or abs(p0_temp - p1) > md.pressure_diff_abs:
m, power = powerplant.get_mass_flow(power, p1, storage_mode)
print('Adjusting mass flow rate.')
print('m / m_corr\t\t', '%.6f'%m, '/', '%.6f'%m_corr, '[kg/s]')
Expand All @@ -222,8 +224,8 @@ def calc_timestep(powerplant, geostorage, power, p0, md, tstep):
print('m / m_corr\t\t', '%.6f'%m, '/', '%.6f'%m_corr, '[kg/s]')
print('p0_new / p1\t\t', '%.6f'%p0_temp, '/', '%.6f'%p1, '[bars]')

elif abs((m - m_corr) / m_corr) > md.flow_diff_rel:
power = powerplant.get_power(m_corr, p1, storage_mode)
elif abs((m - m_corr) / m_corr) > md.flow_diff_rel or abs(m - m_corr) > md.flow_diff_abs:
m, power = powerplant.get_power(m_corr, p1, storage_mode)
tstep_accepted = True
print('Adjusting power to ', power)
print('m / m_corr\t\t', '%.6f'%m, '/', '%.6f'%m_corr, '[kg/s]')
Expand Down Expand Up @@ -353,13 +355,4 @@ def flush(self):
#you might want to specify some extra behavior here.
pass




#__main__()




#if __name__ == "__main__":
__main__(sys.argv[1:])
#__main__(sys.argv[1:])
Loading

0 comments on commit a0728b3

Please sign in to comment.