|
| 1 | +# -*- coding: utf-8 -*- |
| 2 | +""" |
| 3 | +Created on Fri Mar 29 09:40:42 2019 |
| 4 | +
|
| 5 | +@author: cwhanse |
| 6 | +""" |
| 7 | + |
| 8 | +import numpy as np |
| 9 | +import pandas as pd |
| 10 | + |
| 11 | + |
| 12 | +TEMP_MODEL_PARAMS = { |
| 13 | + 'sapm': {'open_rack_cell_glassback': (-3.47, -.0594, 3), |
| 14 | + 'roof_mount_cell_glassback': (-2.98, -.0471, 1), |
| 15 | + 'open_rack_cell_polymerback': (-3.56, -.0750, 3), |
| 16 | + 'insulated_back_polymerback': (-2.81, -.0455, 0), |
| 17 | + 'open_rack_polymer_thinfilm_steel': (-3.58, -.113, 3), |
| 18 | + '22x_concentrator_tracker': (-3.23, -.130, 13)}, |
| 19 | + 'pvsyst': {'freestanding': (29.0, 0), 'insulated': (15.0, 0)} |
| 20 | +} |
| 21 | + |
| 22 | + |
| 23 | +def sapm(poa_global, wind_speed, temp_air, model='open_rack_cell_glassback'): |
| 24 | + ''' |
| 25 | + Estimate cell and module temperatures per the Sandia PV Array |
| 26 | + Performance Model (SAPM, SAND2004-3535), from the incident |
| 27 | + irradiance, wind speed, ambient temperature, and SAPM module |
| 28 | + parameters. |
| 29 | +
|
| 30 | + Parameters |
| 31 | + ---------- |
| 32 | + poa_global : float or Series |
| 33 | + Total incident irradiance in W/m^2. |
| 34 | +
|
| 35 | + wind_speed : float or Series |
| 36 | + Wind speed in m/s at a height of 10 meters. |
| 37 | +
|
| 38 | + temp_air : float or Series |
| 39 | + Ambient dry bulb temperature in degrees C. |
| 40 | +
|
| 41 | + model : string, list, or dict, default 'open_rack_cell_glassback' |
| 42 | + Model to be used. |
| 43 | +
|
| 44 | + If string, can be: |
| 45 | +
|
| 46 | + * 'open_rack_cell_glassback' (default) |
| 47 | + * 'roof_mount_cell_glassback' |
| 48 | + * 'open_rack_cell_polymerback' |
| 49 | + * 'insulated_back_polymerback' |
| 50 | + * 'open_rack_polymer_thinfilm_steel' |
| 51 | + * '22x_concentrator_tracker' |
| 52 | +
|
| 53 | + If dict, supply the following parameters |
| 54 | + (if list, in the following order): |
| 55 | +
|
| 56 | + * a : float |
| 57 | + SAPM module parameter for establishing the upper |
| 58 | + limit for module temperature at low wind speeds and |
| 59 | + high solar irradiance. |
| 60 | +
|
| 61 | + * b : float |
| 62 | + SAPM module parameter for establishing the rate at |
| 63 | + which the module temperature drops as wind speed increases |
| 64 | + (see SAPM eqn. 11). |
| 65 | +
|
| 66 | + * deltaT : float |
| 67 | + SAPM module parameter giving the temperature difference |
| 68 | + between the cell and module back surface at the |
| 69 | + reference irradiance, E0. |
| 70 | +
|
| 71 | + Returns |
| 72 | + -------- |
| 73 | + DataFrame with columns 'temp_cell' and 'temp_module'. |
| 74 | + Values in degrees C. |
| 75 | +
|
| 76 | + References |
| 77 | + ---------- |
| 78 | + [1] King, D. et al, 2004, "Sandia Photovoltaic Array Performance |
| 79 | + Model", SAND Report 3535, Sandia National Laboratories, Albuquerque, |
| 80 | + NM. |
| 81 | +
|
| 82 | + See Also |
| 83 | + -------- |
| 84 | + sapm |
| 85 | + ''' |
| 86 | + |
| 87 | + temp_models = TEMP_MODEL_PARAMS['sapm'] |
| 88 | + |
| 89 | + if isinstance(model, str): |
| 90 | + model = temp_models[model.lower()] |
| 91 | + |
| 92 | + elif isinstance(model, (dict, pd.Series)): |
| 93 | + model = [model['a'], model['b'], model['deltaT']] |
| 94 | + |
| 95 | + a = model[0] |
| 96 | + b = model[1] |
| 97 | + deltaT = model[2] |
| 98 | + |
| 99 | + E0 = 1000. # Reference irradiance |
| 100 | + |
| 101 | + temp_module = pd.Series(poa_global * np.exp(a + b * wind_speed) + temp_air) |
| 102 | + |
| 103 | + temp_cell = temp_module + (poa_global / E0) * (deltaT) |
| 104 | + |
| 105 | + return pd.DataFrame({'temp_cell': temp_cell, 'temp_module': temp_module}) |
| 106 | + |
| 107 | + |
| 108 | +def pvsyst(poa_global, temp_air, wind_speed=1.0, eta_m=0.1, |
| 109 | + alpha_absorption=0.9, model_params='freestanding'): |
| 110 | + """ |
| 111 | + Calculate cell temperature using an emperical heat loss factor model |
| 112 | + as implemented in PVsyst. |
| 113 | +
|
| 114 | + The heat loss factors provided through the 'model_params' argument |
| 115 | + represent the combined effect of convection, radiation and conduction, |
| 116 | + and their values are experimentally determined. |
| 117 | +
|
| 118 | + Parameters |
| 119 | + ---------- |
| 120 | + poa_global : numeric |
| 121 | + Total incident irradiance in W/m^2. |
| 122 | +
|
| 123 | + temp_air : numeric |
| 124 | + Ambient dry bulb temperature in degrees C. |
| 125 | +
|
| 126 | + wind_speed : numeric, default 1.0 |
| 127 | + Wind speed in m/s measured at the same height for which the wind loss |
| 128 | + factor was determined. The default value is 1.0, which is the wind |
| 129 | + speed at module height used to determine NOCT. |
| 130 | +
|
| 131 | + eta_m : numeric, default 0.1 |
| 132 | + Module external efficiency as a fraction, i.e., DC power / poa_global. |
| 133 | +
|
| 134 | + alpha_absorption : numeric, default 0.9 |
| 135 | + Absorption coefficient |
| 136 | +
|
| 137 | + model_params : string, tuple, or list (no dict), default 'freestanding' |
| 138 | + Heat loss factors to be used. |
| 139 | +
|
| 140 | + If string, can be: |
| 141 | +
|
| 142 | + * 'freestanding' (default) |
| 143 | + Modules with rear surfaces exposed to open air (e.g. rack |
| 144 | + mounted). |
| 145 | + * 'insulated' |
| 146 | + Modules with rear surfaces in close proximity to another |
| 147 | + surface (e.g. roof mounted). |
| 148 | +
|
| 149 | + If tuple/list, supply parameters in the following order: |
| 150 | +
|
| 151 | + * constant_loss_factor : float |
| 152 | + Combined heat loss factor coefficient. Freestanding |
| 153 | + default is 29, fully insulated arrays is 15. |
| 154 | +
|
| 155 | + * wind_loss_factor : float |
| 156 | + Combined heat loss factor influenced by wind. Default is 0. |
| 157 | +
|
| 158 | + Returns |
| 159 | + ------- |
| 160 | + temp_cell : numeric or Series |
| 161 | + Cell temperature in degrees Celsius |
| 162 | +
|
| 163 | + References |
| 164 | + ---------- |
| 165 | + [1]"PVsyst 6 Help", Files.pvsyst.com, 2018. [Online]. Available: |
| 166 | + http://files.pvsyst.com/help/index.html. [Accessed: 10- Dec- 2018]. |
| 167 | +
|
| 168 | + [2] Faiman, D. (2008). "Assessing the outdoor operating temperature of |
| 169 | + photovoltaic modules." Progress in Photovoltaics 16(4): 307-315. |
| 170 | + """ |
| 171 | + |
| 172 | + pvsyst_presets = TEMP_MODEL_PARAMS['pvsyst'] |
| 173 | + |
| 174 | + if isinstance(model_params, str): |
| 175 | + model_params = model_params.lower() |
| 176 | + constant_loss_factor, wind_loss_factor = pvsyst_presets[model_params] |
| 177 | + elif isinstance(model_params, (tuple, list)): |
| 178 | + constant_loss_factor, wind_loss_factor = model_params |
| 179 | + else: |
| 180 | + raise TypeError( |
| 181 | + "Please provide model_params as a str, or tuple/list." |
| 182 | + ) |
| 183 | + |
| 184 | + total_loss_factor = wind_loss_factor * wind_speed + constant_loss_factor |
| 185 | + heat_input = poa_global * alpha_absorption * (1 - eta_m) |
| 186 | + temp_difference = heat_input / total_loss_factor |
| 187 | + temp_cell = temp_air + temp_difference |
| 188 | + |
| 189 | + return temp_cell |
0 commit comments