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

4simple_header_config: ObjectType = ObjectType.model_validate({ 

5 "displayType": "Simple Header", 

6 "displayName": "Simple Header", 

7 "ports": { 

8 "outlet_condensate": { 

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

10 "displayName": "Condensate", 

11 "type": ConType.Outlet, 

12 "default": 1, 

13 "streamName": "Condensate S", 

14 "streamOffset": 3, 

15 }, 

16 "outlet_vent": { 

17 "many": False, 

18 "displayName": "Vent Outlet", 

19 "type": ConType.Outlet, 

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

21 "streamName": "Vent S", 

22 "streamOffset": 3, 

23 }, 

24 "inlet": { 

25 "many": True, 

26 "displayName": "Inlet", 

27 "type": ConType.Inlet, 

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

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

30 "streamName": "S", 

31 "streamOffset": 3, 

32 

33 }, 

34 "outlet": { 

35 "many": True, 

36 "displayName": "Outlet", 

37 "type": ConType.Outlet, 

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

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

40 "streamName": "S", 

41 "streamOffset": 3, 

42 }, 

43 

44 }, 

45 "propertyPackagePorts": { 

46 "": ["inlet", "outlet", "outlet_vent", "outlet_condensate"] 

47 }, 

48 "graphicObject": { 

49 "width": 25, 

50 "height": 800, 

51 "autoHeight": True 

52 }, 

53 "indexSets": ["splitter_fraction"], 

54 "properties": { 

55 "split_flow": { 

56 "displayName": "Flow", 

57 "type": "numeric", 

58 "unitType": "molarflow", 

59 "indexSets": ["splitter_fraction"], 

60 }, 

61 "outlet_vent.flow_mol": { 

62 "displayName": "Vent Flow", 

63 "type": "numeric", 

64 "unitType": "molarflow", 

65 }, 

66 "heat_loss": { 

67 "displayName": "Heat Loss", 

68 "type": "numeric", 

69 "unitType": "heatflow", 

70 "value": 0, 

71 }, 

72 "pressure_loss": { 

73 "displayName": "Pressure Drop", 

74 "type": "numeric", 

75 "unitType": "pressure", 

76 "value": 0, 

77 }, 

78 # Read-only properties 

79 "total_flow_mass": { 

80 "displayName": "Mass Flow", 

81 "type": "numeric", 

82 "unitType": "massflow", 

83 }, 

84 "total_flow_mol": { 

85 "displayName": "Molar Flow", 

86 "type": "numeric", 

87 "unitType": "molarflow", 

88 }, 

89 "balance_flow_mol":{ 

90 "displayName": "Balance Flow", 

91 "type": "numeric", 

92 "unitType": "molarflow", 

93 }, 

94 "temperature": { 

95 "displayName": "Temperature", 

96 "type": "numeric", 

97 "unitType": "temperature", 

98 }, 

99 "degree_of_superheat": { 

100 "displayName": "Degree of Superheat", 

101 "type": "numeric", 

102 "unitType": "deltaTemperature", 

103 }, 

104 "pressure": { 

105 "displayName": "Pressure", 

106 "type": "numeric", 

107 "unitType": "pressure", 

108 }, 

109 "vapor_frac": { 

110 "displayName": "Vapor Fraction", 

111 "type": "numeric", 

112 "unitType": "ratio", 

113 }, 

114 "enth_mass": { 

115 "displayName": "Mass Specific Enthalpy", 

116 "type": "numeric", 

117 "unitType": "massEnthalpy", 

118 }, 

119 "enth_mol": { 

120 "displayName": "Molar Specific Enthalpy", 

121 "type": "numeric", 

122 "unitType": "molarEnthalpy", 

123 }, 

124 }, 

125 "splitter_fraction_name": "Outlet", 

126 "propertySetGroups": { 

127 "default": { 

128 "type": "stateVars", 

129 "displayName": "Properties", 

130 "stateVars": ("split_flow", "heat_loss", "pressure_loss"), 

131 } 

132 }, 

133 "keyProperties": [ 

134 "pressure", 

135 "temperature", 

136 "degree_of_superheat", 

137 "enth_mass", 

138 "vapor_frac", 

139 ] 

140})