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

4 statements  

« prev     ^ index     » next       coverage.py v7.10.7, created at 2026-06-23 21:51 +0000

1from common.config_types import * 

2from common.config_utils import * 

3from ..spec_helpers import * 

4 

5tank_config: ObjectType = ObjectType( 

6 displayType="Tank", 

7 displayName="Tank", 

8 ports=default_ports(), 

9 propertyPackagePorts=default_property_package_ports(), 

10 graphicObject=unitop_graphic(), 

11 properties=PropertiesType({ 

12 "heat_duty_inverted": PropertyType( 

13 displayName="Heat Loss", 

14 type="numeric", 

15 unitType="heatflow", 

16 value=0, 

17 ), 

18 "tank_diameter": PropertyType( 

19 displayName="Base Diameter", 

20 type="numeric", 

21 value=1, 

22 unitType="distance", 

23 hasTimeIndex=False, 

24 ), 

25 "tank_level": PropertyType( 

26 displayName="Level", 

27 type="numeric", 

28 value=1, 

29 unitType="distance", 

30 ), 

31 "flow_rate_out": PropertyType( 

32 displayName="Outlet Flow Rate", 

33 type="numeric", 

34 unitType="molarflow", 

35 ), 

36 "deltaP": PropertyType( 

37 displayName="Pressure Increase", 

38 type="numeric", 

39 value=0, 

40 unitType="pressure" 

41 ), 

42 "dynamics": PropertyType( 

43 displayName="Enable Dynamics", 

44 propertySetGroup="dynamics", 

45 type="checkbox", 

46 unitType="dimensionless", 

47 value=False, 

48 ), 

49 "control_volume.volume": PropertyType( 

50 displayName="Volume", 

51 propertySetGroup="dynamics", 

52 type="numeric", 

53 unitType="volume", 

54 value=1, 

55 ), 

56 "control_volume.material_holdup": PropertyType( 

57 displayName="Material Holdup", 

58 propertySetGroup="dynamics", 

59 type="numeric", 

60 unitType="molar", 

61 indexSets=["phase","compound"], 

62 ), 

63 "initial_temperature": PropertyType( 

64 displayName="Initial Temperature", 

65 propertySetGroup="dynamics", 

66 type="numeric", 

67 unitType="temperature", 

68 hasTimeIndex=False, 

69 

70 ), 

71 "initial_pressure": PropertyType( 

72 displayName="Initial Pressure", 

73 propertySetGroup="dynamics", 

74 type="numeric", 

75 unitType="pressure", 

76 hasTimeIndex=False, 

77 ), 

78 "initial_level": PropertyType( 

79 displayName="Initial Level", 

80 propertySetGroup="dynamics", 

81 type="numeric", 

82 unitType="distance", 

83 hasTimeIndex=False, 

84 ), 

85 }), 

86 indexSets=["phase","compound"], 

87 propertySetGroups={ 

88 "default": { 

89 "type": "stateVars", 

90 "displayName": "Properties", 

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

92 }, 

93 "dynamics": { 

94 "type": "stateVars", 

95 "displayName": "Dynamics", 

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

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

98 } 

99 }, 

100 keyProperties=[ 

101 "heat_duty_inverted", 

102 "flow_rate_out", 

103 ], 

104 idaes_adapter=UnitModelAdapter( 

105 args=ArgAdapter({ 

106 "property_package": PropertyPackageAdapter(), 

107 "dynamic": DynamicAdapter(), 

108 "has_holdup": DynamicAdapter(), # these are both set to true at the same time. 

109 "tank_type": ConstantArg("vertical_cylindrical_tank"), 

110 "has_heat_transfer": ConstantArg(True), 

111 }), 

112 ), 

113)