Coverage for backend/flowsheetInternals/unitops/config/objects/valve_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 *
4valve_config: ObjectType = ObjectType.model_validate({
5 "displayType": "Valve",
6 "displayName": "Valve",
7 "ports": default_ports(),
8 "propertyPackagePorts": default_property_package_ports(),
9 "graphicObject": unitop_graphic(),
10 "properties": {
11 "deltaP_inverted": {
12 "displayName": "Pressure Drop",
13 "type": "numeric",
14 "unitType": "pressure",
15 },
16 "ratioP": {
17 "displayName": "Pressure Ratio",
18 "type": "numeric",
19 "unitType": "ratio",
20 },
21 "enable_coefficients":{
22 "displayName": "Enable Coefficients",
23 "propertySetGroup": "advanced",
24 "type": "checkbox",
25 "value": False,
26 "unitType":"dimensionless"
27 },
28 "Cv": {
29 "displayName": "Valve Coefficient",
30 "propertySetGroup": "advanced",
31 "type": "numeric",
32 "unitType": "valveCoefficient",
33 "hasTimeIndex": False,
34 },
35 "valve_opening": {
36 "displayName": "Valve Opening",
37 "propertySetGroup": "advanced",
38 "type": "numeric",
39 "unitType": "ratio",
40 "value":1,
41 },
42 "valve_function":{
43 "displayName": "Valve Function",
44 "propertySetGroup": "advanced",
45 "type": "dropdown",
46 "value": "linear",
47 "options": {
48 "linear": "Linear",
49 "equal_percentage": "Equal Percentage",
50 "quick_opening": "Quick Opening",
51 },
52 "unitType":"dimensionless"
53 },
54 },
55 "propertySetGroups": {
56 "default": {
57 "type": "stateVars",
58 "displayName": "Properties",
59 "stateVars": ("deltaP_inverted", ),
60 },
61 "advanced": {
62 "type": "stateVars",
63 "displayName": "Advanced",
64 "stateVars": ("valve_opening","enable_coefficients"),
65 "toggle": "enable_coefficients"
66 }
67 },
68 "keyProperties": [
69 "deltaP_inverted",
70 "ratioP"
71 ]
72})