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
d2e5f087
Commit
d2e5f087
authored
6 years ago
by
Mads M. Pedersen
Browse files
Options
Downloads
Patches
Plain Diff
Aep map
parent
7359dc93
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/aep/_aep.py
+21
-3
21 additions, 3 deletions
py_wake/aep/_aep.py
py_wake/tests/test_files/fuga/__init__.py
+2
-0
2 additions, 0 deletions
py_wake/tests/test_files/fuga/__init__.py
py_wake/wake_model.py
+8
-2
8 additions, 2 deletions
py_wake/wake_model.py
with
31 additions
and
5 deletions
py_wake/aep/_aep.py
+
21
−
3
View file @
d2e5f087
...
...
@@ -42,15 +42,33 @@ class AEP():
AEP_GWh_ilk
=
self
.
power_ilk
*
self
.
P_lk
[
na
,
:,
:]
*
24
*
365
*
1e-9
return
AEP_GWh_ilk
def
wake_map
(
self
,
x_j
,
y_j
,
h
,
x_i
,
y_i
,
type_i
=
None
,
h_i
=
None
,
wd
=
None
,
ws
=
None
):
def
WS_eff_map
(
self
,
x_j
,
y_j
,
h
,
x_i
,
y_i
,
type_i
=
None
,
h_i
=
None
,
wd
=
None
,
ws
=
None
):
X_j
,
Y_j
=
np
.
meshgrid
(
x_j
,
y_j
)
x_j
,
y_j
=
X_j
.
flatten
(),
Y_j
.
flatten
()
if
len
(
x_i
)
==
0
:
_
,
WS_jlk
,
_
,
P_lk
=
self
.
site
.
local_wind
(
x_j
,
y_j
,
wd
,
ws
)
return
X_j
,
Y_j
,
WS_jlk
,
P_lk
h_i
,
type_i
,
wd
,
ws
=
self
.
_get_defaults
(
x_i
,
h_i
,
type_i
,
wd
,
ws
)
self
.
_run_wake_model
(
x_i
,
y_i
,
h_i
,
type_i
,
wd
,
ws
)
X_j
,
Y_j
=
np
.
meshgrid
(
x_j
,
y_j
)
x_j
,
y_j
=
X_j
.
flatten
(),
Y_j
.
flatten
()
h_j
=
np
.
zeros_like
(
x_j
)
+
h
_
,
WS_jlk
,
_
,
P_lk
=
self
.
site
.
local_wind
(
x_j
,
y_j
,
wd
,
ws
)
dw_ijl
,
cw_ijl
,
_
=
self
.
site
.
distances
(
x_i
,
y_i
,
h_i
,
x_j
,
y_j
,
h_j
,
self
.
WD_ilk
.
mean
(
2
))
WS_eff_jlk
=
self
.
wake_model
.
wake_map
(
self
.
WS_ilk
,
self
.
WS_eff_ilk
,
dw_ijl
,
cw_ijl
,
self
.
ct_ilk
,
type_i
,
WS_jlk
)
return
X_j
,
Y_j
,
WS_eff_jlk
,
P_lk
def
wake_map
(
self
,
x_j
,
y_j
,
h
,
x_i
,
y_i
,
type_i
=
None
,
h_i
=
None
,
wd
=
None
,
ws
=
None
):
X_j
,
Y_j
,
WS_eff_jlk
,
P_lk
=
self
.
WS_eff_map
(
x_j
,
y_j
,
h
,
x_i
,
y_i
,
type_i
,
h_i
,
wd
,
ws
)
return
X_j
,
Y_j
,
(
WS_eff_jlk
*
P_lk
[
na
,
:,
:]).
sum
((
1
,
2
)).
reshape
(
X_j
.
shape
)
def
aep_map
(
self
,
x_j
,
y_j
,
type_j
,
x_i
,
y_i
,
type_i
=
None
,
h_i
=
None
,
wd
=
None
,
ws
=
None
):
h
=
self
.
windTurbines
.
hub_height
(
type_j
)
X_j
,
Y_j
,
WS_eff_jlk
,
P_lk
=
self
.
WS_eff_map
(
x_j
,
y_j
,
h
,
x_i
,
y_i
,
type_i
,
h_i
,
wd
,
ws
)
# power_jlk = self.windTurbines.power_func(type_j, WS_eff_jlk)
# aep_jlk = power_jlk * P_lk[na, :, :] * 24 * 365 * 1e-9
# return X_j, Y_j, aep_jlk.sum((1, 2)).reshape(X_j.shape)
# same as above but requires less memory
return
X_j
,
Y_j
,
((
self
.
windTurbines
.
power_func
(
type_j
,
WS_eff_jlk
)
*
P_lk
[
na
,
:,
:]).
sum
((
1
,
2
))
*
24
*
365
*
1e-9
).
reshape
(
X_j
.
shape
)
This diff is collapsed.
Click to expand it.
py_wake/tests/test_files/fuga/__init__.py
+
2
−
0
View file @
d2e5f087
import
os
LUT_path_2MW_z0_0_03
=
os
.
path
.
dirname
(
__file__
)
+
"
/2MW/Z0=0.03000000Zi=00401Zeta0=0.00E+0/
"
This diff is collapsed.
Click to expand it.
py_wake/wake_model.py
+
8
−
2
View file @
d2e5f087
...
...
@@ -13,6 +13,12 @@ class WakeModel(ABC):
def
calc_wake
(
self
,
WS_ilk
,
TI_ilk
,
dw_iil
,
cw_iil
,
dw_order_indices_l
,
types_i
):
I
,
L
=
dw_iil
.
shape
[
1
:]
i1
,
i2
,
_
=
np
.
where
((
np
.
abs
(
dw_iil
)
+
np
.
abs
(
cw_iil
)
+
np
.
eye
(
I
)[:,
:,
na
])
==
0
)
if
len
(
i1
):
msg
=
"
\n
"
.
join
([
"
Turbines %d and %d are at the same position
"
%
(
i1
[
i
],
i2
[
i
])
for
i
in
np
.
unique
([
i1
,
i2
],
0
)])
raise
Exception
(
msg
)
K
=
WS_ilk
.
shape
[
2
]
deficit_nk
=
np
.
zeros
((
I
*
I
*
L
,
K
))
# deficit_ijlk = deficit_nk.reshape((I, I, L, K)) # from i to j
...
...
@@ -87,8 +93,8 @@ class WakeModel(ABC):
deficit_jlk
[:,
l
][
m
]
=
self
.
calc_deficit
(
**
args
)[:,
0
]
deficit_ijlk
.
append
(
deficit_jlk
)
return
self
.
calc_effective_WS
(
WS_jlk
,
np
.
array
(
deficit_ijlk
)
)
deficit_ijlk
=
np
.
array
(
deficit_ijlk
)
return
self
.
calc_effective_WS
(
WS_jlk
,
deficit_ijlk
)
@abstractmethod
def
calc_deficit
(
self
,
WS_lk
,
D_src_l
,
D_dst_jl
,
dw_jl
,
cw_jl
,
ct_lk
):
...
...
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