无法将PVLIB输出与NREL SAM协调

2024-06-01 20:47:28 发布

您现在位置:Python中文网/ 问答频道 /正文

背景

传统上,我使用NREL SAM工具估算太阳能输出。由于PVLIB的开放性和灵活性,我一直在尝试PVLIB,但我似乎无法协调PVLIB和NREL SAM之间的太阳能产量估算

我所做的

我正在昆士兰州Gympie附近模拟一个假设的太阳能农场。我访问了climate.onebuiling网站,下载了“AUS\u QLD\u Gympie.AP.945660\u TMYx.2003-2017”的zip文件夹/epw文件。然后,我在NREL的SAM工具中使用了使用PVwatts的天气文件,规格如下

  • 200000千瓦直流电
  • 模块类型=标准
  • 1.2直流-交流比
  • 96%逆变器效率
  • 单轴回溯
  • 倾斜=26度
  • 方位角=0度
  • GCR=0.4
  • 损失、阴影和;缩减=默认

在NREL SAM中,我每年获得415.96 GWh的年发电量(AC GWh)

然后,我将同一个epw文件转换成csv,只保留ghi、dni、dhi、temp_air&;的列;风速(Google Drive link to CSV file)。我已将此文件用作PVLIB的导入。我为PVLIB系统指定了与上述相同的规格,增加了反照率=0.2和最大角度=90度(代码如下)

我在PVLIB中得到的结果是395.61 GWh

问题

我得到的结果完全不同。PVLIB=~395 GWh p.a.与SAM=~415 GWh p.a.相比,我预计两者相差约1-2%,但不是5%

与使用clearsky.ineichen(使用linke_浊度进行调整)的PVLIB系统相比,数字更糟糕,该系统每年产生约475 GWh

请求帮助

有人知道为什么我的结果如此不同吗?我能做些什么来缩小差距吗

PVLIB代码

# **********************************************************
# IMPORT LIBRARIES
# **********************************************************
import pandas as pd

from pvlib.pvsystem import PVSystem
from pvlib import clearsky, atmosphere, solarposition, irradiance
from pvlib.location import Location
from pvlib.tracking import SingleAxisTracker
from pvlib.modelchain import ModelChain
from pvlib.temperature import TEMPERATURE_MODEL_PARAMETERS

# **********************************************************
# LOCATION & SOLAR SIZE INPUTS
# **********************************************************
# Lat and Long desired
lat = -26.18
lon = 152.63

# Set Location
tz, altitude, name = 'Australia/Queensland', 10, 'Gympie/QLD'

# Set location details for model
latitude, longitude, = lat, lon
location = Location(latitude, longitude, tz, altitude, name)

# load some module and inverter specifications
module_parameters = {'pdc0': 200000000, 'gamma_pdc': -0.004}
inverter_parameters = {'pdc': 166666666, 'pdc0': 166666666, 'eta_inv_nom': 0.96}
temperature_model_parameters = TEMPERATURE_MODEL_PARAMETERS['sapm']['open_rack_glass_glass']

# **********************************************************
# ONEBUILDING DATA
# **********************************************************
df = pd.read_csv('weather import.csv')
df['time'] = df['time'].astype('datetime64[ns]')
df.set_index(['time'], inplace=True)
df.index = df.index.tz_localize(tz=tz)
df = df.asfreq(freq='1h')
onebuilding = df

# **********************************************************
# INEICHEN CLEAR SKIES ADJUSTED FOR TURBIDITY
# **********************************************************
# Create PVLib inputs
times = df.index
solpos = solarposition.get_solarposition(times, latitude, longitude)
apparent_zenith = solpos['zenith']
rel_airmass = atmosphere.get_relative_airmass(apparent_zenith)
pressure = atmosphere.alt2pres(altitude)
abs_airmass = atmosphere.get_absolute_airmass(rel_airmass, pressure)
linke_turbidity = clearsky.lookup_linke_turbidity(times, latitude, longitude)
dni_extra = irradiance.get_extra_radiation(times)
ineichen = clearsky.ineichen(apparent_zenith, abs_airmass, linke_turbidity, altitude, dni_extra)
ineichen.to_csv('ineichen.csv')

# **********************************************************
# SELECT WHICH WEATHER DATA TO USE (ineichen v onebuilding)
# **********************************************************
# Select which version we wish to use (onebuilding, ineichen)
selected_irrad = onebuilding
print(selected_irrad)

# Create Weather File
weather = pd.DataFrame(data={'ghi': selected_irrad.ghi, 'dni': selected_irrad.dni,
                             'dhi': selected_irrad.dhi, 'temp_air': df['temp_air'],
                             'wind_speed': df['wind_speed']})

# **********************************************************
# CREATE PV SYSTEM AND PV MODEL CHAIN
# **********************************************************
# Define the specs for the PV System (fixed system)
f_system = PVSystem(
    surface_tilt=abs(lat),
    surface_azimuth=0,
    albedo=0.2,
    module='pvwatts_dc',
    inverter='pvwatts_ac',
    module_parameters=module_parameters,
    inverter_parameters=inverter_parameters,
    racking_model='open_rack_glass_glass',
    name='fixed',
    temperature_model_parameters=temperature_model_parameters
)

# Define the specs for the PV System (1 axis tracking system)
t_system = SingleAxisTracker(
    axis_tilt=0,
    axis_azimuth=0,
    max_angle=90,
    backtrack=True,
    module='pvwatts_dc',
    inverter='pvwatts_ac',
    module_parameters=module_parameters,
    inverter_parameters=inverter_parameters,
    name='tracking',
    gcr=.40,
)

# build model chain
mc = ModelChain(
    system=t_system,
    location=location,
    name='pvwatts',
    dc_model='pvwatts',
    ac_model='pvwatts',
    losses_model='pvwatts',
    aoi_model='physical',
    spectral_model='no_loss',
    temperature_model='sapm')

# run model chain
mc.run_model(weather=weather)
print(mc.ac.sum())

Tags: fromimportdfmodelsamsystemparametersmodule
1条回答
网友
1楼 · 发布于 2024-06-01 20:47:28

如果没有中间结果的详细比较,很难说清楚为什么年度能源有所不同。一个促成因素似乎是转置模型(GHI、DHI和DNI到阵列平面):pvlibModelChain默认为Hay/Davies模型,我相信SAM默认为Perez 1990模型。这两个模型在阵列辐照度的年平面上会相差几个百分点,而阵列辐照度随漫射辐照度和直射辐照度的相对水平而变化;见Lave et al. Figure 6

您可以通过向mc实例添加transposition_model = 'perez',来选择pvlib中的Perez 1990模型。我希望这将缩小pvlib和SAM结果之间的差异,并且我对您的发现感兴趣

使用TMY天气文件的计算不会给出与使用晴空模型的辐照度计算相同的结果,因为TMY是根据历史天气记录合成的,因此包括多云期

相关问题 更多 >