-
Notifications
You must be signed in to change notification settings - Fork 1.1k
gallery example for bifacial modeling with pvfactors #1394
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
Changes from 4 commits
13115ef
f81a44c
c883a0a
758455e
a96a1ae
932b7d9
72aa0a7
0fb980c
199e9e6
a3e75c0
e4b97d9
9cc00ac
e975c1e
f486d81
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Bifacial Modeling | ||
----------------- | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
""" | ||
Bifacial Modeling - modelchain | ||
============================== | ||
|
||
Example of bifacial modeling using the modelchain | ||
spaneja marked this conversation as resolved.
Show resolved
Hide resolved
|
||
""" | ||
|
||
# %% | ||
# This example shows how to complete a bifacial modeling example using the | ||
# :py:class:`pvlib.modelchain.ModelChain` with the | ||
# :py:func:`pvlib.bifacial.pvfactors_timeseries` function to transpose | ||
# GHI data to both front and rear Plane of Array (POA) irradiance. | ||
spaneja marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
import pandas as pd | ||
from pvlib import pvsystem | ||
from pvlib import location | ||
from pvlib import modelchain | ||
from pvlib.temperature import TEMPERATURE_MODEL_PARAMETERS as PARAMS | ||
from pvlib import bifacial | ||
|
||
# create site location and times characteristics | ||
lat, lon = 36.084, -79.817 | ||
tz = 'Etc/GMT+5' | ||
times = pd.date_range('2021-06-21', '2021-6-22', freq='1T', tz=tz) | ||
|
||
# create site system characteristics | ||
axis_tilt = 0 | ||
axis_azimuth = 180 | ||
gcr = 0.35 | ||
max_angle = 60 | ||
pvrow_height = 3 | ||
pvrow_width = 4 | ||
albedo = 0.2 | ||
|
||
# load temperature parameters and module/inverter specifications | ||
temp_model_parameters = PARAMS['sapm']['open_rack_glass_polymer'] | ||
spaneja marked this conversation as resolved.
Show resolved
Hide resolved
|
||
sandia_modules = pvsystem.retrieve_sam('SandiaMod') | ||
spaneja marked this conversation as resolved.
Show resolved
Hide resolved
|
||
cec_inverters = pvsystem.retrieve_sam('cecinverter') | ||
sandia_module = sandia_modules['Sanyo_HIP_200DA3_Bifacial__2007__E__'] | ||
cec_inverter = cec_inverters['ABB__MICRO_0_25_I_OUTD_US_208__208V_'] | ||
|
||
# create a location for site, and get solar position and clearsky data | ||
site_location = location.Location(lat, lon, tz=tz, name='Greensboro, NC') | ||
solar_position = site_location.get_solarposition(times) | ||
cs = site_location.get_clearsky(times) | ||
|
||
# load solar position and tracker orientation for use in pvsystem object | ||
sat_mount = pvsystem.SingleAxisTrackerMount(axis_tilt=axis_tilt, | ||
axis_azimuth=axis_azimuth, | ||
max_angle=max_angle, | ||
backtrack=True, | ||
gcr=gcr) | ||
# dc arrays | ||
array = pvsystem.Array(mount=sat_mount, | ||
module_parameters=sandia_module, | ||
temperature_model_parameters=temp_model_parameters) | ||
|
||
# create system object | ||
system = pvsystem.PVSystem(arrays=[array], | ||
inverter_parameters=cec_inverter) | ||
|
||
# created for use in pvfactors timeseries | ||
orientation = sat_mount.get_orientation(solar_position['apparent_zenith'], | ||
solar_position['azimuth']) | ||
|
||
# get rear and front side irradiance from pvfactors transposition engine | ||
irrad = bifacial.pvfactors_timeseries(solar_position['azimuth'], | ||
kandersolar marked this conversation as resolved.
Show resolved
Hide resolved
|
||
solar_position['apparent_zenith'], | ||
orientation['surface_azimuth'], | ||
orientation['surface_tilt'], | ||
axis_azimuth, | ||
times, | ||
cs['dni'], | ||
cs['dhi'], | ||
gcr, | ||
pvrow_height, | ||
pvrow_width, | ||
albedo) | ||
|
||
# turn into pandas DataFrame | ||
irrad = pd.concat(irrad, axis=1) | ||
|
||
# define bifaciality coefficient (specific to module type being used) | ||
# create bifacial effective irradiance using aoi-corrected timeseries values | ||
bifaciality = 0.75 | ||
spaneja marked this conversation as resolved.
Show resolved
Hide resolved
|
||
irrad['effective_irradiance'] = ( | ||
irrad['total_abs_front'] + (irrad['total_abs_back'] * bifaciality) | ||
) | ||
|
||
# create modelchain object for bifacial system and run bifacial simulation | ||
mc_bifi = modelchain.ModelChain(system, site_location) | ||
mc_bifi.run_model_from_effective_irradiance(irrad) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's a small inelegance that specifying There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could default to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Converted to #1411 |
||
|
||
# plot results of both monofacial and bifacial | ||
spaneja marked this conversation as resolved.
Show resolved
Hide resolved
|
||
mc_bifi.results.ac.plot(title='Bifacial Simulation on June Solstice', | ||
ylabel='AC Power') |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
""" | ||
Bifacial Modeling - procedural | ||
============================== | ||
|
||
Example of bifacial modeling using procedural method | ||
spaneja marked this conversation as resolved.
Show resolved
Hide resolved
|
||
""" | ||
|
||
# %% | ||
# This example shows how to complete a bifacial modeling example using the | ||
# :py:class:`pvlib.modelchain.ModelChain` with the | ||
spaneja marked this conversation as resolved.
Show resolved
Hide resolved
|
||
# :py:func:`pvlib.bifacial.pvfactors_timeseries` function to transpose | ||
# GHI data to both front and rear Plane of Array (POA) irradiance. | ||
|
||
import pandas as pd | ||
from pvlib import location | ||
from pvlib import solarposition | ||
from pvlib import tracking | ||
from pvlib import bifacial | ||
from pvlib import temperature | ||
from pvlib import pvsystem | ||
import matplotlib.pyplot as plt | ||
|
||
# using Greensboro, NC for this example | ||
lat, lon = 36.084, -79.817 | ||
tz = 'Etc/GMT+5' | ||
times = pd.date_range('2021-06-21', '2021-6-22', freq='1T', tz=tz) | ||
|
||
# create location object and get clearsky data | ||
site_location = location.Location(lat, lon, tz=tz, name='Greensboro, NC') | ||
cs = site_location.get_clearsky(times) | ||
|
||
# get solar position data | ||
solar_position = solarposition.get_solarposition(cs.index, | ||
lat, | ||
lon | ||
) | ||
spaneja marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
# set ground coverage ratio and max_angle to | ||
# pull orientation data for a single-axis tracker | ||
gcr = 0.35 | ||
max_phi = 60 | ||
orientation = tracking.singleaxis(solar_position['apparent_zenith'], | ||
solar_position['azimuth'], | ||
max_angle=max_phi, | ||
backtrack=True, | ||
gcr=gcr | ||
) | ||
|
||
# set axis_azimuth, albedo, pvrow width and height, and use | ||
# the pvfactors engine for both front and rear-side absorbed irradiance | ||
kandersolar marked this conversation as resolved.
Show resolved
Hide resolved
|
||
axis_azmuth = 180 | ||
spaneja marked this conversation as resolved.
Show resolved
Hide resolved
|
||
pvrow_height = 3 | ||
pvrow_width = 4 | ||
albedo = 0.2 | ||
irrad = bifacial.pvfactors_timeseries(solar_position['azimuth'], | ||
kandersolar marked this conversation as resolved.
Show resolved
Hide resolved
|
||
solar_position['apparent_zenith'], | ||
orientation['surface_azimuth'], | ||
orientation['surface_tilt'], | ||
axis_azmuth, | ||
cs.index, | ||
cs['dni'], | ||
cs['dhi'], | ||
gcr, | ||
pvrow_height, | ||
pvrow_width, | ||
albedo | ||
) | ||
|
||
# using bifaciality factor and pvfactors results, create effective | ||
# irradiance data | ||
bifaciality = 0.75 | ||
effective_irrad_bifi = irrad[2] + (irrad[3] * bifaciality) | ||
spaneja marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
|
||
# get cell temperature using the Faiman model | ||
temp_cell = temperature.faiman(irrad[0], 25, 1) | ||
spaneja marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
# using the pvwatts_dc model and parameters detailed above, | ||
# set pdc0 and return DC power for both bifacial and monofacial | ||
pdc0 = 1 | ||
gamma_pdc = -0.0043 | ||
pdc_bifi = pvsystem.pvwatts_dc(effective_irrad_bifi, | ||
temp_cell, | ||
pdc0, | ||
gamma_pdc=gamma_pdc | ||
).fillna(0) | ||
pdc_bifi.plot(title='Bifacial Simulation on June Solstice', ylabel='DC Power') | ||
|
||
# %% | ||
# For illustration, perform monofacial simulation using pvfactors front-side | ||
# irradiance (AOI-corrected), and plot along with bifacial results. | ||
|
||
effective_irrad_mono = irrad[2] | ||
pdc_mono = pvsystem.pvwatts_dc(effective_irrad_mono, | ||
temp_cell, | ||
pdc0, | ||
gamma_pdc=gamma_pdc | ||
).fillna(0) | ||
|
||
# plot monofacial results | ||
plt.figure() | ||
plt.title('Bifacial vs Monofacial Simulation - June Solstice') | ||
pdc_bifi.plot(label='Bifacial') | ||
pdc_mono.plot(label='Monofacial') | ||
plt.ylabel('DC Power') | ||
plt.legend() | ||
# sphinx_gallery_thumbnail_number = 2 |
Uh oh!
There was an error while loading. Please reload this page.