Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Frederik Zahle
PGL
Commits
68b3f541
Commit
68b3f541
authored
Feb 04, 2021
by
Alex
Committed by
Frederik Zahle
Feb 04, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added airfoil shape mods
parent
1d29a83c
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1120 additions
and
21 deletions
+1120
-21
.gitignore
.gitignore
+1
-0
PGL/components/airfoil.py
PGL/components/airfoil.py
+1020
-21
PGL/test/test_airfoil.py
PGL/test/test_airfoil.py
+99
-0
No files found.
.gitignore
View file @
68b3f541
...
...
@@ -86,6 +86,7 @@ nosetests.xml
*.xyz
*.xyz.fvbnd
*.x2d
Icon?
ehthumbs.db
...
...
PGL/components/airfoil.py
View file @
68b3f541
This diff is collapsed.
Click to expand it.
PGL/test/test_airfoil.py
View file @
68b3f541
...
...
@@ -120,6 +120,105 @@ class AirfoilShapeTests2(unittest.TestCase):
s
=
np
.
sum
(
af
.
points
[:,
1
])
self
.
assertAlmostEqual
(
s
,
0.6714187425159088
,
places
=
5
)
def
test_wavy
(
self
):
af
=
AirfoilShape
(
points
=
np
.
loadtxt
(
'data/ffaw3241.dat'
))
af
.
redistribute
(
128
,
close_te
=
True
)
af
.
wavy
(
-
100e-3
,
100e-3
,
40e-3
,
0.5e-3
,
20e-3
,
128
)
s
=
np
.
sum
(
af
.
points
[:,
1
])
self
.
assertAlmostEqual
(
s
,
1.0209455387348676
,
places
=
5
)
def
test_bite
(
self
):
af
=
AirfoilShape
(
points
=
np
.
loadtxt
(
'data/ffaw3241.dat'
))
af
.
redistribute
(
128
,
close_te
=
True
)
af
.
bite
(
-
20e-3
)
s
=
np
.
sum
(
af
.
points
[:,
1
])
self
.
assertAlmostEqual
(
s
,
0.7387984401323768
,
places
=
5
)
af
.
bite
(
20e-3
)
s
=
np
.
sum
(
af
.
points
[:,
1
])
self
.
assertAlmostEqual
(
s
,
0.6685177054337146
,
places
=
5
)
def
test_step
(
self
):
af
=
AirfoilShape
(
points
=
np
.
loadtxt
(
'data/ffaw3241.dat'
))
af
.
redistribute
(
128
,
close_te
=
True
)
af
.
step
(
-
100e-3
,
100e-3
,
1e-3
,
0.1e-3
/
3
,
128
)
s
=
np
.
sum
(
af
.
points
[:,
1
])
self
.
assertAlmostEqual
(
s
,
0.9917633146652349
,
places
=
5
)
def
test_moveLE
(
self
):
af
=
AirfoilShape
(
points
=
np
.
loadtxt
(
'data/ffaw3241.dat'
))
af
.
redistribute
(
128
,
close_te
=
3
)
af
.
moveLE
(
0.15
,
15e-3
)
s
=
np
.
sum
(
af
.
points
[:,
1
])
self
.
assertAlmostEqual
(
s
,
1.4250613036049513
,
places
=
5
)
def
test_flatsanding
(
self
):
af
=
AirfoilShape
(
points
=
np
.
loadtxt
(
'data/ffaw3241.dat'
))
af
.
redistribute
(
128
,
close_te
=
True
)
af
.
flatsanding
(
-
10e-3
,
25e-3
,
128
)
s
=
np
.
sum
(
af
.
points
[:,
1
])
self
.
assertAlmostEqual
(
s
,
0.18489494967820264
,
places
=
5
)
def
test_rough_paras
(
self
):
af
=
AirfoilShape
(
points
=
np
.
loadtxt
(
'data/ffaw3241.dat'
))
af
.
redistribute
(
128
,
close_te
=
3
)
af
.
rough_paras
(
100e-3
,
1e-3
)
box_ref
=
[
-
0.05001856
,
0.06530538
,
-
0.16562343
,
0.17532873
]
self
.
assertEqual
(
np
.
testing
.
assert_allclose
(
af
.
box
,
box_ref
,
1E-06
),
None
)
def
test_roughpatch_paras
(
self
):
af
=
AirfoilShape
(
points
=
np
.
loadtxt
(
'data/ffaw3241.dat'
))
af
.
redistribute
(
128
,
close_te
=
3
)
af
.
roughpatch_paras
(
10e-3
,
100e-3
,
1e-3
)
box_ref
=
[
0.00099846
,
0.06610987
,
0.00825168
,
0.07490293
]
self
.
assertEqual
(
np
.
testing
.
assert_allclose
(
af
.
box_up
,
box_ref
,
1E-06
),
None
)
def
test_smoothbite
(
self
):
af
=
AirfoilShape
(
points
=
np
.
loadtxt
(
'data/ffaw3241.dat'
))
af
.
redistribute
(
128
,
close_te
=
3
)
af
.
smoothbite
(
20e-3
)
s
=
np
.
sum
(
af
.
points
[:,
1
])
self
.
assertAlmostEqual
(
s
,
0.8913207863514554
,
places
=
5
)
def
test_slot
(
self
):
af
=
AirfoilShape
(
points
=
np
.
loadtxt
(
'data/ffaw3241.dat'
))
af
.
redistribute
(
128
,
close_te
=
3
)
af
.
slot
(
-
20e-3
,
5e-3
,
2e-3
,
0.1e-3
/
3
,
128
)
s
=
np
.
sum
(
af
.
points
[:,
1
])
self
.
assertAlmostEqual
(
s
,
-
1.6577561460630772
,
places
=
5
)
def
test_smoothslot_start
(
self
):
af
=
AirfoilShape
(
points
=
np
.
loadtxt
(
'data/ffaw3241.dat'
))
af
.
redistribute
(
128
,
close_te
=
3
)
af
.
smoothslot_start
(
-
20e-3
,
20e-3
,
2e-3
,
0.1e-3
/
3
,
128
)
s
=
np
.
sum
(
af
.
points
[:,
1
])
self
.
assertAlmostEqual
(
s
,
-
2.8872653934553076
,
places
=
5
)
def
test_smoothslot_end
(
self
):
af
=
AirfoilShape
(
points
=
np
.
loadtxt
(
'data/ffaw3241.dat'
))
af
.
redistribute
(
128
,
close_te
=
3
)
af
.
smoothslot_end
(
-
20e-3
,
20e-3
,
2e-3
,
0.1e-3
/
3
,
128
)
s
=
np
.
sum
(
af
.
points
[:,
1
])
self
.
assertAlmostEqual
(
s
,
-
1.8455353600696762
,
places
=
5
)
def
test_stallstrip
(
self
):
af
=
AirfoilShape
(
points
=
np
.
loadtxt
(
'data/ffaw3241.dat'
))
af
.
redistribute
(
128
,
close_te
=
3
)
af
.
stallstrip
(
0.
,
3e-3
,
128
,
0.1e-3
/
5
,
90.
)
s
=
np
.
sum
(
af
.
points
[:,
1
])
self
.
assertAlmostEqual
(
s
,
1.1306133840208155
,
places
=
5
)
if
__name__
==
'__main__'
:
unittest
.
main
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment