Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
NTRfC
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
Package Registry
Container 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
TFD - Institut für Turbomaschinen und Fluid-Dynamik
tools
NTRfC
Commits
a3d8e760
Commit
a3d8e760
authored
3 years ago
by
Malte Nyhuis
Browse files
Options
Downloads
Patches
Plain Diff
initial tests for airfoil generators
parent
06d38b1b
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ntrfc/database/parsec_airfoil_creator.py
+2
-1
2 additions, 1 deletion
ntrfc/database/parsec_airfoil_creator.py
tests/test_ntrfc_geometry.py
+32
-0
32 additions, 0 deletions
tests/test_ntrfc_geometry.py
with
34 additions
and
1 deletion
ntrfc/database/parsec_airfoil_creator.py
+
2
−
1
View file @
a3d8e760
...
@@ -111,7 +111,7 @@ def pcoef(
...
@@ -111,7 +111,7 @@ def pcoef(
return
coef
return
coef
def
parsec_airfoil_gen
(
pparray
,
halfsinespacing
,
resolution
):
def
parsec_airfoil_gen
(
pparray
,
halfsinespacing
=
True
,
resolution
=
2000
):
# TE & LE of airfoil (normalized, chord = 1)
# TE & LE of airfoil (normalized, chord = 1)
xle
=
0.0
xle
=
0.0
...
@@ -219,3 +219,4 @@ def demo():
...
@@ -219,3 +219,4 @@ def demo():
X
,
Y
=
profile_points
[::,
0
],
profile_points
[::,
1
]
X
,
Y
=
profile_points
[::,
0
],
profile_points
[::,
1
]
d
.
plot
(
X
,
Y
)
d
.
plot
(
X
,
Y
)
d
.
show
()
d
.
show
()
This diff is collapsed.
Click to expand it.
tests/test_ntrfc_geometry.py
+
32
−
0
View file @
a3d8e760
...
@@ -2,6 +2,7 @@ import numpy as np
...
@@ -2,6 +2,7 @@ import numpy as np
import
pyvista
as
pv
import
pyvista
as
pv
def
test_calcConcaveHull
():
def
test_calcConcaveHull
():
"""
"""
in these simple geometries, each point must be found by calcConcaveHull
in these simple geometries, each point must be found by calcConcaveHull
...
@@ -36,3 +37,34 @@ def test_calcConcaveHull():
...
@@ -36,3 +37,34 @@ def test_calcConcaveHull():
assert
len
(
xs
)
==
len
(
xs_raw
)
assert
len
(
xs
)
==
len
(
xs_raw
)
assert
any
([
yi
in
ys_raw
for
yi
in
ys
])
assert
any
([
yi
in
ys_raw
for
yi
in
ys
])
def
test_parsec
():
from
ntrfc.database.parsec_airfoil_creator
import
parsec_airfoil_gen
R_LE
=
0.01
x_PRE
=
0.450
y_PRE
=
-
0.006
d2y_dx2_PRE
=
-
0.4
th_PRE
=
0.05
x_SUC
=
0.450
y_SUC
=
0.055
d2y_dx2_SUC
=
-
0.350
th_SUC
=
-
6
pparray
=
[
R_LE
,
x_PRE
,
y_PRE
,
d2y_dx2_PRE
,
th_PRE
,
x_SUC
,
y_SUC
,
d2y_dx2_SUC
,
th_SUC
]
profile_points
=
parsec_airfoil_gen
(
pparray
)
X
,
Y
=
profile_points
[::,
0
],
profile_points
[::,
1
]
def
test_naca
():
def
rand_naca_code
():
digits
=
np
.
random
.
choice
([
4
,
5
])
if
digits
==
4
:
d1
,
d2
,
d3
,
d4
=
np
.
random
.
randint
(
0
,
6
),
np
.
random
.
randint
(
0
,
8
),
np
.
random
.
randint
(
0
,
6
),
np
.
random
.
randint
(
0
,
9
)
digitstring
=
str
(
d1
)
+
str
(
d2
)
+
str
(
d3
)
+
str
(
d4
)
if
digits
==
5
:
d1
,
d2
,
d3
,
d4
,
d5
=
np
.
random
.
randint
(
0
,
5
),
np
.
random
.
randint
(
0
,
5
),
np
.
random
.
randint
(
0
,
6
),
np
.
random
.
randint
(
0
,
9
),
np
.
random
.
randint
(
0
,
9
)
digitstring
=
str
(
d1
)
+
str
(
d2
)
+
str
(
d3
)
+
str
(
d4
)
+
str
(
d5
)
return
digitstring
profNaca
=
[
rand_naca_code
()
for
i
in
range
(
6
)]
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