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
Commits
a6db5c55
Commit
a6db5c55
authored
8 years ago
by
mads
Committed by
David Verelst
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
renamed mset_nr to mset
parent
38b4dd82
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
wetb/hawc2/st_file.py
+10
-10
10 additions, 10 deletions
wetb/hawc2/st_file.py
with
10 additions
and
10 deletions
wetb/hawc2/st_file.py
+
10
−
10
View file @
a6db5c55
...
@@ -42,16 +42,16 @@ class StFile(object):
...
@@ -42,16 +42,16 @@ class StFile(object):
The autogenerated methods have the following structure
The autogenerated methods have the following structure
def xxx(radius=None, mset
_nr
=1, set
_nr
=1):
def xxx(radius=None, mset=1, set=1):
Parameters:
Parameters:
-----------
-----------
radius : int, float, array_like or None, optional
radius : int, float, array_like or None, optional
Radius/radii of interest
\n
Radius/radii of interest
\n
If int, float or array_like: values are interpolated to requested radius/radii
If int, float or array_like: values are interpolated to requested radius/radii
If None (default): Values of all radii specified in st file returned
If None (default): Values of all radii specified in st file returned
mset
_nr
: int, optional
mset : int, optional
Main set number
Main set number
set
_nr
: int, optional
set : int, optional
Sub set number
Sub set number
...
@@ -60,9 +60,9 @@ class StFile(object):
...
@@ -60,9 +60,9 @@ class StFile(object):
>>>
stfile
=
StFile
(
r
"
tests/test_files/DTU_10MW_RWT_Blade_st.dat
"
)
>>>
stfile
=
StFile
(
r
"
tests/test_files/DTU_10MW_RWT_Blade_st.dat
"
)
>>>
print
(
stfile
.
m
())
# Interpolated mass at radius 36
>>>
print
(
stfile
.
m
())
# Interpolated mass at radius 36
[
1189.51054664
1191.64291781
1202.76694262
...
15.42438683
]
[
1189.51054664
1191.64291781
1202.76694262
...
15.42438683
]
>>>
print
(
st
.
E
(
radius
=
36
,
mset
_nr
=
1
,
set
_nr
=
1
))
# Elasticity interpolated to radius 36m
>>>
print
(
st
.
E
(
radius
=
36
,
mset
=
1
,
set
=
1
))
# Elasticity interpolated to radius 36m
8722924514.652649
8722924514.652649
>>>
print
(
st
.
E
(
radius
=
36
,
mset
_nr
=
1
,
set
_nr
=
2
))
# Same for stiff blade set
>>>
print
(
st
.
E
(
radius
=
36
,
mset
=
1
,
set
=
2
))
# Same for stiff blade set
8.722924514652648e+17
8.722924514652648e+17
"""
"""
def
__init__
(
self
,
filename
):
def
__init__
(
self
,
filename
):
...
@@ -83,7 +83,7 @@ class StFile(object):
...
@@ -83,7 +83,7 @@ class StFile(object):
self
.
main_data_sets
[
mset_nr
]
=
set_data_dict
self
.
main_data_sets
[
mset_nr
]
=
set_data_dict
for
i
,
name
in
enumerate
(
"
r m x_cg y_cg ri_x ri_y x_sh y_sh E G I_x I_y I_p k_x k_y A pitch x_e y_e
"
.
split
()):
for
i
,
name
in
enumerate
(
"
r m x_cg y_cg ri_x ri_y x_sh y_sh E G I_x I_y I_p k_x k_y A pitch x_e y_e
"
.
split
()):
setattr
(
self
,
name
,
lambda
radius
=
None
,
mset
_nr
=
1
,
set
_nr
=
1
,
column
=
i
:
self
.
_value
(
radius
,
column
,
mset
_nr
,
set
_nr
))
setattr
(
self
,
name
,
lambda
radius
=
None
,
mset
=
1
,
set
=
1
,
column
=
i
:
self
.
_value
(
radius
,
column
,
mset
,
set
))
def
_value
(
self
,
radius
,
column
,
mset_nr
=
1
,
set_nr
=
1
):
def
_value
(
self
,
radius
,
column
,
mset_nr
=
1
,
set_nr
=
1
):
st_data
=
self
.
main_data_sets
[
mset_nr
][
set_nr
]
st_data
=
self
.
main_data_sets
[
mset_nr
][
set_nr
]
...
@@ -91,8 +91,8 @@ class StFile(object):
...
@@ -91,8 +91,8 @@ class StFile(object):
radius
=
self
.
radius
(
None
,
mset_nr
,
set_nr
)
radius
=
self
.
radius
(
None
,
mset_nr
,
set_nr
)
return
np
.
interp
(
radius
,
st_data
[:,
0
],
st_data
[:,
column
])
return
np
.
interp
(
radius
,
st_data
[:,
0
],
st_data
[:,
column
])
def
radius
(
self
,
radius
=
None
,
mset
_nr
=
1
,
set
_nr
=
1
):
def
radius
(
self
,
radius
=
None
,
mset
=
1
,
set
=
1
):
r
=
self
.
main_data_sets
[
mset
_nr
][
set
_nr
][:,
0
]
r
=
self
.
main_data_sets
[
mset
][
set
][:,
0
]
if
radius
is
None
:
if
radius
is
None
:
return
r
return
r
return
r
[
np
.
argmin
(
np
.
abs
(
r
-
radius
))]
return
r
[
np
.
argmin
(
np
.
abs
(
r
-
radius
))]
...
@@ -102,8 +102,8 @@ class StFile(object):
...
@@ -102,8 +102,8 @@ class StFile(object):
if
__name__
==
"
__main__
"
:
if
__name__
==
"
__main__
"
:
st
=
StFile
(
r
"
C:\mmpe\HAWC2\models\DTU10MWRef6.0\data/DTU_10MW_RWT_Blade_st.dat
"
)
st
=
StFile
(
r
"
C:\mmpe\HAWC2\models\DTU10MWRef6.0\data/DTU_10MW_RWT_Blade_st.dat
"
)
print
(
st
.
m
())
print
(
st
.
m
())
print
(
st
.
E
(
radius
=
36
,
mset
_nr
=
1
,
set
_nr
=
1
))
# Elastic blade
print
(
st
.
E
(
radius
=
36
,
mset
=
1
,
set
=
1
))
# Elastic blade
print
(
st
.
E
(
radius
=
36
,
mset
_nr
=
1
,
set
_nr
=
2
))
# stiff blade
print
(
st
.
E
(
radius
=
36
,
mset
=
1
,
set
=
2
))
# stiff blade
#print (st.radius())
#print (st.radius())
xyz
=
np
.
array
([
st
.
x_e
(),
st
.
y_e
(),
st
.
r
()]).
T
[:
40
]
xyz
=
np
.
array
([
st
.
x_e
(),
st
.
y_e
(),
st
.
r
()]).
T
[:
40
]
n
=
2
n
=
2
...
...
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