Skip to content

Commit ee9fba0

Browse files
committed
refactor: add yaml process constraints
1 parent 18f5388 commit ee9fba0

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

src/libecalc/presentation/yaml/yaml_types/components/yaml_process_system.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ class YamlOverflow(YamlBase):
9696

9797
class YamlCommonStreamSetting(YamlBase):
9898
rate_fractions: list[YamlExpressionType]
99-
overflow: list[YamlOverflow]
99+
overflow: list[YamlOverflow] | None = None
100100

101101

102102
class YamlCommonStreamDistribution(YamlBase):
@@ -115,10 +115,28 @@ class YamlIndividualStreamDistribution(YamlBase):
115115
]
116116

117117

118+
class YamlProcessConstraints(YamlBase):
119+
outlet_pressure: YamlExpressionType | None = Field(
120+
None,
121+
title="OUTLET_PRESSURE",
122+
description="Target outlet pressure [bara].",
123+
)
124+
intermediate_pressure: YamlExpressionType | None = Field(
125+
None,
126+
title="INTERMEDIATE_PRESSURE",
127+
description="Intermediate pressure [bara] between stages and the outlet pressure.",
128+
)
129+
130+
118131
class YamlProcessSimulation(YamlBase):
119132
name: str
120133
target: YamlParallelProcessSystem | YamlSerialProcessSystem | ProcessSystemReference
121134
stream_distribution: YamlStreamDistribution
135+
constraints: dict[ProcessSystemReference, YamlProcessConstraints] = Field(
136+
default_factory=dict,
137+
title="CONSTRAINTS",
138+
description="Optional constraints per process system reference.",
139+
)
122140

123141

124142
YamlProcessUnit = Annotated[

0 commit comments

Comments
 (0)