4  RBuildings

The intention here is to make available results on the building stocks at various scale from models that propose configuration of energy systems.

The final goal would be to centralise data and results on buildings so that a quick overlook can be given on any of them in Switzerland.

At the district and building scale, REHO is used to find the optimal energy system according to an objective. REHO is an open-source and well documented tool. Please refer to the REHO documentation for details on its functioning.

To generate results over the whole country, varying the model configuration, we use the district typification explained on Section (district-archetypes?).

Those results can then be stored on a database, where the configuration allows to retrieve them.

4.1 Database

4.1.1 Structure

The data volume that represents the results, even with the clustering, is important. Indeed, REHO computes results with time series. Therefore, the minimum amount of data should be stored on the database: redundancy should be avoided while also minimising the requests to the database to compute a value.

The common variables are stored in the model schema. Everything that is related to the buildings is already in GBuildings. The structure is described in Figure 4.1 and the tables are described in Table 4.1 to Table 4.4.

Figure 4.1: Structure of the RBuildings structure, from database to tables

Table 4.1: Time-related tables fields

(a)
Time period
Fields Comments
id Unique id of each hour represented
Period Representative day
Time Hours of the day from 1 to 24
T_ext Exterior temperature at the given hour (°C)
I_global Global irradiance at the given hour (W/m2)
(b)
Time index
Fields Comments
hours Every hour of the year from 1 to 8760
period The period by which it will be represented
a Yellow cells are used to mark Primary Key and blue ones for the Foreign Key, linked to a PK from another table.
(c)
Period frequency
Fields Comments
Period ID of the period of the year
frequency How many days in the year are represented by the period

Table 4.2: REHO model tables fields

(a)
Units characteristics
Fields Comments
id Identifies the unit type
name Name of the unit
name_fr Translation in French
name_de Translation in German
lifetime Lifetime of the unit
Cost_inv1 To compute the investment cost of the unit according to its size
Cost_inv2
GWP_unit1 To compute the CO2-eq emissions of the unit construction
GWP_unit2
land_use_1 To compute the investment cost of the unit according to its size
land_use_2
mine_res_1 To compute the CO2-eq emissions of the unit construction
mine_res_2
water_res_1 To compute the investment cost of the unit according to its size
water_res_2
energy_res_1 To compute the CO2-eq emissions of the unit construction
energy_res_2
Human_toxicity_1 To compute the investment cost of the unit according to its size
Human_toxicity_2
water_pollutants_1 To compute the CO2-eq emissions of the unit construction
water_pollutants_2
metals_water_1 To compute the investment cost of the unit according to its size
metals_water_2
pop_water_1 To compute the CO2-eq emissions of the unit construction
pop_water_2
metals_soil_1 To compute the investment cost of the unit according to its size
metals_soil_2
pollutants_pm_1 To compute the CO2-eq emissions of the unit construction
polutants_pm_2
Metal_air_1 To compute the investment cost of the unit according to its size
Metal_air_2
has_layers To compute the CO2-eq emissions of the unit construction
(b)
Layer
Fields Comments
id Identifies the unit type
name Name of the unit
name_fr Translation in French
name_de Translation in German
Cost_demand_cst Pricing of the resource when buying or selling in the model
Cost_supply_cst
GWP_demand_cst Impact of the resource when buying or selling in the model
GWP_supply_cst
land_use_demand_cst To compute the investment cost of the unit according to its size
land_use_supply_cst
mine_res_demand_cst To compute the CO2-eq emissions of the unit construction
mine_res_supply_cst
water_res_demand_cst To compute the investment cost of the unit according to its size
water_res_supply_cst
energy_demand_cst To compute the CO2-eq emissions of the unit construction
energy_res_supply_cst
Human_toxicity_demand_cst To compute the investment cost of the unit according to its size
Human_toxicity_supply_cst
water_pollutants_demand_cst To compute the CO2-eq emissions of the unit construction
water_pollutants_supply_cst
metals_water_demand_cst To compute the investment cost of the unit according to its size
metals_water_supply_cst
pop_water_demand_cst To compute the CO2-eq emissions of the unit construction
pop_water_supply_cst
metals_soil_demand_cst To compute the investment cost of the unit according to its size
metals_soil_supply_cst
pollutants_pm_demand_cst To compute the CO2-eq emissions of the unit construction
polutants_pm_supply_cst
Metal_air_demand_cst To compute the investment cost of the unit according to its size
Metal_air_supply_cst

Table 4.3: District results tables fields

(a)
Configuration that characterise REHO results
Fields Comments
id Unique id for each configuration
transformer id of the transformer on which REHO was run
Layer_supply For each layer in model.layer, the total annual supply and demand are saved (MWh)
Layer_demand
Unit_installed_kW For each unit in model.unit_characteristics, the size installed is saved (kW)
a Table used to retrieve a run. Allows to filter results by amount of PV installed or by transformer for instance.
(b)
Hub
Fields Comments
id Unique id of the hub in the REHO run
name Name of the hub in the REHO run
connected_to
id_building If the hub is a building, id_building in GBuildings, that allows to retrieve data
id_config id of the run configuration from districts.configuration
(c)
Units installed
Fields Comments
id Unique id for the units installation
id_config id of the REHO run configuration, from districts.configuration
from_unit_type id of the unit from model.units_characteristics, allows to retrieve data on unit
Hub id of the hub from districts.hub
Units_Mult Size of the unit installed (kW)

Table 4.4: District results with timesteps tables fields

(a)
Units with timesteps
Fields Comments
id Unique id of the units use at time t for a given run
id_period id of the period to which time t is associated, from model.time_period
Hub id of the hub from districts.hub
from_unit_type id of the unit from model.units_characteristics, allows to retrieve data on unit
Units_demand Amount of demand, supply and curtailement at unit at time t
Units_supply
Units_curtailment
id_config id of the REHO run configuration, from districts.configuration
a This table stores the flows at units at each time period.
(b)
Grid with timesteps
Fields Comments
id Unique id of the grid data for that period t
id_period id of the time period
Layer id of the layer, allows to retrieve its characteristics from the model schema
Hub id_building, allows to retrieve buildings data from GBuildings
Cost_demand Buying of the layer at time t
Cost_supply Selling of the layer at time t
GWP_demand Impact of buying the layer at time t$
GWP_supply Impact of selling the layer at time t$
Grid_demand How much is bought at time t
Grid_supply How much is sold at time t
Uncontrollable_load Part of the demand that is not controllable
id_config To which REHO solving configuration those results correspond
a This table stores the layers exchange and their costs and impact at each time period.
(c)
Buildings with timesteps
Fields Comments
id Unique id of the building data for that period
id_period ID of the time period
Hub Hub id from table districts.hub
gains Heating gains at time t
heating Heating demand at time t
a Stores the heating demand and heat gains at each time period

Because the data have been so compacted in the tables, it is difficult to read one by itself and information from several may be necessary to cross, as they are not self-sufficient. For that reason, the python repository should be used to manipulate the database in a easier way.

4.2 Repository

The repository contains several functions to manipulate the data related to the database. First of all, there is the definition of a class DB_manager that helps for the writing of the results from a pickle to the database format and for the reading of the results back into the pickle format, while selecting a configuration by its id.

The repository also contains functions to retrieve a configuration according to criteria such as the size of PV installed or the electricity consumption.