refactor: add rotating equipment, drive train and power supply to energy domain#1486
refactor: add rotating equipment, drive train and power supply to energy domain#1486
Conversation
|
should the |
Yes, definitely - good comment. |
Co-authored-by: Kjetil Brakstad <64000017+kjbrak@users.noreply.github.com>
Co-authored-by: Kjetil Brakstad <64000017+kjbrak@users.noreply.github.com>
ref. Pump integration workWe're working on bringing pumps into the new process domain (branch feature/pump-process-unit-v2). The pump computes However, the pump's enthalpy rise is computable analytically: Δh = head / η = ΔP / (ρ × η) [J/kg]. This is physically Question: Should we expand ShaftPowerConsumer to accept this directly? E.g.: @classmethod Or should we make compressor also own its "fluid power" or "delta enthalpy" so we get the same pattern? Also: for pumps, does DriveTrain.mechanical_efficiency apply the same way as for compressors, or is mechanical loss Would be good to discuss before merging so the interface works for both compressors and pumps. |
|
Superseded by #1492 |
Summary
Introduces an energy domain model for drive trains, rotating equipment, and power supplies — decoupled from the process domain.
New modules
Rotating equipment (
domain/energy/rotating_equipment/)RotatingEquipment— abstract base for anything drawing mechanical power from a shaftShaftPowerConsumer— implementation, computes shaft power from enthalpy rise (P = ṁ × Δh)Drive trains (
domain/energy/drive_train/)DriveTrain— abstract base: sums shaft power demand, accounts for mechanical lossesTurbineDriveTrain— gas turbine driver: evaluates fuel viaTurbine(knows about fuel)ElectricDriveTrain— electric motor: computes electrical power demand only (fuel-agnostic) - needs a power supplyPower supplies (
domain/energy/power_supply/)PowerSupply— abstract base: power demand [MW] → fuel rate + capacity marginGeneratorSupply— fuel-burning generator (delegates toGeneratorSetModel)ShoreSupply— subsea cable from shore (zero fuel, cable loss)WindSupply— offshore wind (zero fuel, variable capacity per timestep)Design
The energy domain depends on infrastructure models (
Turbine,GeneratorSetModel) only through thin protocols in domain/energy/infrastructure_contracts.py — no direct imports.DriveTraindoes not own the physical shaft — it only sees resulting power demand. Speed control and chart lookups remain in the process domain.TurbineDriveTrainis a special case where the turbine converts mechanical power directly to fuel.ElectricDriveTrainonly computes electrical power demand — fuel conversion is handled by a separatePowerSupply, composed at a higher level.Simplified diagram:
flowchart LR PR["Process Result\n(h_in, h_out, ṁ)"] SPC["ShaftPowerConsumer\nP = ṁ × Δh"] TDT["TurbineDriveTrain"] EDT["ElectricDriveTrain"] T["Turbine"] FUEL["Fuel\n(Sm³/day)"] subgraph PowerSupply["Power Supply"] GSS["GeneratorSupply"] SCS["ShoreSupply"] WS["WindSupply"] end PR -- "creates" --> SPC SPC -- "shaft power MW" --> TDT SPC -- "shaft power MW" --> EDT TDT -- "mechanical power MW\n(÷ mech. efficiency)" --> T T -- "fuel rate" --> FUEL EDT -- "power demand MW\n(÷ mech. efficiency)" --> PowerSupply GSS -- "fuel rate" --> FUEL style T fill:#f9f,stroke:#333 style GSS fill:#bbf,stroke:#333 style SCS fill:#bbf,stroke:#333 style WS fill:#bbf,stroke:#333 style TDT fill:#fdb,stroke:#333 style EDT fill:#fdb,stroke:#333 style FUEL fill:#faa,stroke:#333Type of Work
See here (internal): https://github.com/equinor/ecalc-internal/discussions/1044
Have you remembered and considered?
docs/drafts/next.draft.md)docs/docs/migration_guides/)BREAKING:in footer or!in headerWhat is this PR all about?
What else did you consider?
Between the lines?