pvcompare.main.apply_pvcompare

pvcompare.main.apply_pvcompare(storeys, country=None, latitude=None, longitude=None, year=None, static_inputs_directory=None, user_inputs_pvcompare_directory=None, user_inputs_mvs_directory=None, collections_mvs_inputs_directory=None, plot=False, pv_setup=None, overwrite_grid_parameters=True, overwrite_pv_parameters=True, overwrite_heat_parameters=True, add_weather_file=None, add_sam_si_module=None, add_electricity_demand=None, add_heat_demand=None, add_pv_timeseries=None)[source]

Runs the main functionalities of pvcompare.

Loads weather data for the given year and location, calculates pv feed-in time series, as well as the nominal values /installation capacities based on the building parameters. Additionally, COPs are calculated if a heat pump is added to the energy system.

Parameters
  • storeys (int) – Number of storeys for which the demand is calculated.

  • country – Country of the location. Default: None.

  • latitude (float or None) – Latitude of country location in country. Default: None.

  • longitude (float or None) – Longitude of country location in country. Default: None.

  • year (int) – Year of the simulation. Default: None.

  • static_inputs_directory (str or None) – Path to pvcompare static inputs. If None, constants.DEFAULT_STATIC_INPUTS_DIRECTORY is used. Default: None.

  • user_inputs_pvcompare_directory (str or None) – Path to user input directory. If None, constants.DEFAULT_USER_INPUTS_PVCOMPARE_DIRECTORY is used. Default: None.

  • user_inputs_mvs_directory (str or None) – Path to input directory containing files that describe the energy system and that are an input to MVS. If None, constants.DEFAULT_USER_INPUTS_MVS_DIRECTORY is used. Default: None.

  • collections_mvs_inputs_directory (str or None) – Path to input data collection. Used in overwrite_mvs_energy_production_file(), there if None, it is set to constants.DEFAULT_COLLECTION_MVS_INPUTS_DIRECTORY.

  • plot (bool) – If True, plots of the PV feed-in time series are created in create_pv_components(). Default: False.

  • pv_setup (dict or None) – Specifies the PV technologies and their installation details used in the simulation. The dictionary contains columns: surface_type, technology, surface_azimuth, surface_tilt. A tilt of 0 resembles a vertical orientation. If pv_setup is None, it is loaded from the user_inputs_pvcompare_directory/pv_setup.cvs. Default: None.

  • overwrite_grid_parameters (bool) – If True, the following grid parameters are inserted into the MVS input csvs automatically: electricity price, feed-in tariff, CO2 emissions, renewable share, gas price. Default: True.

  • overwrite_pv_parameters (bool) – If True, the pv components in ‘energyProduction.csv’ are overwritten with default values from ‘data/user_inputs_collection/’ according to the pv plants defined in ‘pv_setup’. Default: True.

  • overwrite_heat_parameters (bool) – If True, existing COP time series of the heat pump will be overwritten with calculated time series of COP and existing fixed thermal losses absolute and relative will be overwritten with calculated time series of fixed thermal losses relative and absolute. Default: True.

  • add_weather_data (str or None) – Path to csv containing hourly weather time series with columns: [time, latitude, longitude ,ghi, wind_speed, temp_air, precipitable_water, dni, dhi] Default: None. If None, the ERA5 data is used instead.

  • add_sam_si_module (dict or None) – Dictionary with library (’CECMod’ or “SandiaMod”) as key and module name as value. E.g. {“cecmod”:’Canadian_Solar_Inc__CS5P_220M’}. Note that the SI module is only considered if there is the technology “SI” in ‘user_inputs/mvs_inputs/pvcompare_inputs/pv_setup.csv’

  • add_electricity_demand (str or None) – Path to precalculated hourly electricity demand time series for one year (or the same period of a precalculated PV timeseries). Default: None Note that that the demand is only considered if a column “Electricity demand” is added to ‘user_inputs/mvs_inputs/csv_elements/energyConsumption.csv’

  • add_heat_demand (str or None) – Path to precalculated hourly heat demand time series for one year (or the same period of a precalculated PV timeseries). Default: None Note that that the demand is only considered is a column “Heat demand” is added to ‘user_inputs/mvs_inputs/csv_elements/energyConsumption.csv’

  • add_pv_timeseries (dict or None) – Dictionary with {“PV1” : [“filename”: >path_to_time_series< , “module_size”: >module_size in m²<, “module_peak_power”: >peak power of the module in kWp<, “surface_type”: >surface_type for PV installation<], “PV2” : […], …}. You can add more than one module time series by defining more PV-keys. The PV time series itself needs to be a normalized hourly time series in kW/kWp (normalized by the peak power of the module). The surface_type can be one of: [ “flat_roof”, “gable_roof”, “south_facade”, “east_facade”, “west_facade”]. Note that you need to add more specific PV parameters of your module (name, costs, lifetime etc.) in user_inputs_mvs_directory/csv_elements/energyProduction.csv. The columns in energyProduction.csv should be named “PV”+ key (e.g. “PV SI1” if your key is “SI1”). When providing your own time series, overwrite_pv_parameters in apply_pvcompare() should be set to False. When add_pv_timeseries is used, the pv_setup.csv is disregarded.

Returns

Saves calculated time series to timeseries folder in user_inputs_mvs_directory and updates csv files in csv_elements folder.

Return type

None