Fütterungskomponenten API¶
pyadm1.components.feeding.substrate_storage.SubstrateStorage
¶
Bases: Component
Storage facility component for biogas plant substrates.
Models storage of different substrate types with inventory tracking, quality degradation, and capacity management. Supports both solid (silage, solid manure) and liquid (liquid manure, slurry) substrates.
Attributes:
| Name | Type | Description |
|---|---|---|
storage_type |
Type of storage facility |
|
substrate_type |
Category of substrate stored |
|
capacity |
Maximum storage capacity [t or m³] |
|
current_level |
Current inventory level [t or m³] |
|
quality_factor |
Current quality relative to fresh (0-1) |
|
degradation_rate |
Quality degradation rate [1/d] |
|
density |
Substrate bulk density [kg/m³] |
|
dry_matter |
Dry matter content [%] |
|
vs_content |
Volatile solids [% of DM] |
Example
storage = SubstrateStorage( ... "silo1", ... storage_type="vertical_silo", ... substrate_type="corn_silage", ... capacity=1000, ... initial_level=600 ... ) storage.initialize() outputs = storage.step(0, 1, {'withdrawal_rate': 15})
Source code in pyadm1/components/feeding/substrate_storage.py
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 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 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 | |
Functions¶
__init__(component_id, storage_type='vertical_silo', substrate_type='corn_silage', capacity=1000.0, initial_level=0.0, degradation_rate=None, temperature=288.15, name=None)
¶
Initialize substrate storage component.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
component_id
|
str
|
Unique identifier |
required |
storage_type
|
str
|
Type of storage ("vertical_silo", "tank", etc.) |
'vertical_silo'
|
substrate_type
|
str
|
Substrate category ("corn_silage", "manure_liquid", etc.) |
'corn_silage'
|
capacity
|
float
|
Maximum capacity [t or m³] |
1000.0
|
initial_level
|
float
|
Initial inventory [t or m³] |
0.0
|
degradation_rate
|
Optional[float]
|
Quality degradation rate [1/d] (auto-calculated if None) |
None
|
temperature
|
float
|
Storage temperature [K] |
288.15
|
name
|
Optional[str]
|
Human-readable name |
None
|
Source code in pyadm1/components/feeding/substrate_storage.py
from_dict(config)
classmethod
¶
Create storage from dictionary.
Source code in pyadm1/components/feeding/substrate_storage.py
initialize(initial_state=None)
¶
Initialize storage state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
initial_state
|
Optional[Dict[str, Any]]
|
Optional initial state with keys: - 'current_level': Inventory level [t or m³] - 'quality_factor': Quality factor (0-1) - 'storage_time': Time stored [days] - 'cumulative_losses': Total losses [t or m³] |
None
|
Source code in pyadm1/components/feeding/substrate_storage.py
step(t, dt, inputs)
¶
Perform one simulation time step.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
t
|
float
|
Current time [days] |
required |
dt
|
float
|
Time step [days] |
required |
inputs
|
Dict[str, Any]
|
Input data with optional keys: - 'withdrawal_rate': Withdrawal rate [t/d or m³/d] - 'refill_amount': Amount to add [t or m³] - 'refill_quality': Quality of refill (0-1) - 'temperature': Ambient/storage temperature [K] |
required |
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
Dict with keys: - 'current_level': Current inventory [t or m³] - 'utilization': Fill level (0-1) - 'quality_factor': Current quality (0-1) - 'available_mass': Usable inventory [t or m³] - 'degradation_rate': Current degradation rate [1/d] - 'losses_this_step': Mass lost this timestep [t or m³] - 'withdrawn_this_step': Mass withdrawn [t or m³] - 'is_empty': Storage empty flag - 'is_full': Storage full flag |
Source code in pyadm1/components/feeding/substrate_storage.py
to_dict()
¶
Serialize storage to dictionary.
Source code in pyadm1/components/feeding/substrate_storage.py
pyadm1.components.feeding.feeder.Feeder
¶
Bases: Component
Feeder component for automated substrate dosing.
Models feeding systems that transfer substrates from storage to digesters. Includes realistic operational characteristics like dosing accuracy, capacity limits, and power consumption.
Attributes:
| Name | Type | Description |
|---|---|---|
feeder_type |
Type of feeding system |
|
Q_max |
Maximum flow rate [m³/d or t/d] |
|
substrate_type |
Physical category of substrate |
|
dosing_accuracy |
Accuracy of flow control (std dev as fraction) |
|
power_installed |
Installed motor power [kW] |
|
current_flow |
Current actual flow rate [m³/d or t/d] |
|
is_running |
Operating state |
Example
feeder = Feeder( ... "feed1", ... feeder_type="screw", ... Q_max=20, ... substrate_type="solid" ... ) feeder.initialize() result = feeder.step(0, 1/24, {'Q_setpoint': 15})
Source code in pyadm1/components/feeding/feeder.py
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 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 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 | |
Functions¶
__init__(component_id, feeder_type=None, Q_max=20.0, substrate_type='solid', dosing_accuracy=None, power_installed=None, enable_dosing_noise=True, name=None)
¶
Initialize feeder component.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
component_id
|
str
|
Unique identifier |
required |
feeder_type
|
Optional[str]
|
Type of feeder ("screw", "progressive_cavity", etc.) |
None
|
Q_max
|
float
|
Maximum flow rate [m³/d or t/d] |
20.0
|
substrate_type
|
str
|
Substrate category ("solid", "slurry", "liquid", "fibrous") |
'solid'
|
dosing_accuracy
|
Optional[float]
|
Standard deviation of flow as fraction (auto if None) |
None
|
power_installed
|
Optional[float]
|
Installed power [kW] (auto-calculated if None) |
None
|
enable_dosing_noise
|
bool
|
Add realistic dosing variance |
True
|
name
|
Optional[str]
|
Human-readable name |
None
|
Source code in pyadm1/components/feeding/feeder.py
from_dict(config)
classmethod
¶
Create feeder from dictionary.
Source code in pyadm1/components/feeding/feeder.py
initialize(initial_state=None)
¶
Initialize feeder state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
initial_state
|
Optional[Dict[str, Any]]
|
Optional initial state with keys: - 'is_running': Initial operating state - 'current_flow': Initial flow rate [m³/d or t/d] - 'operating_hours': Cumulative operating hours - 'energy_consumed': Cumulative energy [kWh] - 'total_mass_fed': Cumulative mass [t or m³] |
None
|
Source code in pyadm1/components/feeding/feeder.py
step(t, dt, inputs)
¶
Perform one simulation time step.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
t
|
float
|
Current time [days] |
required |
dt
|
float
|
Time step [days] |
required |
inputs
|
Dict[str, Any]
|
Input data with optional keys: - 'Q_setpoint': Desired flow rate [m³/d or t/d] - 'enable_feeding': Enable/disable feeder - 'substrate_available': Amount available in storage [t or m³] - 'speed_setpoint': Desired speed fraction (0-1) |
required |
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
Dict with keys: - 'Q_actual': Actual flow rate [m³/d or t/d] - 'is_running': Current operating state - 'load_factor': Operating load (0-1) - 'P_consumed': Power consumption [kW] - 'blockage_detected': Blockage alarm - 'dosing_error': Deviation from setpoint [%] - 'speed_fraction': Current speed fraction |
Source code in pyadm1/components/feeding/feeder.py
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 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 | |
to_dict()
¶
Serialize feeder to dictionary.