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
17618263
Commit
17618263
authored
4 years ago
by
Mads M. Pedersen
Browse files
Options
Downloads
Patches
Plain Diff
fix bug in data variables for YZGridded flow maps
parent
4cbab6af
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/flow_map.py
+6
-4
6 additions, 4 deletions
py_wake/flow_map.py
py_wake/tests/test_flow_map.py
+20
-0
20 additions, 0 deletions
py_wake/tests/test_flow_map.py
with
26 additions
and
4 deletions
py_wake/flow_map.py
+
6
−
4
View file @
17618263
...
...
@@ -32,7 +32,7 @@ class FlowMap(FlowBox):
Y
=
Y
[:,
:,
na
]
H
=
np
.
reshape
(
localWind_j
.
h
.
data
,
X
.
shape
)
elif
plane
[
0
]
==
'
YZ
'
:
H
=
Y
.
T
[
na
,
:
,
:]
H
=
Y
.
T
[
:,
na
,
:]
Y
=
X
.
T
[:,
na
,
:]
X
=
np
.
reshape
(
localWind_j
.
x
.
data
,
Y
.
shape
)
else
:
...
...
@@ -46,7 +46,9 @@ class FlowMap(FlowBox):
if
plane
[
0
]
==
"
YZ
"
:
# set flowMap.WS_xylk etc.
for
k
in
[
'
WS_eff
'
,
'
TI_eff
'
,
'
WS
'
,
'
WD
'
,
'
TI
'
,
'
P
'
]:
setattr
(
self
.
__class__
,
"
%s_xylk
"
%
k
,
property
(
lambda
self
,
k
=
k
:
self
[
k
].
isel
(
x
=
0
)))
self
[
k
]
=
self
[
k
].
transpose
(
'
h
'
,
'
y
'
,
...)
setattr
(
self
.
__class__
,
"
%s_xylk
"
%
k
,
property
(
lambda
self
,
k
=
k
:
self
[
k
].
isel
(
x
=
0
).
transpose
(
'
y
'
,
'
h
'
,
...)))
self
.
plane
=
plane
...
...
@@ -129,7 +131,7 @@ class FlowMap(FlowBox):
y
=
self
.
X
[
0
]
x
=
np
.
zeros_like
(
y
)
+
self
.
plane
[
1
]
z
=
self
.
simulationResult
.
windFarmModel
.
site
.
elevation
(
x
,
y
)
c
=
ax
.
contourf
(
self
.
X
,
self
.
Y
+
z
,
np
.
reshape
(
data
.
isel
(
x
=
0
),
self
.
X
.
shape
),
levels
=
levels
,
cmap
=
cmap
)
c
=
ax
.
contourf
(
self
.
X
,
self
.
Y
+
z
,
data
.
isel
(
x
=
0
),
levels
=
levels
,
cmap
=
cmap
)
if
plot_colorbar
:
plt
.
colorbar
(
c
,
label
=
clabel
,
ax
=
ax
)
# plot terrain
...
...
@@ -315,4 +317,4 @@ class YZGrid(Grid):
Y
,
Z
=
np
.
meshgrid
(
y
,
z
)
X
=
np
.
zeros_like
(
Y
)
+
x
return
Y
,
Z
,
X
.
flatten
(),
Y
.
flatten
(),
Z
.
flatten
()
return
Y
,
Z
,
X
.
T
.
flatten
(),
Y
.
T
.
flatten
(),
Z
.
T
.
flatten
()
This diff is collapsed.
Click to expand it.
py_wake/tests/test_flow_map.py
+
20
−
0
View file @
17618263
...
...
@@ -77,6 +77,26 @@ def test_YZGrid_plot_wake_map_perpendicular():
plt
.
close
()
def
test_YZGrid_variables
():
site
=
IEA37Site
(
16
)
x
,
y
=
[
0
],
[
0
]
windTurbines
=
IEA37_WindTurbines
()
wf_model
=
IEA37SimpleBastankhahGaussian
(
site
,
windTurbines
)
sim_res
=
wf_model
(
x
,
y
)
fm
=
sim_res
.
flow_map
(
grid
=
YZGrid
(
x
=
100
,
y
=
None
,
resolution
=
100
,
extend
=
.
1
),
wd
=
270
,
ws
=
None
)
fm
.
WS_eff
.
plot
()
plt
.
plot
(
fm
.
y
[::
10
],
fm
.
y
[::
10
]
*
0
+
110
,
'
.
'
)
if
0
:
print
(
np
.
round
(
fm
.
WS_eff
.
interp
(
h
=
110
)[::
10
].
squeeze
().
values
,
4
))
plt
.
show
()
plt
.
close
()
npt
.
assert_array_almost_equal
(
fm
.
WS_eff
.
interp
(
h
=
110
)[::
10
].
squeeze
(),
[
9.1461
,
8.4157
,
7.3239
,
6.058
,
5.022
,
4.6455
,
5.1019
,
6.182
,
7.446
,
8.506
],
4
)
def
test_YZGrid_plot_wake_map_parallel
():
site
=
IEA37Site
(
16
)
x
,
y
=
site
.
initial_position
.
T
...
...
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