boiler ¶
Boiler ¶
Boiler(max_gas_power_uptake, efficiency_rules, minimum_load, load_change_time, capex, biogas, *, stepless_intervals)
A class that represents a boiler.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
max_gas_power_uptake | int | Maximum power of gas the boiler can process [kW]. | required |
efficiency_rules | ndarray | A 2D array with the efficiency rules of the boiler showing efficiency at different loads. [[gas load state 1, eta_th1], [gas load state 2, eta_th2], ...] | required |
minimum_load | float | Minimum load the boiler can operate at. | required |
load_change_time | float | Time it takes to change the load of the boiler [hours]. | required |
capex | int | Capital expenditure of the boiler. | required |
biogas | GasMix | Mixture of gas. Contains fractions of each gas. | required |
stepless_intervals | boolean | Describes whether the boiler can operate at any load between minimum_load and 1. | required |
Source code in src/bsm2_python/energy_management/boiler.py
def __init__(
self,
max_gas_power_uptake: int,
efficiency_rules: np.ndarray,
minimum_load: float,
load_change_time: float,
capex: int,
biogas: GasMix,
*,
stepless_intervals: bool,
):
self.max_gas_power_uptake = max_gas_power_uptake
self.efficiency_rules = efficiency_rules
self.minimum_load = minimum_load
self.load_change_time = load_change_time
self.capex = capex
self._products = np.array([0.0])
self._consumption = np.array([0.0])
self.biogas = biogas
self.stepless_intervals = stepless_intervals
self._load = 0.0
get_efficiencies ¶
get_efficiencies(load)
Returns the efficiency of the boiler at a certain load.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
load | float | Load of the boiler. | required |
Returns:
| Type | Description |
|---|---|
ndarray | Efficiency of the boiler at the given load. [eta_th] |
Source code in src/bsm2_python/energy_management/boiler.py
def get_efficiencies(self, load: float):
"""Returns the efficiency of the boiler at a certain load.
Parameters
----------
load : float
Load of the boiler.
Returns
-------
np.ndarray
Efficiency of the boiler at the given load. \n
[eta_th]
"""
threshold = 1e-5
if load - self.minimum_load < -threshold:
if load > threshold:
# logger.warning('Load below minimum load, efficiencies set to 0')
pass
return np.array([0.0])
else:
closest_rule = np.argmin(np.abs(self.efficiency_rules[:, 0] - load))
# thermal efficiency
return np.array([self.efficiency_rules[closest_rule][1]])
get_consumption ¶
get_consumption(load)
Returns the consumption of the boiler at a certain load.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
load | float | Load of the boiler. | required |
Returns:
| Type | Description |
|---|---|
ndarray | Gas consumption of the boiler at the given load [Nm³/h]. [biogas consumption] |
Source code in src/bsm2_python/energy_management/boiler.py
def get_consumption(self, load: float):
"""Returns the consumption of the boiler at a certain load.
Parameters
----------
load : float
Load of the boiler.
Returns
-------
np.ndarray
Gas consumption of the boiler at the given load [Nm³/h]. \n
[biogas consumption]
"""
threshold = 1e-5
if load - self.minimum_load < -threshold:
if load > threshold:
# logger.warning('Load below minimum load, consumption set to 0')
pass
return np.array([0.0])
else:
return np.array([self.max_gas_power_uptake * load / self.biogas.h_u])
get_products ¶
get_products(load)
Returns the products of the boiler at a certain load.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
load | float | Load of the boiler. | required |
Returns:
| Type | Description |
|---|---|
ndarray | Products of the boiler at the given load [kW]. [heat] |
Source code in src/bsm2_python/energy_management/boiler.py
def get_products(self, load: float):
"""Returns the products of the boiler at a certain load.
Parameters
----------
load : float
Load of the boiler.
Returns
-------
np.ndarray
Products of the boiler at the given load [kW]. \n
[heat]
"""
threshold = 1e-5
if load - self.minimum_load < -threshold:
if load > threshold:
# logger.warning('Load below minimum load, products set to 0')
pass
return np.array([0.0])
else:
th_power = self.max_gas_power_uptake * self.get_efficiencies(load)[0] * load
return np.array([th_power])
consume ¶
consume()
Returns the consumption of the boiler at the current load.
Returns:
| Type | Description |
|---|---|
ndarray | Gas consumption of the boiler at the current load [Nm³/h]. [biogas consumption] |
Source code in src/bsm2_python/energy_management/boiler.py
def consume(self) -> np.ndarray:
"""Returns the consumption of the boiler at the current load.
Returns
-------
np.ndarray
Gas consumption of the boiler at the current load [Nm³/h]. \n
[biogas consumption]
"""
return self.get_consumption(self._load)
produce ¶
produce()
Returns the products of the boiler at the current load.
Returns:
| Type | Description |
|---|---|
ndarray | Products of the boiler at the current load [kW]. [heat] |
Source code in src/bsm2_python/energy_management/boiler.py
def produce(self) -> np.ndarray:
"""Returns the products of the boiler at the current load.
Returns
-------
np.ndarray
Products of the boiler at the current load [kW]. \n
[heat]
"""
return self.get_products(self._load)
calculate_load ¶
calculate_load(power_demand)
Returns the load of the boiler at a certain power demand.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
power_demand | float | Power demand for the boiler. | required |
Returns:
| Type | Description |
|---|---|
float | Load of the boiler to satisfy the given power demand. |
Source code in src/bsm2_python/energy_management/boiler.py
def calculate_load(self, power_demand: float) -> float:
"""Returns the load of the boiler at a certain power demand.
Parameters
----------
power_demand : float
Power demand for the boiler.
Returns
-------
float
Load of the boiler to satisfy the given power demand.
"""
max_heat_output = self.max_gas_power_uptake * self.get_efficiencies(1.0)[0]
if power_demand <= 0.0:
return 0.0
elif power_demand >= max_heat_output:
return 1.0
else:
load = power_demand / max_heat_output
if load < self.minimum_load:
return self.minimum_load
else:
return load
calculate_maintenance_time ¶
calculate_maintenance_time()
Returns the time it takes to maintain the boiler.
(Currently not implemented)
Source code in src/bsm2_python/energy_management/boiler.py
def calculate_maintenance_time(self) -> float:
"""Returns the time it takes to maintain the boiler. <br>
(Currently not implemented)
"""
return self.mttr
check_failure ¶
check_failure()
Returns whether the boiler has failed.
(Currently not implemented)
Source code in src/bsm2_python/energy_management/boiler.py
@staticmethod
def check_failure() -> bool:
"""Returns whether the boiler has failed. <br>
(Currently not implemented)
"""
return False