计算光伏阵列不同表面辐照度的二维视因子模型
pvfactors的Python项目详细描述
pvfactors:简化辐照度建模
pvfactors是pv专业人员用来计算 入射到光伏阵列表面的辐照度。它依赖于 将二维几何图形和视图因子以数学方式集成到 用于计算所有曲面之间反射的公式。
pvfactors最初是从sunpower开发的“vf_模型”包移植过来的,该包在ieee光伏专家会议44 2017年上介绍(见[1]和link到论文)。
文档
文档可以找到here。 它包括许多描述使用pvfactors的许多方法的tutorials。
快速启动
给定一些时间序列输入:
# Import external librariesfromdatetimeimportdatetimeimportpandasaspd# Create input datadf_inputs=pd.DataFrame({'solar_zenith':[20.,50.],'solar_azimuth':[110.,250.],'surface_tilt':[10.,20.],'surface_azimuth':[90.,270.],'dni':[1000.,300.],'dhi':[50.,500.],'albedo':[0.2,0.2]},index=[datetime(2017,8,31,11),datetime(2017,8,31,15)])df_inputs
albedo | dhi | dni | solar_azimuth | solar_zenith | surface_azimuth | surface_tilt | |
---|---|---|---|---|---|---|---|
2017-08-31 11:00:00 | 0.2 | 50.0 | 1000.0 | 110.0 | 20.0 | 90.0 | 10.0 |
2017-08-31 15:00:00 | 0.2 | 500.0 | 300.0 | 250.0 | 50.0 | 270.0 | 20.0 |
以及一些光伏阵列参数
pvarray_parameters={'n_pvrows':3,# number of pv rows'pvrow_height':1,# height of pvrows (measured at center / torque tube)'pvrow_width':1,# width of pvrows'axis_azimuth':0.,# azimuth angle of rotation axis'gcr':0.4,# ground coverage ratio'rho_front_pvrow':0.01,# pv row front surface reflectivity'rho_back_pvrow':0.03# pv row back surface reflectivity}
用户可以使用PVEngine
frompvfactors.engineimportPVEnginefrompvfactors.geometryimportOrderedPVArray# Create an ordered PV arraypvarray=OrderedPVArray.init_from_dict(pvarray_parameters)# Create engineengine=PVEngine(pvarray)# Fit engine to dataengine.fit(df_inputs.index,df_inputs.dni,df_inputs.dhi,df_inputs.solar_zenith,df_inputs.solar_azimuth,df_inputs.surface_tilt,df_inputs.surface_azimuth,df_inputs.albedo)
对于单个时间戳
# Import external librariesimportmatplotlib.pyplotasplt# Get pvarray at given timestamppvarray=engine.run_timestep(idx=1)# Plot pvarray shapely geometriesf,ax=plt.subplots(figsize=(10,3))pvarray.plot(ax)plt.show()
由于简单的几何API,用户可以非常轻松地检查结果
print("Incident irradiance on front surface of middle pv row: {} W/m2".format(pvarray.pvrows[1].front.get_param_weighted('qinc')))print("Reflected irradiance on back surface of left pv row: {} W/m2".format(pvarray.pvrows[0].back.get_param_weighted('reflection')))print("Isotropic irradiance on back surface of right pv row: {} W/m2".format(pvarray.pvrows[2].back.get_param_weighted('isotropic')))
Incident irradiance on front surface of middle pv row: 811.7 W/m2
Reflected irradiance on back surface of left pv row: 90.2 W/m2
Isotropic irradiance on back surface of right pv row: 9.3 W/m2
用户还可以对所有时间戳运行模拟,并获得一个“报告”,该报告将看起来像用户想要的任何东西,并且将依赖于上面显示的简单几何api。 下面是一个示例:
# Create a function that will build a reportfrompvfactors.reportimportexample_fn_build_report# Run full simulationreport=engine.run_all_timesteps(fn_build_report=example_fn_build_report)# Print results (report is defined by report function passed by user)df_report=pd.DataFrame(report,index=df_inputs.index)df_report
100%|██████████| 2/2 [00:00<00:00, 26.58it/s]
qinc_back | iso_back | qinc_front | iso_front | |
---|---|---|---|---|
2017-08-31 11:00:00 | 106.627832 | 0.115792 | 1034.967753 | 20.848345 |
2017-08-31 15:00:00 | 85.535537 | 6.304878 | 811.659036 | 276.181750 |
安装
pvfactors目前与python版本2.7和3.6兼容并经过测试,可在PyPI中获得。
安装pvfactors的最简单方法是使用pip如下:
$ pip install pvfactors
包控制盘文件也可以在github存储库的release section中找到。
要求
需求包含在包的requirements.txt
文件中。这是
重要依赖项列表:
引用pvfactors
感谢您使用pvfactors。 如果您在已发表的作品中使用pvfactors,我们恳请您引用:
Anoma, M., Jacob, D., Bourne, B.C., Scholl, J.A., Riley, D.M. and Hansen, C.W., 2017. View Factor Model and Validation for Bifacial PV and Diffuse Shade on Single-Axis Trackers. In 44th IEEE Photovoltaic Specialist Conference.
贡献
为了改善pvfactors,需要做出贡献。 如果您想贡献,可以从分叉和克隆存储库开始,然后使用pip在包的根文件夹中安装pvfactors:
$ pip install .
要在可编辑模式下安装软件包,可以使用:
$ pip install -e .
参考文献
[1]Anoma,M.,Jacob,D.,Bourne,B.C.,Scholl,J.A.,Riley,D.M.,和Hansen,C.W.(2017年)。 单轴跟踪器中PV和漫射阴影的视景因子模型及验证。在第44届ieee光伏专家会议上。