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

[Reviewed] PV horizontal tracking #293

Merged
merged 30 commits into from
May 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
dce6e38
Update description for next release
Parisra Feb 20, 2023
c9c9ddf
Change 'vh' to 'dual' for 2-axis tracking
Parisra Feb 20, 2023
70370c6
Add description for horizontal tracking options
Parisra Feb 20, 2023
d19100c
Change 'vh' to 'dual' for 2-axis tracking
Parisra Feb 20, 2023
3089f67
Add horizontal and tilted_horizontal tracking options
Parisra Feb 20, 2023
663e16f
Change 'vh' to 'dual' for 2-axis tracking
Parisra Feb 20, 2023
bc0717c
Add reference for horizontal tracking equations
Parisra Feb 20, 2023
55a9805
Delete old version of example notebook
Parisra Feb 20, 2023
bd0d0b1
Updated example version that includes horizontal tracking
Parisra Feb 20, 2023
a9a31bb
Update test to include horizontal tracking options
Parisra Feb 20, 2023
2d70682
Change 'vh' to 'dual' for 2-axis tracking
Parisra Feb 20, 2023
aee6dbc
Change variable name for vertical + update test description
Parisra Feb 20, 2023
0d3f1b1
Update description for horizontal tracking
Parisra Mar 9, 2023
c9dfc64
Updating comments for better clarity
Parisra Mar 13, 2023
b12b993
Changing variable name for more clarity
Parisra Mar 13, 2023
dee3740
Changing variable name for more clarity
Parisra Mar 13, 2023
69a8701
Adding comments
Parisra Mar 13, 2023
70e2b44
Deleting old example notebook
Parisra Mar 13, 2023
3c43451
Adding updated notebook (extra figure at end)
Parisra Mar 13, 2023
17612c5
Delete example file due to conflict
Parisra Mar 13, 2023
ff06a6a
Delete example notebook
Parisra Mar 13, 2023
9f7b5b3
Merge pull request #5 from Parisra/PV_horizontal_tracking
Parisra Mar 13, 2023
b963f26
Upload updated example notebook
Parisra Mar 13, 2023
ad0ba4f
Merge pull request #2 from Parisra/PV_Horizontal_Tracking
martavp Mar 14, 2023
8901c69
Merge branch 'PyPSA:master' into master
martavp Mar 16, 2023
197d76a
solve bug - remove dot when assigning axis_azimuth
martavp Mar 16, 2023
6476a2d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 16, 2023
af57963
Merge branch 'master' of github.com:martavp/atlite into martavp-master
fneum May 2, 2023
afcdda0
solar tracking: review and improve example notebook
fneum May 2, 2023
27b7829
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 2, 2023
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
2 changes: 1 addition & 1 deletion RELEASE_NOTES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Upcoming Release
================

* With this release, we change the license from copyleft GPLv3 to the more liberal MIT license with the consent of all major contributors `#263 <https://github.com/PyPSA/atlite/pull/263>`_.
* Added 1-axis vertical and 2-axis tracking option for solar pv and trigon_model = "simple"
* Added 1-axis horizontal, 1-axis tilted horizontal, 1-axis vertical, and 2-axis tracking options for solar PV; e.g. ``cutout.pv(tracking='horizontal')``.
* Added small documentation for get_windturbineconfig
* The deprecated functions `grid_cells` and `grid_coordinates` were removed.
* Feature: Cutouts are now compressed differently during the `.prepare(...)` step using the native compression feature of netCDF files.
Expand Down
4 changes: 3 additions & 1 deletion atlite/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,8 +560,10 @@ def pv(cutout, panel, orientation, tracking=None, clearsky_model=None, **params)
'atlite.pv.orientation.make_*' functions.
tracking : None or str:
None for no tracking, default
'horizontal' for 1-axis horizontal tracking
'tilted_horizontal' for 1-axis horizontal tracking with tilted axis
'vertical' for 1-axis vertical tracking
'vh' for 2-axis tracking
'dual' for 2-axis tracking
clearsky_model : str or None
Either the 'simple' or the 'enhanced' Reindl clearsky
model. The default choice of None will choose dependending on
Expand Down
4 changes: 2 additions & 2 deletions atlite/pv/irradiation.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,9 @@ def clip(influx, influx_max):
)
if trigon_model == "simple":
k = surface_orientation["cosincidence"] / sin(solar_position["altitude"])
if tracking != "vh":
if tracking != "dual":
cos_surface_slope = cos(surface_orientation["slope"])
elif tracking == "vh":
elif tracking == "dual":
cos_surface_slope = sin(solar_position["altitude"])

influx = direct + diffuse
Expand Down
68 changes: 64 additions & 4 deletions atlite/pv/orientation.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ def SurfaceOrientation(ds, solar_position, orientation, tracking=None):
----------
[1] Sproul, A. B., Derivation of the solar geometric relationships using
vector analysis, Renewable Energy, 32(7), 1187–1205 (2007).
[2] Marion, William F., and Aron P. Dobos. Rotation angle for the optimum
tracking of one-axis trackers. No. NREL/TP-6A20-58891. National Renewable
Energy Lab.(NREL), Golden, CO (United States), 2013.
"""
lon = deg2rad(ds["lon"])
lat = deg2rad(ds["lat"])
Expand All @@ -112,16 +115,73 @@ def SurfaceOrientation(ds, solar_position, orientation, tracking=None):
cosincidence = sin(surface_slope) * cos(sun_altitude) * cos(
surface_azimuth - sun_azimuth
) + cos(surface_slope) * sin(sun_altitude)

elif tracking == "horizontal": # horizontal tracking with horizontal axis
axis_azimuth = orientation[
"azimuth"
] # here orientation['azimuth'] refers to the azimuth of the tracker axis.
rotation = np.arctan(
(cos(sun_altitude) / sin(sun_altitude)) * sin(sun_azimuth - axis_azimuth)
)
surface_slope = abs(rotation)
surface_azimuth = axis_azimuth + np.arcsin(
sin(rotation / sin(surface_slope))
) # the 2nd part yields +/-1 and determines if the panel is facing east or west
cosincidence = cos(surface_slope) * sin(sun_altitude) + sin(
surface_slope
) * cos(sun_altitude) * cos(sun_azimuth - surface_azimuth)

elif tracking == "tilted_horizontal": # horizontal tracking with tilted axis'
axis_tilt = orientation[
"slope"
] # here orientation['slope'] refers to the tilt of the tracker axis.

rotation = np.arctan(
(cos(sun_altitude) * sin(sun_azimuth - surface_azimuth))
/ (
cos(sun_altitude) * cos(sun_azimuth - surface_azimuth) * sin(axis_tilt)
+ sin(sun_altitude) * cos(axis_tilt)
)
)

surface_slope = np.arccos(cos(rotation) * cos(axis_tilt))

azimuth_difference = sun_azimuth - surface_azimuth
azimuth_difference = np.where(
azimuth_difference > pi, 2 * pi - azimuth_difference, azimuth_difference
)
azimuth_difference = np.where(
azimuth_difference < -pi, 2 * pi + azimuth_difference, azimuth_difference
)
rotation = np.where(
np.logical_and(rotation < 0, azimuth_difference > 0),
rotation + pi,
rotation,
)
rotation = np.where(
np.logical_and(rotation > 0, azimuth_difference < 0),
rotation - pi,
rotation,
)

cosincidence = cos(rotation) * (
sin(axis_tilt) * cos(sun_altitude) * cos(sun_azimuth - surface_azimuth)
+ cos(axis_tilt) * sin(sun_altitude)
) + sin(rotation) * cos(sun_altitude) * sin(sun_azimuth - surface_azimuth)

elif tracking == "vertical": # vertical tracking, surface azimuth = sun_azimuth
cosincidence = sin(surface_slope) * cos(sun_altitude) + cos(
surface_slope
) * sin(sun_altitude)
elif tracking == "vh": # both vertical and horizontal tracking
elif tracking == "dual": # both vertical and horizontal tracking
cosincidence = np.float64(1.0)
else:
assert (
False
), "Values describing tracking system must be None for no tracking, 'vertical' for 1-axis vertical tracking, or 'vh' for 2-axis tracking"
assert False, (
"Values describing tracking system must be None for no tracking,"
+ "'horizontal' for 1-axis horizontal tracking,"
+ "tilted_horizontal' for 1-axis horizontal tracking of tilted panle,"
+ "vertical' for 1-axis vertical tracking, or 'dual' for 2-axis tracking"
)

# fixup incidence angle: if the panel is badly oriented and the sun shines
# on the back of the panel (incidence angle > 90degree), the irradiation
Expand Down
2 changes: 2 additions & 0 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ If you would like to cite the Atlite software, please refer to `this paper <http
examples/using_gebco_heightmap.ipynb
examples/plotting_with_atlite.ipynb
examples/logfiles_and_messages.ipynb
examples/solarpv_tracking_options.ipynb
examples/working-with-csp.ipynb
examples/more_examples.rst

.. toctree::
Expand Down
Loading