Solar

  • File name: solar.py

  • Last edited: 2020-06-30

  • Created by: Stefan Bruche (TU Berlin)

The solar classes SolarData, SolarThermalCollector, and PVSystem provide functionality to model feed-in time series data for solar components (thermal and electrical) at a certain location and with specific tilt and azimuth angles.

Note

The solar classes require the availability of the Python module pvlib. The module is not provided with the standard installation of aristopy. If you want to use the solar classes, consider installing the module in your current environment, e.g. via:

>> pip install pvlib

For further information and an installation guide, users are referred to the pvlib documentation.

SolarData

class aristopy.solar.SolarData(ghi, dhi, latitude, longitude, altitude=0, dni=None)[source]

Class to provide solar input data for PV or solar thermal calculations.

The main output is accessed via function “get_plane_of_array_irradiance” for the POA data with specified surface tilt and azimuth values and “get_irradiance_dataframe” for a pandas DataFrame consisting of GHI, DHI and DNI values at the specified location and time index.

Parameters
  • ghi – Pandas series (with datetime index and time zone) for global horizontal irradiation data at the respective location.

  • dhi – Pandas series (with datetime index and time zone) for diffuse horizontal irradiation data at the respective location.

  • latitude – Latitude value (float, int) for respective location.

  • longitude – Longitude value (float, int) for respective location.

  • altitude – Altitude value (float, int) for respective location.

  • dni – Pandas series (with datetime index and time zone) for direct normal (beam) irradiation data at the respective location. Is calculated from GHI and DHI if not provided here.

property ghi
property data_index
property dhi
property dni
property location
get_dni()[source]
get_plane_of_array_irradiance(surface_tilt, surface_azimuth, **kwargs)[source]

Calculate and return the plane of array irradiance (POA).

Parameters
  • surface_tilt – tilt of the modules (0=horizontal, 90=vertical)

  • surface_azimuth – module azimuth angle (180=facing south)

  • kwargs – Option to specify more keyword arguments, e.g, ‘albedo’ or ‘surface_type’. Search for method ‘get_total_irradiance’ in the documentation of pvlib for further information.

Returns

pandas DataFrame with POA (‘poa_global’, …)

get_irradiance_dataframe()[source]

Create and return a pandas DataFrame consisting of global (GHI) and diffuse horizontal (DHI) and direct normal irradiation (DNI).

Returns

pandas DataFrame with column names ‘ghi’, ‘dhi’, ‘dni’

SolarThermalCollector

class aristopy.solar.SolarThermalCollector(**kwargs)[source]

Required input arguments (either while creating the class object or while calling function ‘get_collector_heat_output’.

  • ‘optical_efficiency’: Opt. eff of the collector (float, int)

  • ‘thermal_loss_parameter_1’: Th. loss of the collector (float, int)

  • ‘thermal_loss_parameter_2’: Th. loss of the collector (float, int)
    => See equation in: V.Quaschning, ‘Regenerative Energiesysteme’, 10th edition, Hanser, 2019, p.131ff.

  • ‘irradiance_data’: Irradiance (POA) on collector array (pd.Series)

  • ‘t_ambient’: Ambient temperature (float, int, pd.Series)

  • ‘t_collector_in’: Collector inlet temperature (float, int, pd.Series)

  • ‘t_collector_out’: Collector outlet temp. (float, int, pd.Series)

property t_collector_in
property t_collector_out
property irradiance_data
property optical_efficiency
property thermal_loss_parameter_1
property thermal_loss_parameter_2
property t_ambient
get_collector_heat_output(**kwargs)[source]

Required input arguments (either while creating the class object or while calling function ‘get_collector_heat_output’.

  • ‘optical_efficiency’: Opt. eff of the collector (float, int)

  • ‘thermal_loss_parameter_1’: Th. loss of the collector (float, int)

  • ‘thermal_loss_parameter_2’: Th. loss of the collector (float, int)
    => See equation in: V.Quaschning, ‘Regenerative Energiesysteme’, 10th edition, Hanser, 2019, p.131ff.

  • ‘irradiance_data’: Irradiance (POA) on collector array (pd.Series)

  • ‘t_ambient’: Ambient temperature (float, int, pd.Series)

  • ‘t_collector_in’: Collector inlet temperature (float, int, pd.Series)

  • ‘t_collector_out’: Collector outlet temp. (float, int, pd.Series)

Returns

pandas Series of provided collector heat output

PVSystem

class aristopy.solar.PVSystem(module, inverter)[source]

PVSystem class holds a type of PV module and PV inverter.

The main class function is “get_feedin”, to get the power feedin for a PV plant with specified module, inverter, tilt and azimuth angle, location and weather data.

Parameters
  • module – Name of the module as in PVLib Database. To see the full database type e.g. “pvlib.pvsystem.retrieve_sam(name=’cecmod’)”

  • inverter – Name of the inverter as in PVLib Database. To see the database type e.g. “pvlib.pvsystem.retrieve_sam(name=’cecinverter’)”

property module
property module_parameters
property inverter
property inverter_parameters
property mode
property location
property area

Get area of the PV system in \(m^2\)

Returns

PV System area

property peak_power

PV system peak power [W] can be limited by the inverter or the modules (minimum). If DC mode is selected the inverter is not considered.

Returns

Peak power of the PV System

set_location(latitude, longitude, altitude)[source]
get_feedin(weather, surface_tilt, surface_azimuth, scaling=None, mode='ac', **kwargs)[source]
Parameters
  • weather – requires pandas DataFrame with at least two out of three column names: ‘ghi’, ‘dhi’, ‘dni’. Additionally users can specify column names ‘wind_speed’ and ‘temp_air’ (used in calc. of losses)

  • surface_tilt – tilt of the PV modules (0=horizontal, 90=vertical)

  • surface_azimuth – module azimuth angle (180=facing south)

  • scaling

    1. None=no feed-in scaling [W],

    2. ’area’=scale feed-in to area [W/m2],

    3. ’peak_power’=scale feed-in to nominal power [-]

  • mode

    1. ‘ac’: return AC feed-in (including inverter),

    2. ’dc’: return DC feed-in (excluding inverter)

  • kwargs – Examples for kwargs are ‘albedo’, ‘modules_per_string’, ‘strings_per_inverter’, ‘temperature_model_parameters’, …

Returns

pandas DataFrame with POA (‘poa_global’, …)