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
c3825a39
Commit
c3825a39
authored
6 years ago
by
Mads M. Pedersen
Browse files
Options
Downloads
Patches
Plain Diff
adapt to new fuga test files
parent
18c1401c
No related branches found
No related tags found
1 merge request
!94
Handle disabled mpi
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
tests/test_fuga/test_pyfuga.py
+22
-20
22 additions, 20 deletions
tests/test_fuga/test_pyfuga.py
topfarm/cost_models/fuga/Colonel
+1
-1
1 addition, 1 deletion
topfarm/cost_models/fuga/Colonel
topfarm/cost_models/fuga/py_fuga.py
+3
-3
3 additions, 3 deletions
topfarm/cost_models/fuga/py_fuga.py
with
26 additions
and
24 deletions
tests/test_fuga/test_pyfuga.py
+
22
−
20
View file @
c3825a39
...
...
@@ -23,10 +23,10 @@ def get_fuga():
check_lib_exists
()
pyFuga
=
PyFuga
()
pyFuga
.
setup
(
farm_name
=
'
Horns Rev 1
'
,
turbine_model_path
=
fuga_path
+
'
LUT/
'
,
turbine_model_name
=
'
Vestas_V80_(2_MW_offshore)[h=
6
7.00]
'
,
turbine_model_path
=
fuga_path
+
'
LUT
s-T
/
'
,
turbine_model_name
=
'
Vestas_V80_(2_MW_offshore)[h=7
0
.00]
'
,
tb_x
=
tb_x
,
tb_y
=
tb_y
,
mast_position
=
(
0
,
0
,
70
),
z0
=
0.0
001
,
zi
=
400
,
zeta0
=
0
,
farms_dir
=
fuga_path
+
'
LUT/Farms/
'
,
wind_atlas_path
=
'
Horns Rev 1/hornsrev_north
_only.lib
'
,
climate_interpolation
=
False
)
mast_position
=
(
0
,
0
,
70
),
z0
=
0.0
3
,
zi
=
400
,
zeta0
=
0
,
farms_dir
=
fuga_path
+
'
LUT
s-T
/Farms/
'
,
wind_atlas_path
=
'
MyFarm/north_pm30
_only.lib
'
,
climate_interpolation
=
False
)
return
pyFuga
return
_fuga
...
...
@@ -67,37 +67,39 @@ def testSetup(get_fuga):
def
testAEP_one_tb
(
get_fuga
):
pyFuga
=
get_fuga
([
0
],
[
0
])
np
.
testing
.
assert_array_almost_equal
(
pyFuga
.
get_aep
(
np
.
array
([[
0
],
[
0
]]).
T
),
[
7.450272
,
7.450272
,
0.424962
,
1.
])
np
.
testing
.
assert_array_almost_equal
(
pyFuga
.
get_aep
(
np
.
array
([[
0
],
[
0
]]).
T
),
[
8.2896689155874324
,
8.2896689155874324
,
0.472841
,
1.
])
pyFuga
.
cleanup
()
def
testAEP
(
pyFuga
):
np
.
testing
.
assert_array_almost_equal
(
pyFuga
.
get_aep
(
np
.
array
([[
0
,
200
],
[
0
,
0
]]).
T
),
[
14.866138
,
14.900544
,
0.423981
,
0.997691
])
np
.
testing
.
assert_array_almost_equal
(
pyFuga
.
get_aep_gradients
(
np
.
array
([[
0
,
200
],
[
0
,
0
]]).
T
),
0
)
np
.
testing
.
assert_array_almost_equal
(
pyFuga
.
get_aep
(
np
.
array
([[
0
,
0
],
[
0
,
200
]]).
T
),
[
12.124883
,
14.900544
,
0.3458
,
0.813721
])
np
.
testing
.
assert_array_almost_equal
(
pyFuga
.
get_aep_gradients
(
np
.
array
([[
0
,
0
],
[
0
,
200
]]).
T
),
[[
-
0.001794
,
0.001794
],
[
-
0.008126
,
0.008126
],
[
0.
,
0.
]])
np
.
testing
.
assert_array_almost_equal
(
pyFuga
.
get_aep
(
np
.
array
([[
0
,
200
],
[
0
,
200
]]).
T
),
[
14.864909
,
14.900544
,
0.423946
,
0.997608
])
np
.
testing
.
assert_array_almost_equal
(
pyFuga
.
get_aep_gradients
(
np
.
array
([[
0
,
200
],
[
0
,
200
]]).
T
),
[[
-
5.165553e-06
,
5.165553e-06
],
[
1.599768e-06
,
-
1.599768e-06
],
[
0.000000e+00
,
0.000000e+00
]])
np
.
testing
.
assert_array_almost_equal
(
pyFuga
.
get_aep
(
np
.
array
([[
0
,
1000
],
[
0
,
0
]]).
T
),
[
2
*
8.2896689155874324
,
2
*
8.2896689155874324
,
0.472841
,
1.
])
np
.
testing
.
assert_array_almost_equal
(
pyFuga
.
get_aep_gradients
(
np
.
array
([[
0
,
1000
],
[
0
,
0
]]).
T
),
0
)
np
.
testing
.
assert_array_almost_equal
(
pyFuga
.
get_aep
(
np
.
array
([[
0
,
0
],
[
0
,
200
]]).
T
),
[
14.688347
,
16.579338
,
0.41891
,
0.885943
])
np
.
testing
.
assert_array_almost_equal
(
pyFuga
.
get_aep_gradients
(
np
.
array
([[
0
,
0
],
[
0
,
200
]]).
T
),
[[
-
0.003789
,
0.003789
],
[
-
0.007204
,
0.007204
],
[
0.
,
0.
]])
np
.
testing
.
assert_array_almost_equal
(
pyFuga
.
get_aep
(
np
.
array
([[
0
,
200
],
[
0
,
200
]]).
T
),
[
20.352901
,
16.579338
,
0.580462
,
1.227606
])
np
.
testing
.
assert_array_almost_equal
(
pyFuga
.
get_aep_gradients
(
np
.
array
([[
0
,
200
],
[
0
,
200
]]).
T
),
[[
-
2.033273e-05
,
2.033273e-05
],
[
7.255895e-06
,
-
7.255895e-06
],
[
0.000000e+00
,
0.000000e+00
]])
pyFuga
.
cleanup
()
def
testLargeOffset
(
pyFuga
):
o
=
1.e16
np
.
testing
.
assert_array_almost_equal
(
pyFuga
.
get_aep
(
np
.
array
([[
0
+
o
,
0
+
o
],
[
0
+
o
,
200
+
o
]]).
T
),
[
12.124883
,
14.900544
,
0.3458
,
0.813721
])
np
.
testing
.
assert_array_almost_equal
(
pyFuga
.
get_aep_gradients
(),
[[
-
0.001794
,
0.001794
],
[
-
0.008126
,
0.008126
],
[
0.
,
0.
]])
np
.
testing
.
assert_array_almost_equal
(
pyFuga
.
get_aep
(
np
.
array
([[
0
+
o
,
0
+
o
],
[
0
+
o
,
200
+
o
]]).
T
),
[
14.688347
,
16.579338
,
0.41891
,
0.885943
])
np
.
testing
.
assert_array_almost_equal
(
pyFuga
.
get_aep_gradients
(),
[[
-
0.003789
,
0.003789
],
[
-
0.007204
,
0.007204
],
[
0.
,
0.
]])
def
testAEP_topfarm
(
get_fuga
):
pyFuga
=
get_fuga
()
init_pos
=
[[
0
,
0
],
[
2
00
,
0
]]
init_pos
=
[[
0
,
0
],
[
10
00
,
0
]]
tf
=
TopFarm
(
init_pos
,
pyFuga
.
get_TopFarm_cost_component
(),
160
,
init_pos
,
boundary_type
=
'
square
'
)
tf
.
evaluate
()
np
.
testing
.
assert_array_almost_equal
(
tf
.
get_cost
(),
-
1
4.866138
)
np
.
testing
.
assert_array_almost_equal
(
tf
.
get_cost
(),
-
1
6.579337831174865
)
def
test_pyfuga_cmd
():
...
...
This diff is collapsed.
Click to expand it.
Colonel
@
1a20e6ec
Compare
01e2b99a
...
1a20e6ec
Subproject commit
01e2b99aa8f7f40d7a020710f9a0374bcfa7f26c
Subproject commit
1a20e6ec1f31814904b80cf70327e4d9e7f897fe
This diff is collapsed.
Click to expand it.
topfarm/cost_models/fuga/py_fuga.py
+
3
−
3
View file @
c3825a39
...
...
@@ -130,10 +130,10 @@ def try_me():
if
__name__
==
'
__main__
'
:
pyFuga
=
PyFuga
()
pyFuga
.
setup
(
farm_name
=
'
Horns Rev 1
'
,
turbine_model_path
=
fuga_path
+
'
LUT/
'
,
turbine_model_name
=
'
Vestas_V80_(2_MW_offshore)[h=
6
7.00]
'
,
turbine_model_path
=
fuga_path
+
'
LUT
s-T
/
'
,
turbine_model_name
=
'
Vestas_V80_(2_MW_offshore)[h=7
0
.00]
'
,
tb_x
=
[
423974
,
424033
],
tb_y
=
[
6151447
,
6150889
],
mast_position
=
(
0
,
0
,
70
),
z0
=
0.0
001
,
zi
=
400
,
zeta0
=
0
,
farms_dir
=
fuga_path
+
'
LUT/Farms/
'
,
wind_atlas_path
=
'
Horns Rev 1\hornsrev
.lib
'
)
mast_position
=
(
0
,
0
,
70
),
z0
=
0.0
3
,
zi
=
400
,
zeta0
=
0
,
farms_dir
=
fuga_path
+
'
LUT
s-T
/Farms/
'
,
wind_atlas_path
=
'
MyFarm\DEN05JBgr_7.813E_55.489N_7.4_5
.lib
'
)
print
(
pyFuga
.
get_no_turbines
())
print
(
pyFuga
.
get_aep
(
np
.
array
([[
0
,
0
],
[
0
,
1000
]])))
...
...
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