Skip to content

Commit

Permalink
Remove conversion factors
Browse files Browse the repository at this point in the history
  • Loading branch information
joroeder committed Feb 2, 2024
1 parent 8784844 commit 907a6b0
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions dhnx/optimization/oemof_heatpipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ def __str__(self):

class HeatPipeline(Transformer):
r"""A HeatPipeline represent a Pipeline in a district heating system.
This is done by a Transformer with a constant energy loss independent of
actual power, but dependent on the nominal power and the length parameter.
The HeatPipeline is a single-input-single-output transformer. Additionally,
conversion factors for in- and output flow can be applied.
actual power, but dependent on the nominal power.
The HeatPipeline is a single-input-single-output transformer.
Parameters
----------
Expand Down Expand Up @@ -189,10 +189,6 @@ class HeatPipelineBlock(ScalarBlock): # pylint: disable=too-many-ancestors
loss of heat pipeline"
":math:`\dot{Q}_{nominal}`", ":py:obj:`flows[n, o].nominal_value`", "
P", "Nominal capacity of heating pipeline"
":math:`\eta_{out}`", ":py:obj:`conversion_factors[o][t]`", "P", "
Conversion factor of output flow (Heat Output)"
":math:`\eta_{in}`", ":py:obj:`conversion_factors[i][t]`", "P", "
Conversion factor of input flow (Heat Input)"
":math:`f_{loss}(t)`", ":py:obj:`heat_loss_factor`", "P", "Specific
heat loss factor for pipeline"
":math:`l`", ":py:obj:`length`", "P", "Length of heating pipeline"
Expand Down Expand Up @@ -311,10 +307,6 @@ class HeatPipelineInvestBlock(ScalarBlock): # pylint: disable=too-many-ancestor
loss of heat pipeline"
":math:`\dot{Q}_{nominal}`", ":py:obj:`flows[n, o].nominal_value`", "
V", "Nominal capacity of heating pipeline"
":math:`\eta_{out}`", ":py:obj:`conversion_factors[o][t]`", "P", "
Conversion factor of output flow (heat output)"
":math:`\eta_{in}`", ":py:obj:`conversion_factors[i][t]`", "P", "
Conversion factor of input flow (heat input)"
":math:`f_{loss}(t)`", ":py:obj:`heat_loss_factor`", "P", "Specific
heat loss factor for pipeline"
":math:`l`", ":py:obj:`length`", "P", "Length of heating pipeline"
Expand Down Expand Up @@ -444,15 +436,13 @@ def _relation_rule_with_demand(block, n, t):
expr = 0
try: # oemof.solph<=0.5.0
expr += - m.flow[n, o, t]
expr += m.flow[i, n, t] * n.conversion_factors[
o][t] / n.conversion_factors[i][t]
expr += m.flow[i, n, t]
expr += - block.heat_loss[n, t]
expr += - m.flow[n, d, t]
except KeyError: # oemof.solph>=0.5.1
period = 0 # Periods are not (yet) supported in DHNx
expr += - m.flow[n, o, period, t]
expr += m.flow[i, n, period, t] * n.conversion_factors[
o][t] / n.conversion_factors[i][t]
expr += m.flow[i, n, period, t]
expr += - block.heat_loss[n, t]
expr += - m.flow[n, d, period, t]

Expand Down

0 comments on commit 907a6b0

Please sign in to comment.