Description Usage Arguments Value See Also Examples
View source: R/calculate_energy.R
Calculate the energy output and efficiency rates of an individual in the current population under all given wind directions and speeds. If the terrain effect model is activated, the main calculations to model those effects will be done in this function.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | calculate_energy(
sel,
referenceHeight,
RotorHeight,
SurfaceRoughness,
wnkl,
distanz,
polygon1,
RotorR,
dirSpeed,
srtm_crop,
topograp,
cclRaster,
weibull,
plotit = FALSE
)
|
sel |
A matrix of an individual of the current population |
referenceHeight |
The height at which the incoming wind speeds were
measured. Default is |
RotorHeight |
The height of the turbine hub |
SurfaceRoughness |
A surface roughness length in meters.
With the terrain effect model, a surface roughness is calculated for every
grid cell using the elevation and land cover data. Default is |
wnkl |
The angle from which wake influences are considered to be negligible |
distanz |
The distance after which wake effects are considered to be eliminated |
polygon1 |
The considered area as Simple Feature Polygon |
RotorR |
The desired rotor radius in meter |
dirSpeed |
The wind speed and direction data.frame |
srtm_crop |
A list of 3 raster, with 1) the elevation, 2) an orographic
and 3) a terrain raster. Calculated in |
topograp |
Boolean value, which indicates if the terrain effect model
should be enabled or not. Default is |
cclRaster |
A Corine Land Cover raster, that has to be adapted previously by hand with the surface roughness length for every land cover type. Is only used, when the terrain effect model is activated. |
weibull |
A boolean value that specifies whether to take Weibull
parameters into account. If |
plotit |
If |
Returns a list of an individual of the current generation with resulting wake effects, energy outputs, efficiency rates for every wind direction. The length of the list corresponds to the number of different wind directions.
Other Wind Energy Calculation Functions:
barometric_height()
,
get_dist_angles()
,
turbine_influences()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | ## Not run:
## Create a random Polygon
library(sf)
Polygon1 <- sf::st_as_sf(sf::st_sfc(
sf::st_polygon(list(cbind(
c(4498482, 4498482, 4499991, 4499991, 4498482),
c(2668272, 2669343, 2669343, 2668272, 2668272)))),
crs = 3035
))
## Create a uniform and unidirectional wind data.frame and plot the
## resulting wind rose
data.in <- data.frame(ws = 12, wd = 0)
windrosePlot <- plot_windrose(data = data.in, spd = data.in$ws,
dir = data.in$wd, dirres=10, spdmax=20)
## Assign the rotor radius and a factor of the radius for grid spacing.
Rotor= 50; fcrR= 3
resGrid <- grid_area(shape = Polygon1, size = Rotor*fcrR, prop=1,
plotGrid = TRUE)
## Assign the indexed data frame to new variable. Element 2 of the list
## is the grid, saved as Simple Feature Polygons.
resGrid1 <- resGrid[[1]]
## Create an initial population with the indexed Grid, 15 turbines and
## 100 individuals.
initpop <- init_population(Grid = resGrid1, n = 15, nStart = 100)
## Calculate the expected energy output of the first individual of the
## population.
par(mfrow = c(1,2))
plot(Polygon1); points(initpop[[1]][,'X'],initpop[[1]][,'Y'], pch=20,cex=2)
plot(resGrid[[2]], add = TRUE)
resCalcEn <- calculate_energy(sel=initpop[[1]],referenceHeight= 50,
RotorHeight= 50, SurfaceRoughness = 0.14,wnkl = 20,
distanz = 100000, dirSpeed = data.in,
RotorR = 50, polygon1 = Polygon1, topograp = FALSE,
weibull = FALSE)
resCalcEn <- as.data.frame(resCalcEn)
plot(Polygon1, main = resCalcEn[,'Energy_Output_Red'][[1]])
points(x = resCalcEn[,'Bx'], y = resCalcEn[,'By'], pch = 20)
## Create a variable and multidirectional wind data.frame and plot the
## resulting wind rose
data.in10 <- data.frame(ws = runif(10,1,25), wd = runif(10,0,360))
windrosePlot <- plot_windrose(data = data.in10, spd = data.in10$ws,
dir = data.in10$wd, dirres=10, spdmax=20)
## Calculate the energy outputs for the first individual with more than one
## wind direction.
resCalcEn <- calculate_energy(sel=initpop[[1]],referenceHeight= 50,
RotorHeight= 50, SurfaceRoughness = 0.14,wnkl = 20,
distanz = 100000, dirSpeed = data.in10,
RotorR = 50, polygon1 = Polygon1, topograp = FALSE,
weibull = FALSE)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.