SolarArbiter / solarforecastarbiter-core

Core data gathering, validation, processing, and reporting package for the Solar Forecast Arbiter
https://solarforecastarbiter-core.readthedocs.io
MIT License
33 stars 21 forks source link

POA calculation fails to project DNI into POA 🤦 #718

Closed wholmgren closed 3 years ago

wholmgren commented 3 years ago

The Arbiter's power model fails to project the DNI into the plane of the array when computing POA irradiance:

https://github.com/SolarArbiter/solarforecastarbiter-core/blob/e02d458ba6635157fea0f62dc48dbf4bd67b5c75/solarforecastarbiter/pvmodel.py#L231-L233

With a quick skim of the function/module, you might see aoi_modifier and think POA is properly computed, but you'd be wrong. That modifier is simply the loss due to reflection off the glass. We're still missing the cosine projection. The line should read:

aoi_loss = pvlib.iam.physical(aoi)
beam_effective = dni * np.cos(np.deg2rad(aoi)) * aoi_loss
poa_effective = beam_effective + poa_sky_diffuse + poa_ground_diffuse

Plot below shows the POA for a single axis tracker with and without the fix, plus POA calculated with ModelChain. I'm not sure about the remaining discrepancy with ModelChain as I thought I'd used consistent transposition and albedo values. So I still want to double check if there's another problem.

Screen Shot 2021-08-21 at 1 24 55 PM

Embarrassing oversight that's only now coming to light when experimenting with a clear sky power function and comparing to high quality power data. At least github added support for emojis in issue titles.

wholmgren commented 3 years ago

No additional calculation problem. I was comparing the Arbiter's poa_effective to pvlib's ModelChain.total_irrad['poa_global']. I should have compared to ModelChain.effective_irradiance (this is pvlib 0.8.0, so no ModelChain.results.*). Here's the proper comparison:

Screen Shot 2021-08-21 at 6 33 32 PM