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

Add CSP modelling capabilities. #194

Merged
merged 40 commits into from
Jan 19, 2022
Merged

Add CSP modelling capabilities. #194

merged 40 commits into from
Jan 19, 2022

Conversation

euronion
Copy link
Collaborator

@euronion euronion commented Nov 16, 2021

Closes # (if applicable).

Change proposed in this Pull Request

Description

Motivation and Context

How Has This Been Tested?

Type of change

  • [n/a] Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • [n/a] 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/.
  • [n/a] 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

@codecov-commenter
Copy link

codecov-commenter commented Nov 16, 2021

Codecov Report

Merging #194 (2057d39) into master (f625e76) will decrease coverage by 1.84%.
The diff coverage is 25.42%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #194      +/-   ##
==========================================
- Coverage   73.98%   72.13%   -1.85%     
==========================================
  Files          18       19       +1     
  Lines        1522     1579      +57     
  Branches      212      222      +10     
==========================================
+ Hits         1126     1139      +13     
- Misses        330      374      +44     
  Partials       66       66              
Impacted Files Coverage Δ
atlite/pv/solar_position.py 91.11% <ø> (ø)
atlite/resource.py 58.82% <15.78%> (-6.99%) ⬇️
atlite/convert.py 67.02% <16.66%> (-4.85%) ⬇️
atlite/csp.py 42.85% <42.85%> (ø)
atlite/__init__.py 100.00% <100.00%> (ø)
atlite/cutout.py 72.82% <100.00%> (+0.14%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f625e76...2057d39. Read the comment docs.

@euronion euronion marked this pull request as ready for review November 23, 2021 21:44
@euronion
Copy link
Collaborator Author

@FabianHofmann could you have a look? With a focus on the code.
@pz-max could you have a look? With a focus on the example notebook.

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.

This is really impressive work! The example is excellent and explains well.

Just a few conceptional questions:

  1. I am wondering why the efficiency map is not defined for a azimuth range from 0 to 360. The ranges 0-70 (roughly) and 270 - 360 are missing. Does that mean a solar position in the north is not covered/supported?
  2. I am wondering whether the underestimated efficiencies for low solar altitudes play a role. These have a strong relative deviation from the SAM data. For example: For SAM the combination of altitude=8, azimuth=280 leads to en efficiency of ~10%. The same combination on the derived efficiency map gives efficiency ~0%. Do you see any harmful potential there?
  3. The underestimated efficiencies for low solar altitudes stand in contrast to the overestimated power outputs in winter. In the example the solar altitude during the winter months are between 0 and 20, so exactly the range where the efficiency is underestimated. But still we get a higher power output than the reference model. That seems a bit odd... Any idea?

"The installation details for 'SAM_parabolic_trough' and 'SAM_solar_tower' were retrieved and modelled with NREL's System Advisor Model.\n",
"For details on the process see [the section below](#extracting-efficiencies-from-sam).\n",
"\n",
"The 'lossless_installation' is an universal installation which has be default perfect efficiency and is thus able to convert the direct irradiation of either technology into an heat output.\n",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"The 'lossless_installation' is an universal installation which has be default perfect efficiency and is thus able to convert the direct irradiation of either technology into an heat output.\n",
"The 'lossless_installation' is an universal installation which has per default perfect efficiency and is thus able to convert the direct irradiation of either technology into an heat output.\n",

@FabianHofmann
Copy link
Contributor

Code-wise I have nothing to complain about :) Everything is super readable and well-structured

@pz-max
Copy link
Contributor

pz-max commented Nov 24, 2021

Hi Johannes, amazing contribution! 🥇
The Jupyter scripts looks also great. I like that you are verifying the model by comparing it to PS10 and also changing some of the datasets. Contentwise, everything seems alright. I would also forward this jupyter script as an initial draft to get some more qualified comments.

A little comment on the notebook:
As partly done, split cells in physics and plotting part i.e. cell 9, 16, 19, 22

@euronion
Copy link
Collaborator Author

Thank you both of you for your feedback!

@FabianHofmann

1. I am wondering why the efficiency map is not defined for a azimuth range from 0 to 360. The ranges 0-70 (roughly) and 270 - 360 are missing. Does that mean a solar position in the north is not covered/supported?

Oops. You're absolutely right. Chile, South Africa, Australia, ... would all have suffered from this mistake. I corrected it now by mirroring the efficiency in the interval [90°,270°] to [90°,-90°=270°] with the mirror plane being 90°. Documentation is also updated. Thanks!

2. I am wondering whether the underestimated efficiencies for low solar altitudes play a role. These have a strong relative deviation from the SAM data. For example: For SAM the combination of altitude=8, azimuth=280 leads to en efficiency of ~10%. The same combination on the derived efficiency map gives  efficiency ~0%. Do you see any harmful potential there?

I don't think so, at least not in this example. A low solar altitude also coincides with a low direct solar irradiation. An solar altitude of e.g. 8° rarely happens when there is significant irradiation. Here's two figures showcasing this:

  • In the top picture time vs. efficiency for the PS10 location in Spain during winter solistice. There are 4 points per day with significantly lower efficiency during sun rise and sun set.
  • In the lower picture the DHI for the same location and time. Notice that for only 3 of the 4 time points with low efficiency the DHI is != 0. Simulatenously for those 3 points the irradiation is already low and the contribution to the daily output less significant anyway.

image

I agree that this is an effect which contributes a little bit. It is also something a user can improve for themselve by using a better efficiency map / CSP installation config as input. Lastly I think it is something that - as long as we are using hourly resolved data sets - we will always struggle with: The comparison of the output of a single plant at high temporal resolution is the edge case to which atlite can / should not be applied IMHO.

3. The underestimated efficiencies for low solar altitudes stand in contrast to the overestimated power outputs in winter. In the example the solar altitude during the winter months are between 0 and 20, so exactly the range where the efficiency is underestimated. But still we get a higher power output than the reference model. That seems a bit odd... Any idea?

I presume this is an issue with the lack of atmospheric attenuation (For now we're using clearsky conditions). This should lead to problems especially during the winter season in Spain. Inspecting the system in SAM yields the following picture for January:

image

In the top picture you see on the left y-axis in blue the output of the solar field to HTF (heat transfer fluid) in MW_th. In orange on the right the wind speed at that time. High wind speeds and low generation correlate (during daytime).
In the bottom picture for the same time range incident DNI (left axis, red) vs. relative humidity (black, right axis) on the solar field. Notice how they also negatively correlate.

Let's see what Max's expert say about this. :)

@pz-max
Copy link
Contributor

pz-max commented Nov 25, 2021 via email

@euronion
Copy link
Collaborator Author

euronion commented Nov 26, 2021

@pz-max : will do. I'll add a note to the notebook and create+link an issue in the GH repository with "help wanted".

  • Note to myself: Do the above

edit: I'm not going to do this as the quality is now significantly better (correct data for SAM used).

@euronion
Copy link
Collaborator Author

I did a quick review on alternative datasets which might yield better results, especially for CSP data which relies on direct irradiation data on the surface, which in turn is influenced by the aerosol and cloud data used in each dataset. NREL's SAM uses the NSRDB which tries to be better in that regard than e.g. SARAH, which only uses a constant annual aerosol specification.
I created a separate issue #213 as a result of this investigation.

But more importantly:
During this review I noticed that the weather data set used by my SAM installation was off (filename reported a different location than the file contents listed). So the major deviations I saw in my comparisons and listed in the earlier version of the examples/working-with-csp.ipynb notebook were due to misaligned input data. (The data SAM downloaded was for somewhere in South Eastern Europe).

With the data for the correct location the deviations are much smaller and IMHO qualitatively totally acceptable, e.g.:

image

If the checks all pass I'd say we're ready to merge.

@euronion euronion merged commit e409ddd into master Jan 19, 2022
@fneum
Copy link
Member

fneum commented Jan 19, 2022

Really nice :)

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.

5 participants