-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFarm.py
71 lines (51 loc) · 1.74 KB
/
Farm.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
66
67
68
69
70
71
# -*- coding: utf-8 -*-
"""
Created on Fri Oct 25 10:49:00 2019
@author: Eric Lee
"""
import numpy as np
from Jensen_Point_Model import Jensen_Point as JP
from Katic_Model2 import Katic
from Tester import rotation_matrix as rm
from Reorder import reorder
generatorEfficiency = .5
air_density = 1
Cp = .3
alpha = .1
rnot = 20
u = 8.1
WindDir = 0
n = 8
nturbines = np.array([[0,0,20],[0,40,20],[0,100,20]])
n = len(nturbines)
for i in range(n):
nturbines[i,:] = np.dot(rm(WindDir),nturbines[i,:])
#PosWind = np.dot(rm(axis, WindDir), PosWind)
#Turbine1 = np.dot(rm(axis, WindDir), Turbine1)
nturbines = reorder(nturbines)
wtVelocityTH = np.zeros([1,n])
wtVelocityCos = np.zeros([1,n])
WSTop = u
WSCos = u
for i in range(n):
if i == 0:
wtVelocityTH[0,i] = u
wtVelocityCos[0,i] = u
elif i == 1:
WSTop = JP(alpha,rnot,WSTop,nturbines[i-1,:],nturbines[i,:])
WSCos = JP(alpha,rnot,WSCos,nturbines[i-1,:],nturbines[i,:])
wtVelocityTH[0,i] = WSTop[0]
wtVelocityCos[0,i] = WSCos[1]
WSTop = WSTop[0]
WSCos = WSCos[1]
else:
#(TurbineN, rnot, PosWind,alpha,u,otheru)
WSTop = Katic(nturbines[:i,:], rnot, nturbines[i,:], alpha, WSTop, wtVelocityTH[:i])
WSCos = Katic(nturbines[:i,:], rnot, nturbines[i,:], alpha, WSCos, wtVelocityCos[:i])
wtVelocityTH[0,i] = WSTop[0]
wtVelocityCos[0,i] = WSCos[1]
WSTop = WSTop[0]
WSCos = WSCos[1]
rotorArea = np.pi * rnot**2
wtPowerTH = generatorEfficiency*(0.5*air_density*rotorArea*Cp*np.power(wtVelocityTH, 3))
wtPowerCos = generatorEfficiency*(0.5*air_density*rotorArea*Cp*np.power(wtVelocityCos, 3))