Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
PyWake
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TOPFARM
PyWake
Commits
a619ef52
Commit
a619ef52
authored
6 years ago
by
Mads M. Pedersen
Browse files
Options
Downloads
Patches
Plain Diff
normalize sector frequency
parent
66a78c09
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
py_wake/examples/data/hornsrev1.py
+4
-1
4 additions, 1 deletion
py_wake/examples/data/hornsrev1.py
py_wake/site/_site.py
+1
-0
1 addition, 0 deletions
py_wake/site/_site.py
py_wake/tests/test_aep.py
+23
-17
23 additions, 17 deletions
py_wake/tests/test_aep.py
with
28 additions
and
18 deletions
py_wake/examples/data/hornsrev1.py
+
4
−
1
View file @
a619ef52
...
@@ -71,7 +71,7 @@ ct_curve = np.array([[3.0, 0.0],
...
@@ -71,7 +71,7 @@ ct_curve = np.array([[3.0, 0.0],
[
25.0
,
0.053
]])
[
25.0
,
0.053
]])
class
Hornsrev
V80
(
OneTypeWindTurbines
):
class
V80
(
OneTypeWindTurbines
):
def
__init__
(
self
):
def
__init__
(
self
):
OneTypeWindTurbines
.
__init__
(
self
,
'
V80
'
,
diameter
=
80
,
hub_height
=
70
,
OneTypeWindTurbines
.
__init__
(
self
,
'
V80
'
,
diameter
=
80
,
hub_height
=
70
,
ct_func
=
self
.
ct
,
power_func
=
self
.
power
)
ct_func
=
self
.
ct
,
power_func
=
self
.
power
)
...
@@ -83,6 +83,9 @@ class HornsrevV80(OneTypeWindTurbines):
...
@@ -83,6 +83,9 @@ class HornsrevV80(OneTypeWindTurbines):
return
np
.
interp
(
u
,
power_curve
[:,
0
],
power_curve
[:,
1
])
return
np
.
interp
(
u
,
power_curve
[:,
0
],
power_curve
[:,
1
])
HornsrevV80
=
V80
class
HornsrevSite
(
UniformWeibullSite
):
class
HornsrevSite
(
UniformWeibullSite
):
def
__init__
(
self
):
def
__init__
(
self
):
f
=
[
3.597152
,
3.948682
,
5.167395
,
7.000154
,
8.364547
,
6.43485
,
f
=
[
3.597152
,
3.948682
,
5.167395
,
7.000154
,
8.364547
,
6.43485
,
...
...
This diff is collapsed.
Click to expand it.
py_wake/site/_site.py
+
1
−
0
View file @
a619ef52
...
@@ -161,6 +161,7 @@ class UniformWeibullSite(UniformSite):
...
@@ -161,6 +161,7 @@ class UniformWeibullSite(UniformSite):
wdir
=
np
.
linspace
(
0
,
360
,
len
(
p_wd
),
endpoint
=
False
)
wdir
=
np
.
linspace
(
0
,
360
,
len
(
p_wd
),
endpoint
=
False
)
indexes
=
np
.
argmin
((
np
.
arange
(
360
)[:,
np
.
newaxis
]
-
wdir
+
360
/
len
(
p_wd
)
/
2
)
%
360
,
1
)
indexes
=
np
.
argmin
((
np
.
arange
(
360
)[:,
np
.
newaxis
]
-
wdir
+
360
/
len
(
p_wd
)
/
2
)
%
360
,
1
)
self
.
p_wd
=
np
.
array
(
p_wd
)[
indexes
]
/
(
360
/
len
(
p_wd
))
self
.
p_wd
=
np
.
array
(
p_wd
)[
indexes
]
/
(
360
/
len
(
p_wd
))
self
.
p_wd
/=
self
.
p_wd
.
sum
()
self
.
a
=
np
.
array
(
a
)[
indexes
]
self
.
a
=
np
.
array
(
a
)[
indexes
]
self
.
k
=
np
.
array
(
k
)[
indexes
]
self
.
k
=
np
.
array
(
k
)[
indexes
]
...
...
This diff is collapsed.
Click to expand it.
py_wake/tests/test_aep.py
+
23
−
17
View file @
a619ef52
...
@@ -3,7 +3,7 @@ from py_wake.examples.data.iea37 import iea37_path
...
@@ -3,7 +3,7 @@ from py_wake.examples.data.iea37 import iea37_path
from
py_wake.examples.data.iea37._iea37
import
IEA37_WindTurbines
from
py_wake.examples.data.iea37._iea37
import
IEA37_WindTurbines
from
py_wake.examples.data.iea37.iea37_reader
import
read_iea37_windrose
,
\
from
py_wake.examples.data.iea37.iea37_reader
import
read_iea37_windrose
,
\
read_iea37_windfarm
read_iea37_windfarm
from
py_wake.site._site
import
UniformSite
from
py_wake.site._site
import
UniformSite
,
UniformWeibullSite
from
py_wake.tests
import
npt
from
py_wake.tests
import
npt
from
py_wake.wake_models.noj
import
NOJ
from
py_wake.wake_models.noj
import
NOJ
from
py_wake.examples.data
import
hornsrev1
from
py_wake.examples.data
import
hornsrev1
...
@@ -11,6 +11,13 @@ from py_wake.wake_models.gaussian import IEA37SimpleBastankhahGaussian
...
@@ -11,6 +11,13 @@ from py_wake.wake_models.gaussian import IEA37SimpleBastankhahGaussian
import
numpy
as
np
import
numpy
as
np
def
test_aep_no_wake
():
site
=
UniformWeibullSite
([
1
],
[
10
],
[
2
],
.
75
)
V80
=
hornsrev1
.
V80
()
aep
=
AEP
(
site
,
V80
,
NOJ
(
V80
))
npt
.
assert_almost_equal
(
aep
.
calculate_AEP
([
0
],
[
0
]).
sum
(),
8.260757098
,
9
)
def
test_wake_map
():
def
test_wake_map
():
_
,
_
,
freq
=
read_iea37_windrose
(
iea37_path
+
"
iea37-windrose.yaml
"
)
_
,
_
,
freq
=
read_iea37_windrose
(
iea37_path
+
"
iea37-windrose.yaml
"
)
n_wt
=
16
n_wt
=
16
...
@@ -43,8 +50,8 @@ def test_wake_map():
...
@@ -43,8 +50,8 @@ def test_wake_map():
def
test_aep_map
():
def
test_aep_map
():
_
,
_
,
freq
=
read_iea37_windrose
(
iea37_path
+
"
iea37-windrose.yaml
"
)
_
,
_
,
freq
=
read_iea37_windrose
(
iea37_path
+
"
iea37-windrose.yaml
"
)
n_wt
=
16
#
n_wt = 16
x
,
y
,
_
=
read_iea37_windfarm
(
iea37_path
+
'
iea37-ex%d.yaml
'
%
n_wt
)
#
x, y, _ = read_iea37_windfarm(iea37_path + 'iea37-ex%d.yaml' % n_wt)
x
=
[
0
,
0
]
x
=
[
0
,
0
]
y
=
[
0
,
200
]
y
=
[
0
,
200
]
...
@@ -52,11 +59,11 @@ def test_aep_map():
...
@@ -52,11 +59,11 @@ def test_aep_map():
windTurbines
=
IEA37_WindTurbines
(
iea37_path
+
'
iea37-335mw.yaml
'
)
windTurbines
=
IEA37_WindTurbines
(
iea37_path
+
'
iea37-335mw.yaml
'
)
wake_model
=
IEA37SimpleBastankhahGaussian
(
windTurbines
)
wake_model
=
IEA37SimpleBastankhahGaussian
(
windTurbines
)
aep
=
AEP
(
site
,
windTurbines
,
wake_model
)
aep
=
AEP
(
site
,
windTurbines
,
wake_model
)
print
(
aep
.
calculate_AEP
([
0
],
[
0
]).
sum
())
#
print(aep.calculate_AEP([0], [0]).sum())
x_j
=
np
.
arange
(
-
150
,
150
,
20
)
x_j
=
np
.
arange
(
-
150
,
150
,
20
)
y_j
=
np
.
arange
(
-
250
,
250
,
20
)
y_j
=
np
.
arange
(
-
250
,
250
,
20
)
X
,
Y
,
Z
=
aep
.
aep_map
(
x_j
,
y_j
,
0
,
x
,
y
,
wd
=
[
0
])
X
,
Y
,
Z
=
aep
.
aep_map
(
x_j
,
y_j
,
0
,
x
,
y
,
wd
=
[
0
])
print
(
y_j
)
#
print(y_j)
if
0
:
if
0
:
import
matplotlib.pyplot
as
plt
import
matplotlib.pyplot
as
plt
c
=
plt
.
contourf
(
X
,
Y
,
Z
,
100
)
# , np.arange(2, 10, .01))
c
=
plt
.
contourf
(
X
,
Y
,
Z
,
100
)
# , np.arange(2, 10, .01))
...
@@ -68,20 +75,19 @@ def test_aep_map():
...
@@ -68,20 +75,19 @@ def test_aep_map():
plt
.
axis
(
'
equal
'
)
plt
.
axis
(
'
equal
'
)
plt
.
show
()
plt
.
show
()
print
(
np
.
round
(
Z
[
17
],
2
).
tolist
())
#
print(np.round(Z[17], 2).tolist())
ref
=
[
21.5
,
21.4
,
21.02
,
20.34
,
18.95
,
16.54
,
13.17
,
10.17
,
10.17
,
13.17
,
16.54
,
18.95
,
20.34
,
21.02
,
21.4
]
ref
=
[
21.5
,
21.4
,
21.02
,
20.34
,
18.95
,
16.54
,
13.17
,
10.17
,
10.17
,
13.17
,
16.54
,
18.95
,
20.34
,
21.02
,
21.4
]
npt
.
assert_array_almost_equal
(
Z
[
17
],
ref
,
2
)
npt
.
assert_array_almost_equal
(
Z
[
17
],
ref
,
2
)
def
test_aep_no_wake_loss
():
def
test_aep_no_wake_loss
_hornsrev
():
_
,
_
,
freq
=
read_iea37_windrose
(
iea37_path
+
"
iea37-windrose.yaml
"
)
wt
=
hornsrev1
.
V80
(
)
n_wt
=
16
x
,
y
=
hornsrev1
.
wt_x
,
hornsrev1
.
wt_y
x
,
y
,
_
=
read_iea37_windfarm
(
iea37_path
+
'
iea37-ex%d.yaml
'
%
n_wt
)
site
=
UniformWeibullSite
([
1
],
[
10
],
[
2
],
.
75
)
x
=
[
0
,
0
]
aep
=
AEP
(
site
,
wt
,
NOJ
(
wt
))
y
=
[
0
,
200
]
npt
.
assert_almost_equal
(
aep
.
calculate_AEP_no_wake_loss
(
x
,
y
).
sum
()
/
80
,
8.260757098
)
site
=
UniformSite
(
freq
,
ti
=
0.75
)
windTurbines
=
IEA37_WindTurbines
(
iea37_path
+
'
iea37-335mw.yaml
'
)
cap_factor
=
aep
.
calculate_AEP
(
x
,
y
).
sum
()
/
aep
.
calculate_AEP_no_wake_loss
(
x
,
y
).
sum
()
wake_model
=
IEA37SimpleBastankhahGaussian
(
windTurbines
)
# print(cap_factor)
aep
=
AEP
(
site
,
windTurbines
,
wake_model
)
npt
.
assert_almost_equal
(
cap_factor
,
0.947175839142014
)
print
(
aep
.
calculate_AEP_no_wake_loss
(
x
,
y
))
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment