Skip to content
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

ENH: infinite sheds #717

Merged
merged 133 commits into from
Feb 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
133 commits
Select commit Hold shift + click to select a range
865cbfa
WIP: ENH: infinite sheds
mikofski May 10, 2019
2d77d82
DOC: add infinite_sheds to api.rst, docstrings form sky_angle
mikofski May 16, 2019
7b5def1
ENH: functions for infinite sheds
mikofski May 16, 2019
246dd2b
ENH: clean up docstrings, add 4-quad arctan2, add api docs, more get_…
mikofski May 17, 2019
29333dd
DOC: fix latex math, use psi_t for top, psi_b for bottom
mikofski May 17, 2019
51fe74d
STY: don't use get_* for standard functions
mikofski May 19, 2019
0af1fc2
ENH: create class methods to get irradiance, FIXME: front/back poa no…
mikofski May 19, 2019
9690938
TST: add infinite_sheads test, add infinite_sheds to pvlib-api
mikofski May 19, 2019
6d5c2cb
TST: ground illumination test
mikofski May 19, 2019
99fdc69
TST: coerce df to float, replace div/0 with nan
mikofski May 19, 2019
680b700
TST: set atol to 1e-6 to compare to CSV
mikofski May 19, 2019
97d9664
TST: test for shade line
mikofski May 19, 2019
4931446
TST: fix diffuse fraction NaN and Inf, consolidate front+back = 1 test
mikofski May 20, 2019
7ec812b
TST: add tests for sky angle, psi_top
mikofski May 20, 2019
7e97fcb
ENH: STY: fix stickler, ignore binary operator breaks
mikofski May 20, 2019
4a4e22e
add fixmes for ground illumination and ground view factor
mikofski May 24, 2019
3045928
ENH: BUG: DOC: change "ground-illumination" to "unshaded-ground-fract…
mikofski Jul 1, 2019
b2d0496
Merge branch 'master' into infinite_sheds
mikofski Jul 2, 2019
4c2b3cd
Merge branch 'infinite_sheds' of github.com:mikofski/pvlib-python int…
mikofski Jul 2, 2019
135e074
ENH: BUG: calculate angles and VF from ground between panels to sky
mikofski Jul 4, 2019
d32c144
ENH: BUG: remove gcr_prime from vf calc, not used
mikofski Jul 4, 2019
da7611b
BUG: fix view factors formulas
mikofski Jul 4, 2019
fde1851
STY: shorten line in test_infinite_sheds for sum of angles at z1 limit
mikofski Jul 4, 2019
8247fbe
Merge branch 'master' into infinite_sheds
mikofski Jul 10, 2019
f9eb300
DOC: update module docstring with process from Marion, et al.
mikofski Jul 10, 2019
15822ab
BUG: revert changes to ground and sky to pv surface view factors
mikofski Jul 12, 2019
04a4039
ENH: integrate Fgnd-pv and Fsky-z
mikofski Jul 15, 2019
c87148a
Merge branch 'master' into infinite_sheds
mikofski Sep 20, 2019
5453527
Merge branch 'master' into infinite_sheds
mikofski Nov 11, 2019
5798343
Merge branch 'master' into infinite_sheds
mikofski Nov 27, 2019
9ee9486
Merge branch 'infinite_sheds' of github.com:mikofski/pvlib-python int…
mikofski Nov 27, 2019
d4cdd20
Merge branch 'master' into infinite_sheds
mikofski Aug 27, 2020
ae0c651
Merge branch 'master' into infinite_sheds
mikofski Jan 17, 2021
0f08cb7
fix references
mikofski Jan 17, 2021
0559e57
update infinite sheds
mikofski Jan 17, 2021
6db7104
remove discretized angles for fgndsky
mikofski Feb 6, 2021
b211037
don't discretize z
mikofski Feb 8, 2021
d137f04
clarify what next, prev mean
mikofski Feb 8, 2021
6a583cf
clarify what z0 and z1 limits mean
mikofski Feb 8, 2021
089a355
clean up outputs for get_irradiance
mikofski Feb 8, 2021
1671e7e
consolidate solar projection tests
mikofski Feb 8, 2021
6d5776b
use fraction of pvsurface fx
mikofski Feb 9, 2021
2a38dfd
Merge branch 'master' into infinite_sheds
mikofski Feb 9, 2021
2f3ffcf
Merge branch 'master' of https://github.com/pvlib/pvlib-python into i…
cwhanse Oct 4, 2021
dddae59
be quiet stickler
cwhanse Oct 4, 2021
71a6fa0
TODO inserts, docstring edits
cwhanse Oct 5, 2021
2a174dc
re-organize
cwhanse Oct 8, 2021
cd0d114
create test files, move two functions to utils
cwhanse Oct 8, 2021
8f11255
adjust test paths
cwhanse Oct 8, 2021
d2c1448
fix testing
cwhanse Oct 9, 2021
144489f
adjustments to sky_angle_tangent
cwhanse Oct 11, 2021
a55f587
adjustments to get tests to run
cwhanse Nov 12, 2021
b6ee09a
move shade_line to shading.shaded_fraction
cwhanse Nov 12, 2021
517c303
remove shade_line from infinite_sheds
cwhanse Nov 12, 2021
c2fdc56
remove functions that have moved to utils, shading
cwhanse Nov 12, 2021
5aef380
move several functions to private
cwhanse Nov 12, 2021
60ed926
move more functions to private
cwhanse Nov 12, 2021
0d088db
update test_utils.py
cwhanse Nov 16, 2021
e689377
linting
cwhanse Nov 16, 2021
3e45cd4
tilt to surface_tilt, docstring work
cwhanse Nov 16, 2021
80cd517
consolidate some functions, docstring work
cwhanse Nov 17, 2021
9744776
sky diffuse view factors
cwhanse Nov 18, 2021
923a014
finish editing get_irradiance and supporting functions
cwhanse Dec 3, 2021
e62d4a6
rework public functions
cwhanse Dec 6, 2021
cdc4153
formatting
cwhanse Dec 7, 2021
d1d4005
remove old test file
cwhanse Dec 7, 2021
56eb655
add tests for sky_angle functions, remove diffuse_ratio
cwhanse Dec 8, 2021
b6c60b1
more tests, fix error in _sky_angle
cwhanse Dec 9, 2021
66f0350
more tests and docstring work
cwhanse Dec 13, 2021
aae4d12
stickler
cwhanse Dec 13, 2021
76a2066
space, merge upstream
cwhanse Dec 13, 2021
e87cc03
remove old test file, test fixes
cwhanse Dec 13, 2021
2ac6639
test fixes
cwhanse Dec 13, 2021
b556c55
remove axis from linspace usage
cwhanse Dec 13, 2021
a7ee923
documentation
cwhanse Dec 13, 2021
682f23c
docstrings
cwhanse Dec 13, 2021
4b035da
height = 0 and surface_tilt = 0 cases
cwhanse Dec 14, 2021
64a7f95
vectorize _vf_ground_sky
cwhanse Dec 16, 2021
336ad62
overhaul ground to sky view factors, add function to utils
cwhanse Dec 31, 2021
ea5ea20
lint, handle floats
cwhanse Dec 31, 2021
c5a9d61
improve test fixture, remove unused
cwhanse Jan 1, 2022
6156dca
loop over rotations in _vf_ground_sky_integ, test get_irradiance_poa
cwhanse Jan 1, 2022
c574262
more tests
cwhanse Jan 1, 2022
c581c88
lint
cwhanse Jan 1, 2022
b0ba9f5
complete coverage
cwhanse Jan 1, 2022
6127c4f
progress on testing get_irradiance
cwhanse Jan 1, 2022
186d670
more testing
cwhanse Jan 2, 2022
e25a113
whoops
cwhanse Jan 2, 2022
466cde7
Merge branch 'master' of https://github.com/pvlib/pvlib-python into i…
cwhanse Jan 4, 2022
460714a
merge upstream
cwhanse Jan 4, 2022
f0eb172
remove local test hack
cwhanse Jan 4, 2022
3dbed5f
correction to unshaded_ground_fraction
cwhanse Jan 5, 2022
296b137
move pvfactors tests
cwhanse Jan 6, 2022
a9e139a
additional testing
cwhanse Jan 7, 2022
992d428
add max_zenith to unshaded_ground_fraction
cwhanse Jan 7, 2022
0b81a92
docstring work
cwhanse Jan 13, 2022
2bc3a10
use shading function, extend shading.shaded_fraction
cwhanse Jan 13, 2022
49958df
documentation
cwhanse Jan 13, 2022
224e5b4
clarifications, consistent argument order
cwhanse Jan 15, 2022
d71c9cd
fix errors
cwhanse Jan 16, 2022
b084c34
use numeric instead of array-like
cwhanse Jan 16, 2022
3ccd302
docstring sanding
cwhanse Jan 17, 2022
3e16964
more docstring work, reorder arguments for consistency
cwhanse Jan 17, 2022
8adf64e
edits from review
cwhanse Jan 23, 2022
337262c
fix tests
cwhanse Jan 24, 2022
e5fb113
fix test
cwhanse Jan 24, 2022
b316d3b
remove max_rows from public
cwhanse Jan 31, 2022
371c407
move shaded_fraction from shading.py to infinite_sheds private
cwhanse Feb 1, 2022
f161dce
Merge branch 'master' of https://github.com/pvlib/pvlib-python into i…
cwhanse Feb 2, 2022
679731a
move shading_fraction
cwhanse Feb 2, 2022
a90a045
repair test, stickler
cwhanse Feb 2, 2022
6c1f12c
remove axis_azimuth
cwhanse Feb 2, 2022
eff490c
redo tests without axis_azimuth, few corrections
cwhanse Feb 2, 2022
eb6daa7
trailing spaces
cwhanse Feb 2, 2022
525078f
behind the array criteria, return names
cwhanse Feb 3, 2022
1564a40
changes from review
cwhanse Feb 8, 2022
aaa7262
diffuse fraction when ghi is 0
cwhanse Feb 8, 2022
5814085
clean up
cwhanse Feb 8, 2022
d64ea79
Merge branch 'master' of https://github.com/pvlib/pvlib-python into i…
cwhanse Feb 8, 2022
01a5fc1
Merge branch 'master' of https://github.com/pvlib/pvlib-python into i…
cwhanse Feb 11, 2022
5b1357b
Apply suggestions from code review
cwhanse Feb 13, 2022
5d1b778
changes solar_zenith, solar_azimuth names
cwhanse Feb 13, 2022
03c49c0
Update pvlib/bifacial/infinite_sheds.py
cwhanse Feb 13, 2022
764f807
DOI directive in infinite_sheds.get_irradiance
mikofski Feb 14, 2022
da34555
Merge branch 'master' into infinite_sheds
mikofski Feb 17, 2022
5688240
change back to solar_zenith, solar_azimuth
cwhanse Feb 21, 2022
80fb2b6
Merge branch 'infinite_sheds' of https://github.com/mikofski/pvlib-py…
cwhanse Feb 21, 2022
60fa642
rename in test_utils
cwhanse Feb 21, 2022
8bc1d1d
OrderedDict to dict
cwhanse Feb 21, 2022
87d472a
create bifacial.rst
cwhanse Feb 21, 2022
2c9d4c9
Update docs/sphinx/source/user_guide/bifacial.rst
cwhanse Feb 21, 2022
1a7c33c
Apply suggestions from code review
cwhanse Feb 21, 2022
b2c19a7
remove OrderedDict
cwhanse Feb 21, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions docs/sphinx/source/reference/bifacial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
Bifacial
========

Methods for calculating back surface irradiance
Functions for calculating front and back surface irradiance

.. autosummary::
:toctree: generated/

bifacial.pvfactors_timeseries
bifacial.pvfactors.pvfactors_timeseries
bifacial.infinite_sheds.get_irradiance
bifacial.infinite_sheds.get_irradiance_poa
105 changes: 105 additions & 0 deletions docs/sphinx/source/user_guide/bifacial.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
.. _bifacial:

Bifacial modeling
=================

This section reviews the bifacial modeling capabilities of
pvlib-python.

A bifacial module accepts light on both surfaces. Bifacial modules usually have
a front and back surface, with the back surface intended to face away from
the primary source of light. The primary challenge in modeling a PV system
with bifacial modules is estimating the irradiance on the front and back
surfaces.

pvlib-python provides two groups of functions for estimating front and back
irradiance:

1. a wrapper for convenient use of the pvfactors package:
:py:func:`~pvlib.bifacial.pvfactors.pvfactors_timeseries`

2. the infinite sheds bifacial model:
:py:func:`~pvlib.bifacial.infinite_sheds.get_irradiance`
:py:func:`~pvlib.bifacial.infinite_sheds.get_irradiance_poa`


pvfactors
=========

The `pvfactors <https://sunpower.github.io/pvfactors/>`_ package calculates
incident irradiance on the front and back surfaces of an array. pvfactors uses
a 2D geometry which assumes that the array is made up of long, regular rows.
Irradiance is calculated in the middle of a row; end-of-row effects are not
included. pvfactors can model arrays in fixed racking or on single-axis
trackers.


Infinite Sheds
==============

The "infinite sheds" model [1] is a 2-dimensional model of irradiance on the
front and rear surfaces of a PV array. The model assumes that the array
comprises parallel, equally spaced rows (sheds) and calculates irradiance in
the middle of a shed which is far from the front and back rows of the array.
Sheds are assumed to be long enough that end-of-row effects can be
neglected. Rows can be at fixed tilt or on single-axis trackers. The ground
is assumed to be horizontal and level, and the array is mounted at a fixed
height above the ground.

The infinite sheds model accounts for the following effects:

- limited view from the row surfaces to the sky due to blocking of the
sky by nearby rows;
- reduction of irradiance reaching the ground due to shadows cast by
rows and due to blocking of the sky by nearby rows.

The model operates in the following steps:

1. Find the fraction of unshaded ground between rows, ``f_gnd_beam`` where
both direct and diffuse irradiance is received. The model assumes that
there is no direct irradiance in the shaded fraction ``1 - f_gnd_beam``.
2. Calculate the view factor, ``fz_sky``, from the ground to the sky accounting
for the parts of the sky that are blocked from view by the array's rows.
The view factor is multiplied by the sky diffuse irradiance to calculate
the diffuse irradiance reaching the ground. Sky diffuse irradiance is thus
assumed to be isotropic.
3. Calculate the view factor from the row surface to the ground which
determines the fraction of ground-reflected irradiance that reaches the row
surface.
4. Find the fraction of the row surface that is shaded from direct irradiance.
Only sky and ground-reflected irradiance reach the the shaded fraction of
the row surface.
5. For the front and rear surfaces, apply the incidence angle modifier to
the direct irradiance and sum the diffuse sky, diffuse ground, and direct
irradiance to compute the plane-of-array (POA) irradiance on each surface.
6. Apply the bifaciality factor, shade factor and transmission factor to
the rear surface POA irradiance and add the result to the front surface
POA irradiance to calculate the total POA irradiance on the row.

Array geometry is defined by the following:

- ground coverage ratio (GCR), ``gcr``, the ratio of row slant height to
the spacing between rows (pitch).
- height of row center above ground, ``height``.
- tilt of the row from horizontal, ``surface_tilt``.
- azimuth of the row's normal vector, ``surface_azimuth``.
View factors from the ground to the sky are calculated at points spaced along
a one-dimensional axis on the ground, with the origin under the center of a
row and the positive direction toward the right. The positive direction is
considered to be towards the "front" of the array. Array height differs in this
code from the description in [1], where array height is described at the row's
lower edge.

This model is influenced by the 2D model published by Marion, *et al.* in [2].

References
----------
.. [1] Mikofski, M., Darawali, R., Hamer, M., Neubert, A., and Newmiller,
J. "Bifacial Performance Modeling in Large Arrays". 2019 IEEE 46th
Photovoltaic Specialists Conference (PVSC), 2019, pp. 1282-1287.
doi: 10.1109/PVSC40753.2019.8980572.
.. [2] Marion. B., MacAlpine, S., Deline, C., Asgharzadeh, A., Toor, F.,
Riley, D., Stein, J. and Hansen, C. "A Practical Irradiance Model for
Bifacial PV Modules".2017 IEEE 44th Photovoltaic Specialists Conference
(PVSC), 2017, pp. 1537-1543. doi: 10.1109/PVSC.2017.8366263

1 change: 1 addition & 0 deletions docs/sphinx/source/user_guide/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ User Guide
modelchain
timetimezones
clearsky
bifacial
forecasts
comparison_pvlib_matlab
variables_style_rules
Expand Down
5 changes: 5 additions & 0 deletions docs/sphinx/source/whatsnew/v0.9.1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ Breaking changes

Deprecations
~~~~~~~~~~~~
* Moved :py:func:`pvlib.bifacial.pvfactors_timeseries` to
:py:func:`pvlib.bifacial.pvfactors.pvfactors_timeseries`.
:py:module:`pvlib.bifacial` is now a sub-package. (:pull:`717`)
* :py:func:`pvlib.modelchain.basic_chain` is deprecated.
See :py:meth:`pvlib.modelchain.ModelChain.with_pvwatts` and
:py:meth:`pvlib.modelchain.ModelChain.with_sapm` for alternative simplified
Expand All @@ -16,6 +19,8 @@ Deprecations

Enhancements
~~~~~~~~~~~~
* Added `pvlib.bifacial.infinite_sheds`, containing a model for irradiance
on front and back surfaces of bifacial arrays. (:pull:`717`)
* Added ``map_variables`` option to :func:`~pvlib.iotools.read_crn` (:pull:`1368`)
* Added :py:func:`pvlib.temperature.prilliman` for modeling cell temperature
at short time steps (:issue:`1081`, :pull:`1391`)
Expand Down
13 changes: 13 additions & 0 deletions pvlib/bifacial/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"""
The ``bifacial`` module contains functions to model irradiance for bifacial
modules.

"""
from pvlib._deprecation import deprecated
from pvlib.bifacial import pvfactors, infinite_sheds, utils # noqa: F401
kandersolar marked this conversation as resolved.
Show resolved Hide resolved

pvfactors_timeseries = deprecated(
since='0.9.1',
name='pvlib.bifacial.pvfactors_timeseries',
alternative='pvlib.bifacial.pvfactors.pvfactors_timeseries'
)(pvfactors.pvfactors_timeseries)
Loading