Flow
EnFlow
¶
Bases: EnBaseModel
Represents an energy flow model designed to manage and optimize energy-related variables and constraints in an energy system. It includes parameters such as nominal values, variable costs, bounds, gradients, and additional constraints like nonconvex flows, lifetime, or custom attributes.
This class is typically employed in optimization scenarios where energy flows between nodes in a system are analyzed and adjusted based on various input parameters to minimize costs or adhere to specific constraints.
Attributes:
Name | Type | Description |
---|---|---|
nominal_value |
float | EnInvestment
|
The nominal value of the flow. If set, the corresponding optimization variable of the flow object will be bounded by this value multiplied with min(lower bound)/max(upper bound). |
variable_costs |
float | list[float] | None
|
The costs associated with one unit of the flow per hour. These costs for each timestep will be added to the objective expression of the optimization problem. |
min |
float | list[float] | None
|
Normed minimum value of the flow. |
max |
float | list[float] | None
|
Normed maximum value of the flow. The absolute maximum flow will be calculated by multiplying nominal_value with max. |
fix |
float | list[float] | None
|
Normed fixed value for the flow variable. It will be multiplied with nominal_value to get the absolute value. |
positive_gradient_limit |
dict | None
|
Normed upper bound on the positive difference (flow[t-1] < flow[t]) of two consecutive flow values. |
negative_gradient_limit |
dict | None
|
Normed upper bound on the negative difference (flow[t-1] > flow[t]) of two consecutive flow values. |
full_load_time_max |
int | None
|
Maximum energy transported by the flow, expressed as the time (in hours) the flow would have to run at nominal capacity (nominal_value). |
full_load_time_min |
int | None
|
Minimum energy transported by the flow, expressed as the time (in hours) the flow would have to run at nominal capacity (nominal_value). |
integer |
bool | None
|
If True, the flow values will be bounded to integers. |
nonconvex |
EnNonConvex | None
|
If a nonconvex flow object is specified, the flow's constraints will be significantly altered based on the NonConvexFlow model. |
fixed_costs |
float | list[float] | None
|
Fixed costs associated with a flow, provided on a yearly basis. Applicable only for a multi-period model. |
lifetime |
int | None
|
Lifetime of a flow (in years). When reached (considering the initial age), the flow is forced to 0. Applicable only for a multi-period model. |
age |
int | None
|
Age of a flow (in years). When reached (considering the initial age), the flow is forced to 0. Applicable only for a multi-period model. |
custom_attributes |
dict | None
|
Custom attributes provided as a dictionary for customized investment limits or additional properties. |
Source code in backend/app/ensys/components/flow.py
9 10 11 12 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 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 |
|
to_oemof(energysystem)
¶
Converts the current instance into an oemof.solph.Flow object using the provided energy system and internal parameters. The method prepares the necessary arguments from the instance and inputs, constructs the Flow object, and returns it.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
energysystem
|
EnergySystem
|
The energy system object used to derive specific characteristics for the flow conversion (oemof.solph.EnergySystem). |
required |
Returns:
Type | Description |
---|---|
Flow
|
A corresponding oemof.solph.Flow object built using the instance parameters and the energy system context (oemof.solph.Flow). |