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
92033815
Commit
92033815
authored
1 year ago
by
Thomée Corentin
Browse files
Options
Downloads
Patches
Plain Diff
Handled degenrate case in Kutta
parent
a3916106
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
hspm/src/geometry.cpp
+1
-1
1 addition, 1 deletion
hspm/src/geometry.cpp
hspm/src/solver.cpp
+4
-1
4 additions, 1 deletion
hspm/src/solver.cpp
python/main.py
+1
-8
1 addition, 8 deletions
python/main.py
with
6 additions
and
10 deletions
hspm/src/geometry.cpp
+
1
−
1
View file @
92033815
...
...
@@ -30,7 +30,7 @@ void HSPM::generateNaca4DigitCoordinates(double camber, double camberPos, double
} else {
x_distr(i) = chord/2 * (cos(angle)+1);
}*/
x_distr
(
i
)
=
chord
*
pow
((
1
+
cos
((
angle
+
M_PI
)
/
2
)),
2
);
x_distr
(
i
)
=
chord
*
pow
((
1
+
cos
((
angle
+
M_PI
)
/
2
)),
2
);
}
for
(
size_t
i
=
0
;
i
<=
N
;
i
++
)
{
...
...
This diff is collapsed.
Click to expand it.
hspm/src/solver.cpp
+
4
−
1
View file @
92033815
...
...
@@ -34,7 +34,7 @@ void HSPM::solve()
// q = s1*tau + s2
// We need Kutta for tau
tau
=
this
->
solveOffBodyKutta
();
q
=
s1
*
tau
+
s2
;
this
->
computeInviscidVelocity
();
...
...
@@ -84,6 +84,9 @@ double HSPM::solveOffBodyKutta() {
double
_tau_terms
=
2
*
(
_a
*
_b
+
_c
*
_d
-
_e
*
_f
-
_g
*
_h
);
double
_const_terms
=
pow
(
_b
,
2
)
+
pow
(
_d
,
2
)
-
pow
(
_f
,
2
)
-
pow
(
_h
,
2
);
if
(
_tau2_terms
<
1e-10
)
return
-
_const_terms
/
_tau_terms
;
// If the quadratic equation is degenerate, we can solve it directly
// Solve the quadratic equation
double
tau_
=
(
-
_tau_terms
+
sqrt
(
pow
(
_tau_terms
,
2
)
-
4
*
_tau2_terms
*
_const_terms
))
/
(
2
*
_tau2_terms
);
...
...
This diff is collapsed.
Click to expand it.
python/main.py
+
1
−
8
View file @
92033815
from
utils
import
*
N
=
1000
config
=
{
'
chord
'
:
1
,
'
it_solver_tolerance
'
:
1e-6
,
'
aoa
'
:
2
,
'
naca
'
:
"
0012
"
,
'
N
'
:
N
,
'
N
'
:
100
,
'
filename
'
:
"
airfoil.dat
"
}
if
__name__
==
"
__main__
"
:
solver
=
initHSPM
(
config
)
"""
for i in range(N):
solver.imposeBlowingVelocity(i, 1)
solver.setdStar(i, 0.1)
"""
solver
.
solve
()
cl
=
solver
.
cl
...
...
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