Coverage for backend/flowsheetInternals/unitops/config/objects/heat_exchanger_1d_config.py: 100%

3 statements  

« prev     ^ index     » next       coverage.py v7.10.7, created at 2025-11-06 23:27 +0000

1from common.config_types import * 

2from common.config_utils import * 

3 

4heat_exchanger_1d_config: ObjectType = ObjectType.model_validate({ 

5 "displayType": "Heat Exchanger (1D)", 

6 "displayName": "Heat Exchanger (1D)", 

7 

8 # Use IDAES port names so the adapter can bind directly 

9 "ports": { 

10 "hot_side_inlet": { 

11 "displayName": "Hot Inlet", 

12 "type": "inlet", 

13 "streamOffset": 1, 

14 "streamName": "HS", 

15 }, 

16 "hot_side_outlet": { 

17 "displayName": "Hot Outlet", 

18 "type": "outlet", 

19 "streamOffset": 1, 

20 "streamName": "HS", 

21 }, 

22 "cold_side_inlet": { 

23 "displayName": "Cold Inlet", 

24 "type": "inlet", 

25 "streamOffset": 1, 

26 "streamName": "CS", 

27 }, 

28 "cold_side_outlet": { 

29 "displayName": "Cold Outlet", 

30 "type": "outlet", 

31 "streamOffset": 1, 

32 "streamName": "CS", 

33 }, 

34 }, 

35 

36 # Tell the factory which ports share a property package 

37 "propertyPackagePorts": { 

38 "Hot Side": ["hotInlet", "hotOutlet"], 

39 "Cold Side": ["coldInlet", "coldOutlet"], 

40 }, 

41 

42 "graphicObject": unitop_graphic(), 

43 

44 # Declare we have discretized (1D) properties keyed by this axis 

45 "indexSets": ["discretization"], 

46 

47 "properties": { 

48 # Scalar specs/outputs 

49 "overall_heat_transfer_coefficient": { 

50 "displayName": "Heat Transfer Coefficient (U)", 

51 "type": "numeric", 

52 "unitType": "heat_transf_coeff", 

53 }, 

54 "area": { 

55 "displayName": "Heat Exchange Area", 

56 "type": "numeric", 

57 "unitType": "area", 

58 "hasTimeIndex": False, 

59 }, 

60 "length": { 

61 "displayName": "Length", 

62 "type": "numeric", 

63 "unitType": "distance", 

64 "hasTimeIndex": False, 

65 }, 

66 "flow_type": { 

67 "displayName": "Flow Pattern", 

68 "type": "dropdown", 

69 "unitType": "dimensionless", 

70 "options": { 

71 "countercurrent": "Counter-current", 

72 "cocurrent": "Co-current", 

73 }, 

74 "value": "countercurrent", # Default value 

75 "hasTimeIndex": False, 

76 }, 

77 "transformation_method": { 

78 "displayName": "Discretization Method", 

79 "type": "dropdown", 

80 "unitType": "dimensionless", 

81 "options": { 

82 "dae.finite_difference": "Finite Difference", 

83 "dae.collocation": "Collocation", 

84 }, 

85 "value": "dae.collocation", 

86 "hasTimeIndex": False, 

87 }, 

88 "transformation_scheme": { 

89 "displayName": "Discretization Scheme", 

90 "type": "dropdown", 

91 "unitType": "dimensionless", 

92 "options": { 

93 "BACKWARD": "Backward", 

94 "FORWARD": "Forward", 

95 "LAGRANGE-RADAU": "Lagrange-Radau", 

96 }, 

97 "value": "LAGRANGE-RADAU", 

98 "hasTimeIndex": False, 

99 }, 

100 "finite_elements": { 

101 "displayName": "Number of Finite Elements", 

102 "type": "numeric_arg", 

103 "unitType": "dimensionless", 

104 "value": 20, # IDAES default 

105 "hasTimeIndex": False, 

106 }, 

107 "collocation_points": { 

108 "displayName": "Collocation Points", 

109 "type": "numeric_arg", 

110 "unitType": "dimensionless", 

111 "value": 3, # IDAES default 

112 "hasTimeIndex": False, 

113 }, 

114 # "hot_side.deltaP_inverted": { 

115 # "displayName": "Pressure Drop (Hot Side)", 

116 # "type": "numeric", 

117 # "unitType": "pressure", 

118 # "value": 0.0, 

119 # }, 

120 # "cold_side.deltaP_inverted": { 

121 # "displayName": "Pressure Drop (Cold Side)", 

122 # "type": "numeric", 

123 # "unitType": "pressure", 

124 # "value": 0.0, 

125 # }, 

126 

127 # 1D profiles (arrays) along the discretization axis; read-only display 

128 "hot_side.temperature_profile": { 

129 "displayName": "Hot Temperature Profile", 

130 "type": "numeric", 

131 "unitType": "temperature", 

132 "indexSets": ["discretization"], 

133 "readOnly": True, 

134 }, 

135 "cold_side.temperature_profile": { 

136 "displayName": "Cold Temperature Profile", 

137 "type": "numeric", 

138 "unitType": "temperature", 

139 "indexSets": ["discretization"], 

140 "readOnly": True, 

141 }, 

142 }, 

143 

144 "propertySetGroups": { 

145 "default": { 

146 "type": "stateVars", 

147 "displayName": "Properties", 

148 "stateVars": ("flow_type", "transformation_method", "transformation_scheme", "finite_elements", "collocation_points", "overall_heat_transfer_coefficient", "area", "length"), 

149 }, 

150 "profiles": { 

151 "type": "stateVars", 

152 "displayName": "Profiles", 

153 "stateVars": ("hot_side.temperature_profile", "cold_side.temperature_profile"), 

154 }, 

155 }, 

156 

157 "keyProperties": [ 

158 "overall_heat_transfer_coefficient", 

159 "area", 

160 "length", 

161 ], 

162})