Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
HSPM
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Thomée Corentin
HSPM
Commits
ac067532
Commit
ac067532
authored
2 months ago
by
Thomee Corentin
Browse files
Options
Downloads
Patches
Plain Diff
CutTE
parent
68d63db8
Branches
main
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
hspm/api/core.py
+11
-0
11 additions, 0 deletions
hspm/api/core.py
hspm/src/geometry.cpp
+68
-2
68 additions, 2 deletions
hspm/src/geometry.cpp
hspm/src/hspm.h
+4
-0
4 additions, 0 deletions
hspm/src/hspm.h
hspm/src/solver.cpp
+4
-4
4 additions, 4 deletions
hspm/src/solver.cpp
with
87 additions
and
6 deletions
hspm/api/core.py
+
11
−
0
View file @
ac067532
...
...
@@ -63,6 +63,17 @@ def initHSPM(cfg):
hspm
.
sLe
=
cfg
[
'
sLe
'
]
hspm
.
sTe
=
cfg
[
'
sTe
'
]
cfg
[
"
N
"
]
=
1
# Placeholder value for the generateNaca4DigitCoordinates function
if
'
cutTE
'
in
cfg
:
hspm
.
cutTE
=
cfg
[
'
cutTE
'
]
if
not
"
sTe
"
in
cfg
:
print
(
"
HSPM Warning: Trailing edge mesh size (sTe) not defined. Using default value of 0.01
"
)
cfg
[
'
sTe
'
]
=
0.01
hspm
.
sTe
=
cfg
[
'
sTe
'
]
if
'
stopTE
'
in
cfg
:
hspm
.
stopTE
=
True
hspm
.
stopTELocation
=
cfg
[
'
stopTE
'
]
if
cfg
[
'
naca
'
]:
hspm
.
generateNaca4DigitCoordinates
(
int
(
cfg
[
'
naca
'
][
0
]),
int
(
cfg
[
'
naca
'
][
1
]),
int
(
cfg
[
'
naca
'
][
2
:
4
]),
int
(
cfg
[
'
N
'
]))
...
...
This diff is collapsed.
Click to expand it.
hspm/src/geometry.cpp
+
68
−
2
View file @
ac067532
...
...
@@ -67,8 +67,6 @@ void HSPM::generateNaca4DigitCoordinates(double camber, double camberPos, double
}
N
=
_N
;
x
=
Eigen
::
VectorXd
(
N
+
1
);
y
=
Eigen
::
VectorXd
(
N
+
1
);
Eigen
::
VectorXd
angleDistribution
=
Eigen
::
VectorXd
::
LinSpaced
(
N
+
1
,
0
,
2
*
M_PI
);
...
...
@@ -117,6 +115,74 @@ void HSPM::generateNaca4DigitCoordinates(double camber, double camberPos, double
}
}
if
(
cutTE
)
{
size_t
newN
=
N
;
size_t
remPts
=
0
;
for
(
size_t
i
=
1
;
i
<=
N
/
2
;
i
++
)
{
if
(
chord
-
x_distr
(
i
)
>=
sTe
)
{
std
::
cout
<<
"Removed "
<<
i
-
1
<<
" points from the trailing edge. "
<<
std
::
endl
;
newN
=
N
-
(
i
-
1
)
*
2
;
remPts
=
i
-
1
;
break
;
}
}
Eigen
::
VectorXd
x_distr_new
=
Eigen
::
VectorXd
(
newN
+
1
);
x_distr_new
(
0
)
=
x_distr
(
0
);
for
(
size_t
i
=
1
;
i
<
newN
;
i
++
)
{
x_distr_new
(
i
)
=
x_distr
(
i
+
remPts
);
}
x_distr_new
(
newN
)
=
x_distr
(
N
);
N
=
newN
;
x_distr
=
x_distr_new
;
std
::
cout
<<
"HSPM: The mesh contains "
<<
N
<<
" elements."
<<
std
::
endl
;
}
if
(
stopTE
)
{
// First, find the mesh size at stopTELOcation
double
stopSize
;
size_t
N_behind
;
double
actualStopTELocation
;
double
behindSize
;
size_t
N_rem
;
size_t
newN
;
for
(
size_t
i
=
1
;
i
<
N
/
2
;
i
++
)
{
if
(
x_distr
(
i
)
<=
stopTELocation
)
{
// We found the location
actualStopTELocation
=
x_distr
(
i
);
stopSize
=
x_distr
(
i
)
-
x_distr
(
i
+
1
);
N_behind
=
(
1
-
actualStopTELocation
)
/
stopSize
;
behindSize
=
(
1
-
actualStopTELocation
)
/
N_behind
;
N_rem
=
i
;
newN
=
N
+
2
*
(
N_behind
-
N_rem
);
break
;
}
}
std
::
cout
<<
newN
<<
std
::
endl
;
Eigen
::
VectorXd
x_distr_new
=
Eigen
::
VectorXd
(
newN
+
1
);
for
(
size_t
i
=
0
;
i
<
N_behind
;
i
++
)
{
x_distr_new
(
i
)
=
1
-
behindSize
*
i
;
}
for
(
size_t
i
=
0
;
i
<
N
-
2
*
N_rem
;
i
++
)
{
x_distr_new
(
i
+
N_behind
)
=
x_distr
(
i
+
N_rem
);
}
for
(
size_t
i
=
0
;
i
<
N_behind
+
1
;
i
++
)
{
x_distr_new
(
newN
-
i
)
=
1
-
i
*
behindSize
;
}
N
=
newN
;
x_distr
=
x_distr_new
;
std
::
cout
<<
"HSPM: The mesh contains "
<<
N
<<
" elements."
<<
std
::
endl
;
}
x
=
Eigen
::
VectorXd
(
N
+
1
);
y
=
Eigen
::
VectorXd
(
N
+
1
);
for
(
size_t
i
=
0
;
i
<=
N
;
i
++
)
{
double
T
=
10
*
thickness
/
100
*
chord
*
(
.2969
*
sqrt
(
x_distr
(
i
)
/
chord
)
-
.126
*
x_distr
(
i
)
/
chord
-
.3537
*
pow
(
x_distr
(
i
)
/
chord
,
2
)
+
.2843
*
pow
(
x_distr
(
i
)
/
chord
,
3
)
-
.1015
*
pow
(
x_distr
(
i
)
/
chord
,
4
));
...
...
This diff is collapsed.
Click to expand it.
hspm/src/hspm.h
+
4
−
0
View file @
ac067532
...
...
@@ -84,6 +84,10 @@ public:
double
sLe
,
sTe
;
double
prog
;
// For exponential mesh
bool
cutTE
;
bool
stopTE
;
double
stopTELocation
;
private
:
Eigen
::
PartialPivLU
<
Eigen
::
MatrixXd
>
solver
;
};
...
...
This diff is collapsed.
Click to expand it.
hspm/src/solver.cpp
+
4
−
4
View file @
ac067532
...
...
@@ -133,7 +133,7 @@ void HSPM::computePressureDistribution() {
// Compute the tangential speeds
for
(
size_t
i
=
0
;
i
<
N
;
i
++
)
{
V_t
(
i
)
=
V_inf
*
cos
(
AoA
-
theta
(
i
));
/*
V_t(i) = V_inf * cos(AoA - theta(i));
for (size_t j=0; j<N; j++) {
V_t(i) += A_t(i, j) * q(j);
V_t(i) += B_t(i, j) * tau;
...
...
@@ -143,9 +143,9 @@ void HSPM::computePressureDistribution() {
Cp(i, 0) = x_m(i);
Cp(i, 1) = y_m(i);
Cp(i, 2) = 0;
Cp
(
i
,
3
)
=
1
-
pow
(
V_t
(
i
)
/
V_inf
,
2
);
Cp(i, 3) = 1 - pow(V_t(i) / V_inf, 2);
*/
/*
// Off body Cp, gives better graphs !
double
x_visc
=
x_m
(
i
)
-
dStar
(
i
)
*
sin
(
theta
(
i
));
double
y_visc
=
y_m
(
i
)
+
dStar
(
i
)
*
cos
(
theta
(
i
));
...
...
@@ -160,7 +160,7 @@ void HSPM::computePressureDistribution() {
Cp
(
i
,
1
)
=
y_m
(
i
);
Cp
(
i
,
2
)
=
0
;
Cp
(
i
,
3
)
=
1
-
pow
(
V_mag
/
V_inf
,
2
);
*/
}
cl
=
0
;
...
...
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