modify script to use bifacial modelling method
This commit is contained in:
parent
2cae51ccbf
commit
cc7a1eb993
@ -4,6 +4,7 @@ import logging
|
|||||||
import math
|
import math
|
||||||
|
|
||||||
import pvlib
|
import pvlib
|
||||||
|
from pvlib.bifacial.pvfactors import pvfactors_timeseries
|
||||||
|
|
||||||
from Utilities.Processes import calculate_no_of_panels, calculate_required_system_size
|
from Utilities.Processes import calculate_no_of_panels, calculate_required_system_size
|
||||||
|
|
||||||
@ -143,57 +144,48 @@ def calculate_energy_production_vertical(c):
|
|||||||
no_of_rows = np.unique(panel_coordinates["y"]).shape[0]
|
no_of_rows = np.unique(panel_coordinates["y"]).shape[0]
|
||||||
no_of_shaded_rows = no_of_rows - 1
|
no_of_shaded_rows = no_of_rows - 1
|
||||||
|
|
||||||
|
no_of_panels_in_row = np.unique(panel_coordinates["x"]).shape[0]
|
||||||
|
|
||||||
collector_width = c["panel"]["dimensions"]["length"]
|
collector_width = c["panel"]["dimensions"]["length"]
|
||||||
# calculate delta between unique y coordinates of panels to get pitch
|
# calculate delta between unique y coordinates of panels to get pitch
|
||||||
pitch = np.unique(panel_coordinates["y"])[1] - np.unique(panel_coordinates["y"])[0]
|
pitch = np.unique(panel_coordinates["y"])[1] - np.unique(panel_coordinates["y"])[0]
|
||||||
surface_to_axis_offset = 0
|
surface_to_axis_offset = 0
|
||||||
shaded_row_rotation = 90
|
shaded_row_rotation = 90
|
||||||
shading_row_rotation = 90
|
shading_row_rotation = 90
|
||||||
|
surface_azimuth = 90 # east facing
|
||||||
axis_tilt = 0
|
axis_tilt = 0
|
||||||
axis_azimuth = 180
|
axis_azimuth = 0
|
||||||
|
|
||||||
morning_projected_solar_zenith = pvlib.shading.projected_solar_zenith_angle(
|
ground_coverage = (
|
||||||
solar_zenith=solar_positions["apparent_zenith"],
|
no_of_panels
|
||||||
solar_azimuth=solar_positions["azimuth"],
|
* c["panel"]["dimensions"]["width"]
|
||||||
axis_azimuth=axis_azimuth,
|
* c["panel"]["dimensions"]["thickness"]
|
||||||
axis_tilt=axis_tilt,
|
|
||||||
)
|
)
|
||||||
|
land_area = (
|
||||||
|
c["environment"]["roof"]["dimensions"]["width"]
|
||||||
|
* c["environment"]["roof"]["dimensions"]["length"]
|
||||||
|
)
|
||||||
|
gcr = ground_coverage / land_area
|
||||||
|
logger.info(f"Ground coverage ratio: {gcr}")
|
||||||
|
|
||||||
morning_shaded_fraction = pvlib.shading.shaded_fraction1d(
|
# use pvfactors bifacial modelling package
|
||||||
solar_zenith=morning_projected_solar_zenith,
|
for row in range(no_of_rows):
|
||||||
solar_azimuth=solar_positions["azimuth"],
|
result = pvfactors_timeseries(
|
||||||
axis_azimuth=axis_azimuth,
|
solar_zenith=solar_positions["apparent_zenith"],
|
||||||
shaded_row_rotation=shaded_row_rotation,
|
solar_azimuth=solar_positions["azimuth"],
|
||||||
shading_row_rotation=shading_row_rotation,
|
surface_azimuth=surface_azimuth,
|
||||||
collector_width=collector_width,
|
surface_tilt=90,
|
||||||
pitch=pitch,
|
axis_azimuth=axis_azimuth,
|
||||||
surface_to_axis_offset=surface_to_axis_offset,
|
timestamps=solar_positions.index,
|
||||||
axis_tilt=axis_tilt,
|
dni=clearsky_data["dni"],
|
||||||
)
|
dhi=clearsky_data["dhi"],
|
||||||
morning_shaded_fraction = morning_shaded_fraction * no_of_shaded_rows / no_of_rows
|
gcr=gcr,
|
||||||
|
pvrow_height=c["panel"]["dimensions"]["length"],
|
||||||
afternoon_projected_solar_zenith = pvlib.shading.projected_solar_zenith_angle(
|
pvrow_width=c["panel"]["dimensions"]["width"] * no_of_panels_in_row,
|
||||||
solar_zenith=solar_positions["apparent_zenith"],
|
albedo=0.2,
|
||||||
solar_azimuth=solar_positions["azimuth"],
|
n_pvrows=no_of_rows,
|
||||||
axis_azimuth=axis_azimuth + 180,
|
index_observed_pvrow=row,
|
||||||
axis_tilt=axis_tilt,
|
)
|
||||||
)
|
|
||||||
afternoon_shaded_fraction = pvlib.shading.shaded_fraction1d(
|
|
||||||
solar_zenith=afternoon_projected_solar_zenith,
|
|
||||||
solar_azimuth=solar_positions["azimuth"],
|
|
||||||
axis_azimuth=axis_azimuth + 180,
|
|
||||||
shaded_row_rotation=shaded_row_rotation,
|
|
||||||
shading_row_rotation=shading_row_rotation,
|
|
||||||
collector_width=collector_width,
|
|
||||||
pitch=pitch,
|
|
||||||
surface_to_axis_offset=surface_to_axis_offset,
|
|
||||||
axis_tilt=axis_tilt,
|
|
||||||
)
|
|
||||||
afternoon_shaded_fraction = (
|
|
||||||
afternoon_shaded_fraction * no_of_shaded_rows / no_of_rows
|
|
||||||
)
|
|
||||||
|
|
||||||
logger.info("Shaded fraction calculated for solar positions")
|
|
||||||
|
|
||||||
# calculate irradiance on plane of array
|
# calculate irradiance on plane of array
|
||||||
poa_front = pvlib.irradiance.get_total_irradiance(
|
poa_front = pvlib.irradiance.get_total_irradiance(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user