Skip to content

Commit

Permalink
Merge branch 'fix/heat-exchanger-effectiveness-derivatives-typos' int…
Browse files Browse the repository at this point in the history
…o dev
  • Loading branch information
fwitte committed Oct 27, 2024
2 parents f1b0a15 + 123230c commit 95d678b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 3 additions & 1 deletion docs/whats_new/v0-7-7.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ Bug Fixes
Furthermore, it is checked whether a file is represented by a class
available in the namespace via the :code:`@component_registry` decorator
(`PR #536 <https://github.com/oemof/tespy/pull/536>`__).

- Fixed a typo in the Jacobian of the hot side and cold side
:code:`HeatExchanger` effectiveness
(`PR #563 <https://github.com/oemof/tespy/pull/563>`__).

Other Changes
#############
Expand Down
4 changes: 2 additions & 2 deletions src/tespy/components/heat_exchangers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ def eff_cold_deriv(self, increment_filter, k):
self.jacobian[k, c.h.J_col] = self.numeric_deriv(f, 'h', c)

if self.is_variable(i2.h):
self.jacobian[k, i2.h.J_col] = 1 - self.eta_cold.val
self.jacobian[k, i2.h.J_col] = 1 - self.eff_cold.val

def calc_dh_max_hot(self):
r"""Calculate the theoretical maximum enthalpy decrease on the hot side
Expand Down Expand Up @@ -828,7 +828,7 @@ def eff_hot_deriv(self, increment_filter, k):
i2 = self.inl[1]

if self.is_variable(i1.h):
self.jacobian[k, i1.h.J_col] = 1 - self.eta_hot.val
self.jacobian[k, i1.h.J_col] = 1 - self.eff_hot.val

for c in [o1, i2]:
if self.is_variable(c.p, increment_filter):
Expand Down
5 changes: 4 additions & 1 deletion tests/test_components/test_heat_exchangers.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,10 @@ def test_HeatExchanger(self, tmp_path):
)
assert round(instance.eff_cold.val, 1) == 0.9, msg

self.c3.set_attr(m=None)
self.c1.set_attr(p=None)
self.c2.set_attr(p=3)
self.c3.set_attr(m=None, p=None)
self.c4.set_attr(p=5)
instance.set_attr(eff_max=None, eff_hot=0.9, eff_cold=0.9)
self.nw.solve("design")
self.nw._convergence_check()
Expand Down

0 comments on commit 95d678b

Please sign in to comment.