Skip to content

Commit

Permalink
Merge branch 'dev' of github.com:oemof/oemof_base into features/two_r…
Browse files Browse the repository at this point in the history
…egion_example
  • Loading branch information
uvchik committed Dec 7, 2015
2 parents 8bdea39 + cecc654 commit e87fd93
Show file tree
Hide file tree
Showing 6 changed files with 525 additions and 28 deletions.
4 changes: 2 additions & 2 deletions doc/api/modules.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
oemof_base
==========
oemof
=====

.. toctree::
:maxdepth: 4
Expand Down
485 changes: 485 additions & 0 deletions doc/framework_concept.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 7 additions & 6 deletions doc/meta_description.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ oemof is programmed in Python and uses several Python packages for scientific ap

The framework consists of packages. For the communication between these packages interfaces are provided. A package again consists of modules that handle a defined task. A linkage of specific modules of the various packages is in oemof called an application (app) and depicts for example a concrete energy system model. The following image shows the underlying concept.

**Abbildung**: Verschiedene Pakete, aus denen verschiedene App gebastelt werden
.. image:: framework_concept.svg
:height: 744px
:width: 1052 px
:scale: 30 %
:alt: alternate text
:align: center

Besides other applications the apps "renpass-gis" and "reegis" are currently developed within the framework. "renpass-gis" enables the simulation of a future European energy system with a high spatial and temporal resolution. Different expansion pathways of conventional power plants, renewable energies and net infrastructure can be considered. The app "reegis" provides a simulation of a regional heat and power supply system. These two examples show that the modular approach of the framework allows applications with very different objectives.

Expand All @@ -45,10 +50,6 @@ Components and buses can be combined to an energy system. Buses are nodes, conne

Besides the use of the basic components one has the possibility to develop more specified components on the base of the basic components. The following figure illustrates the setup of a simple energy system and the basic structure explained before.

Figure: Setup of a simple energy system within the framework (buses and
components)


Mathematical description (generic formulation as graph without timesteps)
----------------------------------------------------------------------------

Expand Down Expand Up @@ -331,7 +332,7 @@ Currently, oemof provides the following classes. The first three levels represen

* Simple
* CHP
* SimplexExtractionCHP
* SimpleExtractionCHP
* Storage

* Transport
Expand Down
2 changes: 2 additions & 0 deletions doc/whatsnew/v0002.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ New features
Documentation
#############

* missing docstrings of the core subpackage added

Testing
#######
Expand All @@ -16,6 +17,7 @@ Testing
Bug fixes
#########

* now the api-docs can be read on readthedocs.org

Other changes
#############
Expand Down
45 changes: 27 additions & 18 deletions oemof/core/energy_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ class EnergySystem:
regions : list of core.energy_system.Region objects
List of regions defined in the :py:class:`Region
<oemof.core.energy_system.Simulation>` class.
year : integer
Define the time for the energy system.
Attributes
----------
Expand All @@ -49,29 +51,36 @@ def __init__(self, **kwargs):
setattr(self, attribute, kwargs.get(attribute, []))
Entity.registry = self
self.optimization_model = kwargs.get('optimization_model', None)
self.year = kwargs.get('year')

# TODO: Condense signature (use Buse)
def connect(self, code1, code2, media, in_max, out_max, eta,
transport_class):
"""Create a transport object to connect to buses."""
def connect(self, bus1, bus2, in_max, out_max, eta, transport_class):
"""Create two transport objects to connect two buses of the same type
in both directions.
Parameters
----------
bus1, bus2 : core.network.Bus object
Two buses to be connected.
eta : float
Constant efficiency of the transport.
in_max : float
Maximum input the transport can handle, in $MW$.
out_max : float
Maximum output which can possibly be obtained when using the
transport, in $MW$.
transport_class class
Transport class to use for the connection
"""
if not transport_class == transport.Simple:
logging.error('')
raise(TypeError(
"Sorry, `EnergySystem.connect` currently only works with" +
"a `transport_class` argument of" + str(transport.Simple)))
for reg_out, reg_in in [(code1, code2), (code2, code1)]:
logging.debug('Creating simple {2} from {0} to {1}'.format(
reg_out, reg_in, transport_class))
uid = '_'.join([reg_out, reg_in, media])
self.connections[uid] = transport_class(
uid=uid,
outputs=[self.regions[reg_out].buses['_'.join(
['b', reg_out, media])]],
inputs=[self.regions[reg_in].buses['_'.join(
['b', reg_in, media])]],
out_max={'_'.join(['b', reg_out, media]): out_max},
in_max={'_'.join(['b', reg_in, media]): in_max},
eta=[eta]
)
for bus_a, bus_b in [(bus1, bus2), (bus2, bus1)]:
uid = bus_a.uid + bus_b.uid
transport_class(uid=uid, outputs=[bus_a], inputs=[bus_b],
out_max=[out_max], in_max=[in_max], eta=[eta])

# TODO: Add concept to make it possible to use another solver library.
def optimize(self):
Expand Down Expand Up @@ -190,6 +199,6 @@ def __init__(self, **kwargs):
self.stream_solver_output = kwargs.get('stream_solver_output', False)
self.objective_options = kwargs.get('objective_options', {})
self.duals = kwargs.get('duals', False)
self.timesteps = kwargs.get('timesteps', None)
self.timesteps = kwargs.get('timesteps')
if self.timesteps is None:
raise ValueError('No timesteps defined!')
4 changes: 2 additions & 2 deletions oemof/core/network/entities/components/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ class Source(Component):
The opposite of a Sink, i.e. a Component which only produces and as a
consequence has no input.
Parameter
---------
Parameters
----------
in_max : float
maximum input of component (e.g. in MW)
out_max : float
Expand Down

0 comments on commit e87fd93

Please sign in to comment.