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

solar pv tracking option added #255

Merged
merged 19 commits into from
Feb 3, 2023
Merged

Conversation

enrilizaga
Copy link
Contributor

@enrilizaga enrilizaga commented Sep 14, 2022

Change proposed in this Pull Request

Added 1-axis vertical and 2-axis tracking option for solar pv (+ small documentation addition for get_windturbineconfig)

Description

Updated orientation.py and convert.py:

  • Default option is no tracking (tracking = 0)
  • For vertical tracking, surface azimuth = sun_azimuth angles
  • For 2-axis tracking, both the azimuth and the slope follow the sun, thus cos(incidence angle)=1

Motivation and Context

This change adds the solar pv tracking capability to the code. Solar pv tracking is widely used as it increases the solar pv efficiency significantly. This change improves the fidelity of the code to represent those efficiencies

How Has This Been Tested?

The updated code was tested locally (see snapshots)

  • The following commands provided the same results (tracking = 0 default)
    cap_factors_pv_notrack = cutout.pv(panel='CSi', orientation={'slope': 30., 'azimuth': 180.}, capacity_factor=True)
    cap_factors_pv_0axis = cutout.pv(panel='CSi', orientation={'slope': 30., 'azimuth': 180.}, tracking=0, capacity_factor=True)
    0tracking_comparison
    0tracking_comparison_2

  • Tracking = 1 and =2 were tested as well:
    cap_factors_pv_1axis = cutout.pv(panel='CSi', orientation={'slope': 30., 'azimuth': 180.}, tracking=1, capacity_factor=True)
    cap_factors_pv_2axis = cutout.pv(panel='CSi', orientation={'slope': 30., 'azimuth': 180.}, tracking=2, capacity_factor=True)
    1tracking
    2tracking

  • Checked that csp was not affected (tracking change only for solar pv)
    cf = cutout.csp(installation="SAM_solar_tower", capacity_factor=True)
    cf = cutout.csp(installation="SAM_parabolic_trough", capacity_factor=True)
    csp

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I tested my contribution locally and it seems to work fine.
  • I locally ran pytest inside the repository and no unexpected problems came up.
  • I have adjusted the docstrings in the code appropriately.
  • I have documented the effects of my code changes in the documentation doc/.
  • I have added newly introduced dependencies to environment.yaml file.
  • I have added a note to release notes doc/release_notes.rst.
  • I have used pre-commit run --all to lint/format/check my contribution

@enrilizaga enrilizaga changed the title solar pv tracking option added. 0 no tracking, 1 vertical tracking, 2… solar pv tracking option added Sep 14, 2022
@FabianHofmann
Copy link
Contributor

FabianHofmann commented Oct 11, 2022

Hey @enrilizaga, sorry this takes a while on our side... but the code looks great! Some optional point would be awesome

Would that be possible for you?

@enrilizaga
Copy link
Contributor Author

Hi @FabianHofmann, many thanks for your reply! I have:

  • added notebook example solarpv_tracking_options.ipynb and corresponding .nblink

  • added pv_tracking_test function within test_preparation_and_conversion.py

  • added tracking option for trigon_model "simple" within tiltedirradiation function

  • added new version 0.2.10 in the RELEASE_NOTES.rst

Please let me know.
Thank you!

@FabianHofmann
Copy link
Contributor

This is awesome. I'm having a look at the changes next week.

@fneum
Copy link
Member

fneum commented Nov 13, 2022

Ping! Would be super cool to include it in the upcoming PyPSA-Eur version.

@fneum
Copy link
Member

fneum commented Nov 13, 2022

closes #140
closes #220

Copy link
Contributor

@FabianHofmann FabianHofmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@enrilizaga the code look great! Some comments from my side. I am currently running the notebook. I also want to make a check that the pv for tracking=0 is the same as in the current master.

Comment on lines +503 to +506
as accepted by atlite.resource.get_windturbineconfig(). Locally stored turbine
configurations can also be modified with this function. E.g. to setup a different hub
height from the one used in the yaml file,one would write
"turbine=get_windturbineconfig(“NREL_ReferenceTurbine_5MW_offshore”)|{“hub_height”:120}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am wondering where this change is coming from.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good change!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@FabianHofmann just a small doc addition explaining how to modify the wind hub height. This is unrelated to the pv tracking update

@@ -530,21 +532,24 @@ def wind(cutout, turbine, smooth=False, **params):


# solar PV
def convert_pv(ds, panel, orientation, trigon_model="simple", clearsky_model="simple"):
def convert_pv(
ds, panel, orientation, tracking, trigon_model="simple", clearsky_model="simple"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make tracking a keyword argument here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Default to no tracking would be a sensible choice.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just updated it. The no tracking option is the default option (e.g. see third assertion of pv_tracking_test)

Comment on lines 569 to 572
tracking : int 0, 1, 2:
0 for no tracking, default
1 for 1-axis vertical tracking
2 for 2-axis tracking
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am wondering whether we should rather take the arguments

  • False,
  • 'v' or 'vertical'
  • 'h' or 'horizontal'
  • 'full'

where horizontal is not supported right now. This would make integration in the future easier. Could you change this?

Copy link
Member

@fneum fneum Nov 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or instead of "full" -> "hv" or "vh"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea indeed! I have not included 'horizontal' as that is not supported by the code, but should be now easier to integrate it in the future

Copy link
Member

@martavp martavp Nov 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry to jump in here without actually reviewing the code but this comment caught my attention. I think we should prioritize including 1-axis horizontal tracking.
In short, horizontal 1-axis tracking is widely used in the market today (about 50% of new PV power plants use it) while 2-axis or vertical tracking is not used at all.
I understand that this PR only includes vertical and 2-axes (and that is great, thanks for the work @enrilizaga ) but I think it would look weird in the next release if only exotic options are included but not the dominant "horizontal 1-axis tracking".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @martavp. I understand your point, but I am not sure why that would prevent this PR from being added into the code? Horizontal 1-axis tracking may be more widely used, but it is also more complex to implement and outside my scope of work. PS: would be great if you could share the reference re PV panels market share by tracking type!

Copy link
Contributor

@FabianHofmann FabianHofmann Nov 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@enrilizaga no worries, the PR is great (!) and this missing feature would not prevent it from being merged. But since you already have experience with the math, would you mind trying to lift the implementation to the full features stack? That would make it perfect. I had a try with horizontal tracking in #220 but due to missing time, I did not dig down any further. There you also find a reference (https://www.nrel.gov/docs/fy13osti/58891.pdf) for the hsat.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @martavp. I understand your point, but I am not sure why that would prevent this PR from being added into the code? Horizontal 1-axis tracking may be more widely used, but it is also more complex to implement and outside my scope of work. PS: would be great if you could share the reference re PV panels market share by tracking type!

I fully agree with @FabianHofmann, the PR is great and should be merged. I was just calling attention to the fact that we should try to add 1-axis horizontal tracking soon (ideally before the next release). I also did not find the time to work on this myself, so thanks again @enrilizaga for your contribution.

A good reference for the share of market representative of every tracking strategy can be the International Technology Roadmap for PV (ITRPV). You need to register to download the report and I cannot find the relevant figure in the most updated version, but check slide 35 from this presentation

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, thanks for the clarification. When is next release? I could look into it at some point in the next month or so but I am currently time constrained.

Re the market share, thanks for sharing that reference. Unfortunately ITRPV does not seem to have data on horizontal vs vertical 1-axis tracking separately and just reports all as "1-axis tracking"?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No pressure on the release date. If you can make it this year, that would be great. Otherwise I could also spend some hours, likely not before January on this. To give you a proper hint on the implementation I'd have make some research, which is atm not possible for me...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @enrilizaga I'm pretty sure that ITRPV only mentions "1-axis tracking" assuming that is horizontal tracking. Vertical tracking is not used at all in commercial utility-scale applications.

I'm also time constrained until January, but I can also find some time there to make suggestions. I have also talked to @Parisra and she might be able to put some time into implementing this.

@enrilizaga
Copy link
Contributor Author

@FabianHofmann @fneum thanks for your comments. Just included them in the last commit. Please let me know!

@FabianHofmann
Copy link
Contributor

Hey @enrilizaga, do you have concrete plans on continuing on this PR? Otherwise, we could look whether we can find someone to finish it up.

@martavp
Copy link
Member

martavp commented Feb 2, 2023

I know that @Parisra is working on implementing the horizontal tracking option.
Mainly obtaining the tilt and orientation of the solar panels using Eq. 8-10 from NREL report
Maybe @FabianHofmann you can accept @enrilizaga PR and @Parisra takes it from there

@fneum
Copy link
Member

fneum commented Feb 2, 2023

I think that’d make sense. No need for full tracking implemented until merging.

@FabianHofmann
Copy link
Contributor

@martavp let's do it :) @Parisra could you then make sure to counter test the formulas? I haven't had the time to go into them in detail.

@enrilizaga many thanks again! This is a great contribution and super well done!

@FabianHofmann FabianHofmann merged commit 2493c4b into PyPSA:master Feb 3, 2023
@Parisra
Copy link
Contributor

Parisra commented Feb 3, 2023

Hi @FabianHofmann , yes I can do that. I've just finished adding the formulas for horizontal tracking and will be doing some tests next week to make sure the results make sense. I'll do a pull request once everything is ready.

@FabianHofmann
Copy link
Contributor

great thanks @Parisra

@martavp martavp mentioned this pull request Mar 16, 2023
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants