Commit 9fa2c2a
committed
feat(yaml): introduce interstage types and segment constraints for process systems
Add YAML types to express process system topology (PROCESS_SYSTEMS) and
operational scenarios (PROCESS_SIMULATIONS) with full separation of equipment
and operation. Mapper is separate work.
New process system types (all named, defined under PROCESS_SYSTEMS):
- COMPRESSOR_STAGE: single compressor stage with inlet temperature
- PRESSURE_DROP: any interstage element that introduces a pressure drop
- MIXER: stream injection point (pure topology — no stream defined here)
- SPLITTER: stream extraction point (pure topology — no rate defined here)
- SERIAL: ordered list of named process system references; carries ANTI_SURGE
(physical equipment choice: INDIVIDUAL_ASV or COMMON_ASV, defaults to INDIVIDUAL_ASV)
- PARALLEL: parallel arrangement of named serial trains
PROCESS_SIMULATIONS fields:
- TARGET: single reference to the target process system
- INLET_STREAM: reference to an inlet stream (serial target)
- STREAM_DISTRIBUTION: COMMON_STREAM or INDIVIDUAL_STREAMS (parallel target)
- COMMON_STREAM: SETTINGS list tried in order; first within capacity wins;
each setting supports OVERFLOW between trains
- INDIVIDUAL_STREAMS: one stream reference per train
- MIXER_STREAMS: map of mixer name -> inlet stream reference
- SPLITTER_RATES: map of splitter name -> rate (VALUE + UNIT)
- CONSTRAINTS: map of item name or train name -> YamlSegmentConstraint
Using the train name targets the train outlet regardless of last stage
YamlSegmentConstraint per segment boundary:
- OUTLET_PRESSURE: required; target pressure [bara]
- PRESSURE_CONTROL: optional; defaults to DOWNSTREAM_CHOKE for the train outlet
constraint and INDIVIDUAL_ASV_RATE for all intermediate segment constraints
ANTI_SURGE is on the SERIAL train (physical equipment), not the constraint.
Consistency between train ANTI_SURGE and constraint PRESSURE_CONTROL is validated
at asset level (e.g. COMMON_ASV pressure control requires COMMON_ASV on the train).
Cross-reference validation in YamlAsset (runs at parse time, before domain code):
- Every constraint must have OUTLET_PRESSURE set
- Every MIXER in the target train must have an entry in MIXER_STREAMS
- Every SPLITTER in the target train must have an entry in SPLITTER_RATES
- Constraint keys must be item names in the train or the train name itself
- PRESSURE_CONTROL defaults applied before consistency validation
New YamlAntiSurge enum in yaml_enums.py.1 parent 90a14eb commit 9fa2c2a
3 files changed
Lines changed: 189 additions & 20 deletions
File tree
- src/libecalc/presentation/yaml/yaml_types
- components
- models
Lines changed: 98 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
| 13 | + | |
11 | 14 | | |
| 15 | + | |
12 | 16 | | |
13 | 17 | | |
14 | 18 | | |
| |||
191 | 195 | | |
192 | 196 | | |
193 | 197 | | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
Lines changed: 86 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | 67 | | |
72 | 68 | | |
73 | 69 | | |
74 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
75 | 78 | | |
76 | 79 | | |
77 | | - | |
78 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
79 | 94 | | |
80 | 95 | | |
81 | 96 | | |
82 | 97 | | |
83 | 98 | | |
84 | | - | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
85 | 115 | | |
86 | 116 | | |
87 | 117 | | |
| |||
96 | 126 | | |
97 | 127 | | |
98 | 128 | | |
99 | | - | |
| 129 | + | |
100 | 130 | | |
101 | 131 | | |
102 | 132 | | |
103 | 133 | | |
104 | 134 | | |
105 | | - | |
| 135 | + | |
106 | 136 | | |
107 | 137 | | |
108 | 138 | | |
109 | 139 | | |
110 | 140 | | |
111 | 141 | | |
112 | 142 | | |
113 | | - | |
| 143 | + | |
114 | 144 | | |
115 | 145 | | |
116 | 146 | | |
117 | 147 | | |
118 | 148 | | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
119 | 158 | | |
120 | 159 | | |
121 | 160 | | |
122 | 161 | | |
123 | | - | |
124 | | - | |
125 | | - | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
126 | 184 | | |
127 | 185 | | |
128 | | - | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
129 | 190 | | |
130 | 191 | | |
131 | 192 | | |
| |||
135 | 196 | | |
136 | 197 | | |
137 | 198 | | |
138 | | - | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
139 | 205 | | |
140 | 206 | | |
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
0 commit comments