fluxopt.components ¶
Port
dataclass
¶
Port(
id: str,
imports: list[Flow] | IdList[Flow] = list(),
exports: list[Flow] | IdList[Flow] = list(),
)
System boundary that imports from or exports to buses.
__post_init__ ¶
Converter
dataclass
¶
Converter(
id: str,
inputs: list[Flow] | IdList[Flow],
outputs: list[Flow] | IdList[Flow],
conversion_factors: list[dict[str, TimeSeries]] = list(),
)
Linear conversion between input and output flows.
Conversion equation (per equation index)::
sum_f(a_f * P_{f,t}) = 0 for all t
__post_init__ ¶
Qualify flow ids and build short→qualified mapping.
Source code in src/fluxopt/components.py
boiler
classmethod
¶
Create a boiler converter: fuel * eta = thermal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
Converter id. |
required |
thermal_efficiency
|
TimeSeries
|
Thermal efficiency eta. |
required |
fuel_flow
|
Flow
|
Input fuel flow. |
required |
thermal_flow
|
Flow
|
Output thermal flow. |
required |
Source code in src/fluxopt/components.py
heat_pump
classmethod
¶
heat_pump(
id: str,
cop: TimeSeries,
electrical_flow: Flow,
source_flow: Flow,
thermal_flow: Flow,
) -> Converter
Create a heat pump converter with source heat.
Two conversion equations
electrical * COP = thermal electrical + source = thermal
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
Converter id. |
required |
cop
|
TimeSeries
|
Coefficient of performance. |
required |
electrical_flow
|
Flow
|
Input electrical flow. |
required |
source_flow
|
Flow
|
Input environmental heat flow (air, ground, water). |
required |
thermal_flow
|
Flow
|
Output thermal flow. |
required |
Source code in src/fluxopt/components.py
power2heat
classmethod
¶
power2heat(
id: str, efficiency: TimeSeries, electrical_flow: Flow, thermal_flow: Flow
) -> Converter
Create an electric resistance heater: electrical * eta = thermal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
Converter id. |
required |
efficiency
|
TimeSeries
|
Electrical-to-thermal efficiency. |
required |
electrical_flow
|
Flow
|
Input electrical flow. |
required |
thermal_flow
|
Flow
|
Output thermal flow. |
required |
Source code in src/fluxopt/components.py
chp
classmethod
¶
chp(
id: str,
eta_el: TimeSeries,
eta_th: TimeSeries,
fuel_flow: Flow,
electrical_flow: Flow,
thermal_flow: Flow,
) -> Converter
Create a CHP converter with separate electrical and thermal outputs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
Converter id. |
required |
eta_el
|
TimeSeries
|
Electrical efficiency. |
required |
eta_th
|
TimeSeries
|
Thermal efficiency. |
required |
fuel_flow
|
Flow
|
Input fuel flow. |
required |
electrical_flow
|
Flow
|
Output electrical flow. |
required |
thermal_flow
|
Flow
|
Output thermal flow. |
required |