-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Use Hottel's method for bifacial.utils.*_integ functions #1865
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
base: main
Are you sure you want to change the base?
Conversation
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. |
I don't see any reason not to retain the current |
the crossed-strings math assumed x0=0, x1=1. I am confident it could be extended to other endpoints, but reverting this for now.
assert np.isclose(vf_expected, vf_actual) | ||
|
||
|
||
def test_vf_ground_sky_2d_integ_deprecated(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def test_vf_ground_sky_2d_integ_deprecated(): | |
@fail_on_pvlib_version(...) | |
def test_vf_ground_sky_2d_integ_deprecated(): |
Let's make sure docs and code gets cleaned in the future? v0.12 or v0.13, whatever feels right. I would also add the future version to deprecate in the docs admonition.
docs/sphinx/source/reference
for API changes.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`
).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:
And since
vf_ground_sky_2d_integ
is the main bottleneck ininfinite_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.