From 2cf2583292ced2db6c5070ab669d823d17a2f521 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Fri, 30 Aug 2024 17:39:05 +0100 Subject: [PATCH 01/11] references, variable definition, notes section --- pvlib/irradiance.py | 53 ++++++++++++++++++++++++++++----------------- 1 file changed, 33 insertions(+), 20 deletions(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index 435c318562..3e1d743f84 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -850,15 +850,10 @@ def haydavies(surface_tilt, surface_azimuth, dhi, dni, dni_extra, def reindl(surface_tilt, surface_azimuth, dhi, dni, ghi, dni_extra, solar_zenith, solar_azimuth): r''' - Determine diffuse irradiance from the sky on a tilted surface using - Reindl's 1990 model - - .. math:: - - I_{d} = DHI \left(A R_b + (1 - A) \left(\frac{1 + \cos\beta}{2}\right) - \left(1 + \sqrt{\frac{I_{hb}}{I_h}} \sin^3(\beta/2)\right) \right) + Determine the diffuse irradiance from the sky on a tilted surface using + the Reindl (1990) model [1, 2]_. - Reindl's 1990 model determines the diffuse irradiance from the sky + The Reindl model determines the diffuse irradiance from the sky (ground reflected irradiance is not included in this algorithm) on a tilted surface using the surface tilt angle, surface azimuth angle, diffuse horizontal irradiance, direct normal irradiance, global @@ -904,23 +899,41 @@ def reindl(surface_tilt, surface_azimuth, dhi, dni, ghi, dni_extra, Notes ----- - The poa_sky_diffuse calculation is generated from the Loutzenhiser et al. - (2007) paper, equation 8. Note that I have removed the beam and ground - reflectance portion of the equation and this generates ONLY the diffuse - radiation from the sky and circumsolar, so the form of the equation - varies slightly from equation 8. + The Reindl (1990) model for the sky diffuse irradiance, :math:`I_d`, is as + follows: + + .. math:: + + I_{d} = DHI \left(A \cdot R_b + (1 - A) + \left(\frac{1 + \cos\theta_T}{2}\right) + \left(1 + \sqrt{\frac{BHI}{GHI}} \sin^3(\theta_T/2)\right) \right). + + :math:`DHI`, :math:`BHI`, and :math:`GHI` are the diffuse, beam (direct) + and global horizontal irradiances, respectively. :math:`A` is the + anisotropy index, which is the ratio of the direct normal irradiance to the + extraterrestrial irradiation, :math:`R_b` is the projection ratio, which is + defined as the cosine of the ratio of angle of incidence (AOI) to the + cosine of the zenith angle, and :math:`\theta_T` is the tilt angle of the + array. + + The poa_sky_diffuse calculation is generated from Loutzenhiser et al. + (2007) [3]_, Equation 8. The beam and ground reflectance portion of the + equation have been removed, therefore the model described here generates + ONLY the diffuse radiation from the sky and circumsolar, so the form of the + equation varies slightly from Equation 8 in [3]_. References ---------- - .. [1] Loutzenhiser P.G. et. al. "Empirical validation of models to - compute solar irradiance on inclined surfaces for building energy - simulation" 2007, Solar Energy vol. 81. pp. 254-267 - - .. [2] Reindl, D.T., Beckmann, W.A., Duffie, J.A., 1990a. Diffuse + .. [1] Reindl, D. T., Beckmann, W. A., Duffie, J. A., 1990a. Diffuse fraction correlations. Solar Energy 45(1), 1-7. - - .. [3] Reindl, D.T., Beckmann, W.A., Duffie, J.A., 1990b. Evaluation of + :doi:`10.1016/0038-092X(90)90060-P` + .. [2] Reindl, D. T., Beckmann, W. A., Duffie, J. A., 1990b. Evaluation of hourly tilted surface radiation models. Solar Energy 45(1), 9-17. + :doi:'10.1016/0038-092X(90)90061-G' + .. [3] Loutzenhiser P. G. et. al. "Empirical validation of models to + compute solar irradiance on inclined surfaces for building energy + simulation" 2007, Solar Energy vol. 81. pp. 254-267 + :doi:'10.1016/j.solener.2006.03.009' ''' cos_tt = aoi_projection(surface_tilt, surface_azimuth, From 83a683a338301bbe29689911d2a7c5e6c540289b Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Fri, 30 Aug 2024 17:46:36 +0100 Subject: [PATCH 02/11] Update irradiance.py --- pvlib/irradiance.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index 3e1d743f84..2b769d10bc 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -879,7 +879,7 @@ def reindl(surface_tilt, surface_azimuth, dhi, dni, ghi, dni_extra, direct normal irradiance in W/m^2. ghi: numeric - Global irradiance in W/m^2. + Global horizontal irradiance in W/m^2. dni_extra : numeric Extraterrestrial normal irradiance in W/m^2. @@ -912,11 +912,11 @@ def reindl(surface_tilt, surface_azimuth, dhi, dni, ghi, dni_extra, and global horizontal irradiances, respectively. :math:`A` is the anisotropy index, which is the ratio of the direct normal irradiance to the extraterrestrial irradiation, :math:`R_b` is the projection ratio, which is - defined as the cosine of the ratio of angle of incidence (AOI) to the + defined as the cosine of the ratio of angle of incidence to the cosine of the zenith angle, and :math:`\theta_T` is the tilt angle of the array. - The poa_sky_diffuse calculation is generated from Loutzenhiser et al. + The ``poa_sky_diffuse`` calculation is generated from Loutzenhiser et al. (2007) [3]_, Equation 8. The beam and ground reflectance portion of the equation have been removed, therefore the model described here generates ONLY the diffuse radiation from the sky and circumsolar, so the form of the From 1773149d19d3f257424e8af29d1f650f2de2060a Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Wed, 25 Sep 2024 19:01:44 +0100 Subject: [PATCH 03/11] Update irradiance.py --- pvlib/irradiance.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index 2b769d10bc..1e938787e5 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -851,13 +851,13 @@ def reindl(surface_tilt, surface_azimuth, dhi, dni, ghi, dni_extra, solar_zenith, solar_azimuth): r''' Determine the diffuse irradiance from the sky on a tilted surface using - the Reindl (1990) model [1, 2]_. + the Reindl (1990) model. - The Reindl model determines the diffuse irradiance from the sky + The Reindl model [1]_ [2]_ determines the diffuse irradiance from the sky (ground reflected irradiance is not included in this algorithm) on a tilted surface using the surface tilt angle, surface azimuth angle, diffuse horizontal irradiance, direct normal irradiance, global - horizontal irradiance, extraterrestrial irradiance, sun zenith + horizontal irradiance, extraterrestrial normal irradiance, sun zenith angle, and sun azimuth angle. Parameters @@ -899,8 +899,8 @@ def reindl(surface_tilt, surface_azimuth, dhi, dni, ghi, dni_extra, Notes ----- - The Reindl (1990) model for the sky diffuse irradiance, :math:`I_d`, is as - follows: + The Reindl (1990) model for the sky diffuse irradiance, + :math:`I_d`, is as follows: .. math:: @@ -1268,8 +1268,8 @@ def _f(i, j, zeta): [+0.328, +0.471, -0.216, +0.069, -0.105, -0.028], [+0.557, +0.241, -0.300, +0.086, -0.085, -0.012], [+0.861, -0.323, -0.355, +0.240, -0.467, -0.008], - [ 1.212, -1.239, -0.444, +0.305, -0.797, +0.047], - [ 1.099, -1.847, -0.365, +0.275, -1.132, +0.124], + [1.212, -1.239, -0.444, +0.305, -0.797, +0.047], + [1.099, -1.847, -0.365, +0.275, -1.132, +0.124], [+0.544, +0.157, -0.213, +0.118, -1.455, +0.292], [+0.544, +0.157, -0.213, +0.118, -1.455, +0.292], [+0.000, +0.000, +0.000, +0.000, +0.000, +0.000], From e2fcc851953ec6a29b5221051c69b01933c9b478 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Wed, 25 Sep 2024 19:08:58 +0100 Subject: [PATCH 04/11] Update irradiance.py consistent reference style --- pvlib/irradiance.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index b922bbd255..31aacf4da8 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -942,11 +942,11 @@ def reindl(surface_tilt, surface_azimuth, dhi, dni, ghi, dni_extra, :doi:`10.1016/0038-092X(90)90060-P` .. [2] Reindl, D. T., Beckmann, W. A., Duffie, J. A., 1990b. Evaluation of hourly tilted surface radiation models. Solar Energy 45(1), 9-17. - :doi:'10.1016/0038-092X(90)90061-G' - .. [3] Loutzenhiser P. G. et. al. "Empirical validation of models to + :doi:`10.1016/0038-092X(90)90061-G` + .. [3] Loutzenhiser P. G. et. al., 2007. Empirical validation of models to compute solar irradiance on inclined surfaces for building energy - simulation" 2007, Solar Energy vol. 81. pp. 254-267 - :doi:'10.1016/j.solener.2006.03.009' + simulation. Solar Energy 81(2), 254-267 + :doi:`10.1016/j.solener.2006.03.009` ''' cos_tt = aoi_projection(surface_tilt, surface_azimuth, From ac586479e1d99df6126c7232ac4e403ea5ede140 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Wed, 25 Sep 2024 19:10:55 +0100 Subject: [PATCH 05/11] Update irradiance.py add date to sentence --- pvlib/irradiance.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index 31aacf4da8..df2911be61 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -866,9 +866,9 @@ def reindl(surface_tilt, surface_azimuth, dhi, dni, ghi, dni_extra, Determine the diffuse irradiance from the sky on a tilted surface using the Reindl (1990) model. - The Reindl model [1]_ [2]_ determines the diffuse irradiance from the sky - (ground reflected irradiance is not included in this algorithm) on a - tilted surface using the surface tilt angle, surface azimuth angle, + The Reindl (1990) model [1]_ [2]_ determines the diffuse irradiance from + the sky (ground reflected irradiance is not included in this algorithm) on + a tilted surface using the surface tilt angle, surface azimuth angle, diffuse horizontal irradiance, direct normal irradiance, global horizontal irradiance, extraterrestrial normal irradiance, sun zenith angle, and sun azimuth angle. From a800066f30635c39a7eb9478b1c81f08d64ba4bc Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Wed, 25 Sep 2024 19:55:23 +0100 Subject: [PATCH 06/11] R_b definition --- pvlib/irradiance.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index df2911be61..a8c47c7a02 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -925,7 +925,7 @@ def reindl(surface_tilt, surface_azimuth, dhi, dni, ghi, dni_extra, and global horizontal irradiances, respectively. :math:`A` is the anisotropy index, which is the ratio of the direct normal irradiance to the extraterrestrial irradiation, :math:`R_b` is the projection ratio, which is - defined as the cosine of the ratio of angle of incidence to the + defined as the ratio of the cosine of the angle of incidence (AOI) to the cosine of the zenith angle, and :math:`\theta_T` is the tilt angle of the array. From 4b78046b20e1f0c926f61581382fb6fd4644daa0 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Thu, 3 Oct 2024 12:41:27 +0100 Subject: [PATCH 07/11] Update v0.11.2.rst --- docs/sphinx/source/whatsnew/v0.11.2.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/sphinx/source/whatsnew/v0.11.2.rst b/docs/sphinx/source/whatsnew/v0.11.2.rst index 918dcc18d1..c59edde4c7 100644 --- a/docs/sphinx/source/whatsnew/v0.11.2.rst +++ b/docs/sphinx/source/whatsnew/v0.11.2.rst @@ -16,7 +16,8 @@ Documentation ~~~~~~~~~~~~~ * Edited docstrings for :py:func:`~pvlib.pvsystem.dc_ohms_from_percent` and :py:func:`~pvlib.pvsystem.dc_ohmic_losses` for clarity. (:issue:`1601`, :pull:`2229`) - +* Updated :py:func:`~pvlib.irradiance.reindle` to include equation variable + definitions and a new "notes" section (:issue:`2183`, :pull:`2193`) Testing ~~~~~~~ @@ -29,4 +30,5 @@ Requirements Contributors ~~~~~~~~~~~~ * Cliff Hansen (:ghuser:`cwhanse`) +* Rajiv Daxini (:ghuser:`RDaxini`) From 24f82df216efd1dafe6806ff28035efeeb7390a0 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Thu, 3 Oct 2024 16:02:56 +0100 Subject: [PATCH 08/11] Apply suggestions from code review Thanks for the review Co-authored-by: Cliff Hansen --- docs/sphinx/source/whatsnew/v0.11.2.rst | 4 ++-- pvlib/irradiance.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/sphinx/source/whatsnew/v0.11.2.rst b/docs/sphinx/source/whatsnew/v0.11.2.rst index c59edde4c7..81d36fda64 100644 --- a/docs/sphinx/source/whatsnew/v0.11.2.rst +++ b/docs/sphinx/source/whatsnew/v0.11.2.rst @@ -16,8 +16,8 @@ Documentation ~~~~~~~~~~~~~ * Edited docstrings for :py:func:`~pvlib.pvsystem.dc_ohms_from_percent` and :py:func:`~pvlib.pvsystem.dc_ohmic_losses` for clarity. (:issue:`1601`, :pull:`2229`) -* Updated :py:func:`~pvlib.irradiance.reindle` to include equation variable - definitions and a new "notes" section (:issue:`2183`, :pull:`2193`) +* Updated :py:func:`~pvlib.irradiance.reindl` to include definitions of terms + and a new "notes" section (:issue:`2183`, :pull:`2193`) Testing ~~~~~~~ diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index bc2720ed33..35928181cc 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -875,7 +875,7 @@ def reindl(surface_tilt, surface_azimuth, dhi, dni, ghi, dni_extra, the Reindl (1990) model. The Reindl (1990) model [1]_ [2]_ determines the diffuse irradiance from - the sky (ground reflected irradiance is not included in this algorithm) on + the sky on a tilted surface using the surface tilt angle, surface azimuth angle, diffuse horizontal irradiance, direct normal irradiance, global horizontal irradiance, extraterrestrial normal irradiance, sun zenith @@ -933,11 +933,11 @@ def reindl(surface_tilt, surface_azimuth, dhi, dni, ghi, dni_extra, and global horizontal irradiances, respectively. :math:`A` is the anisotropy index, which is the ratio of the direct normal irradiance to the extraterrestrial irradiation, :math:`R_b` is the projection ratio, which is - defined as the ratio of the cosine of the angle of incidence (AOI) to the + the ratio of the cosine of the angle of incidence (AOI) to the cosine of the zenith angle, and :math:`\theta_T` is the tilt angle of the array. - The ``poa_sky_diffuse`` calculation is generated from Loutzenhiser et al. + Implementation is based on Loutzenhiser et al. (2007) [3]_, Equation 8. The beam and ground reflectance portion of the equation have been removed, therefore the model described here generates ONLY the diffuse radiation from the sky and circumsolar, so the form of the From fce529c62bf7b8cdac76246f2d15f87d2bf26cc3 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Thu, 3 Oct 2024 16:13:21 +0100 Subject: [PATCH 09/11] extraterrestrial -> direct extraterrestrial as per the paper (variable I_on) --- pvlib/irradiance.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index bc2720ed33..0aa29b743d 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -932,10 +932,10 @@ def reindl(surface_tilt, surface_azimuth, dhi, dni, ghi, dni_extra, :math:`DHI`, :math:`BHI`, and :math:`GHI` are the diffuse, beam (direct) and global horizontal irradiances, respectively. :math:`A` is the anisotropy index, which is the ratio of the direct normal irradiance to the - extraterrestrial irradiation, :math:`R_b` is the projection ratio, which is - defined as the ratio of the cosine of the angle of incidence (AOI) to the - cosine of the zenith angle, and :math:`\theta_T` is the tilt angle of the - array. + direct extraterrestrial irradiation, :math:`R_b` is the projection ratio, + which is defined as the ratio of the cosine of the angle of incidence (AOI) + to the cosine of the zenith angle, and :math:`\theta_T` is the tilt angle + of the array. The ``poa_sky_diffuse`` calculation is generated from Loutzenhiser et al. (2007) [3]_, Equation 8. The beam and ground reflectance portion of the From 378ee46d81652c8e5a286027554f82d4b9cb02ac Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Thu, 3 Oct 2024 16:18:18 +0100 Subject: [PATCH 10/11] clarify horizontal irradiances definition --- pvlib/irradiance.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index 0aa29b743d..411b38f344 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -929,13 +929,13 @@ def reindl(surface_tilt, surface_azimuth, dhi, dni, ghi, dni_extra, \left(\frac{1 + \cos\theta_T}{2}\right) \left(1 + \sqrt{\frac{BHI}{GHI}} \sin^3(\theta_T/2)\right) \right). - :math:`DHI`, :math:`BHI`, and :math:`GHI` are the diffuse, beam (direct) - and global horizontal irradiances, respectively. :math:`A` is the - anisotropy index, which is the ratio of the direct normal irradiance to the - direct extraterrestrial irradiation, :math:`R_b` is the projection ratio, - which is defined as the ratio of the cosine of the angle of incidence (AOI) - to the cosine of the zenith angle, and :math:`\theta_T` is the tilt angle - of the array. + :math:`DHI`, :math:`BHI`, and :math:`GHI` are the diffuse horizontal, beam + (direct) horizontal and global horizontal irradiances, respectively. + :math:`A` is the anisotropy index, which is the ratio of the direct normal + irradiance to the direct extraterrestrial irradiation, :math:`R_b` is the + projection ratio, which is defined as the ratio of the cosine of the angle + of incidence (AOI) to the cosine of the zenith angle, and :math:`\theta_T` + is the tilt angle of the array. The ``poa_sky_diffuse`` calculation is generated from Loutzenhiser et al. (2007) [3]_, Equation 8. The beam and ground reflectance portion of the From ccc3d4b50b987393f4399c2c91c45cdc3dfd4ab4 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Thu, 3 Oct 2024 16:18:49 +0100 Subject: [PATCH 11/11] theta_T->beta --- pvlib/irradiance.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index 411b38f344..c72782cfc9 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -926,15 +926,15 @@ def reindl(surface_tilt, surface_azimuth, dhi, dni, ghi, dni_extra, .. math:: I_{d} = DHI \left(A \cdot R_b + (1 - A) - \left(\frac{1 + \cos\theta_T}{2}\right) - \left(1 + \sqrt{\frac{BHI}{GHI}} \sin^3(\theta_T/2)\right) \right). + \left(\frac{1 + \cos\beta}{2}\right) + \left(1 + \sqrt{\frac{BHI}{GHI}} \sin^3(\beta/2)\right) \right). :math:`DHI`, :math:`BHI`, and :math:`GHI` are the diffuse horizontal, beam (direct) horizontal and global horizontal irradiances, respectively. :math:`A` is the anisotropy index, which is the ratio of the direct normal irradiance to the direct extraterrestrial irradiation, :math:`R_b` is the projection ratio, which is defined as the ratio of the cosine of the angle - of incidence (AOI) to the cosine of the zenith angle, and :math:`\theta_T` + of incidence (AOI) to the cosine of the zenith angle, and :math:`\beta` is the tilt angle of the array. The ``poa_sky_diffuse`` calculation is generated from Loutzenhiser et al.