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

4tank_config: ObjectType = ObjectType.model_validate({ 

5 "displayType": "Tank", 

6 "displayName": "Tank", 

7 "ports": default_ports(), 

8 "propertyPackagePorts": default_property_package_ports(), 

9 "graphicObject": unitop_graphic(), 

10 "properties": { 

11 "heat_duty_inverted": { 

12 "displayName": "Heat Loss", 

13 "type": "numeric", 

14 "unitType": "heatflow", 

15 "value": 0, 

16 }, 

17 "tank_diameter": { 

18 "displayName": "Base Diameter", 

19 "type": "numeric", 

20 "value": 1, 

21 "unitType": "distance", 

22 "hasTimeIndex": False, 

23 }, 

24 "tank_level": { 

25 "displayName": "Level", 

26 "type": "numeric", 

27 "value": 1, 

28 "unitType": "distance", 

29 }, 

30 "flow_rate_out": { 

31 "displayName": "Outlet Flow Rate", 

32 "type": "numeric", 

33 "unitType": "molarflow", 

34 }, 

35 "deltaP": { 

36 "displayName": "Pressure Increase", 

37 "type": "numeric", 

38 "value": 0, 

39 "unitType": "pressure" 

40 }, 

41 "dynamics": { 

42 "displayName": "Enable Dynamics", 

43 "propertySetGroup" : "dynamics", 

44 "type": "checkbox", 

45 "unitType": "dimensionless", 

46 "value": False, 

47 }, 

48 "control_volume.volume": { 

49 "displayName": "Volume", 

50 "propertySetGroup" : "dynamics", 

51 "type": "numeric", 

52 "unitType": "volume", 

53 "value": 1, 

54 }, 

55 "control_volume.material_holdup": { 

56 "displayName": "Material Holdup", 

57 "propertySetGroup" : "dynamics", 

58 "type": "numeric", 

59 "unitType": "molar", 

60 "indexSets": ["phase","compound"], 

61 }, 

62 "initial_temperature": { 

63 "displayName": "Initial Temperature", 

64 "propertySetGroup" : "dynamics", 

65 "type": "numeric", 

66 "unitType": "temperature", 

67 "hasTimeIndex": False, 

68 

69 }, 

70 "initial_pressure": { 

71 "displayName": "Initial Pressure", 

72 "propertySetGroup" : "dynamics", 

73 "type": "numeric", 

74 "unitType": "pressure", 

75 "hasTimeIndex": False, 

76 }, 

77 "initial_level": { 

78 "displayName": "Initial Level", 

79 "propertySetGroup" : "dynamics", 

80 "type": "numeric", 

81 "unitType": "distance", 

82 "hasTimeIndex": False, 

83 }, 

84 }, 

85 "indexSets": ["phase","compound"], 

86 "propertySetGroups": { 

87 "default": { 

88 "type": "stateVars", 

89 "displayName": "Properties", 

90 "stateVars": ("heat_duty_inverted", "tank_diameter","tank_level"), 

91 }, 

92 "dynamics": { 

93 "type": "stateVars", 

94 "displayName": "Dynamics", 

95 "toggle": "dynamics", # if holdup is true, then display these properties 

96 "stateVars": ("dynamics","initial_level", "initial_temperature","initial_pressure") 

97 } 

98 }, 

99 "keyProperties": [ 

100 "heat_duty_inverted", 

101 "flow_rate_out", 

102 ] 

103})