Shading factor: issue on negative PV tilt value
Summary
In a APV central with single axis tracking and the axis being oriented North-South (i.e. the PV modules face east in the morning, zenith around midday and west in the evening), the PV production drops to 0 in the afternoon.
Steps to reproduce
- CentralAzimut : 0
- Bifaciality : True
- RotationAxisNumber : 1
Look at the values of SF_front in MODULES.PHOTOVOLTAICS.production.PV_Production.get_shading_factor().
What is the current bug behavior?
Generate a dataframe for debugging purposes. Insert a debugging point at the return statement of get_shading_factor() and run this in the debug console:
df = pd.DataFrame({'Sun v. central coord. X': sun_vect_cc[:,0],
'Sun v. central coord. Y': sun_vect_cc[:,1],
'Sun v. central coord. Z':sun_vect_cc[:,2],
'tilt Y': tiltY[:],
'theta_r_front': teta_r_front[:],
'theta_r_rear': teta_r_rear[:],
'SF front': SF_front,
'SF rear': SF_rear
})
Provides the following dataframe:
The first rectangle corresponds to "morning" and the second one to "afternoon".
The SF front value is 1 in the afternoon, which is inconsistent with the tracking behavior of the PV modules : it should be 0 near noon, and slowly increase until sunset.
In the current case, the PV modules' front face produces 0 electricity in the afternoon.
What is the expected correct behavior?
The values of SF front should be roughly symmetrical over the day hours, with a minimum at or around noon (when the Sun is at the zenith).
The PV production should not drop to 0 in the afternoon.
Possible fixes
MODULES.PHOTOVOLTAICS.production.PV_Production.get_shading_factor(), the first 6 statements.
This can be arranged by distinguishing tracking and non-tracking scenario, as the problem only comes up because of tracking as it is always the front side of panels that faces sun.
If rotation_axis_number == 0:
teta_r_front[sun_vect_cc[:,0]<0] = 'NaN'
else:
teta_r_front[sun_vect_cc[:,0]<0] = -teta_r_front
Sources
The function is based on https://docs.nrel.gov/docs/fy20osti/76626.pdf