Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
WindEnergyToolbox
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
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
toolbox
WindEnergyToolbox
Merge requests
!43
New pc file
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
New pc file
new_pc_file
into
master
Overview
0
Commits
3
Pipelines
2
Changes
6
Merged
Mads M. Pedersen
requested to merge
new_pc_file
into
master
7 years ago
Overview
0
Commits
3
Pipelines
2
Changes
6
Expand
0
0
Merge request reports
Compare
master
version 1
e4cb5de2
7 years ago
master (base)
and
latest version
latest version
9c4ea9ae
3 commits,
7 years ago
version 1
e4cb5de2
2 commits,
7 years ago
6 files
+
320
−
171
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
6
Search (e.g. *.vue) (Ctrl+P)
wetb/hawc2/tests/test_blade.py
0 → 100644
+
48
−
0
Options
'''
Created on 3. maj 2017
@author: mmpe
'''
import
os
import
unittest
from
wetb.hawc2.blade
import
H2Blade
import
numpy
as
np
tfp
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'
test_files/
'
)
# test file path
class
Test
(
unittest
.
TestCase
):
# def testBladeInfo(self):
# bi = H2Blade(tfp + "simulation_setup/DTU10MWRef6.0/htc/DTU_10MW_RWT.htc")
# if 0:
# import matplotlib.pyplot as plt
# print (dir(bi))
# #print (bi.radius_s())
# plt.plot(bi.radius_s(), bi.twist())
# plt.plot(bi.c2def[:,2], bi.c2def[:,3])
# x = np.linspace(0,1,1000)
# plt.plot(bi.blade_radius*x, bi.c2nd(x)[:,3])
# plt.show()
def
testBladeInfo_AE
(
self
):
bi
=
H2Blade
(
None
,
tfp
+
"
NREL_5MW_ae.txt
"
,
tfp
+
"
NREL_5MW_pc.txt
"
)
self
.
assertEqual
(
bi
.
thickness
(
32
),
23.78048780487805
)
self
.
assertEqual
(
bi
.
chord
(
32
),
3.673
)
self
.
assertEqual
(
bi
.
pc_set_nr
(
32
),
1
)
def
testBladeInfo_PC_AE
(
self
):
bi
=
H2Blade
(
None
,
tfp
+
"
NREL_5MW_ae.txt
"
,
tfp
+
"
NREL_5MW_pc.txt
"
)
self
.
assertEqual
(
bi
.
CL
(
36
,
10
),
1.358
)
self
.
assertEqual
(
bi
.
CD
(
36
,
10
),
0.0255
)
self
.
assertEqual
(
bi
.
CM
(
36
,
10
),
-
0.1103
)
# def test_curved_length2radius(self):
# bi = H2BladeInfo(tfp + "simulation_setup/DTU10MWRef6.0/htc/DTU_10MW_RWT.htc")
# np.testing.assert_array_equal(bi.xyztwist(86.4979, curved_length=True), bi.xyztwist(86.3655))
if
__name__
==
"
__main__
"
:
#import sys;sys.argv = ['', 'Test.testBladeInfo']
unittest
.
main
()
\ No newline at end of file
Loading