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
ad2708b0
Commit
ad2708b0
authored
2 years ago
by
many
Browse files
Options
Downloads
Patches
Plain Diff
fix naca airfoil creator finite_te and testmethod
parent
a3cc7c5c
No related branches found
No related tags found
1 merge request
!10
Merge recent changes in master to we_ahrens
Pipeline
#8337
passed
2 years ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ntrfc/turbo/airfoil_generators/naca_airfoil_creator.py
+1
-1
1 addition, 1 deletion
ntrfc/turbo/airfoil_generators/naca_airfoil_creator.py
tests/turbo/airfoil_generators/test_naca_airfoil_creator.py
+39
-1
39 additions, 1 deletion
tests/turbo/airfoil_generators/test_naca_airfoil_creator.py
with
40 additions
and
2 deletions
ntrfc/turbo/airfoil_generators/naca_airfoil_creator.py
+
1
−
1
View file @
ad2708b0
...
...
@@ -275,7 +275,7 @@ def naca(number, n, finite_te=False, half_cosine_spacing=True):
pointa
=
np
.
array
([
X
[
0
],
Y
[
0
],
0
])
pointb
=
np
.
array
([
X
[
-
1
],
Y
[
-
1
],
0
])
center
=
(
pointb
-
pointa
)
/
2
+
pointa
arcres
=
int
(
n
/
5
)
arcres
=
int
(
n
/
5
)
+
1
arc
=
pv
.
CircularArc
(
pointa
,
pointb
,
center
,
resolution
=
arcres
,
negative
=
True
)
arcpts
=
arc
.
points
[
1
:
-
2
]
points
=
np
.
vstack
([
points
,
arcpts
[::
-
1
]])
...
...
This diff is collapsed.
Click to expand it.
tests/turbo/airfoil_generators/test_naca_airfoil_creator.py
+
39
−
1
View file @
ad2708b0
def
test_naca
(
tmpdir
):
def
test_naca
():
from
ntrfc.turbo.airfoil_generators.naca_airfoil_creator
import
naca
import
numpy
as
np
import
pyvista
as
pv
res
=
480
xs
,
ys
=
naca
(
"
6510
"
,
res
,
half_cosine_spacing
=
False
,
finite_te
=
False
)
points
=
np
.
stack
([
xs
,
ys
,
np
.
zeros
(
len
(
xs
))]).
T
poly
=
pv
.
PolyData
(
points
)
assert
poly
.
number_of_points
==
res
*
2
+
1
xs
,
ys
=
naca
(
"
6510
"
,
res
,
half_cosine_spacing
=
True
,
finite_te
=
False
)
points
=
np
.
stack
([
xs
,
ys
,
np
.
zeros
(
len
(
xs
))]).
T
poly
=
pv
.
PolyData
(
points
)
assert
poly
.
number_of_points
==
res
*
2
+
1
xs
,
ys
=
naca
(
"
6510
"
,
res
,
half_cosine_spacing
=
False
,
finite_te
=
True
)
points
=
np
.
stack
([
xs
,
ys
,
np
.
zeros
(
len
(
xs
))]).
T
poly
=
pv
.
PolyData
(
points
)
assert
poly
.
number_of_points
==
res
*
2
+
1
+
97
-
2
xs
,
ys
=
naca
(
"
6510
"
,
res
,
half_cosine_spacing
=
True
,
finite_te
=
True
)
points
=
np
.
stack
([
xs
,
ys
,
np
.
zeros
(
len
(
xs
))]).
T
poly
=
pv
.
PolyData
(
points
)
assert
poly
.
number_of_points
==
res
*
2
+
1
+
97
-
2
xs
,
ys
=
naca
(
"
23112
"
,
res
,
half_cosine_spacing
=
False
,
finite_te
=
False
)
points
=
np
.
stack
([
xs
,
ys
,
np
.
zeros
(
len
(
xs
))]).
T
poly
=
pv
.
PolyData
(
points
)
assert
poly
.
number_of_points
==
res
*
2
+
1
xs
,
ys
=
naca
(
"
23112
"
,
res
,
half_cosine_spacing
=
True
,
finite_te
=
False
)
points
=
np
.
stack
([
xs
,
ys
,
np
.
zeros
(
len
(
xs
))]).
T
poly
=
pv
.
PolyData
(
points
)
assert
poly
.
number_of_points
==
res
*
2
+
1
xs
,
ys
=
naca
(
"
23112
"
,
res
,
half_cosine_spacing
=
False
,
finite_te
=
True
)
points
=
np
.
stack
([
xs
,
ys
,
np
.
zeros
(
len
(
xs
))]).
T
poly
=
pv
.
PolyData
(
points
)
assert
poly
.
number_of_points
==
res
*
2
+
1
+
97
-
2
xs
,
ys
=
naca
(
"
23112
"
,
res
,
half_cosine_spacing
=
True
,
finite_te
=
True
)
points
=
np
.
stack
([
xs
,
ys
,
np
.
zeros
(
len
(
xs
))]).
T
poly
=
pv
.
PolyData
(
points
)
assert
poly
.
number_of_points
==
res
*
2
+
1
+
97
-
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