Basic usage of pvcompare

Run a simulation

You can easily run a simulation by executing one of the examples in examples/. There are three examples, one that accounts only for the electricity sector, one for sector coupling using heat pumps and one example covering heat demand with a gas plant as a reference scenario for the one with heat pumps.

If you want to set up your own scenario, you need to insert input files into the directory first. How to do this is described in the next paragraph Define your own components and parameters. Afterwards you can run a simulation by running the file run_pvcompare.py in the parent folder of pvcompare. In order to run a simulation you need to at least define the following parameters:

  • latitude: float

  • longitude: float

  • year: int

  • storeys: int

  • country: str

  • scenario_name: str

Define your own components and parameters

pvcompare provides you with templates and default parameters for your simulations. You can find three basic scenarios (for the electricity sector, sector coupled system and a reference for the sector coupled system) in examples/example_user_inputs/. A full description of the parameters and default values can be found in the section Parameters of pvcompare: Definitions and Default Values. However, you can also define your own energy system, choose different parameters and/or change the settings.

You can configure your own scenario by defining the parameters in data/user_inputs. It contains two subfolders mvs_inputs for all MVS parameters and pvcompare_inputs for pvcompare inputs parameters. You can define a different input directory by providing the parameters user_inputs_mvs_directory and user_inputs_pvcompare_directory to the apply_pvcompare() and apply_mvs() functions. Please note that pvcompare only works with csv files but not with json files.

Because the data/user_inputs folder is an individual working directory, it is left empty in the initial state of pvcompare. The user is required to fill in the specific input files that fit to the according energy system setup. The directory data/user_inputs_collection contains a collection of all kinds of possible asset definitions that have been used within the GRECO Project. Users are welcome to copy specific parts from this collection folder into the data/user_inputs files. It is also possible to define new MVS assets (e.g. different power plants, storages or energy providers, transformers etc.). Please see the MVS documentation on simulating with the MVS for more information. When setting up your input files, make sure that your individual input folder contains all available files. Even though you can change the values of the parameters, the files themselves, their naming and structure cannot be changed.

There are three input folders (one for each example) in the examples/example_user_inputs/ directory that resemble specific scenario setups for sector coupled and electricity sector scenarios. For a start we recommend to study the example input files and then set up your own input files accordingly by adding (or removing) components from the data/user_inputs_collection directory.

The following list gives an overview over all user input files. See section Parameters of pvcompare: Definitions and Default Values for more information.

pvcompare_inputs

  • pv_setup.csv: Definition of PV assets (technology, tilt angle, azimuth angle, roof-top or facade installation)

  • building_parameters.csv: Definition of characteristics of the building type that should be considered in the simulation

  • heat_pumps_and_chillers.csv: Definition of characteristics of the heat pump and chiller for the calculation of the COP/EER

  • stratified_thermal_storage.csv: Definition of characteristics of the stratified thermal energy storage for the calculation of thermal energy losses from the storage to the environment

mvs_inputs/csv_elements

  • constraints.csv: List of contraints that should be activated for the energy system optimization (such as Net Zero Energy (NZE) constraint)

  • economic_data.csv: General information about the simulation (currency, project duration, discount factor)

  • energyBusses.csv: Definition of connecting busses (e.g. one electricty and one heat bus in a sector coupled scenario)

  • energyConsumption.csv: Definition of the energy demand (e.g. electricity demand and/or heat demand with the filename of the demand time series)

  • energyConversion.csv: Definition of transformers (e.g. solar inverter, charge controller, heat pumps etc.)

  • energyProduction.csv: Definition of local generation (e.g. one or more PV plants with the maximal installable capacity and costs)

  • energyProviders.csv: Definition of the energy Provider (e.g. a DSO or a gas plant in the reference sector coupled scenario)

  • energyStorage.csv: Definition of storages (Li-Ion battery or thermal energy storage (TES) with the filename of the csv file that contains more precise information of each storage (e.g. storage_01.csv or storage_02.csv))

  • fixcost.csv: Definition of general fix costs of the project (disregarded by default)

  • project_data.csv: Definition of the location and name of the simulation

  • simulation_settings.csv: Definition of the year and the duration of the simulation (e.g. one year or less)

  • storage_**.csv: Definition of more precise storage parameters (as an addition to energyStorage.csv)

Download ERA5 weather data

When running a simulation, pvcompare automatically downloads the ERA5 weather data from Climate Data Store (CDS) and stores it locally in data/static_inputs, unless the file already exists. In order to enable this download you first need to create an account at the CDS and install the cdsapi package. This page provides information about the installation. When using the API for a large amount of data (e.g. a year for one location) the request gets queued and the download might take a while.

Two example weather years for Berlin, Germany, 2017 and Madrid, Spain, 2017 are already added to data/static_inputs.

Provide your own weather data

As an alternative oemof feedinlib provides a jupyter notebook with instructions on how to download data for a single coordinate or a region.

Add a sensitivy to your simulations

If you want to add a sensitivity to your simulation by varying one parameter, you can use the loop_mvs() or loop_pvcompare() functionality, depending on whether the parameter you want to vary is a pvcompare or a MVS parameter.

The following pvcompare parameters can be varied:

  • location (country, lat, lon)

  • year (e.g. 2018)

  • storeys (number of storeys of the buildings)

  • technology (PV technologies: si, cpv or psi)

  • hp_temp (upper bound temperature of the heat pump (external outlet temperature at the condenser))

Further, all MVS parameters can be varied by specifying the csv file, the column name and the parameter name to be changed in loop_mvs() . Please note that in each sensitivity analysis only one parameter can be varied.

For more information see loop_mvs() and loop_pvcompare().