fluxopt.components
¶
Classes:
| Name | Description |
|---|---|
Port |
System boundary that imports from or exports to buses. |
Converter |
Conversion between input and output flows. |
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.
Methods:
| Name | Description |
|---|---|
__post_init__ |
Qualify flow ids with the port id. |
__post_init__
¶
Converter
dataclass
¶
Converter(
id: str,
inputs: list[Flow] | IdList[Flow],
outputs: list[Flow] | IdList[Flow],
conversion_factors: list[dict[str, Variate]] = list(),
conversion: PiecewiseConversion | None = None,
)
Conversion between input and output flows.
Two mutually exclusive modes:
- Linear —
conversion_factors=[{flow_short_id: a_f}, ...], one dict per equation; constraintsum_f(a_f * P_{f,t}) = 0. - Piecewise —
conversion=PiecewiseConversion(...); the solver interpolates between breakpoints, optionally with on/off viaPiecewiseConversion.status.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
Converter id. |
required |
|
list[Flow] | IdList[Flow]
|
Input flows. |
required |
|
list[Flow] | IdList[Flow]
|
Output flows. |
required |
|
list[dict[str, Variate]]
|
Linear-mode equations. Empty when
|
list()
|
|
PiecewiseConversion | None
|
Piecewise-mode curve. |
None
|
Methods:
| Name | Description |
|---|---|
__post_init__ |
Qualify flow ids and validate mode exclusivity. |
boiler |
Create a boiler converter: fuel * eta = thermal. |
heat_pump |
Create a heat pump converter with source heat. |
power2heat |
Create an electric resistance heater: electrical * eta = thermal. |
chp |
Create a CHP converter with separate electrical and thermal outputs. |
__post_init__
¶
Qualify flow ids and validate mode exclusivity.
Source code in src/fluxopt/components.py
boiler
classmethod
¶
boiler(
id: str, thermal_efficiency: Variate, fuel_flow: Flow, thermal_flow: Flow
) -> Converter
Create a boiler converter: fuel * eta = thermal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
Converter id. |
required |
|
Variate
|
Thermal efficiency eta. |
required |
|
Flow
|
Input fuel flow. |
required |
|
Flow
|
Output thermal flow. |
required |
Source code in src/fluxopt/components.py
heat_pump
classmethod
¶
heat_pump(
id: str,
cop: Variate,
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 |
|---|---|---|---|
|
str
|
Converter id. |
required |
|
Variate
|
Coefficient of performance. |
required |
|
Flow
|
Input electrical flow. |
required |
|
Flow
|
Input environmental heat flow (air, ground, water). |
required |
|
Flow
|
Output thermal flow. |
required |
Source code in src/fluxopt/components.py
power2heat
classmethod
¶
power2heat(
id: str, efficiency: Variate, electrical_flow: Flow, thermal_flow: Flow
) -> Converter
Create an electric resistance heater: electrical * eta = thermal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
Converter id. |
required |
|
Variate
|
Electrical-to-thermal efficiency. |
required |
|
Flow
|
Input electrical flow. |
required |
|
Flow
|
Output thermal flow. |
required |
Source code in src/fluxopt/components.py
chp
classmethod
¶
chp(
id: str,
eta_el: Variate,
eta_th: Variate,
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 |
|---|---|---|---|
|
str
|
Converter id. |
required |
|
Variate
|
Electrical efficiency. |
required |
|
Variate
|
Thermal efficiency. |
required |
|
Flow
|
Input fuel flow. |
required |
|
Flow
|
Output electrical flow. |
required |
|
Flow
|
Output thermal flow. |
required |