Coverage for backend/django/flowsheetInternals/unitops/config/objects/waterpipe_config.py: 100%
4 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 *
6waterpipe_config: ObjectType = ObjectType(
7 displayType="Water Pipe",
8 displayName="Water Pipe",
9 ports={
10 "inlet": PortType(
11 displayName="Inlet",
12 type=ConType.Inlet,
13 streamType="stream",
14 ),
15 "outlet": PortType(
16 displayName="Outlet",
17 type=ConType.Outlet,
18 streamType="stream",
19 )
20 },
21 propertyPackagePorts=default_property_package_ports(),
22 graphicObject=unitop_graphic(),
23 properties=PropertiesType({
24 "number_of_pipes": PropertyType(
25 displayName="Number of Pipes",
26 type="numeric",
27 unitType="ratio"
28 ),
29 "length": PropertyType(
30 displayName="Length",
31 type="numeric",
32 unitType="head",
33 ),
34 "diameter": PropertyType(
35 displayName="Diameter",
36 type="numeric",
37 unitType="diameter",
38 ),
39 "elevation_change": PropertyType(
40 displayName="Elevation Change",
41 type="numeric",
42 unitType="head",
43 ),
44 "fcorrection_dp": PropertyType(
45 displayName="Pressure Drop Correction Factor",
46 type="numeric",
47 unitType="ratio"
48 ),
49 "volume": PropertyType(
50 displayName="Total Volume of all Pipes",
51 type="numeric",
52 unitType="volume"
53 ),
54 "deltaP": PropertyType(
55 displayName="Pressure Drop",
56 type="numeric",
57 unitType="pressure",
58 ),
59 "deltaP_friction": PropertyType(
60 displayName="Pressure Drop due to Friction",
61 type="numeric",
62 unitType="ratio",
63 ),
64 "deltaP_gravity": PropertyType(
65 displayName="Pressure Drop due to Gravity",
66 type="numeric",
67 unitType="ratio",
68 ),
69 "deltaP_area_change": PropertyType(
70 displayName="Pressure Drop due to Area Change",
71 type="numeric",
72 unitType="ratio",
73 ),
76 }),
77 propertySetGroups={
78 "default": {
79 "type": "stateVars",
80 "displayName": "Properties",
81 "stateVars": (
82 "number_of_pipes",
83 "length",
84 "diameter",
85 "elevation_change",
86 "fcorrection_dp",
87 "volume",
88 "deltaP_friction",
89 "deltaP_gravity",
90 "deltaP_area_change",
91 )
92 }
93 },
94 keyProperties=[
95 "number_of_pipes",
96 "length",
97 "diameter",
98 "deltaP",
99 ],
100 idaes_adapter=UnitModelAdapter(
101 args=ArgAdapter({
102 "property_package": PropertyPackageAdapter(),
103 "has_heat_transfer": ConstantArg(False),
104 "has_pressure_change": ConstantArg(True),
105 }),
106 properties=SerialisePropertiesAdapter(),
107 ports=SerialisePortAdapter()
108 ),
109)