Skip to content

add temperature.sapm_cell_from_module #938

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Apr 7, 2020
1 change: 1 addition & 0 deletions docs/sphinx/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ PV temperature models

temperature.sapm_cell
temperature.sapm_module
temperature.sapm_cell_from_module
temperature.pvsyst_cell
temperature.faiman

Expand Down
4 changes: 3 additions & 1 deletion docs/sphinx/source/whatsnew/v0.7.2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ Enhancements
``temperature_model='faiman'`` option to :py:class:`~pvlib.modelchain.ModelChain`
(:pull:`897`) (:issue:`836`).
* Add Kimber soiling model :py:func:`pvlib.losses.soiling_kimber`. (:pull:`860`)
* Add :func:`~pvlib.iotools.read_pvgis_tmy` for files downloaded using the
* Add :py:func:`~pvlib.iotools.read_pvgis_tmy` for files downloaded using the
PVGIS tool. (:issue:`880`)
* Add :py:func:`~pvlib.temperature.sapm_cell_from_module` to convert back-of-
module temperature to cell temperature (:issue:`927`)

Bug fixes
~~~~~~~~~
Expand Down
73 changes: 70 additions & 3 deletions pvlib/temperature.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def _temperature_model_params(model, parameter_set):
def sapm_cell(poa_global, temp_air, wind_speed, a, b, deltaT,
irrad_ref=1000):
r'''
Calculate cell temperature per the Sandia PV Array Performance Model.
Calculate cell temperature per the Sandia Array Performance Model.

See [1]_ for details on the Sandia Array Performance Model.

Expand Down Expand Up @@ -116,12 +116,13 @@ def sapm_cell(poa_global, temp_air, wind_speed, a, b, deltaT,
'''
module_temperature = sapm_module(poa_global, temp_air, wind_speed,
a, b)
return module_temperature + (poa_global / irrad_ref) * deltaT
return sapm_cell_from_module(module_temperature, poa_global, deltaT,
irrad_ref)


def sapm_module(poa_global, temp_air, wind_speed, a, b):
r'''
Calculate module back surface temperature per the Sandia PV Array
Calculate module back surface temperature per the Sandia Array
Performance Model.

See [1]_ for details on the Sandia Array Performance Model.
Expand Down Expand Up @@ -186,6 +187,72 @@ def sapm_module(poa_global, temp_air, wind_speed, a, b):
return poa_global * np.exp(a + b * wind_speed) + temp_air


def sapm_cell_from_module(module_temperature, poa_global, deltaT,
irrad_ref=1000):
r'''
Calculate cell temperature from module temperature using the Sandia Array
Performance Model.

See [1]_ for details on the Sandia Array Performance Model.

Parameters
----------
module_temperature : numeric
Temperature of back of module surface [C].

poa_global : numeric
Total incident irradiance [W/m^2].

deltaT : float
Parameter :math:`\Delta T` in :eq:`sapm2` [C].

irrad_ref : float, default 1000
Reference irradiance, parameter :math:`E_{0}` in
:eq:`sapm2` [W/m^2].

Returns
-------
numeric, values in degrees C.

Notes
-----
The model for cell temperature :math:`T_{C}` is given by Eq. 12 in [1]_.

.. math::
:label: sapm2

T_{C} = T_{m} + \frac{E}{E_{0}} \Delta T

The module back surface temperature :math:`T_{m}` is implemented in
:py:func:`~pvlib.temperature.sapm_module`.

Model parameters depend both on
the module construction and its mounting. Parameter sets are provided in
[1]_ for representative modules and mounting, and are coded for convenience
in ``pvlib.temperature.TEMPERATURE_MODEL_PARAMETERS``.

+---------------+----------------+-------+---------+---------------------+
| Module | Mounting | a | b | :math:`\Delta T [C]`|
+===============+================+=======+=========+=====================+
| glass/glass | open rack | -3.47 | -0.0594 | 3 |
+---------------+----------------+-------+---------+---------------------+
| glass/glass | close roof | -2.98 | -0.0471 | 1 |
+---------------+----------------+-------+---------+---------------------+
| glass/polymer | open rack | -3.56 | -0.075 | 3 |
+---------------+----------------+-------+---------+---------------------+
| glass/polymer | insulated back | -2.81 | -0.0455 | 0 |
+---------------+----------------+-------+---------+---------------------+

References
----------
.. [1] King, D. et al, 2004, "Sandia Photovoltaic Array Performance
Model", SAND Report 3535, Sandia National Laboratories, Albuquerque,
NM.

'''
return module_temperature + (poa_global / irrad_ref) * deltaT


def pvsyst_cell(poa_global, temp_air, wind_speed=1.0, u_c=29.0, u_v=0.0,
eta_m=0.1, alpha_absorption=0.9):
r"""
Expand Down
6 changes: 6 additions & 0 deletions pvlib/tests/test_temperature.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ def test_sapm_module(sapm_default):
assert_allclose(default, 40.809, 3)


def test_sapm_cell_from_module(sapm_default):
default = temperature.sapm_cell_from_module(50, 900,
sapm_default['deltaT'])
assert_allclose(default, 50 + 900 / 1000 * sapm_default['deltaT'])


def test_sapm_ndarray(sapm_default):
temps = np.array([0, 10, 5])
irrads = np.array([0, 500, 0])
Expand Down