|
7 | 7 | from pvlib.tools import cosd, sind, tand
|
8 | 8 | from pvlib.bifacial import utils
|
9 | 9 | from pvlib.shading import masking_angle
|
10 |
| -from pvlib.irradiance import beam_component, aoi |
11 |
| - |
| 10 | +from pvlib.irradiance import beam_component, aoi, haydavies |
12 | 11 |
|
13 | 12 | def _vf_ground_sky_integ(surface_tilt, surface_azimuth, gcr, height,
|
14 | 13 | pitch, max_rows=10, npoints=100):
|
@@ -401,7 +400,8 @@ def _shaded_fraction(solar_zenith, solar_azimuth, surface_tilt,
|
401 | 400 |
|
402 | 401 | def get_irradiance_poa(surface_tilt, surface_azimuth, solar_zenith,
|
403 | 402 | solar_azimuth, gcr, height, pitch, ghi, dhi, dni,
|
404 |
| - albedo, iam=1.0, npoints=100): |
| 403 | + albedo, model='isotropic', dni_extra=None, iam=1.0, |
| 404 | + npoints=100): |
405 | 405 | r"""
|
406 | 406 | Calculate plane-of-array (POA) irradiance on one side of a row of modules.
|
407 | 407 |
|
@@ -457,6 +457,13 @@ def get_irradiance_poa(surface_tilt, surface_azimuth, solar_zenith,
|
457 | 457 | albedo : numeric
|
458 | 458 | Surface albedo. [unitless]
|
459 | 459 |
|
| 460 | + model : str, default 'isotropic' |
| 461 | + Irradiance model - can be one of 'isotropic' or 'haydavies'. |
| 462 | +
|
| 463 | + dni_extra : numeric, optional |
| 464 | + Extraterrestrial direct normal irradiance. Required when |
| 465 | + ``model='haydavies'``. [W/m2] |
| 466 | +
|
460 | 467 | iam : numeric, default 1.0
|
461 | 468 | Incidence angle modifier, the fraction of direct irradiance incident
|
462 | 469 | on the surface that is not reflected away. [unitless]
|
@@ -495,6 +502,27 @@ def get_irradiance_poa(surface_tilt, surface_azimuth, solar_zenith,
|
495 | 502 | --------
|
496 | 503 | get_irradiance
|
497 | 504 | """
|
| 505 | + if model == 'haydavies': |
| 506 | + if dni_extra is None: |
| 507 | + raise ValueError(f'must supply dni_extra for {model} model') |
| 508 | + # Call haydavies first time within the horizontal plane - to subtract |
| 509 | + # circumsolar_horizontal from DHI |
| 510 | + sky_diffuse_comps_horizontal = haydavies(0, 180, dhi, dni, dni_extra, |
| 511 | + solar_zenith, solar_azimuth, |
| 512 | + return_components=True) |
| 513 | + circumsolar_horizontal = sky_diffuse_comps_horizontal['circumsolar'] |
| 514 | + |
| 515 | + # Call haydavies a second time where circumsolar_normal is facing |
| 516 | + # directly towards sun, and can be added to DNI |
| 517 | + sky_diffuse_comps_normal = haydavies(solar_zenith, solar_azimuth, dhi, |
| 518 | + dni, dni_extra, solar_zenith, |
| 519 | + solar_azimuth, |
| 520 | + return_components=True) |
| 521 | + circumsolar_normal = sky_diffuse_comps_normal['circumsolar'] |
| 522 | + |
| 523 | + dhi = dhi - circumsolar_horizontal |
| 524 | + dni = dni + circumsolar_normal |
| 525 | + |
498 | 526 | # Calculate some geometric quantities
|
499 | 527 | # rows to consider in front and behind current row
|
500 | 528 | # ensures that view factors to the sky are computed to within 5 degrees
|
@@ -580,8 +608,8 @@ def get_irradiance_poa(surface_tilt, surface_azimuth, solar_zenith,
|
580 | 608 |
|
581 | 609 | def get_irradiance(surface_tilt, surface_azimuth, solar_zenith, solar_azimuth,
|
582 | 610 | gcr, height, pitch, ghi, dhi, dni,
|
583 |
| - albedo, iam_front=1.0, iam_back=1.0, |
584 |
| - bifaciality=0.8, shade_factor=-0.02, |
| 611 | + albedo, model='isotropic', dni_extra=None, iam_front=1.0, |
| 612 | + iam_back=1.0, bifaciality=0.8, shade_factor=-0.02, |
585 | 613 | transmission_factor=0, npoints=100):
|
586 | 614 | """
|
587 | 615 | Get front and rear irradiance using the infinite sheds model.
|
@@ -643,6 +671,13 @@ def get_irradiance(surface_tilt, surface_azimuth, solar_zenith, solar_azimuth,
|
643 | 671 | albedo : numeric
|
644 | 672 | Surface albedo. [unitless]
|
645 | 673 |
|
| 674 | + model : str, default 'isotropic' |
| 675 | + Irradiance model - can be one of 'isotropic' or 'haydavies'. |
| 676 | +
|
| 677 | + dni_extra : numeric, optional |
| 678 | + Extraterrestrial direct normal irradiance. Required when |
| 679 | + ``model='haydavies'``. [W/m2] |
| 680 | +
|
646 | 681 | iam_front : numeric, default 1.0
|
647 | 682 | Incidence angle modifier, the fraction of direct irradiance incident
|
648 | 683 | on the front surface that is not reflected away. [unitless]
|
@@ -720,13 +755,15 @@ def get_irradiance(surface_tilt, surface_azimuth, solar_zenith, solar_azimuth,
|
720 | 755 | surface_tilt=surface_tilt, surface_azimuth=surface_azimuth,
|
721 | 756 | solar_zenith=solar_zenith, solar_azimuth=solar_azimuth,
|
722 | 757 | gcr=gcr, height=height, pitch=pitch, ghi=ghi, dhi=dhi, dni=dni,
|
723 |
| - albedo=albedo, iam=iam_front, npoints=npoints) |
| 758 | + albedo=albedo, model=model, dni_extra=dni_extra, iam=iam_front, |
| 759 | + npoints=npoints) |
724 | 760 | # back side POA irradiance
|
725 | 761 | irrad_back = get_irradiance_poa(
|
726 | 762 | surface_tilt=backside_tilt, surface_azimuth=backside_sysaz,
|
727 | 763 | solar_zenith=solar_zenith, solar_azimuth=solar_azimuth,
|
728 | 764 | gcr=gcr, height=height, pitch=pitch, ghi=ghi, dhi=dhi, dni=dni,
|
729 |
| - albedo=albedo, iam=iam_back, npoints=npoints) |
| 765 | + albedo=albedo, model=model, dni_extra=dni_extra, iam=iam_back, |
| 766 | + npoints=npoints) |
730 | 767 |
|
731 | 768 | colmap_front = {
|
732 | 769 | 'poa_global': 'poa_front',
|
|
0 commit comments