Skip to content

Commit 06f8f6e

Browse files
cwhansewholmgren
andauthored
add temperature.sapm_cell_from_module (#938)
* add temperature.sapm_cell_to_module * add See also to docstring * Update pvlib/temperature.py Co-Authored-By: Will Holmgren <[email protected]> * remove hyphen * remove ~ from function paths Co-authored-by: Will Holmgren <[email protected]>
1 parent 6b03e9d commit 06f8f6e

File tree

4 files changed

+95
-4
lines changed

4 files changed

+95
-4
lines changed

docs/sphinx/source/api.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ PV temperature models
232232

233233
temperature.sapm_cell
234234
temperature.sapm_module
235+
temperature.sapm_cell_from_module
235236
temperature.pvsyst_cell
236237
temperature.faiman
237238

docs/sphinx/source/whatsnew/v0.7.2.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,17 @@ Enhancements
2121
* TMY3 dataframe returned by :py:func:`~pvlib.iotools.read_tmy3` now contains
2222
the original ``Date (MM/DD/YYYY)`` and ``Time (HH:MM)`` columns that the
2323
indices were parsed from. (:pull:`866`)
24-
* Add :py:func:`~pvlib.pvsystem.PVSystem.faiman` and added
24+
* Add :py:func:`pvlib.pvsystem.PVSystem.faiman` and added
2525
``temperature_model='faiman'`` option to :py:class:`~pvlib.modelchain.ModelChain`
2626
(:pull:`897`) (:issue:`836`).
27+
* Add Kimber soiling model :py:func:`pvlib.losses.soiling_kimber`. (:pull:`860`)
28+
* Add :py:func:`pvlib.iotools.read_pvgis_tmy` for files downloaded using the
2729
* Add Kimber soiling model :py:func:`pvlib.soiling.kimber`. (:pull:`860`,
2830
:issue`935`)
2931
* Add :func:`~pvlib.iotools.read_pvgis_tmy` for files downloaded using the
3032
PVGIS tool. (:issue:`880`)
33+
* Add :py:func:`pvlib.temperature.sapm_cell_from_module` to convert back of
34+
module temperature to cell temperature (:issue:`927`)
3135
* Add new module :py:mod:`pvlib.snow` to contain models related to snow coverage and effects on a PV system. (:pull:`764`)
3236
* Add snow coverage model :py:func:`pvlib.snow.coverage_nrel` and function to identify when modules are fully covered by snow :py:func:`pvlib.snow.fully_covered_nrel`. (:issue:`577`)
3337
* Add function :py:func:`pvlib.snow.dc_loss_nrel` for effect of snow coverage on DC output. (:pull:`764`)

pvlib/temperature.py

Lines changed: 83 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def _temperature_model_params(model, parameter_set):
3333
def sapm_cell(poa_global, temp_air, wind_speed, a, b, deltaT,
3434
irrad_ref=1000):
3535
r'''
36-
Calculate cell temperature per the Sandia PV Array Performance Model.
36+
Calculate cell temperature per the Sandia Array Performance Model.
3737
3838
See [1]_ for details on the Sandia Array Performance Model.
3939
@@ -107,6 +107,11 @@ def sapm_cell(poa_global, temp_air, wind_speed, a, b, deltaT,
107107
Model", SAND Report 3535, Sandia National Laboratories, Albuquerque,
108108
NM.
109109
110+
See also
111+
--------
112+
sapm_cell_from_module
113+
sapm_module
114+
110115
Examples
111116
--------
112117
>>> from pvlib.temperature import sapm_cell, TEMPERATURE_MODEL_PARAMETERS
@@ -116,12 +121,13 @@ def sapm_cell(poa_global, temp_air, wind_speed, a, b, deltaT,
116121
'''
117122
module_temperature = sapm_module(poa_global, temp_air, wind_speed,
118123
a, b)
119-
return module_temperature + (poa_global / irrad_ref) * deltaT
124+
return sapm_cell_from_module(module_temperature, poa_global, deltaT,
125+
irrad_ref)
120126

121127

122128
def sapm_module(poa_global, temp_air, wind_speed, a, b):
123129
r'''
124-
Calculate module back surface temperature per the Sandia PV Array
130+
Calculate module back surface temperature per the Sandia Array
125131
Performance Model.
126132
127133
See [1]_ for details on the Sandia Array Performance Model.
@@ -182,10 +188,84 @@ def sapm_module(poa_global, temp_air, wind_speed, a, b):
182188
Model", SAND Report 3535, Sandia National Laboratories, Albuquerque,
183189
NM.
184190
191+
See also
192+
--------
193+
sapm_cell
194+
sapm_cell_from_module
185195
'''
186196
return poa_global * np.exp(a + b * wind_speed) + temp_air
187197

188198

199+
def sapm_cell_from_module(module_temperature, poa_global, deltaT,
200+
irrad_ref=1000):
201+
r'''
202+
Calculate cell temperature from module temperature using the Sandia Array
203+
Performance Model.
204+
205+
See [1]_ for details on the Sandia Array Performance Model.
206+
207+
Parameters
208+
----------
209+
module_temperature : numeric
210+
Temperature of back of module surface [C].
211+
212+
poa_global : numeric
213+
Total incident irradiance [W/m^2].
214+
215+
deltaT : float
216+
Parameter :math:`\Delta T` in :eq:`sapm2` [C].
217+
218+
irrad_ref : float, default 1000
219+
Reference irradiance, parameter :math:`E_{0}` in
220+
:eq:`sapm2` [W/m^2].
221+
222+
Returns
223+
-------
224+
numeric, values in degrees C.
225+
226+
Notes
227+
-----
228+
The model for cell temperature :math:`T_{C}` is given by Eq. 12 in [1]_.
229+
230+
.. math::
231+
:label: sapm2
232+
233+
T_{C} = T_{m} + \frac{E}{E_{0}} \Delta T
234+
235+
The module back surface temperature :math:`T_{m}` is implemented in
236+
:py:func:`~pvlib.temperature.sapm_module`.
237+
238+
Model parameters depend both on the module construction and its mounting.
239+
Parameter sets are provided in [1]_ for representative modules and
240+
mounting, and are coded for convenience in
241+
``pvlib.temperature.TEMPERATURE_MODEL_PARAMETERS``.
242+
243+
+---------------+----------------+-------+---------+---------------------+
244+
| Module | Mounting | a | b | :math:`\Delta T [C]`|
245+
+===============+================+=======+=========+=====================+
246+
| glass/glass | open rack | -3.47 | -0.0594 | 3 |
247+
+---------------+----------------+-------+---------+---------------------+
248+
| glass/glass | close roof | -2.98 | -0.0471 | 1 |
249+
+---------------+----------------+-------+---------+---------------------+
250+
| glass/polymer | open rack | -3.56 | -0.075 | 3 |
251+
+---------------+----------------+-------+---------+---------------------+
252+
| glass/polymer | insulated back | -2.81 | -0.0455 | 0 |
253+
+---------------+----------------+-------+---------+---------------------+
254+
255+
References
256+
----------
257+
.. [1] King, D. et al, 2004, "Sandia Photovoltaic Array Performance
258+
Model", SAND Report 3535, Sandia National Laboratories, Albuquerque,
259+
NM.
260+
261+
See also
262+
--------
263+
sapm_cell
264+
sapm_module
265+
'''
266+
return module_temperature + (poa_global / irrad_ref) * deltaT
267+
268+
189269
def pvsyst_cell(poa_global, temp_air, wind_speed=1.0, u_c=29.0, u_v=0.0,
190270
eta_m=0.1, alpha_absorption=0.9):
191271
r"""

pvlib/tests/test_temperature.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ def test_sapm_module(sapm_default):
2626
assert_allclose(default, 40.809, 3)
2727

2828

29+
def test_sapm_cell_from_module(sapm_default):
30+
default = temperature.sapm_cell_from_module(50, 900,
31+
sapm_default['deltaT'])
32+
assert_allclose(default, 50 + 900 / 1000 * sapm_default['deltaT'])
33+
34+
2935
def test_sapm_ndarray(sapm_default):
3036
temps = np.array([0, 10, 5])
3137
irrads = np.array([0, 500, 0])

0 commit comments

Comments
 (0)