Coverage for backend/flowsheetInternals/unitops/config/objects/heater_config.py: 100%
3 statements
« prev ^ index » next coverage.py v7.10.7, created at 2025-11-06 23:27 +0000
« 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 *
4heater_config: ObjectType = ObjectType.model_validate({
5 "displayType": "Heater",
6 "displayName": "Heater",
8 "ports": default_ports(),
9 "propertyPackagePorts": default_property_package_ports(),
10 "graphicObject": unitop_graphic(),
11 "properties": {
12 "heat_duty": {
13 "displayName": "Heat Added",
14 "type": "numeric",
15 "unitType": "heatflow"
16 },
17 "deltaP_inverted": {
18 "displayName": "Pressure Drop",
19 "type": "numeric",
20 "value": 0,
21 "unitType": "pressure"
22 },
23 "control_volume.material_holdup": {
24 "displayName": "Material Holdup",
25 "propertySetGroup" : "dynamics",
26 "type": "numeric",
27 "unitType": "molar",
28 "indexSets": ["phase","compound"],
29 },
30 "control_volume.energy_holdup": {
31 "displayName": "Energy Holdup",
32 "propertySetGroup" : "dynamics",
33 "type": "numeric",
34 "unitType": "energy",
35 "indexSets": ["phase"], # https://idaes-pse.readthedocs.io/en/2.4.0/reference_guides/core/control_volume_0d.html#add-total-enthalpy-balances
36 },
37 "control_volume.volume": {
38 "displayName": "Volume",
39 "propertySetGroup" : "dynamics",
40 "type": "numeric",
41 "unitType": "volume",
42 "value": 1,
43 },
44 "control_volume.material_accumulation": {
45 "displayName": "Material Accumulation",
46 "propertySetGroup" : "dynamics",
47 "type": "numeric",
48 "value": 0,
49 "unitType": "molarflow",
50 "indexSets": ["phase","compound"],
51 },
52 "control_volume.energy_accumulation": {
53 "displayName": "Energy Accumulation",
54 "propertySetGroup" : "dynamics",
55 "type": "numeric",
56 "value": 0,
57 "unitType": "heatflow",
58 "indexSets": ["phase"],
59 },
60 "control_volume.phase_fraction": {
61 "displayName": "Phase Fraction",
62 "propertySetGroup" : "dynamics",
63 "type": "numeric",
64 "unitType": "dimensionless",
65 "indexSets": ["phase"],
66 "sumToOne": True,
67 },
68 "dynamics": {
69 "displayName": "Enable Dynamics",
70 "propertySetGroup" : "dynamics",
71 "type": "checkbox",
72 "unitType": "dimensionless",
73 "value": False,
74 },
75 "initial_material_accumulation": {
76 "displayName": "Initial Material Accumulation",
77 "propertySetGroup" : "dynamics",
78 "type": "numeric",
79 "value": 0,
80 "unitType": "molarflow",
81 "indexSets": ["phase","compound"],
82 "hasTimeIndex": False,
83 },
84 "initial_energy_accumulation": {
85 "displayName": "Initial Energy Accumulation",
86 "propertySetGroup" : "dynamics",
87 "type": "numeric",
88 "value": 0,
89 "unitType": "heatflow",
90 "indexSets": ["phase"],
91 "hasTimeIndex": False,
92 },
93 "initial_material_holdup": {
94 "displayName": "Initial Material Holdup",
95 "propertySetGroup" : "dynamics",
96 "type": "numeric",
97 "unitType": "molar",
98 "indexSets": ["phase","compound"],
99 "hasTimeIndex": False,
100 },
101 "initial_energy_holdup": {
102 "displayName": "Initial Energy Holdup",
103 "propertySetGroup" : "dynamics",
104 "type": "numeric",
105 "unitType": "energy",
106 "indexSets": ["phase"], # https://idaes-pse.readthedocs.io/en/2.4.0/reference_guides/core/control_volume_0d.html#add-total-enthalpy-balances
107 "hasTimeIndex": False,
108 },
109 },
110 "indexSets": ["phase","compound"],
111 "propertySetGroups": {
112 "default": {
113 "type": "stateVars",
114 "displayName": "Properties",
115 "stateVars": ("heat_duty", "deltaP_inverted"),
116 },
117 "dynamics": {
118 "type": "stateVars",
119 "displayName": "Dynamics",
120 "toggle": "dynamics", # if holdup is true, then display these properties
121 "stateVars": ("dynamics","initial_material_accumulation", "initial_energy_accumulation", "control_volume.phase_fraction")
122 }
123 },
124 "keyProperties": [
125 "heat_duty"
126 ]
127})