【问题标题】:Incident Solar Irradiation on inclinded plane using SolaR使用 SolarR 在斜面上入射太阳辐射
【发布时间】:2021-11-07 14:15:59
【问题描述】:

我想将 9 公里网格 ECMWF 太阳表面向下辐射的全球辐射与在丹麦的一个地点测量的倾斜辐射进行比较。然而,结果不是很好,我发现理解非常全面但相当复杂的solar包有很多困难。

library(dplyr)
library(solaR)

2018 年前 117 小时从 ECMWF ERA-5 陆地模型https://cds.climate.copernicus.eu/cdsapp#!/dataset/reanalysis-era5-land?tab=overview 下载的太阳表面向下辐射 (ssrd) 和 2m 环境温度 (t2m)(输入为从 ecmwfr 下载并非易事)。

ssdr <- c(0,0,0,0,0,0,0,0,0,0,5.5,15.7,22.3,58.5,59.7,34.3,6.9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  0,0,14.1,66.9,116.9,130.2,109.7,61.9,9.3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2.8,7.5,
  12.6,13.2,17.7,11.8,2.2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5.2,22.1,40.4,41.3,30.5,
  17.7,5.4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,31.7,49.8,77.8,51.8,35.6,7.8,0,0,0,0)

t2m <- c(278.6,278.6,278.5,278.4,278.3,278.1,277.9,277.8,278,278.2,278.4,278.5,278.7,278.8,
278.6,278.4,278.1,278,278,277.8,277.7,277.7,278,278.1,278.2,278.1,278.1,278.1,278,
277.9,277.8,278,278.2,278.3,278.6,278.9,279.1,279,278.6,278,277.7,277.3,276.9,276.5,
276.4,276.5,276.4,276.3,276.4,276.5,276.5,276.6,276.4,276.1,275.6,275.4,275,275.1,
275,275.1,275.1,275.4,275.6,275.6,275.7,275.8,275.9,276,276,276,276.1,276.3,276.6,
276.6,276.6,276.6,276.6,276.7,276.7,276.8,276.7,276.5,276.5,276.6,276.5,276.4,276.4,
276.4,276.2,276.1,275.9,275.4,275.4,275.2,275,275.2,274.9,274.7,274.6,274.3,274.5,
274.4,274.4,274.7,274.6,275,275.5,275.9,276.4,276.1,275.8,275.4,275.2,275.1,275,
275.4,275.2)

从 solarheatdata.eu 网站获得 2018 年前 5 天的测量数据

## site ID of VRA solar plant on solarheatdata.eu
site <- "45"

## start and end data of data request
start_date <- "01-01-2018"
end_date <- "05-01-2018"

##request data from solarheatdata.eu website
sh_raw <- read.csv(file = paste0('http://solarheatdata.eu/modules/sol/histdata.asp?anlaeg=', site, "&fromdate=", start_date,"&todate=",end_date ,"&results=hours&csv=1"), 
               header = FALSE, sep = ';')

## give header correct names
names(sh_raw) <- c('date', 'solar_heat_MWh', 'solar_heat_production_Whm2', 'solar_radiation_Whm2')

## trim data to match ssdr and t2m
sh_raw <- sh_raw[1:NROW(ssdr),]

为solar 函数准备数据。 Vra的纬度是57.4,面板的角度是35度。


## lubridate used to create date variables
library(lubridate)

## create data frame of date, G0 and Ta for solaR
sh_dat <- sh_raw %>% 
  transmute(date = dmy_hm(str_sub(date, 0, -7)),
         G0 = ssdr,
         Ta = t2m-273.15)

##calculate bdI Meteo object
bdi_df = dfI2Meteo(sh_dat, lat = 57.4, time.col = 'date')

## obtain the global, diffuse and direct irradiation and irradiance on the generator plane (which is 35 degrees)
gef <- calcGef(lat = 57.4, modeRad = 'bdI', dataRad = bdi_df, beta = 35)

输出数据框包含 G 列,即斜面上的全局辐照度。但是,将其与测量值绘制出来会得到截然不同的结果。


## output data frame for each hour
output_df <- data.frame(gef@GefI)

##add measured irradiation from site as a column for comparison
output_df$site_Wm2 <- sh_raw$solar_radiation_Whm2
output_df$date <- ymd_hms(row.names(output_df))

## time_dygraph very handy for plotting and visualising time series ## remotes::install_github("skgrange/threadr")
library(threadr)

threadr::time_dygraph(output_df, variable = c('G', 'site_Wm2'))

我了解 ECMWF 数据是针对 9 公里网格的,但是,基本上倾斜值看起来不正确。这也是我的理解,我可以使用不同的模型,但是对于 calcgef 函数我看不到这些。

【问题讨论】:

  • 关于“倾斜值看起来不正确”。我认为您可以通过展示一些价值观并具体说明您认为不正确的内容来帮助他人。关于调试这样的东西,尝试一个更简单的案例,您可以更轻松地确定输出应该是什么。例如。太阳正午,水平表面或倾角=纬度,类似的东西。
  • @B_K 除非绝对必要,否则不建议使用 ERA5 等再分析数据进行辐照度。对于丹麦,有几个免费的辐照度数据集可用,准确度要高得多。首先,我建议您研究 PVGIS,它也可以为您转换到倾斜平面。如果有兴趣,我可以提供一个使用 pvlib 的 Python 示例。
  • 感谢您的意见,亚当。自从这篇文章以来,我没有机会研究这么多,但 python 示例真的很有帮助。
  • 关于 ERA5 的使用,ECMWF 警告不要将其用于单个站点,因为该值代表完整的网格,在陆地数据的情况下为 9 公里。在我看来,这比使用 50 公里以外的测量值更好吗?辐射测量点真的很难找到。

标签: r solar


【解决方案1】:

让我们将您的数据与该位置的外星辐照度进行比较:

## Extract all the variables as a time series 
z <- as.zooI(gef, complete = TRUE)
## Include the original values of irradiance
z$ssdr <- ssdr 
## Plot both time series together
xyplot(z[, c("Bo0", "ssdr")], superpose = TRUE)

如图所示,这些时间序列并不同步。在一天中的某些时间里,水平面上的辐照度大于外星辐照度,这是不可能的。这就是您在 gef 对象中获得 NA 值的原因。

您的ssdr 时间序列很可能使用当地时间。如果是这种情况,您必须使用local2Solar 函数将其更改为根据经度表示的太阳时(请阅读此函数的帮助页面以获取更多信息)。您应该查看calcG0 函数帮助页面的最后一个示例。该示例使用本地时间从 NREL 站下载数据,并使用local2solar 修改时间戳。

PD。我不明白你为什么下载数据但你不使用它。

【讨论】:

    猜你喜欢
    • 2018-06-26
    • 1970-01-01
    • 2012-11-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-11-30
    • 2017-01-02
    • 1970-01-01
    相关资源
    最近更新 更多