Energysystem
EnEnergysystem
¶
Bases: EnBaseModel
Represents an energy system model, encapsulating multiple components such as buses, sinks, sources, converters, storages, and constraints. This class provides methods to add components to the energy system and to convert it into a compatible format for integration with the oemof library.
Designed to handle different types of energy system elements, each of which is stored in its respective categorized list. The class allows for integration with external energy system processing tools by supporting the transformation of its components.
Attributes:
Name | Type | Description |
---|---|---|
busses |
list[EnBus]
|
List of all buses in the energy system. |
sinks |
list[EnSink]
|
List of all sinks in the energy system. |
sources |
list[EnSource]
|
List of all sources in the energy system. |
converters |
list[EnConverter]
|
List of all converters in the energy system. |
generic_storages |
list[EnGenericStorage]
|
List of all generic storages in the energy system. |
constraints |
list[EnConstraints]
|
List of all constraints in the energy system. |
Source code in backend/app/ensys/components/energysystem.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 |
|
add(elem)
¶
Adds an element to the corresponding list based on its type. Determines the type of the given element and appends it to its respective container (e.g., sinks, sources, busses, etc.). Raises an exception if the type of the element is not recognized.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
elem
|
EnSink | EnSource | EnBus | EnGenericStorage | EnConverter | EnConstraints
|
The element to be added. It should be one of the following types: EnSink, EnSource, EnBus, EnGenericStorage, EnConverter, or EnConstraints. |
required |
Returns:
Type | Description |
---|---|
None |
Source code in backend/app/ensys/components/energysystem.py
to_oemof_energysystem(energysystem)
¶
Converts the internal energy system components to an oemof energy system and adds them to the provided oemof energy system instance. Each component in the internal energy system is iterated through, converted to its corresponding oemof object, and subsequently added to the provided energy system. This includes busses, sinks, sources, converters, and generic storages.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
energysystem
|
EnergySystem
|
The oemof energy system instance to which the converted components of the internal energy system are added. |
required |
Returns:
Type | Description |
---|---|
solph.EnergySystem
|
An updated oemof energy system instance containing all converted components. |