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:
time: instance of TimeUnit describing the studied time period.
energy_type: energy type of the energy unit (see energy.energy_types)
p: instantaneous power of the energy unit (kW)
e_tot: total energy either consumed or produced by the energy unit on the studied time period during the time period (kWh)
u: binary describing if the unit is operating (1) or not (0) at t (i.e. delivering or consuming power)
poles: energy poles of the energy unit (see energy.io.poles)
EnergyUnit parameters can be used to add energy constraints or new attributes calculation to the energy unit, such as e_max or starting_cost.
- 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:
OptObjectDescription
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=0, p_max=10000.0, e_min=None, e_max=None, 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:
OptObjectDescription
Module dedicated to the parent class (EnergyUnit) of :
production units
consumption units
storage units
- add_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)
- add_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: add_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]
NB: the previous version of add_operating_time_range (deprecated since version 0.3.1) had integers instead of str hours as parameters, do not forget to update it if needed !
- minimize_co2_emissions(weight=1, pareto=False)[source]
Objective to minimize the co2 emissions of the energy unit
- Parameters:
weight – Weight coefficient for the objective
pareto – if True, OMEGAlpes calculates a pareto front based on this objective (two objectives needed)
- minimize_costs(weight=1, pareto=False)[source]
Objective to minimize the costs (starting and operating costs)
- Parameters:
weight – Weight coefficient for the objective
pareto – if True, OMEGAlpes calculates a pareto front based on this objective (two objectives needed)
- minimize_energy(weight=1, pareto=False)[source]
Objective to minimize the energy of the energy unit
- Parameters:
weight – Weight coefficient for the objective
pareto – if True, OMEGAlpes calculates a pareto front based on this objective (two objectives needed)
- minimize_exergy(energy_unit=None, weight=1, pareto=False)[source]
Alternate objective of exergy optimization that may be interesting in some cases.
- Parameters:
weight – Weight coefficient for the objective
pareto – if True, OMEGAlpes calculates a pareto front based on this objective (two objectives needed)
- minimize_exergy_destruction(weight=1, pareto=False)[source]
This is the main objective of any exergetic optimization.
- Parameters:
weight – Weight coefficient for the objective
pareto – if True, OMEGAlpes calculates a pareto front based on this objective (two objectives needed)
- minimize_operating_cost(weight=1, pareto=False)[source]
Objective to minimize the operating costs
- Parameters:
weight – Weight coefficient for the objective
pareto – if True, OMEGAlpes calculates a pareto front based on this objective (two objectives needed)
- minimize_starting_cost(weight=1, pareto=False)[source]
Objective to minimize the starting costs
- Parameters:
weight – Weight coefficient for the objective
pareto – if True, OMEGAlpes calculates a pareto front based on this objective (two objectives needed)
- minimize_time_of_use(weight=1, pareto=False)[source]
Objective to minimize the time of running of the energy unit
- Parameters:
weight – Weight coefficient for the objective
pareto – if True, OMEGAlpes calculates a pareto front based on this objective (two objectives needed)
- set_operating_time_range(operating_time_range: [[<class 'str'>, <class 'str'>]])[source]
DEPRECATED: the name of the function changed to add_operating_time_range for code consistency, please use this function !
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:
EnergyUnitDescription
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:
ShiftableEnergyUnit
- class omegalpes.energy.units.energy_units.SeveralEnergyUnit(time, name, fixed_power, p_min=0, p_max=100000.0, imaginary=False, e_min=None, e_max=None, 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:
VariableEnergyUnitDescription
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:
VariableEnergyUnitDescription
EnergyUnit with shiftable power profile.
Attributes
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:
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:
ShiftableEnergyUnit
- class omegalpes.energy.units.energy_units.VariableEnergyUnit(time, name, flow_direction='in', p_min=0, p_max=10000.0, e_min=None, e_max=None, 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]
Bases:
EnergyUnit
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=0, p_max=100000.0, e_min=None, e_max=None, 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:
EnergyUnitDescription
Simple Consumption unit. The parameters and attributes are described in EnergyUnit parent class. Here, consumption_cost is the cost associated to the energy consumption of the unit (€/kWh).
- maximize_consumption(weight=1, pareto=False)[source]
- Parameters:
weight – Weight coefficient for the objective
pareto – if True, OMEGAlpes calculates a pareto front based on this objective (two objectives needed)
- 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:
FixedEnergyUnit,ConsumptionUnitDescription
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, imaginary=False, p_min=0, p_max=100000.0, e_min=None, e_max=None, 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:
VariableConsumptionUnit,SeveralEnergyUnitDescription
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.ShiftableConsumptionUnit(time, name: str, power_values, mandatory=True, co2_out=None, starting_cost=None, operating_cost=None, energy_type=None, verbose=True)[source]
Bases:
ShiftableEnergyUnit,VariableConsumptionUnitDescription
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:
SquareEnergyUnit,VariableConsumptionUnitDescription
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=0, p_max=100000.0, e_min=None, e_max=None, 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:
VariableEnergyUnit,ConsumptionUnitDescription
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, particle_emission=None, starting_cost=None, operating_cost=None, energy_type=None, rr_energy=False, verbose=True)[source]
Bases:
FixedEnergyUnit,ProductionUnitDescription
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=0, p_max=100000.0, e_min=None, e_max=None, co2_out=None, particle_emission=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, rr_energy=False, verbose=True, no_warn=True)[source]
Bases:
EnergyUnitDescription
Simple Production unit. The parameters and attributes are described in EnergyUnit parent class.
- class omegalpes.energy.units.production_units.SeveralProductionUnit(time, name, fixed_prod, imaginary=False, p_min=0, p_max=100000.0, e_min=None, e_max=None, nb_unit_min=0, nb_unit_max=None, co2_out=None, particle_emission=None, starting_cost=None, operating_cost=None, max_ramp_up=None, max_ramp_down=None, energy_type=None, rr_energy=False, verbose=True, no_warn=True)[source]
Bases:
VariableProductionUnit,SeveralEnergyUnitDescription
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, particle_emission=None, starting_cost=None, operating_cost=None, energy_type=None, rr_energy=False, verbose=True)[source]
Bases:
ShiftableEnergyUnit,VariableProductionUnitDescription
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, particle_emission=None, starting_cost=None, operating_cost=None, energy_type=None, rr_energy=False, verbose=True, no_warn=True)[source]
Bases:
SquareEnergyUnit,VariableProductionUnitDescription
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=0, p_max=100000.0, e_min=None, e_max=None, co2_out=None, particle_emission=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, rr_energy=False, verbose=True, no_warn=True)[source]
Bases:
VariableEnergyUnit,ProductionUnitDescription
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.
SingleConversionUnit: Conversion unit made of a single consumption unit and a single production unit. It can be used for any energy vector, and an efficiency ratio between the input (consumption) and the output (production)
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:
AssemblyUnitDescription
Simple Conversion unit, inheriting from AssemblyUnit
Attributes
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=0, pmax_in_elec=100000.0, p_in_elec=None, pmin_out_elec=0, pmax_out_elec=100000.0, p_out_elec=None, elec_to_elec_ratio=1)[source]
Bases:
ConversionUnitDescription
Electrical Conversion unit with an electricity consumption and an electricity production
Attributes
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=0, pmax_in_elec=100000.0, p_in_elec=None, pmin_out_therm=0, pmax_out_therm=100000.0, p_out_therm=None, elec_to_therm_ratio=1, verbose=True)[source]
Bases:
ConversionUnit- Description
DEPRECATED: please now use SingleConversionUnit with relevant energy types
Electrical to thermal Conversion unit with an electricity consumption and a thermal production
Attributes
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=0, pmax_in_elec=100000.0, p_in_elec=None, pmin_in_therm=0, pmax_in_therm=100000.0, p_in_therm=None, pmin_out_therm=0, pmax_out_therm=100000.0, p_out_therm=None, cop=3, losses=0, min_time_on=None)[source]
Bases:
ConversionUnitDescription
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=0, pmax_up=100000.0, pmin_down=0, pmax_down=100000.0, up2down_eff=1, down2up_eff=1, energy_type_up=None, energy_type_down=None, verbose=True)[source]
Bases:
ConversionUnitDescription
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
- class omegalpes.energy.units.conversion_units.SingleConversionUnit(time, name, pmin_in=0, pmax_in=100000.0, p_in=None, energy_type_in=None, pmin_out=0, pmax_out=100000.0, p_out=None, energy_type_out=None, efficiency_ratio=1, verbose=True)[source]
Bases:
ConversionUnitDescription
Conversion unit made of a single consumption unit and a single production unit. It can be used for any energy vector, and an efficiency ratio between the input (consumption) and the output (production)
- Attributes
production_unit: output of the conversion unit
consumption_unit: input of the conversion unit
conversion: Definition Dynamic Constraint linking the input to the output through a ratio
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=0, pc_max=None, pd_min=0, pd_max=None, 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, ef_geq_e0=False, energy_type=None, e_min_ch=None, e_max_ch=None, e_min_disch=None, e_max_disch=None)[source]
Bases:
AssemblyUnitDescription
Simple Storage unit
If storage capacity isn’t an optimization variable, please assign a capacity value.
Attributes
charge (VariableConsumptionUnit) : represents the charge part of the storage unit
discharge (VariableProductionUnit) : represents the discharge part of the storage unit
capacity (Quantity): maximal energy that can be stored [kWh]
e (Quantity): energy at time t in the storage [kWh]
p (Quantity): power at time t in the storage [kW]
e (Quantity): energy at time t in the storage [Binary]
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
u(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)
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]
- minimize_capacity(pc_max_ratio: float = None, pd_max_ratio: float = None, weight=1)[source]
Objective of minimizing the capacity. If pc_max_ratio and pd_max_ratio are set AND pc_max and pd_max have None value in the StorageUnit, pc_max and pd_max are constrained to have values in accordance with the given ratio of the capacity.
- Parameters:
weight – Weight coefficient for the objective
pc_max_ratio – ratio of the capacity for pc_max value i.e. if pc_max_ratio is 1/2, pc_max = capacity / 2. This ratio should be taken in accordance with the value of the time step.
pd_max_ratio – ratio of the capacity for pd_max value i.e. if pd_max_ratio is 1/2, pd_max = capacity / 2. This ratio should be taken in accordance with the value of the time step.
- class omegalpes.energy.units.storage_units.StorageUnitTm1(time, name='StUtm1', pc_min=0, pc_max=100000.0, pd_min=0, 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, operator=None)[source]
Bases:
StorageUnit- Description
Storage unit where the energy is described at the end of a timestep. Calculation : e[t]-e[t-1] = dt * (pc[t]*eff_c - pd[t]*1/eff_d - self_disch*capa - self_disch_t*e[t]) In this case, e_f is not defined as a quantity
- Attributes
capacity (Quantity): maximal energy that can be stored [kWh]
e (Quantity): energy at time t in the storage [kWh]
set_soc_min (DynamicConstraint): constraining the energy to be above the value : soc_min*capacity
set_soc_max (DynamicConstraint): 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 (DynamicConstraint) : 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 (DynamicConstraint) : defining the max charging power, avoiding charging and discharging at the same time
def_max_discharging (DynamicConstraint) : defining the max discharging power, avoiding charging and discharging at the same time
def_min_charging (DynamicConstraint) : defining the min charging power, avoiding charging and discharging at the same time
def_min_discharging (DynamicConstraint) : defining the min discharging power, avoiding charging and discharging at the same time
set_e_0 (ExternalConstraint) : set the energy state for t=0
set_e_f (ExternalConstraint) : set the energy state for the last time step
ef_is_e0 (ExternalConstraint) : Imposing ef=e0 on the time period
cycles (ExternalDynamicConstraint) : setting a cycle constraint e[t] = e[t+cycles/dt]
- class omegalpes.energy.units.storage_units.ThermoclineStorage(time, name, pc_min=0, pc_max=100000.0, pd_min=0, 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_ch=None, e_max_ch=None, e_min_disch=None, e_max_disch=None, Tcycl=120, ef_is_e0=False)[source]
Bases:
StorageUnitDescription
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=0, pmax_cons=100000.0, p_cons=None, pmin_prod=0, pmax_prod=100000.0, p_prod=None, energy_type_prod=None, energy_type_cons=None, verbose=True)[source]
Bases:
AssemblyUnitDescription
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:
OptObjectThis class defines an energy node.
- 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=0, 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
- property get_connected_energy_units
Return the list of connected EnergyUnits in the EnergyNode
- property get_exports
Return the list of exports to the EnergyNode
- property get_flows
Get all the power flows of the energy node :rtype: list :return: list of power flows
- property get_imports
Return the list of imports to the EnergyNode
- property get_input_poles
- property get_output_poles
- property 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:
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]
Bases:
OptObject
- 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]
Bases:
OptObject
- 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]
Bases:
RCNetwork_1
- 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.
Determines exergy destruction within any EnergyUnit.
Recognizes Electrical and Thermal energy.
Can calculate exergy for a single unit or for a list of units.
Can proceed with only one temperature value or with a list of temperatures.
5.1. Formulates exergy for one single EnergyUnit and temperature.
5.2. Formulates timely exergy if one single EnergyUnit and a list of temperatures is provided.
5.3. Formulates exergy for each unit within a list of EnergyUnits if only one temperature is provided.
5.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.
- class omegalpes.energy.exergy.ElectricalExergy(energy_unit: EnergyUnit)[source]
Bases:
OptObject
- class omegalpes.energy.exergy.ExergyDestruction(energy_unit=None, exergy_eff=1, temp_ref=20, temp_heat=None)[source]
Bases:
OptObject
- class omegalpes.energy.exergy.ThermalExergy(energy_unit: EnergyUnit, temp_heat: int, temp_ref=20)[source]
Bases:
OptObject
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