Skip to content

Commit 9fb0c48

Browse files
committed
Add tests
1 parent 9e83d7c commit 9fb0c48

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

tests/test_components/test_heat_exchangers.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,34 @@ def test_SimpleHeatExchanger(self):
374374
msg = 'kA value needs to be identical on network and component level.'
375375
assert kA_network == kA_comp, msg
376376

377+
def test_SimpleHeatExchanger_kA_convergence_cooling(self):
378+
"""Test kA group equation convergence for near ambient temperature outflow."""
379+
instance = SimpleHeatExchanger("heatexchanger")
380+
self.setup_SimpleHeatExchanger_network(instance)
381+
self.c1.set_attr(fluid={"H2O": 1}, x=0, p=28, m=0.005)
382+
instance.D.min_val = 0.001
383+
instance.set_attr(
384+
pr=0.95,
385+
Tamb=20,
386+
kA=250,
387+
L=1000,
388+
D='var',
389+
ks=4.57e-5
390+
)
391+
self.nw.solve("design")
392+
self.nw.assert_convergence()
393+
assert round(self.c2.T.val - instance.Tamb.val, 3) == 0.002
394+
395+
def test_SimpleHeatExchanger_kA_convergence_heating(self):
396+
instance = SimpleHeatExchanger("heatexchanger")
397+
self.setup_SimpleHeatExchanger_network(instance)
398+
399+
instance.set_attr(Tamb=10, D=0.0215, L=50, ks=0.00001, kA=3000.0)
400+
self.c1.set_attr(p=4, m=0.1, fluid={"Water": 1}, T=0)
401+
self.nw.solve("design")
402+
self.nw.assert_convergence()
403+
assert round(instance.Tamb.val - self.c2.T.val, 3) == 0.008
404+
377405
def test_ParabolicTrough(self):
378406
"""Test component properties of parabolic trough."""
379407
instance = ParabolicTrough('parabolic trough')

0 commit comments

Comments
 (0)