energy package¶
The energy package gathers the energy units, poles and nodes modules:
The energy units inherit from the EnergyUnit
object which
itself inherit from the Unit
object.
Energy_units module¶
This module defines the energy units of OMEGAlpes. The production, consumption and storage unit will inherit from it.
The energy_units module defines the basic attributes and methods of an energy unit in OMEGAlpes.
- The class EnergyUnit includes the following attributes and quantities:
- p : instantaneous power of the energy unit (kW)
- p_min : minimal power (kW)
- p_max : maximal power (kW)
- e_tot : total energy during the time period (kWh)
- e_min : minimal energy of the unit (kWh)
- e_max : maximal energy of the unit (kWh)
- u : binary describing if the unit is operating or not at t (delivering or consuming P)
This module also includes the classes: - FixedEnergyUnit: energy unit with a fixed power profile
- VariableEnergyUnit: energy unit with a variable power profile
- SquareEnergyUnit: energy unit with a defined square power profile,
inheriting from VariableEnergyUnit.
- ShiftableEnergyUnit: energy unit with a power profile that can be time
shifted , inheriting from VariableEnergyUnit.
- TriangleEnergyUnit: energy unit with a defined triangular power profile,
inheriting from VariableEnergyUnit.
- SawtoothEnergyUnit: energy unit with a defined sawtooth power profile,
inheriting from VariableEnergyUnit.
- SeveralEnergyUnit: Energy unit based on a fixed power curve enabling to
multiply several times (nb_unit) the same power curve.
- AssemblyUnit: an assembly unit has at least a production unit and a
consumption unit and is using one or several energy types. It can also integrate reversible energy units. It inherits from OptObject and it is the parent class of ConversionUnit and ReversibleUnit.
-
class
omegalpes.energy.units.energy_units.
AssemblyUnit
(time, name, prod_units=None, cons_units=None, rev_units=None, verbose=True)[source]¶ Bases:
omegalpes.general.optimisation.core.OptObject
Description
Simple Assembly unit: assembly units has at least a production unit and a consumption unit and is using one or several energy types. It can also integrate reversible energy units. It inherits from OptObject and it is the parent class of ConversionUnit and ReversibleUnit.Attributes
- time: TimeUnit describing the studied time period
- prod_units: list of the production units in the assembly unit.
- cons_units: list of the consumption units in the assembly unit.
- rev_units: list of the reversible units in the assembly unit.
- poles: dictionary of the poles of the assembly unit
-
class
omegalpes.energy.units.energy_units.
EnergyUnit
(time, name, flow_direction='in', p=None, p_min=-10000.0, p_max=10000.0, e_min=-1000000.0, e_max=1000000.0, starting_cost=None, operating_cost=None, min_time_on=None, min_time_off=None, max_ramp_up=None, max_ramp_down=None, co2_out=None, availability_hours=None, energy_type=None, no_warn=True, verbose=True)[source]¶ Bases:
omegalpes.general.optimisation.core.OptObject
Description
Module dedicated to the parent class (EnergyUnit) of :
- production units
- consumption units
- storage units
-
add_availability
(av_hours: int)[source]¶ Add a number of hours of availability of the energy unit during the study period
Parameters: av_hours – int: number of hours of availability of the energy unit during the study period
-
add_co2_emissions
(co2_out: float)[source]¶ Add an CO2 emissions associated to the energy unit based on the value co2_out. For each time step the energy unit is running the co2_out value is multiplied by the power production or consumption and added to the co2_emissions of the energy unit.
Parameters: co2_out – float: co2 emissions corresponding to the operation of the energy unit. To be multiplied by the power at each time step
-
add_max_ramp_down
(max_ramp_down: float)[source]¶ Add a maximal ramp value between two consecutive power values decreasing
Parameters: max_ramp_down – float: maximal ramp value between two consecutive power values decreasing
-
add_max_ramp_up
(max_ramp_up: float)[source]¶ Add a maximal ramp value between two consecutive power values increasing
Parameters: max_ramp_up – float: maximal ramp value between two consecutive power values increasing
-
add_min_time_off
(min_time_off: float)[source]¶ Add a minimal time during which the energy unit has to remain off once it is switched off
Parameters: min_time_off – float: minimal time during which the energy unit has to remain off once it is switched off
-
add_min_time_on
(min_time_on: float)[source]¶ Add a minimal time during which the energy unit should function once it is started-up
Parameters: min_time_on – float: minimal time during which the energy unit should function once it is started-up
-
add_operating_cost
(operating_cost: float)[source]¶ Add an operating cost associated to the energy unit based on the value operating_cost. For each time step the energy unit is running the operating_cost value is multiplied by the power production or consumption and added to the operating_costs.
Parameters: operating_cost – float: cost corresponding operation of the energy unit. To be multiplied by the power at each time step
-
add_operating_time_range
(operating_time_range=[[<class 'int'>, <class 'int'>]])[source]¶ DEPRECATED : please use set_operating_time_range Add a range of hours during which the energy unit can be operated
example: [[10, 12], [14, 17]]
Parameters: operating_time_range – [[first hour of functioning : int, hour to stop (not in functioning): int]]
-
add_starting_cost
(start_cost: float)[source]¶ Add a starting cost associated to the energy unit based on the value start_cost. Each time the energy unit is starting (or restarting)
i.e. not functioning time t and functioning time t+1 ( When start_up[t+1] = 1 corresponding to u[t] = 0 and u[t+1] = 1)the start_cost value is added to the starting_costs.
Parameters: start_cost – float: cost corresponding to the start-up of the energy unit
-
minimize_co2_emissions
(weight=1)[source]¶ Objective to minimize the co2 emissions of the energy unit
Parameters: weight – Weight coefficient for the objective
-
minimize_costs
(weight=1)[source]¶ Objective to minimize the costs (starting and operating costs)
Parameters: weight – Weight coefficient for the objective
-
minimize_energy
(weight=1)[source]¶ Objective to minimize the energy of the energy unit
Parameters: weight – Weight coefficient for the objective
-
minimize_exergy
(energy_unit=None, weight=1)[source]¶ Alternate objective of exergy optimization that may be interesting in some cases.
-
minimize_exergy_destruction
(weight=1)[source]¶ This is the main objective of any exergetic optimization.
-
minimize_operating_cost
(weight=1)[source]¶ Objective to minimize the operating costs
Parameters: weight – Weight coefficient for the objective
-
minimize_starting_cost
(weight=1)[source]¶ Objective to minimize the starting costs
Parameters: weight – Weight coefficient for the objective
-
minimize_time_of_use
(weight=1)[source]¶ Objective to minimize the time of running of the energy unit
Parameters: weight – Weight coefficient for the objective
-
set_energy_limits_on_time_period
(e_min=0, e_max=None, start='YYYY-MM-DD HH:MM:SS', end='YYYY-MM-DD HH:MM:SS', period_index=None)[source]¶ Add an energy limit during a defined time period
Parameters: - e_min – Minimal energy set during the time period (int or float)
- e_max – Maximal energy set during the time period (int or float)
- start – Date of start of the time period YYYY-MM-DD HH:MM:SS ( str)
- end – Date of end of the time period YYYY-MM-DD HH:MM:SS (str)
-
set_operating_time_range
(operating_time_range=[[<class 'str'>, <class 'str'>]])[source]¶ Add a range of hours during which the energy unit can be operated. The final time should be greater than the initial time within a time range, except when the final time is ‘00:00’.
example: set_operating_time_range([[‘10:00’, ‘12:00’], [‘14:00’, ‘17:00’]])
Parameters: operating_time_range – list of lists of strings in the format HH:MM [[first hour operating: str, hour to stop (not operating): str], [second hour operating: str, hour to stop (not operating): str], etc]
-
class
omegalpes.energy.units.energy_units.
FixedEnergyUnit
(time, name: str, p: list, flow_direction='in', starting_cost=None, operating_cost=None, co2_out=None, energy_type=None, verbose=True)[source]¶ Bases:
omegalpes.energy.units.energy_units.EnergyUnit
Description
Energy unit with a fixed power profile.Attributes
- p : instantaneous power known by advance (kW)
- energy_type : type of energy (‘Electrical’, ‘Heat’, …)
-
class
omegalpes.energy.units.energy_units.
SawtoothEnergyUnit
(time, name, flow_direction, p_peak, p_low, alpha_peak, t_triangle, t_sawtooth, mandatory=True, starting_cost=None, operating_cost=None, co2_out=None, energy_type=None, verbose=True)[source]¶ Bases:
omegalpes.energy.units.energy_units.ShiftableEnergyUnit
-
class
omegalpes.energy.units.energy_units.
SeveralEnergyUnit
(time, name, fixed_power, p_min=1e-05, p_max=100000.0, imaginary=False, e_min=0, e_max=1000000.0, nb_unit_min=0, nb_unit_max=None, flow_direction='in', starting_cost=None, operating_cost=None, max_ramp_up=None, max_ramp_down=None, co2_out=None, energy_type=None, verbose=True, no_warn=True)[source]¶ Bases:
omegalpes.energy.units.energy_units.VariableEnergyUnit
Description
Energy unit based on a fixed power curve enabling to multiply several times (nb_unit) the same power curve.
Be careful, if imaginary == True, the solution may be imaginary as nb_unit can be continuous. The accurate number of the power unit should be calculated later
Attributes
- fixed_power : fixed power curve
-
class
omegalpes.energy.units.energy_units.
ShiftableEnergyUnit
(time, name: str, flow_direction, power_values: list, mandatory=True, co2_out=None, starting_cost=None, operating_cost=None, energy_type=None, verbose=True)[source]¶ Bases:
omegalpes.energy.units.energy_units.VariableEnergyUnit
Description
EnergyUnit with shiftable power profile.AttributsAttributes
- power_values : power profile to shift (kW)
- mandatory : indicates if the power is mandatory (True) or not (False)
- starting_cost : cost of the starting of the EnergyUnit
- operating_cost : cost of the operation (€/kW)
- energy_type : type of energy (‘Electrical’, ‘Heat’, …)
-
class
omegalpes.energy.units.energy_units.
SquareEnergyUnit
(time, name, p_square, n_square, t_between_sq, t_square=1, flow_direction='in', starting_cost=None, operating_cost=None, co2_out=None, energy_type=None, verbose=True, no_warn=True)[source]¶ Bases:
omegalpes.energy.units.energy_units.VariableEnergyUnit
-
class
omegalpes.energy.units.energy_units.
TriangleEnergyUnit
(time, name, flow_direction, p_peak, alpha_peak, t_triangle: list, mandatory=True, starting_cost=None, operating_cost=None, co2_out=None, energy_type=None, verbose=True)[source]¶ Bases:
omegalpes.energy.units.energy_units.ShiftableEnergyUnit
-
class
omegalpes.energy.units.energy_units.
VariableEnergyUnit
(time, name, flow_direction='in', p_min=-10000.0, p_max=10000.0, e_min=-1000000.0, e_max=1000000.0, starting_cost=None, operating_cost=None, min_time_on=None, min_time_off=None, max_ramp_up=None, max_ramp_down=None, co2_out=None, availability_hours=None, energy_type=None, verbose=True, no_warn=True)[source]¶
Consumption_units module¶
This module defines the consumption units
The consumption_units module defines various classes of consumption units, from generic to specific ones.
- It includes :
ConsumptionUnit : simple consumption unit. It inherits from EnergyUnit, its power flow direction is always ‘in’.
3 Objectives are also available :
- minimize consumption,
- maximize consumption,
- minimize consumption costs.
FixedConsumptionUnit : consumption with a fixed load profile. It inherits from ConsumptionUnit.
VariableConsumptionUnit : consumption unit allowing for a variation of power between p_min et p_max. It inherits from ConsumptionUnit.
- And also :
- SeveralConsumptionUnit: Consumption unit based on a fixed consumption curve enabling to multiply several times (nb_unit) the same consumption profile
- SeveralImaginaryConsumptionUnit: Consumption unit based on a fixed consumption curve enabling to multiply several times (nb_unit) the same consumption profile. Be careful, the solution may be imaginary as nb_unit can be continuous. The accurate number of the Consumption units should be calculated later
- SquareConsumptionUnit: Consumption unit with a fixed value and fixed duration.
- ShiftableConsumptionUnit: Consumption unit with shiftable consumption profile.
-
class
omegalpes.energy.units.consumption_units.
ConsumptionUnit
(time, name, p=None, p_min=1e-05, p_max=100000.0, e_min=0, e_max=1000000.0, co2_out=None, starting_cost=None, consumption_cost=None, min_time_on=None, min_time_off=None, max_ramp_up=None, max_ramp_down=None, availability_hours=None, energy_type=None, verbose=True)[source]¶ Bases:
omegalpes.energy.units.energy_units.EnergyUnit
Description
Simple Consumption unitAttributes
- p : instantaneous power demand (kW)
- p_max : maximal instantaneous power demand (kW)
- p_min : minimal instantaneous power demand (kW)
- energy_type : type of energy (‘Electrical’, ‘Heat’, …)
- consumption_cost : cost associated to the energy consumption
-
class
omegalpes.energy.units.consumption_units.
FixedConsumptionUnit
(time, name, p: list = None, co2_out=None, starting_cost=None, operating_cost=None, energy_type=None, verbose=True)[source]¶ Bases:
omegalpes.energy.units.energy_units.FixedEnergyUnit
,omegalpes.energy.units.consumption_units.ConsumptionUnit
Description
Consumption unit with a fixed consumption profile.Attributes
- p : instantaneous power demand known in advance (kW)
- energy_type : type of energy (‘Electrical’, ‘Heat’, …)
- consumption_cost : cost associated to the energy consumption
-
class
omegalpes.energy.units.consumption_units.
SeveralConsumptionUnit
(time, name, fixed_cons, p_min=1e-05, p_max=100000.0, e_min=0, e_max=1000000.0, nb_unit_min=0, nb_unit_max=None, co2_out=None, starting_cost=None, operating_cost=None, max_ramp_up=None, max_ramp_down=None, energy_type=None, verbose=True, no_warn=True)[source]¶ Bases:
omegalpes.energy.units.consumption_units.VariableConsumptionUnit
,omegalpes.energy.units.energy_units.SeveralEnergyUnit
Description
Consumption unit based on a fixed consumption curve enabling to multiply several times (nb_unit) the same consumption curve.Attributes
- fixed_cons : fixed consumption curve
-
class
omegalpes.energy.units.consumption_units.
SeveralImaginaryConsumptionUnit
(time, name, fixed_cons, p_min=1e-05, p_max=100000.0, e_min=0, e_max=1000000.0, nb_unit_min=0, nb_unit_max=None, co2_out=None, starting_cost=None, operating_cost=None, max_ramp_up=None, max_ramp_down=None, energy_type=None, verbose=True, no_warn=True)[source]¶ Bases:
omegalpes.energy.units.consumption_units.VariableConsumptionUnit
,omegalpes.energy.units.energy_units.SeveralEnergyUnit
Description
Consumption unit based on a fixed consumption curve enabling to multiply several times (nb_unit) the same consumption curve. Be careful, the solution may be imaginary as nb_unit can be continuous. The accurate number of the consumption unit should be calculated later.Attributes
- fixed_cons : fixed consumption curve
-
class
omegalpes.energy.units.consumption_units.
ShiftableConsumptionUnit
(time, name: str, power_values, mandatory=True, co2_out=None, starting_cost=None, operating_cost=None, energy_type=None, verbose=True)[source]¶ Bases:
omegalpes.energy.units.energy_units.ShiftableEnergyUnit
,omegalpes.energy.units.consumption_units.VariableConsumptionUnit
Description
Consumption unit with shiftable consumption profile.Attributes
- power_values : consumption profile to shift (kW)
- mandatory : indicates if the consumption is mandatory (True) or not
(False) * starting_cost : cost of the starting of the consumption * operating_cost : cost of the operation (€/kW) * energy_type : type of energy (‘Electrical’, ‘Heat’, …)
-
class
omegalpes.energy.units.consumption_units.
SquareConsumptionUnit
(time, name, p_square, duration, n_square, t_between_sq, co2_out=None, starting_cost=None, operating_cost=None, energy_type=None, verbose=True, no_warn=False)[source]¶ Bases:
omegalpes.energy.units.energy_units.SquareEnergyUnit
,omegalpes.energy.units.consumption_units.VariableConsumptionUnit
Description
Consumption unit with a fixed value and fixed duration.Only the time of beginning can be modifiedOperation can be mandatory or notAttributes
- p : instantaneous power consumption (kW)
- duration : duration of the power delivery (hours)
- mandatory : indicates if the power delivery is mandatory or not
- energy_type : type of energy (‘Electrical’, ‘Heat’, …)
- consumption_cost : cost associated to the energy consumption
-
class
omegalpes.energy.units.consumption_units.
VariableConsumptionUnit
(time, name, p_min=1e-05, p_max=100000.0, e_min=0, e_max=1000000.0, co2_out=None, starting_cost=None, operating_cost=None, min_time_on=None, min_time_off=None, max_ramp_up=None, max_ramp_down=None, energy_type=None, verbose=True, no_warn=True)[source]¶ Bases:
omegalpes.energy.units.energy_units.VariableEnergyUnit
,omegalpes.energy.units.consumption_units.ConsumptionUnit
Description
Consumption unit with a variation of power between p_min et p_max.Attributes
- p_max : maximal instantaneous power consumption (kW)
- p_min : minimal instantaneous power consumption (kW)
- energy_type : type of energy (‘Electrical’, ‘Heat’, …)
Production_units module¶
This module defines the production units
The production_units module defines various kinds of production units with associated attributes and methods.
- It includes :
ProductionUnit : simple production unit inheriting from EnergyUnit and with an outer flow direction. The outside co2 emissions, the starting cost, the operating cost, the minimal operating time, the minimal non-operating time, the maximal increasing ramp and the maximal decreasing ramp can be filled.
Objectives are also available :
- minimize starting cost, operating cost, total cost
- minimize production, co2_emissions, time of use
- maximize production
FixedProductionUnit : Production unit with a fixed production profile.
VariableProductionUnit : Production unit with a variation of power between p_min et p_max.
- And also :
- SeveralProductionUnit: Production unit based on a fixed production curve enabling to multiply several times (nb_unit) the same production curve
- SeveralImaginaryProductionUnit: Production unit based on a fixed production curve enabling to multiply several times (nb_unit) the same production curve. Be careful, the solution may be imaginary as nb_unit can be continuous. The accurate number of the production unit should be calculated later
- SquareProductionUnit: Production unit with a fixed value and fixed duration.
- ShiftableProductionUnit: Production unit with shiftable production profile.
-
class
omegalpes.energy.units.production_units.
FixedProductionUnit
(time, name: str, p: list = None, co2_out=None, starting_cost=None, operating_cost=None, energy_type=None, verbose=True)[source]¶ Bases:
omegalpes.energy.units.energy_units.FixedEnergyUnit
,omegalpes.energy.units.production_units.ProductionUnit
Description
Production unit with a fixed production profile.Attributes
- p : instantaneous power production known by advance (kW)
- energy_type : type of energy (‘Electrical’, ‘Heat’, …)
-
class
omegalpes.energy.units.production_units.
ProductionUnit
(time, name, p=None, p_min=1e-05, p_max=100000.0, e_min=0, e_max=1000000.0, co2_out=None, starting_cost=None, operating_cost=None, min_time_on=None, min_time_off=None, max_ramp_up=None, max_ramp_down=None, availability_hours=None, energy_type=None, verbose=True, no_warn=True)[source]¶ Bases:
omegalpes.energy.units.energy_units.EnergyUnit
Description
Simple Production unitAttributes
- co2_out: outside co2 emissions
- starting_cost: the starting cost
- operating_cost: the operating cost
- min_time_on : the minimal operating time
- min_time_off : the minimal non-operating time
- max_ramp_up : the maximal increasing ramp
- max_ramp_down ; the maximal decreasing ramp
-
class
omegalpes.energy.units.production_units.
SeveralImaginaryProductionUnit
(time, name, fixed_prod, p_min=1e-05, p_max=100000.0, e_min=0, e_max=1000000.0, nb_unit_min=0, nb_unit_max=None, co2_out=None, starting_cost=None, operating_cost=None, max_ramp_up=None, max_ramp_down=None, energy_type=None, verbose=True, no_warn=True)[source]¶ Bases:
omegalpes.energy.units.production_units.VariableProductionUnit
,omegalpes.energy.units.energy_units.SeveralEnergyUnit
Description
Production unit based on a fixed production curve enabling to multiply several times (nb_unit) the same production curve. Be careful, the solution may be imaginary as nb_unit can be continuous. The accurate number of the production unit should be calculated later.Attributes
- fixed_prod : fixed production curve
-
class
omegalpes.energy.units.production_units.
SeveralProductionUnit
(time, name, fixed_prod, p_min=1e-05, p_max=100000.0, e_min=0, e_max=1000000.0, nb_unit_min=0, nb_unit_max=None, co2_out=None, starting_cost=None, operating_cost=None, max_ramp_up=None, max_ramp_down=None, energy_type=None, verbose=True, no_warn=True)[source]¶ Bases:
omegalpes.energy.units.production_units.VariableProductionUnit
,omegalpes.energy.units.energy_units.SeveralEnergyUnit
Description
Production unit based on a fixed production curve enabling to multiply several times (nb_unit) the same production curve. nb_unit is an integer variable.Attributes
- fixed_prod : fixed production curve
-
class
omegalpes.energy.units.production_units.
ShiftableProductionUnit
(time, name: str, power_values, mandatory=True, co2_out=None, starting_cost=None, operating_cost=None, energy_type=None, verbose=True)[source]¶ Bases:
omegalpes.energy.units.energy_units.ShiftableEnergyUnit
,omegalpes.energy.units.production_units.VariableProductionUnit
Description
Production unit with shiftable production profile.Attributes
- power_values : production profile to shift (kW)
- mandatory : indicates if the production is mandatory : True or not : False
- starting_cost : cost of the starting of the production
- operating_cost : cost of the operation (€/kW)
- energy_type : type of energy (‘Electrical’, ‘Heat’, …)
-
class
omegalpes.energy.units.production_units.
SquareProductionUnit
(time, name, p_square, duration, n_square, t_between_sq, co2_out=None, starting_cost=None, operating_cost=None, energy_type=None, verbose=True, no_warn=True)[source]¶ Bases:
omegalpes.energy.units.energy_units.SquareEnergyUnit
,omegalpes.energy.units.production_units.VariableProductionUnit
Description
Production unit with a fixed value and fixed duration.Only the time of beginning can be modified.Operation can be mandatory or not.Attributes
- p : instantaneous power production (kW)
- duration : duration of the power delivery (hours)
- mandatory : indicates if the power delivery is mandatory or not
- energy_type : type of energy (‘Electrical’, ‘Heat’, …)
-
class
omegalpes.energy.units.production_units.
VariableProductionUnit
(time, name, p_min=1e-05, p_max=100000.0, e_min=0, e_max=1000000.0, co2_out=None, starting_cost=None, operating_cost=None, min_time_on=None, min_time_off=None, max_ramp_up=None, max_ramp_down=None, energy_type=None, verbose=True, no_warn=True)[source]¶ Bases:
omegalpes.energy.units.energy_units.VariableEnergyUnit
,omegalpes.energy.units.production_units.ProductionUnit
Description
Production unit with a variation of power between p_min et p_max.Attributes
- p_max : maximal instantaneous power production (kW)
- p_min : minimal instantaneous power production (kW)
- energy_type : type of energy (‘Electrical’, ‘Heat’, …)
Conversion_units module¶
This module defines the conversion units, inheriting from AssemblyUnits
The conversion_units module defines various classes of conversion units, from generic to specific ones.
- It includes :
- ConversionUnit : simple conversion unit. It inherits from AssemblyUnit.
- ElectricalToThermalConversionUnit : Electrical to thermal Conversion unit with an electricity consumption and a thermal production linked by and electrical to thermal ratio. It inherits from ConversionUnit
- HeatPump : Simple Heat Pump with an electricity consumption, a heat production and a heat consumption. It has a theoretical coefficient of performance COP and inherits from ConversionUnit.
-
class
omegalpes.energy.units.conversion_units.
ConversionUnit
(time, name, prod_units=None, cons_units=None, rev_units=None, verbose=True)[source]¶ Bases:
omegalpes.energy.units.energy_units.AssemblyUnit
Description
Simple Conversion unit, inheriting from AssemblyUnitAttributes
- time : TimeUnit describing the studied time period
- prod_units : list of the production units
- cons_units : list of the consumption units
- poles : dictionary of the poles of the conversion unit
-
class
omegalpes.energy.units.conversion_units.
ElectricalConversionUnit
(time, name, pmin_in_elec=1e-05, pmax_in_elec=100000.0, p_in_elec=None, pmin_out_elec=1e-05, pmax_out_elec=100000.0, p_out_elec=None, elec_to_elec_ratio=1)[source]¶ Bases:
omegalpes.energy.units.conversion_units.ConversionUnit
Description
Electrical Conversion unit with an electricity consumption and an electricity productionAttributes
- elec_production_unit : electricity production unit (electrical output)
- elec_consumption_unit : electricity consumption unit (electrical input)
- conversion : Definition Dynamic Constraint linking the electrical
input to the electrical output through the elec_to_elec ratio
-
class
omegalpes.energy.units.conversion_units.
ElectricalToThermalConversionUnit
(time, name, pmin_in_elec=1e-05, pmax_in_elec=100000.0, p_in_elec=None, pmin_out_therm=1e-05, pmax_out_therm=100000.0, p_out_therm=None, elec_to_therm_ratio=1, verbose=True)[source]¶ Bases:
omegalpes.energy.units.conversion_units.ConversionUnit
Description
Electrical to thermal Conversion unit with an electricity consumption and a thermal productionAttributes
- thermal_production_unit : thermal production unit (thermal output)
- elec_consumption_unit : electricity consumption unit (electrical input)
- conversion : Definition Dynamic Constraint linking the electrical
- input to
- the thermal output through the electrical to thermal ratio
-
class
omegalpes.energy.units.conversion_units.
HeatPump
(time, name, pmin_in_elec=1e-05, pmax_in_elec=100000.0, p_in_elec=None, pmin_in_therm=1e-05, pmax_in_therm=100000.0, p_in_therm=None, pmin_out_therm=1e-05, pmax_out_therm=100000.0, p_out_therm=None, cop=3, losses=0)[source]¶ Bases:
omegalpes.energy.units.conversion_units.ConversionUnit
Description
Simple Heat Pump with an electricity consumption, a thermal production and a thermal consumption. It has a theoretical coefficient of performance COP and inherits from ConversionUnit.Attributes
- thermal_production_unit : thermal production unit (condenser)
- elec_consumption_unit : electricity consumption unit (electrical input)
- thermal_consumption_unit : heay consumption unit (evaporator)
- COP : Quantity describing the coefficient of performance of the heat pump
- conversion : Definition Dynamic Constraint linking the electrical
input to the thermal output through the electrical to thermal ratio * power_flow : Definition Dynamic constraint linking the thermal output to the electrical and thermal inputs in relation to the losses.
-
class
omegalpes.energy.units.conversion_units.
ReversibleConversionUnit
(time, name, pmin_up=1e-05, pmax_up=100000.0, pmin_down=1e-05, pmax_down=100000.0, up2down_eff=1, down2up_eff=1, energy_type_up=None, energy_type_down=None, verbose=True)[source]¶ Bases:
omegalpes.energy.units.conversion_units.ConversionUnit
Description
Reversible Conversion unit with two reversible units, one for each side of the conversion unit. Theses sides will be called upstream and downstream.Attributes
- rev_unit_upstream: reversible unit upstream
- rev_unit_downstream: reversible unit downstream
- conversion_up2down: Definition Dynamic Constraint linking the
consumption of the upstream reversible unit to the production of the downstream reversible unit through the up2down_eff * conversion_down2up: Definition Dynamic Constraint linking the consumption of the downstream reversible unit to the production of the upstream reversible unit through the down2up_eff
Storage_units module¶
This module defines the storage units
The storage_units module defines various kinds of storage units with associated attributes and methods, from simple to specific ones.
- It includes :
- StorageUnit : simple storage unit inheriting from EnergyUnit, with storage specific attributes. It includes the objective “minimize capacity”.
- Thermocline storage : a thermal storage that need to cycle (i.e. reach SOC_max) every period of Tcycle
-
class
omegalpes.energy.units.storage_units.
StorageUnit
(time, name, pc_min=1e-05, pc_max=100000.0, pd_min=1e-05, pd_max=100000.0, capacity=None, e_0=None, e_f=None, soc_min=0, soc_max=1, eff_c=1, eff_d=1, self_disch=0, self_disch_t=0, ef_is_e0=False, cycles=None, energy_type=None, e_min=-1000000.0, e_max=1000000.0)[source]¶ Bases:
omegalpes.energy.units.energy_units.VariableEnergyUnit
Description
Simple Storage unitAttributes
- capacity (Quantity): maximal energy that can be stored [kWh]
- e (Quantity): energy at time t in the storage [kWh]
- set_soc_min (TechnicalDynamicConstraint): constraining the energy to be above the value : soc_min*capacity
- set_soc_max (TechnicalDynamicConstraint): constraining the energy to be below the value : soc_max*capacity
- pc (Quantity) : charging power [kW]
- pd (Quantity) : discharging power [kW]
- uc (Quantity) : binary variable describing the charge of the storage unit : 0 : Not charging & 1 : charging
- calc_e (DefinitionDynamicConstraint) : energy calculation at time t ; relation power/energy
- calc_p (DefinitionDynamicConstraint) : power calculation at time t ;
- power
- flow equals charging power minus discharging power
- on_off_stor (DefinitionDynamicConstraint) : making u[t] matching with storage modes (on/off)
- def_max_charging (DefinitionDynamicConstraint) : defining the max charging power, avoiding charging and discharging at the same time
- def_max_discharging (DefinitionDynamicConstraint) : defining the max discharging power, avoiding charging and discharging at the same time
- def_min_charging (DefinitionDynamicConstraint) : defining the min charging power, avoiding charging and discharging at the same time
- def_min_discharging (DefinitionDynamicConstraint) : defining the min discharging power, avoiding charging and discharging at the same time
- set_e_0 (ActorConstraint) : set the energy state for t=0
- e_f (Quantity) : energy in the storage at the end of the time horizon, i.e. after the last time step [kWh]
- e_f_min (TechnicalConstraint) : e_f value is constrained above soc_min*capacity
- e_f_max (TechnicalConstraint) : e_f value is constrained below soc_max*capacity
- set_e_f (ActorConstraint) : when e_f is given, it is set in the same way the energy is, but after the last time step
- calc_e_f (DefinitionConstraint) : when e_f is not given, it is calculated in the same way the energy is, but after the last time step
- ef_is_e0 (TechnicalConstraint) : Imposing ef=e0 on the time period.
- cycles (TechnicalDynamicConstraint) : setting a cycle constraint e[t] = e[t+cycles/dt]
-
class
omegalpes.energy.units.storage_units.
ThermoclineStorage
(time, name, pc_min=1e-05, pc_max=100000.0, pd_min=1e-05, pd_max=100000.0, capacity=None, e_0=None, e_f=None, soc_min=0, soc_max=1, eff_c=1, eff_d=1, self_disch=0, e_min=-1000000.0, e_max=1000000.0, Tcycl=120, ef_is_e0=False)[source]¶ Bases:
omegalpes.energy.units.storage_units.StorageUnit
Description
Class ThermoclineStorage : class defining a thermocline heat storage, inheriting from StorageUnit.Attributes
- is_soc_max (Quantity) : indicating if the storage is fully charged 0:No 1:Yes
- def_is_soc_max_inf (DynamicConstraint) : setting the right value for is_soc_max
- def_is_soc_max_sup (DynamicConstraint) : setting the right value for is_soc_max
- force_soc_max (TechnicalDynamicConstraint) : The energy has to be at least once at its maximal value during the period Tcycl.
Reversible_units module¶
This module defines the reversible units
The reversible_units module defines various kinds of reversible units with associated attributes and methods, from simple to specific ones, inheriting from AssemblyUnit.
- It includes :
- ReversibleUnit : simple reversible unit with only one consumption and
one production units. It can both produce and consume energy but not at the same time.
-
class
omegalpes.energy.units.reversible_units.
ReversibleUnit
(time, name, pmin_cons=1e-05, pmax_cons=100000.0, p_cons=None, pmin_prod=1e-05, pmax_prod=100000.0, p_prod=None, energy_type_prod=None, energy_type_cons=None, verbose=True)[source]¶ Bases:
omegalpes.energy.units.energy_units.AssemblyUnit
Description
Simple Reversible unit inheriting from AssemblyUnit. It is made of a consumption unit and a production unit that can both operate but not at the same time (reversible constraint).Attributes
- production_unit (ProductionUnit)
- consumption_unit (ConsumptionUnit)
- def_rev (DefinitionDynamicConstraint): definition of the reversible
constraint * def_rev_c (DefinitionDynamicConstraint): definition of the reversible constraint in the case where only the consumption is fixed * def_rev_p (DefinitionDynamicConstraint): definition of the reversible constraint in the case where only the production is fixed
Energy_nodes module¶
This module defines the energy nodes that will allow energy transmission between the various energy units and conversion units
The energy_node module includes the EnergyNode class for energy transmission between production, consumption, conversion and storage. Defining several energy nodes and exporting/importing energy between them can also allow for a better demarcation of the energy system.
-
class
omegalpes.energy.energy_nodes.
EnergyNode
(time, name, energy_type=None, operator=None)[source]¶ Bases:
omegalpes.general.optimisation.core.OptObject
This class defines an energy node.
-
add_pole
(pole: omegalpes.energy.io.poles.Epole) → None[source]¶ Add an energy pole to the poles_list
Parameters: pole – Epole
-
connect_units
(*units)[source]¶ Connecting all EnergyUnit to the EnergyNode
Parameters: units (EnergyUnit) – EnergyUnits connected to the EnergyNode
-
create_export
(node, export_min, export_max)[source]¶ Create the export from the EnergyNode (self) to the EnergyNode (node)
Parameters: - node – EnergyNode to whom power can be exported
- export_min – Minimal value of exported power when there is export
- export_max – Maximal value of exported power when there is export
Returns: Quantity that defines the power exported
-
export_to_node
(node, export_min=1e-05, export_max=100000.0)[source]¶ Add an export of power from the node to another node
Parameters: - node – EnergyNode to whom power can be exported
- export_min – Minimal value of exported power when there is export
- export_max – Maximal value of exported power when there is export
-
get_connected_energy_units
¶ Return the list of connected EnergyUnits in the EnergyNode
-
get_exports
¶ Return the list of exports to the EnergyNode
-
get_flows
¶ Get all the power flows of the energy node :rtype: list :return: list of power flows
-
get_imports
¶ Return the list of imports to the EnergyNode
-
get_poles
¶ Return the list of energy poles in the EnergyNode
-
Thermal Building module¶
This module enables to model buildings as thermal loads
-
class
omegalpes.energy.buildings.thermal.
HeatingLoad
(time, name, tz, p_max=10000000000000.0, T_set=19, temp_margin=1, no_cooling=True)[source]¶ Bases:
omegalpes.energy.units.consumption_units.VariableConsumptionUnit
-
class
omegalpes.energy.buildings.thermal.
RCNetwork_1
(time, name, T_ext, theta_ec, theta_em, T_int_min=0, T_int_max=50, theta_ea=None, theta_c=None, theta_m=None, h_ea=0, h_ac=0, h_ec=0, h_mc=0, h_em=0, c_m=0, f_im=None, f_r_l=0.7, f_r_p=0.5, f_r_a=0.2, f_sa=0.1, f_sm=None, f_sc=None, f_ic=None, f_hc_cv=None, U_wall=0.2, U_win=1.2, U_roof=0.2, e_wall=0.9, e_win=0.9, e_roof=0.9, a_wall=0.6, a_roof=0.6, A_wall=None, A_win=None, A_roof=None, owner=None)[source]¶
-
class
omegalpes.energy.buildings.thermal.
ThermalZone
(rc_network, phi_i_a, phi_i_l, phi_i_p, I_sol_av, Fsh_win, T_mean, T_dew, sky_cover=1, T_ext=None, hvac_prop=None)[source]¶
-
class
omegalpes.energy.buildings.thermal.
ZEA_RCNetwork_1
(time, name, T_ext, A_f, A_win, Aext_v, A_roof, footprint, U_win, U_wall, U_roof, U_base, floors, e_wall=0.9, e_win=0.9, e_roof=0.9, a_wall=0.6, a_roof=0.6, construction='heavy', height_bg=0, perimeter=0, f_hc_cv=1, void=0, hvac_prop=None, T_int_min=0, T_int_max=50, owner=None)[source]¶
-
omegalpes.energy.buildings.thermal.
calc_Htr_op
(Aop_bel, Aop_sup, footprint, U_base, U_wall, U_roof)[source]¶
-
omegalpes.energy.buildings.thermal.
calc_I_rad_linearization_coef
(Tdry, Tdew, Tlin, sky_cover=1)[source]¶ Parameters: - T_dry – Dry bulb temperature in Celsius
- T_dew – Dew point temperature in Celsius
- sky_cover –
Returns: list(A), list(B):
-
omegalpes.energy.buildings.thermal.
calc_I_sol
(I_sol_average, Aop_sup, Aroof, Awin, a_wall, a_roof, U_wall, U_roof, Fsh_win)[source]¶ Parameters: - I_sol_average – W/m2
- Aop_sup – Opaque wall areas above ground (excluding voids and windows) [m2]
- Aroof – Roof area [m2]
- Awin – Windows area [m2]
- a_wall – Absorption coefficient of the walls [0..1]
- a_roof – Absorption coefficeint of the roof [0..1]
- U_wall –
- U_roof –
- Fsh_win – Shading factor for windows
Returns: I_sol [kW]
-
omegalpes.energy.buildings.thermal.
calc_T_sky
(T_dry, T_dew, sky_cover=1)[source]¶ Parameters: - T_dry – Dry bulb temperature in Celsius
- T_dew – Dew point temperature in Celsius
- sky_cover – Sky cover
-
omegalpes.energy.buildings.thermal.
calc_skytemp
(Tdrybulb, Tdewpoint, N=1)[source]¶ - Copyright 2014, Architecture and Building Systems - ETH Zurich
Parameters: - Tdrybulb – Drybuld temperature [°C]
- Tdewpoint – Dewpoint temperature [°C]
- N – Sky cover
Returns: Sky temperature in °C
-
omegalpes.energy.buildings.thermal.
get_Cm_Af
(construction)[source]¶ - Description code Cm_Af Light construction T1 110000 Medium construction T2 165000 Heavy construction T3 300000
-
omegalpes.energy.buildings.thermal.
lookup_effective_mass_area_factor
(cm)[source]¶ Look up the factor to multiply the conditioned floor area by to get the effective mass area by building construction type. This is used for the calculation of the effective mass area “Am” in get_prop_RC_model. Standard values can be found in the Annex G of ISO EN13790
param: cm: The internal heat capacity per unit of area [J/m2]. return: Effective mass area factor (0, 2.5 or 3.2 depending on cm value).
Exergy module¶
This module contains the exergy assessment routines of OMEGALPES. This module:
- Determines inlet, outlet or contained exergy of, respectively, any ConsumptionUnit, ProductionUnit or StorageUnit.
2) Determines exergy destruction within any EnergyUnit. 2) Recognizes Electrical and Thermal energy. 3) Can calculate exergy for a single unit or for a list of units. 4) Can proceed with only one temperature value or with a list of temperatures.
4.1. Formulates exergy for one single EnergyUnit and temperature. 4.2. Formulates timely exergy if one single EnergyUnit and a list of
temperatures is provided.
- 4.3. Formulates exergy for each unit within a list of EnergyUnits if only
- one temperature is provided.
- 4.4. Formulates timely exergy for each unit within a list of EnergyUnits if
- a list of temperatures is provided.
The exergy-related classes defined in this module are not physical units. They are virtual units attached to their energetic counterparts. Consequently, the exergy and exergy destruction calculated in this module are attached to the EnergyUnit as a Quantity at the moment of calculating it.
Copyright 2018 G2Elab / MAGE
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-
class
omegalpes.energy.exergy.
ElectricalExergy
(energy_unit: omegalpes.energy.units.energy_units.EnergyUnit)[source]¶
-
class
omegalpes.energy.exergy.
ExergyDestruction
(energy_unit=None, exergy_eff=1, temp_ref=20, temp_heat=None)[source]¶
Poles module¶
This module defines inputs and outputs of as poles
- The poles module includes :
- FlowPole : this class defines a pole with a directed flow (in or out)
- EPole : this class define an energy pole
-
class
omegalpes.energy.io.poles.
Epole
(p, direction, energy_type=None)[source]¶ Bases:
omegalpes.energy.io.poles.FlowPole
Description
Definition of an energetic pole, power and power flow direction convention ‘in’ or ‘out’