gpt4 book ai didi

python - 无法协调 PVLIB 输出与 NREL SAM

转载 作者:行者123 更新时间:2023-12-01 00:02:47 27 4
gpt4 key购买 nike

背景

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

我做了什么

我正在模拟昆士兰州金皮附近的一个假设太阳能发电厂。我访问了 climate.onebuiling 网站,并下载了“AUS_QLD_Gympie.AP.945660_TMYx.2003-2017”的 zip 文件夹/epw 文件。然后,我使用 PVwatts 在 NREL 的 SAM 工具中使用该天气文件,具有以下规范;

  • 200,000 千瓦直流
  • 模块类型 = 标准
  • 1.2 直流与交流比率
  • 96% 逆变器效率
  • 1轴回溯
  • 倾斜 = 26 度
  • 方位角 = 0 度
  • GCR = 0.4
  • 损失、阴影和削减=默认

在 NREL SAM 中,我的年能源产量 (AC GWh) 为每年 415.96 GWh。

然后,我获取了相同的 epw 文件并将其转换为 csv,仅保留 ghi、dni、dhi、temp_air 和 Wind_speed ( Google Drive link to CSV file ) 的列。我已将此文件用作 PVLIB 的导入。我指定了一个与上述规范相同的 PVLIB 系统,但增加了反照率 = 0.2 和最大角度 = 90 度(下面的代码)。

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

问题

我得到的结果有很大不同。 PVLIB = 每年约 395 GWh vs SAM = 每年约 415 GWH我预计会有 1-2% 左右的差异,但不是 5%。

当我与使用clearsky.ineichen(通过 linke_turbidity 调整)的 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())

最佳答案

如果不详细比较中间结果,很难确切地说出每年的能量不同的原因。一个影响因素似乎是转置模型(GHI、DHI 和 DNI 到阵列平面):pvlib ModelChain默认为 Hay/Davies 模型,我相信 SAM默认为 Perez 1990 型号。这两个模型的年阵列平面辐照度会存在几个百分点的差异,该辐照度随漫射辐照度和直接辐照度的相对水平而变化;请参阅Lave et al. Figure 6 .

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

使用 TMY 天气文件进行的计算不会得到与使用晴空模型的辐照度进行计算相同的结果,因为 TMY 是根据历史天气记录组合而成的,因此包括多云时段。

关于python - 无法协调 PVLIB 输出与 NREL SAM,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60218037/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com