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
2610f8e6
Commit
2610f8e6
authored
6 years ago
by
Mads M. Pedersen
Committed by
Mads M. Pedersen
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
adde test of wec
parent
3c4585e5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
py_wake/tests/test_wake_model.py
+76
-0
76 additions, 0 deletions
py_wake/tests/test_wake_model.py
py_wake/tests/test_wake_models/test_noj.py
+5
-6
5 additions, 6 deletions
py_wake/tests/test_wake_models/test_noj.py
with
81 additions
and
6 deletions
py_wake/tests/test_wake_model.py
0 → 100644
+
76
−
0
View file @
2610f8e6
import
numpy
as
np
import
pytest
from
py_wake.examples.data.iea37
import
iea37_path
from
py_wake.examples.data.iea37._iea37
import
IEA37_WindTurbines
,
IEA37Site
from
py_wake.wake_models.noj
import
NOJ
from
py_wake.examples.data.iea37.iea37_reader
import
read_iea37_windrose
from
py_wake.site._site
import
UniformSite
from
py_wake.aep_calculator
import
AEPCalculator
from
py_wake.tests
import
npt
from
py_wake.examples.data.hornsrev1
import
HornsrevV80
from
py_wake.tests.test_files
import
tfp
from
py_wake.wake_models.fuga
import
Fuga
from
py_wake.tests.test_files.fuga
import
LUT_path_2MW_z0_0_03
def
test_wake_model
():
_
,
_
,
freq
=
read_iea37_windrose
(
iea37_path
+
"
iea37-windrose.yaml
"
)
site
=
UniformSite
(
freq
,
ti
=
0.75
)
windTurbines
=
IEA37_WindTurbines
(
iea37_path
+
'
iea37-335mw.yaml
'
)
wake_model
=
NOJ
(
windTurbines
)
aep
=
AEPCalculator
(
site
,
windTurbines
,
wake_model
)
with
pytest
.
raises
(
ValueError
,
match
=
"
Turbines 0 and 1 are at the same position
"
):
aep
.
calculate_AEP
([
0
,
0
],
[
0
,
0
],
wd
=
np
.
arange
(
0
,
360
,
22.5
),
ws
=
[
9.8
])
def
test_wec
():
# move turbine 1 600 300
wt_x
=
[
-
250
,
600
,
-
500
,
0
,
500
,
-
250
,
250
]
wt_y
=
[
433
,
300
,
0
,
0
,
0
,
-
433
,
-
433
]
wts
=
HornsrevV80
()
site
=
UniformSite
([
1
,
0
,
0
,
0
],
ti
=
0.75
)
wake_model
=
Fuga
(
LUT_path_2MW_z0_0_03
,
wts
)
aep
=
AEPCalculator
(
site
,
wts
,
wake_model
)
x_j
=
np
.
linspace
(
-
1500
,
1500
,
500
)
y_j
=
np
.
linspace
(
-
1500
,
1500
,
300
)
_
,
_
,
Z_wec1
=
aep
.
wake_map
(
x_j
,
y_j
,
70
,
wt_x
,
wt_y
,
wt_height
=
70
,
wd
=
[
30
],
ws
=
[
10
])
aep
.
wake_model
.
wec
=
2
X
,
Y
,
Z_wec2
=
aep
.
wake_map
(
x_j
,
y_j
,
70
,
wt_x
,
wt_y
,
wt_height
=
70
,
wd
=
[
30
],
ws
=
[
10
])
if
0
:
import
matplotlib.pyplot
as
plt
c
=
plt
.
contourf
(
X
,
Y
,
Z_wec1
,
np
.
arange
(
6
,
10.5
,
.
1
))
plt
.
colorbar
(
c
)
plt
.
plot
(
X
[
0
],
Y
[
140
])
wts
.
plot
(
wt_x
,
wt_y
)
plt
.
figure
()
c
=
plt
.
contourf
(
X
,
Y
,
Z_wec2
,
np
.
arange
(
6
,
10.5
,
.
1
))
plt
.
colorbar
(
c
)
plt
.
plot
(
X
[
0
],
Y
[
140
])
wts
.
plot
(
wt_x
,
wt_y
)
plt
.
figure
()
plt
.
plot
(
X
[
0
],
Z_wec1
[
140
,
:],
label
=
"
Z=70m
"
)
plt
.
plot
(
X
[
0
],
Z_wec2
[
140
,
:],
label
=
"
Z=70m
"
)
plt
.
plot
(
X
[
0
,
100
:
400
:
10
],
Z_wec1
[
140
,
100
:
400
:
10
],
'
.
'
)
plt
.
plot
(
X
[
0
,
100
:
400
:
10
],
Z_wec2
[
140
,
100
:
400
:
10
],
'
.
'
)
plt
.
legend
()
plt
.
show
()
npt
.
assert_array_almost_equal
(
Z_wec1
[
140
,
100
:
400
:
10
],
[
10.0547
,
10.0519
,
10.0718
,
10.0093
,
9.6786
,
7.8589
,
6.8539
,
9.2199
,
9.9837
,
10.036
,
10.0796
,
10.0469
,
10.0439
,
9.1866
,
7.2552
,
9.1518
,
10.0449
,
10.0261
,
10.0353
,
9.9256
,
9.319
,
8.0062
,
6.789
,
8.3578
,
9.9393
,
10.0332
,
10.0191
,
10.0186
,
10.0191
,
10.0139
],
4
)
npt
.
assert_array_almost_equal
(
Z_wec2
[
140
,
100
:
400
:
10
],
[
10.0297
,
9.9626
,
9.7579
,
9.2434
,
8.2318
,
7.008
,
6.7039
,
7.7303
,
9.0101
,
9.6877
,
9.9068
,
9.7497
,
9.1127
,
7.9505
,
7.26
,
7.9551
,
9.2104
,
9.7458
,
9.6637
,
9.1425
,
8.2403
,
7.1034
,
6.5109
,
7.2764
,
8.7653
,
9.7139
,
9.9718
,
10.01
,
10.0252
,
10.0357
],
4
)
This diff is collapsed.
Click to expand it.
py_wake/tests/test_wake_models/test_noj.py
+
5
−
6
View file @
2610f8e6
...
...
@@ -2,7 +2,7 @@ import pytest
import
numpy
as
np
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
,
IEA37Site
from
py_wake.examples.data.iea37.iea37_reader
import
read_iea37_windrose
,
\
read_iea37_windfarm
from
py_wake.site._site
import
UniformSite
...
...
@@ -85,11 +85,10 @@ def test_NOJ_6_turbines_in_row():
def
test_wake_map
():
_
,
_
,
freq
=
read_iea37_windrose
(
iea37_path
+
"
iea37-windrose.yaml
"
)
n_wt
=
16
x
,
y
,
_
=
read_iea37_windfarm
(
iea37_path
+
'
iea37-ex%d.yaml
'
%
n_wt
)
site
=
IEA37Site
(
16
)
x
,
y
=
site
.
initial_position
.
T
site
=
UniformSite
(
freq
,
ti
=
0.75
)
windTurbines
=
IEA37_WindTurbines
(
iea37_path
+
'
iea37-335mw.yaml
'
)
wake_model
=
NOJ
(
windTurbines
)
aep
=
AEPCalculator
(
site
,
windTurbines
,
wake_model
)
...
...
@@ -101,7 +100,7 @@ def test_wake_map():
import
matplotlib.pyplot
as
plt
c
=
plt
.
contourf
(
X
,
Y
,
Z
)
# , np.arange(2, 10, .01))
plt
.
colorbar
(
c
)
site
.
plot_
wind
t
urbines
(
x
,
y
)
wind
T
urbines
.
plot
(
x
,
y
)
plt
.
show
()
...
...
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