Coverage for backend/flowsheetInternals/unitops/config/objects/header_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 

4header_config: ObjectType = ObjectType.model_validate({ 

5 "displayType": "Header", 

6 "displayName": "Header", 

7 

8 "ports": { 

9 "condensate_outlet": { 

10 "many": False, # Always exactly 1, cannot increase 

11 "displayName": "Condensate", 

12 "type": ConType.Outlet, 

13 "default": 1, 

14 "streamName": "Condensate S", 

15 "streamOffset": 3, 

16 }, 

17 "vent": { 

18 "many": False, 

19 "displayName": "Vent Outlet", 

20 "type": ConType.Outlet, 

21 "default": 1, # default number of outlets 

22 "streamName": "Vent S", 

23 "streamOffset": 3, 

24 }, 

25 "inlet": { 

26 "many": True, 

27 "displayName": "Inlet", 

28 "type": ConType.Inlet, 

29 "default": 1, # default number of inlets 

30 "minimum": 1, # minimum number of inlets 

31 "streamName": "S", 

32 "streamOffset": 3, 

33 

34 }, 

35 "outlet": { 

36 "many": True, 

37 "displayName": "Outlet", 

38 "type": ConType.Outlet, 

39 "default": 2, # default number of outlets 

40 "minimum": 1, # minimum number of outlets 

41 "streamName": "S", 

42 "streamOffset": 3, 

43 }, 

44 

45 }, 

46 "propertyPackagePorts": { 

47 "": ["inlet", "outlet", "vent", "condensate_outlet"] 

48 }, 

49 "graphicObject": { 

50 "width": 25, 

51 "height": 800, 

52 "autoHeight": True 

53 }, 

54 "indexSets": ["splitter_fraction"], 

55 "properties": { 

56 "split_flow": { 

57 "displayName": "Flow", 

58 "type": "numeric", 

59 "unitType": "molarflow", 

60 "indexSets": ["splitter_fraction"], 

61 }, 

62 "splitter.vent.flow_mol": { 

63 "displayName": "Vent Flow", 

64 "type": "numeric", 

65 "unitType": "molarflow", 

66 }, 

67 "heat_duty_inverted": { 

68 "displayName": "Heat Loss", 

69 "type": "numeric", 

70 "unitType": "heatflow", 

71 "value": 0, 

72 }, 

73 "deltaP_inverted": { 

74 "displayName": "Pressure Drop", 

75 "type": "numeric", 

76 "unitType": "pressure", 

77 "value": 0, 

78 }, 

79 # Read-only properties 

80 "total_flow_mass": { 

81 "displayName": "Mass Flow", 

82 "type": "numeric", 

83 "unitType": "massflow", 

84 }, 

85 "total_flow_mol": { 

86 "displayName": "Molar Flow", 

87 "type": "numeric", 

88 "unitType": "molarflow", 

89 }, 

90 "balance_flow_mol":{ 

91 "displayName": "Balance Flow", 

92 "type": "numeric", 

93 "unitType": "molarflow", 

94 }, 

95 "temperature": { 

96 "displayName": "Temperature", 

97 "type": "numeric", 

98 "unitType": "temperature", 

99 }, 

100 "degree_of_superheat": { 

101 "displayName": "Degree of Superheat", 

102 "type": "numeric", 

103 "unitType": "deltaTemperature", 

104 }, 

105 "pressure": { 

106 "displayName": "Pressure", 

107 "type": "numeric", 

108 "unitType": "pressure", 

109 }, 

110 "vapor_frac": { 

111 "displayName": "Vapor Fraction", 

112 "type": "numeric", 

113 "unitType": "ratio", 

114 }, 

115 "enth_mass": { 

116 "displayName": "Mass Specific Enthalpy", 

117 "type": "numeric", 

118 "unitType": "massEnthalpy", 

119 }, 

120 "enth_mol": { 

121 "displayName": "Molar Specific Enthalpy", 

122 "type": "numeric", 

123 "unitType": "molarEnthalpy", 

124 }, 

125 }, 

126 "splitter_fraction_name": "Outlet", 

127 "propertySetGroups": { 

128 "default": { 

129 "type": "stateVars", 

130 "displayName": "Properties", 

131 "stateVars": ("split_flow", "heat_duty_inverted", "deltaP_inverted"), 

132 } 

133 }, 

134 "keyProperties": [ 

135 "pressure", 

136 "temperature", 

137 "degree_of_superheat", 

138 "enth_mass", 

139 "vapor_frac", 

140 ] 

141})