@@ -476,6 +476,37 @@ def test_HeatExchanger(self, tmp_path):
476
476
)
477
477
assert round (self .c3 .m .val , 2 ) == 7.96
478
478
479
+ def test_HeatExchanger_effectiveness_invalid (self ):
480
+
481
+ instance = HeatExchanger ('heat exchanger' )
482
+ self .setup_HeatExchanger_network (instance )
483
+
484
+ # remove fluid specifications
485
+ self .c1 .set_attr (fluid = {f : None for f in self .c1 .fluid .val })
486
+ self .c3 .set_attr (fluid = {f : None for f in self .c3 .fluid .val })
487
+
488
+ # add new fluids
489
+ # temperature range > 300 °C
490
+ self .c1 .set_attr (fluid = {"INCOMP::NaK" : 1 }, m = 10 , T = 400 , p = 1 )
491
+ self .c2 .set_attr (T = 350 , p = 1 )
492
+ # temperature range < 100 °C at 1 bar
493
+ self .c3 .set_attr (fluid = {"INCOMP::Water" : 1 }, T = 25 , p = 1 )
494
+ self .c4 .set_attr (T = 50 , p = 1 )
495
+ instance .set_attr (eff_cold = None , eff_hot = None , pr1 = None , pr2 = None )
496
+
497
+ self .nw .solve ("design" )
498
+ self .nw ._convergence_check ()
499
+ msg = (
500
+ 'Value of cold effectiveness must be nan but is '
501
+ f'{ round (instance .eff_cold .val , 1 )} .'
502
+ )
503
+ assert np .isnan (instance .eff_cold .val ), msg
504
+ msg = (
505
+ 'Value of hot effectiveness must be nan but is '
506
+ f'{ round (instance .eff_hot .val , 1 )} .'
507
+ )
508
+ assert np .isnan (instance .eff_hot .val ), msg
509
+
479
510
def test_Condenser (self , tmp_path ):
480
511
"""Test component properties of Condenser."""
481
512
instance = Condenser ('condenser' )
0 commit comments