Coverage for backend/django/flowsheetInternals/unitops/config/objects/heat_user_config.py: 100%
17 statements
« prev ^ index » next coverage.py v7.10.7, created at 2026-05-13 02:47 +0000
« prev ^ index » next coverage.py v7.10.7, created at 2026-05-13 02:47 +0000
1from common.config_types import *
2from common.config_utils import *
3from ..spec_helpers import *
5#Ports
6inlet_steam = PortType(displayName="Steam Inlet", type = ConType.Inlet, streamType="stream", streamName="S")
8outlet_return = PortType(displayName="Return", type = ConType.Outlet, streamType="stream", streamName="S")
9outlet_drain = PortType(displayName="Drain", type = ConType.Outlet, streamType="stream", streamName="S")
11#Properties:
12heat_demand = PropertyType(displayName="Heat Demand", type = "numeric", unit = "kW", unitType="heatflow")
13return_rate = PropertyType(displayName="Condensate Return Rate", value = 1, type = "numeric", unitType="ratio")
14deltaT_subcool = PropertyType(displayName="Degree of Subcooling", value = 0, type = "numeric", unit = "K", unitType="deltaTemperature")
15user_heat_loss = PropertyType(displayName="User Heat Loss", value = 0, type = "numeric", unit = "kW", unitType="heatflow")
16user_pressure_loss = PropertyType(displayName="User Pressure Loss", value = 0, type = "numeric", unit = "Pa", unitType="pressure")
17return_temperature = PropertyType(displayName="Condensate Return Temperature", value = 90, type = "numeric", unit = "C", unitType="temperature")
18return_pressure = PropertyType(displayName="Condensate Return Pressure", type = "numeric", value = 100, unit = "KPa", unitType="pressure")
19return_heat_loss = PropertyType(displayName="Return Heat Losses", type = "numeric", unit = "kW", unitType="heatflow")
20outlet_temperature = PropertyType(displayName="Outlet Temperature", type = "numeric", unit = "K", unitType="temperature")
23_propertypackageports = {"": ["inlet", "outlet_return", "outlet_drain"],}
25#Config Creation:
26heat_user_config: ObjectType = ObjectType(
27 displayType="Heat User",
28 displayName="Heat User",
29 ports={
30 "inlet": inlet_steam,
31 "outlet_return": outlet_return,
32 "outlet_drain": outlet_drain,
33 },
34 propertyPackagePorts=_propertypackageports,
35 graphicObject=unitop_graphic(),
36 properties=PropertiesType({
37 "heat_demand": heat_demand,
38 "deltaT_subcool": deltaT_subcool,
39 "user_heat_loss": user_heat_loss,
40 "user_pressure_loss": user_pressure_loss,
41 "return_rate": return_rate,
42 "return_temperature": return_temperature,
43 "return_pressure": return_pressure,
44 "return_heat_loss": return_heat_loss,
45 "outlet_temperature": outlet_temperature,
46 }),
47 propertySetGroups={
48 "default": PropertySetType(
49 type="stateVars",
50 displayName="Properties",
51 stateVars=(
52 "return_rate",
53 "deltaT_subcool",
54 "user_heat_loss",
55 "user_pressure_loss",
56 "return_temperature",
57 "return_pressure",
58 ),
59 )
60 },
61 keyProperties=[],
62 idaes_adapter=UnitModelAdapter(
63 args=ArgAdapter({
64 "property_package": PropertyPackageAdapter(),
65 }),
66 properties=SerialisePropertiesAdapter(),
67 ports=SerialisePortAdapter(),
68 ),
69)