-
Notifications
You must be signed in to change notification settings - Fork 0
/
Wind energy.py
70 lines (47 loc) · 1.27 KB
/
Wind energy.py
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
59
60
61
62
63
64
65
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 22 16:47:30 2022
@author: quang
"""
import pandas as pd
import math
import numpy as np
import xarray as xr
from netCDF4 import Dataset
ds = xr.open_dataset('Weibull_c_k_150m.nc')
k = ds.k.values
c = ds.c.values
df = pd.read_csv('Power curve.csv')
# Turbine
ro = 1.225
Vcin = 4
Vcout = 25
Vrate = 11
Prate = 15000 #kW 15MW
D = 248;
A = math.pi*D**2/4;
do = xr.Dataset()
do['AEP'] = ds['k']*0
time = 365*24;
for i in range(0,26):
#if ((~np.isnan(ds.k)) and (~np.isnan(ds.c)) == True):
Cpeq = df.Cp[i]
fv = k/c*(i/c)**(k-1)*np.exp(-(i/c)**k)
do.AEP.values = do.AEP.values + df.Power[i]*fv*time
'''
if i >= Vcin and i<Vrate:
do.AEP.values = do.AEP.values + 0.5*ro*A*Cpeq*i**3/1000*fv*time
if i >= Vrate and i <= Vcout:
do.AEP.values = do.AEP.values + Prate*fv*time
'''
do.to_netcdf('AEP_150m.nc')
'''
for i in range(0,26):
#if ((~np.isnan(ds.k)) and (~np.isnan(ds.c)) == True):
fv = k/c*(i/c)**(k-1)*np.exp(-(i/c)**k)
if i >= Vcin and i<Vrate:
do.AEP.values = do.AEP.values + 0.5*ro*A*Cpeq*i**3/1000*fv*time
if i >= Vrate and i <= Vcout:
do.AEP.values = do.AEP.values + Prate*fv*time
do.to_netcdf('AEP_150m.nc')
'''