Skip to content

flare

Flare

Flare(capex, max_gas_uptake, threshold)

A class that represents a flare.

Parameters:

Name Type Description Default
capex int

Capital expenditure of the flare.

required
max_gas_uptake int

Maximum gas the flare can process [Nm³/h].

required
threshold float

The threshold at which the flare starts to operate.

required
Source code in src/bsm2_python/energy_management/flare.py
def __init__(self, capex: int, max_gas_uptake: int, threshold: float):
    self.capex = capex
    self.max_gas_uptake = max_gas_uptake
    self.threshold = threshold
    self._consumption = np.array([0.0])
    self._products = np.array([0.0])
    self._load = 0.0

calculate_load

calculate_load(gas_surplus)

Calculates the load of the flare depending on the gas surplus.

Parameters:

Name Type Description Default
gas_surplus float

The gas surplus that the flare has to process [Nm³/h].

required
Source code in src/bsm2_python/energy_management/flare.py
def calculate_load(self, gas_surplus: float) -> float:
    """Calculates the load of the flare depending on the gas surplus.

    Parameters
    ----------
    gas_surplus : float
        The gas surplus that the flare has to process [Nm³/h].
    """

    if gas_surplus == 0.0:
        return 0.0
    elif gas_surplus > self.max_gas_uptake:
        return 1.0
    else:
        return float(gas_surplus / self.max_gas_uptake)

produce

produce()

Returns the production of the flare. Flare does not produce anything, only here to satisfy the Module interface.

Source code in src/bsm2_python/energy_management/flare.py
@staticmethod
def produce() -> np.ndarray:
    """Returns the production of the flare.
    Flare does not produce anything, only here to satisfy the `Module` interface.
    """

    return np.array([0.0])

consume

consume()

Returns the consumption of the flare at the current load.

Returns:

Type Description
ndarray

Consumption of the flare [kW].

[biogas]

Source code in src/bsm2_python/energy_management/flare.py
def consume(self) -> np.ndarray:
    """Returns the consumption of the flare at the current load.

    Returns
    -------
    np.ndarray
        Consumption of the flare [kW]. \n
        [biogas]
    """

    return np.array([self._load * self.max_gas_uptake])

calculate_maintenance_time

calculate_maintenance_time()

Returns the maintenance time of the flare.
(Currently not implemented)

Source code in src/bsm2_python/energy_management/flare.py
@staticmethod
def calculate_maintenance_time() -> float:
    """Returns the maintenance time of the flare. <br>
    (Currently not implemented)
    """

    return 0.0

check_failure

check_failure()

Returns if the flare has failed.
(Currently not implemented)

Source code in src/bsm2_python/energy_management/flare.py
@staticmethod
def check_failure() -> bool:
    """Returns if the flare has failed. <br>
    (Currently not implemented)
    """

    return False