Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pypk
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
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
Aerospace and Mechanical Engineering
pypk
Commits
1de1eeaf
Commit
1de1eeaf
authored
10 months ago
by
Adrien Crovato
Browse files
Options
Downloads
Patches
Plain Diff
Add structural damping via complex proportional stiffness method.
parent
2e117e60
Branches
adri
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1
Vesion 1.1
Pipeline
#23837
passed
10 months ago
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
pypk/api_core.py
+2
-1
2 additions, 1 deletion
pypk/api_core.py
pypk/eigensolver.py
+5
-4
5 additions, 4 deletions
pypk/eigensolver.py
tests/agard_grad.py
+1
-0
1 addition, 0 deletions
tests/agard_grad.py
with
8 additions
and
5 deletions
pypk/api_core.py
+
2
−
1
View file @
1de1eeaf
...
...
@@ -35,7 +35,8 @@ def init_pypk(cfg):
else
:
raise
RuntimeError
(
'"
fluid
"
entry must be
"
unmatched
"
or
"
matched_isa
"
!
\n
'
)
# Eigen solver
eig
=
EigenSolver
(
cfg
[
'
l_ref
'
],
cfg
[
'
n_modes
'
])
g
=
cfg
[
'
g_struct
'
]
if
'
g_struct
'
in
cfg
else
0.0
eig
=
EigenSolver
(
cfg
[
'
l_ref
'
],
cfg
[
'
n_modes
'
],
g
)
# Aggregator
agg
=
KSAggregator
(
cfg
[
'
rho_ks
'
])
# p-k method
...
...
This diff is collapsed.
Click to expand it.
pypk/eigensolver.py
+
5
−
4
View file @
1de1eeaf
...
...
@@ -20,9 +20,10 @@ import scipy.linalg as spla
class
EigenSolver
:
"""
Eigen solver
"""
def
__init__
(
self
,
l
,
n
):
def
__init__
(
self
,
l
,
n
,
g
=
0
):
self
.
_l
=
l
# reference length
self
.
_n
=
n
# number of modes
self
.
_g
=
(
1
+
1j
*
g
)
# structural damping (complex proportional stiffness)
def
compute
(
self
,
rho
,
u
,
m
,
k
,
q
):
"""
Compute eigenvalues and eigenvectors
...
...
@@ -32,7 +33,7 @@ class EigenSolver:
k : stiffness matrix
q : aerodynamic matrix
"""
p
,
v
=
spla
.
eig
(
k
-
0.5
*
rho
*
u
**
2
*
q
,
-
u
**
2
/
self
.
_l
**
2
*
m
)
# det((p*u/l)^2*M + K - q_inf*Q) = 0
p
,
v
=
spla
.
eig
(
self
.
_g
*
k
-
0.5
*
rho
*
u
**
2
*
q
,
-
u
**
2
/
self
.
_l
**
2
*
m
)
# det((p*u/l)^2*M + K - q_inf*Q) = 0
p
=
np
.
sqrt
(
p
)
# Sort
p
=
np
.
where
(
np
.
imag
(
p
)
<
0
,
-
p
,
p
)
# change sign of p if imag(p) < 0
...
...
@@ -58,10 +59,10 @@ class EigenSolver:
a
=
np
.
zeros
((
self
.
_n
+
1
,
self
.
_n
+
1
),
dtype
=
complex
)
b
=
np
.
zeros
((
self
.
_n
+
1
,
1
),
dtype
=
complex
)
a
[:
-
1
,
0
]
=
-
2
*
p
*
u
**
2
/
self
.
_l
**
2
*
m
@
v
a
[:
-
1
,
1
:]
=
p
**
2
*
u
**
2
/
self
.
_l
**
2
*
m
+
k
-
0.5
*
rho
*
u
**
2
*
q
a
[:
-
1
,
1
:]
=
p
**
2
*
u
**
2
/
self
.
_l
**
2
*
m
+
self
.
_g
*
k
-
0.5
*
rho
*
u
**
2
*
q
a
[
-
1
,
0
]
=
0
a
[
-
1
,
1
:]
=
v
.
T
b
[:
-
1
,
0
]
=
(
p
**
2
*
u
**
2
/
self
.
_l
**
2
*
dm
+
dk
-
0.5
*
rho
*
u
**
2
*
dq
)
@
v
b
[:
-
1
,
0
]
=
(
p
**
2
*
u
**
2
/
self
.
_l
**
2
*
dm
+
self
.
_g
*
dk
-
0.5
*
rho
*
u
**
2
*
dq
)
@
v
b
[
-
1
,
0
]
=
0
x
=
spla
.
lu_solve
((
spla
.
lu_factor
(
a
)),
b
)
return
x
[
0
,
0
]
This diff is collapsed.
Click to expand it.
tests/agard_grad.py
+
1
−
0
View file @
1de1eeaf
...
...
@@ -32,6 +32,7 @@ def get_cfg():
'
mu
'
:
143.920
,
# mass ratio
'
f_ref
'
:
40.3511
,
# frequency of first torsional mode
'
n_modes
'
:
4
,
# number of modes
'
g_struct
'
:
0.02
,
# structural damping
'
rho_ks
'
:
1e6
,
# KS aggregation parameter for KS
'
method
'
:
'
nipk
'
,
# method type
'
fluid
'
:
'
unmatched
'
,
# fluid type
...
...
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