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

Use Hottel's method for bifacial.utils.*_integ functions #1865

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

kandersolar
Copy link
Member

  • Closes #xxxx
  • I am familiar with the contributing guidelines
  • Tests added
  • Updates entries in docs/sphinx/source/reference for API changes.
  • Adds description and name entries in the appropriate "what's new" file in docs/sphinx/source/whatsnew for all changes. Includes link to the GitHub Issue with :issue:`num` or this Pull Request with :pull:`num`. Includes contributor name and/or GitHub username (link with :ghuser:`user`).
  • New code is fully documented. Includes numpydoc compliant docstrings, examples, and comments where necessary.
  • Pull request is nearly complete and ready for detailed review.
  • Maintainer: Appropriate GitHub Labels (including remote-data) and Milestone are assigned to the Pull Request and linked Issue.

I realized that our integrated view factor calculations are equivalent to what is calculated using Hottel's crossed strings method. The calculations are straightforward, closed form, and much faster than numerical integration. Here is a speed comparison for the ground->sky view factor:

image

And since vf_ground_sky_2d_integ is the main bottleneck in infinite_sheds.get_irradiance, runtime improves there by 1-2 orders of magnitude as well.

PR is marked as draft while the code is a mess.

@mikofski
Copy link
Member

mikofski commented Sep 19, 2023

FYI: there’s another pvlib issue with links to recent uses of Hottel’s crossed strings in the literature, one of the main advantages being its easy application for PV on slopes.

One disadvantage may be that we lose view factor as a function of location on the ground which could be reused in Marion’s model.

@kandersolar
Copy link
Member Author

One disadvantage may be that we lose view factor as a function of location on the ground

I don't see any reason not to retain the current vf(x) functions. This PR only changes how the _integ() functions are computed internally.

the crossed-strings math assumed x0=0, x1=1.  I am confident it could be extended to other endpoints, but reverting this for now.
@kandersolar kandersolar modified the milestones: v0.10.2, v0.10.3 Sep 21, 2023
@kandersolar kandersolar modified the milestones: v0.10.3, v0.10.4 Dec 20, 2023
@kandersolar kandersolar modified the milestones: v0.10.4, Someday Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants