Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
TopFarm2
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
TopFarm2
Commits
377378e7
Commit
377378e7
authored
6 years ago
by
Mads M. Pedersen
Browse files
Options
Downloads
Patches
Plain Diff
get get_TopFarm_cost_component in AEPCalculator
parent
e2d3ea8a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
topfarm/cost_models/utils/aep_calculator.py
+16
-12
16 additions, 12 deletions
topfarm/cost_models/utils/aep_calculator.py
with
16 additions
and
12 deletions
topfarm/cost_models/utils/aep_calculator.py
+
16
−
12
View file @
377378e7
...
...
@@ -9,6 +9,7 @@ from fusedwake import fusedwake
import
numpy
as
np
from
topfarm.cost_models.fused_wake_wrappers
import
FusedWakeGCLWakeModel
from
topfarm.cost_models.utils.wind_resource
import
WindResource
from
topfarm.cost_models.cost_model_wrappers
import
AEPCostModelComponent
class
AEPCalculator
(
object
):
...
...
@@ -25,19 +26,22 @@ class AEPCalculator(object):
def
__call__
(
self
,
turbine_positions
):
no_wake_WD
,
no_wake_WS
,
no_wake_TI
,
weight
=
self
.
wind_resource
(
turbine_positions
,
self
.
wdir
,
self
.
wsp
)
power_GW
=
self
.
wake_model
(
turbine_positions
,
no_wake_WD
,
no_wake_WS
,
no_wake_TI
)
/
1e9
power_GW
=
self
.
wake_model
(
turbine_positions
,
no_wake_WD
,
no_wake_WS
,
no_wake_TI
)
/
1e9
return
np
.
sum
(
power_GW
*
weight
)
*
24
*
365
def
get_TopFarm_cost_component
(
self
):
n_wt
=
self
.
wake_model
.
windFarm
.
nWT
return
AEPCostModelComponent
(
n_wt
,
lambda
*
args
:
self
(
*
args
))
if
__name__
==
'
__main__
'
:
f
=
np
.
array
(
"
3.597152 3.948682 5.167395 7.000154 8.364547 6.43485 8.643194 11.77051 15.15757 14.73792 10.01205 5.165975
"
.
split
(),
dtype
=
np
.
float
)
A
=
np
.
array
(
"
9.176929 9.782334 9.531809 9.909545 10.04269 9.593921 9.584007 10.51499 11.39895 11.68746 11.63732 10.08803
"
.
split
(),
dtype
=
np
.
float
)
k
=
np
.
array
(
"
2.392578 2.447266 2.412109 2.591797 2.755859 2.595703 2.583984 2.548828 2.470703 2.607422 2.626953 2.326172
"
.
split
(),
dtype
=
np
.
float
)
wr
=
WindResource
(
f
/
100
,
A
,
k
,
ti
=
np
.
zeros_like
(
f
)
+
.
1
)
f
=
[
0.035972
,
0.039487
,
0.051674
,
0.070002
,
0.083645
,
0.064348
,
0.086432
,
0.117705
,
0.151576
,
0.147379
,
0.10012
,
0.05166
]
A
=
[
9.176929
,
9.782334
,
9.531809
,
9.909545
,
10.04269
,
9.593921
,
9.584007
,
10.51499
,
11.39895
,
11.68746
,
11.63732
,
10.08803
]
k
=
[
2.392578
,
2.447266
,
2.412109
,
2.591797
,
2.755859
,
2.595703
,
2.583984
,
2.548828
,
2.470703
,
2.607422
,
2.626953
,
2.326172
]
wr
=
WindResource
(
f
/
100
,
A
,
k
,
ti
=
np
.
zeros_like
(
f
)
+
.
1
)
hornsrev_yml
=
os
.
path
.
dirname
(
fusedwake
.
__file__
)
+
"
/../examples/hornsrev.yml
"
hornsrev_yml_2tb
=
"
../../example_data/hornsrev_2tb.yml
"
wm
=
FusedWakeGCLWakeModel
(
hornsrev_yml_2tb
)
aep_calc
=
AEPCalculator
(
wr
,
wm
)
hornsrev_yml_2tb
=
"
../../example_data/hornsrev_2tb.yml
"
wm
=
FusedWakeGCLWakeModel
(
hornsrev_yml
)
aep_calc
=
AEPCalculator
(
wr
,
wm
)
print
(
aep_calc
(
wm
.
wf
.
pos
))
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