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
a3916106
Commit
a3916106
authored
1 year ago
by
Thomée Corentin
Browse files
Options
Downloads
Patches
Plain Diff
Removed IT_SOLVER_TOLERANCE, made the 1e-10 cleaner
parent
a3a36402
No related branches found
Branches containing commit
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
+1
-2
1 addition, 2 deletions
hspm/api/core.py
hspm/src/hspm.h
+0
-1
0 additions, 1 deletion
hspm/src/hspm.h
hspm/src/influenceCoeffs.cpp
+21
-0
21 additions, 0 deletions
hspm/src/influenceCoeffs.cpp
hspm/src/solver.cpp
+8
-8
8 additions, 8 deletions
hspm/src/solver.cpp
with
30 additions
and
11 deletions
hspm/api/core.py
+
1
−
2
View file @
a3916106
...
...
@@ -9,8 +9,7 @@ def initHSPM(cfg):
hspm
=
hspmw
.
HSPM
()
hspm
.
chord
=
cfg
[
'
chord
'
]
# Not optimal, but it will do for now
hspm
.
IT_SOLVER_TOLERANCE
=
cfg
[
'
it_solver_tolerance
'
]
hspm
.
V_inf
=
1
# Shouldn't have any impact on the solution (To verify)
hspm
.
V_inf
=
1
# Shouldn't have any impact on the solution
hspm
.
AoA
=
np
.
deg2rad
(
cfg
[
'
aoa
'
])
if
cfg
[
'
naca
'
]:
...
...
This diff is collapsed.
Click to expand it.
hspm/src/hspm.h
+
0
−
1
View file @
a3916106
...
...
@@ -52,7 +52,6 @@ public:
Eigen
::
VectorXd
b
;
Eigen
::
VectorXd
c
;
double
IT_SOLVER_TOLERANCE
;
double
tau
;
Eigen
::
VectorXd
s1
;
Eigen
::
VectorXd
s2
;
...
...
This diff is collapsed.
Click to expand it.
hspm/src/influenceCoeffs.cpp
+
21
−
0
View file @
a3916106
...
...
@@ -92,6 +92,27 @@ Eigen::MatrixXd HSPM::getSpeedAtPoint(double x_p, double y_p)
// Influence of the panels: A and B
for
(
size_t
j
=
0
;
j
<
N
;
j
++
)
{
// Check if we are on the panel
if
(
abs
(
x_p
-
x_m
(
j
)
<
1e-10
)
&&
abs
(
y_p
-
y_m
(
j
))
<
1e-10
)
{
double
_A_t
=
0
;
double
_A_n
=
.5
;
double
_A_x
=
_A_t
*
cos
(
theta
(
j
))
-
_A_n
*
sin
(
theta
(
j
));
double
_A_y
=
_A_t
*
sin
(
theta
(
j
))
+
_A_n
*
cos
(
theta
(
j
));
double
_B_x
=
_A_y
;
double
_B_y
=
-
_A_x
;
// tau contribution
speeds
(
0
,
0
)
+=
_A_x
*
s1
(
j
)
+
_B_x
;
speeds
(
1
,
0
)
+=
_A_y
*
s1
(
j
)
+
_B_y
;
// constant contribution
speeds
(
0
,
1
)
+=
_A_x
*
s2
(
j
);
speeds
(
1
,
1
)
+=
_A_y
*
s2
(
j
);
continue
;
}
double
sine
=
sin
(
-
theta
(
j
));
double
cosine
=
cos
(
-
theta
(
j
));
double
r_p_jp1
=
sqrt
(
pow
(
x_p
-
x
(
j
+
1
),
2
)
+
pow
(
y_p
-
y
(
j
+
1
),
2
)
);
...
...
This diff is collapsed.
Click to expand it.
hspm/src/solver.cpp
+
8
−
8
View file @
a3916106
...
...
@@ -42,10 +42,10 @@ void HSPM::solve()
}
double
HSPM
::
solveOffBodyKutta
()
{
double
xc_0
=
x_m
(
0
)
-
(
dStar
(
0
)
+
1e-10
)
*
sin
(
theta
(
0
));
double
yc_0
=
y_m
(
0
)
+
(
dStar
(
0
)
+
1e-10
)
*
cos
(
theta
(
0
));
double
xc_N1
=
x_m
(
N
-
1
)
-
(
dStar
(
N
-
1
)
+
1e-10
)
*
sin
(
theta
(
N
-
1
));
double
yc_N1
=
y_m
(
N
-
1
)
+
(
dStar
(
N
-
1
)
+
1e-10
)
*
cos
(
theta
(
N
-
1
));
double
xc_0
=
x_m
(
0
)
-
dStar
(
0
)
*
sin
(
theta
(
0
));
double
yc_0
=
y_m
(
0
)
+
dStar
(
0
)
*
cos
(
theta
(
0
));
double
xc_N1
=
x_m
(
N
-
1
)
-
dStar
(
N
-
1
)
*
sin
(
theta
(
N
-
1
));
double
yc_N1
=
y_m
(
N
-
1
)
+
dStar
(
N
-
1
)
*
cos
(
theta
(
N
-
1
));
/*
The magnitude of the velocity at the control points is equal
...
...
@@ -98,8 +98,8 @@ void HSPM::computeInviscidVelocity()
*/
for
(
size_t
i
=
0
;
i
<
N
;
i
++
)
{
double
x_visc
=
x_m
(
i
)
-
(
dStar
(
i
)
+
1e-10
)
*
sin
(
theta
(
i
));
double
y_visc
=
y_m
(
i
)
+
(
dStar
(
i
)
+
1e-10
)
*
cos
(
theta
(
i
));
double
x_visc
=
x_m
(
i
)
-
dStar
(
i
)
*
sin
(
theta
(
i
));
double
y_visc
=
y_m
(
i
)
+
dStar
(
i
)
*
cos
(
theta
(
i
));
Eigen
::
MatrixXd
UV
=
this
->
getSpeedAtPoint
(
x_visc
,
y_visc
);
...
...
@@ -144,8 +144,8 @@ void HSPM::computePressureDistribution() {
/*
// Off body Cp, gives better graphs !
double x_visc = x_m(i) -
(
dStar(i)
+1e-10)
* sin(theta(i));
double y_visc = y_m(i) +
(
dStar(i)
+1e-10)
* cos(theta(i));
double x_visc = x_m(i) - dStar(i) * sin(theta(i));
double y_visc = y_m(i) + dStar(i) * cos(theta(i));
Eigen::MatrixXd UV = this->getSpeedAtPoint(x_visc, y_visc);
double _U = UV(0,0) * tau + UV(0,1);
...
...
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