Coverage for backend/django/flowsheetInternals/unitops/config/objects/valve_config.py: 100%
4 statements
« prev ^ index » next coverage.py v7.10.7, created at 2026-06-23 21:51 +0000
« 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 *
5valve_config: ObjectType = ObjectType(
6 displayType="Valve",
7 displayName="Valve",
8 ports=default_ports(),
9 propertyPackagePorts=default_property_package_ports(),
10 graphicObject=unitop_graphic(),
11 properties=PropertiesType({
12 "deltaP_inverted": PropertyType(
13 displayName="Pressure Drop",
14 type="numeric",
15 unitType="pressure",
16 ),
17 "ratioP": PropertyType(
18 displayName="Pressure Ratio",
19 type="numeric",
20 unitType="ratio",
21 ),
22 "enable_coefficients": PropertyType(
23 displayName="Enable Coefficients",
24 propertySetGroup="advanced",
25 type="checkbox",
26 value=False,
27 unitType="dimensionless"
28 ),
29 "Cv": PropertyType(
30 displayName="Valve Coefficient",
31 propertySetGroup="advanced",
32 type="numeric",
33 unitType="valveCoefficient",
34 hasTimeIndex=False,
35 ),
36 "valve_opening": PropertyType(
37 displayName="Valve Opening",
38 propertySetGroup="advanced",
39 type="numeric",
40 unitType="ratio",
41 value=1,
42 ),
43 "valve_function": PropertyType(
44 displayName="Valve Function",
45 propertySetGroup="advanced",
46 type="dropdown",
47 value="linear",
48 options={
49 "linear": "Linear",
50 "equal_percentage": "Equal Percentage",
51 "quick_opening": "Quick Opening",
52 },
53 unitType="dimensionless"
54 ),
55 }),
56 propertySetGroups={
57 "default": {
58 "type": "stateVars",
59 "displayName": "Properties",
60 "stateVars": ("deltaP_inverted", ),
61 },
62 "advanced": {
63 "type": "stateVars",
64 "displayName": "Advanced",
65 "stateVars": ("valve_opening","enable_coefficients"),
66 "toggle": "enable_coefficients"
67 }
68 },
69 keyProperties=[
70 "deltaP_inverted",
71 "ratioP"
72 ],
73 idaes_adapter=UnitModelAdapter(
74 args=ArgAdapter({
75 "property_package": PropertyPackageAdapter(),
76 "enable_coefficients": ToggleAdapter("enable_coefficients"),
77 "valve_function": EnumAdapter("valve_function"),
78 "dynamic": ConstantArg(False),
79 }),
80 ),
81)