Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
toolbox
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
12
Issues
12
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
4
Merge Requests
4
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Institute of Technical Acoustics (ITA)
toolbox
Commits
476328d5
Commit
476328d5
authored
Aug 14, 2017
by
Markus Mueller-Trapet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor changes (language, typos, etc)
parent
00957f0f
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
23 deletions
+35
-23
applications/Numeric/FluidFEM/@itaMeshBoundaryC/getValueAtFrequency.m
.../Numeric/FluidFEM/@itaMeshBoundaryC/getValueAtFrequency.m
+10
-4
applications/Numeric/FluidFEM/MAkomplex.m
applications/Numeric/FluidFEM/MAkomplex.m
+5
-5
applications/Numeric/FluidFEM/ModalAnalysis.m
applications/Numeric/FluidFEM/ModalAnalysis.m
+3
-3
applications/Numeric/FluidFEM/ita_ModeSolve.m
applications/Numeric/FluidFEM/ita_ModeSolve.m
+14
-9
applications/Numeric/FluidFEM/particularS.m
applications/Numeric/FluidFEM/particularS.m
+3
-2
No files found.
applications/Numeric/FluidFEM/@itaMeshBoundaryC/getValueAtFrequency.m
View file @
476328d5
...
@@ -6,10 +6,16 @@ function value = getValueAtFrequency(varargin)
...
@@ -6,10 +6,16 @@ function value = getValueAtFrequency(varargin)
% </ITA-Toolbox>
% </ITA-Toolbox>
if
nargin
<
4
if
nargin
<
4
if
isa
(
varargin
{
1
},
'itaMeshBoundaryC'
),
this
=
varargin
{
1
};
if
isa
(
varargin
{
1
},
'itaMeshBoundaryC'
)
else
error
(
'getValueAtFrequency:: Wrong input argument'
);
end
this
=
varargin
{
1
};
if
isnumeric
(
varargin
{
2
}),
freq
=
varargin
{
2
};
else
else
error
(
'getValueAtFrequency:: Wrong input argument'
);
end
error
(
'getValueAtFrequency:: Wrong input argument'
);
end
if
isnumeric
(
varargin
{
2
})
freq
=
varargin
{
2
};
else
error
(
'getValueAtFrequency:: Wrong input argument'
);
end
if
nargin
==
2
if
nargin
==
2
%disp('getValueAtFrequency:: When I have no fluid informations, I choose c=343.7 m/s and rho = 1.2 kg/m!');
%disp('getValueAtFrequency:: When I have no fluid informations, I choose c=343.7 m/s and rho = 1.2 kg/m!');
Z0
=
343.7
*
1.2
;
Z0
=
343.7
*
1.2
;
...
...
applications/Numeric/FluidFEM/MAkomplex.m
View file @
476328d5
...
@@ -42,7 +42,7 @@ omegaO = 2*pi*(fGr+deltaFreqMax);
...
@@ -42,7 +42,7 @@ omegaO = 2*pi*(fGr+deltaFreqMax);
if
fdependent
==
0
% no frequency dependent boundary conditions
if
fdependent
==
0
% no frequency dependent boundary conditions
% eigenvalues / eigenvectors
% eigenvalues / eigenvectors
[
eVector
,
eValue
]
=
polyeig
(
SysMat
.
S
,
1
i
*
aYn
,
-
SysMat
.
M
/
fluid
.
c
^
2
);
[
eVector
,
eValue
]
=
polyeig
(
SysMat
.
S
,
1
i
*
aYn
,
-
SysMat
.
M
/
fluid
.
c
^
2
);
h
=
waitbar
(
0
,
'
K
omplex Modulation: Pressure calculation is running...'
);
h
=
waitbar
(
0
,
'
C
omplex Modulation: Pressure calculation is running...'
);
tic
tic
% sort eigenvectors
% sort eigenvectors
[
~
,
pos2
]
=
sort
(
real
(
eValue
));
[
~
,
pos2
]
=
sort
(
real
(
eValue
));
...
@@ -103,11 +103,11 @@ if fdependent == 0 % no frequency dependent boundary conditions
...
@@ -103,11 +103,11 @@ if fdependent == 0 % no frequency dependent boundary conditions
end
end
t2
=
toc
;
t2
=
toc
;
disp
(
' '
);
disp
(
' '
);
disp
(
'Time
k
omplex'
);
disp
(
'Time
c
omplex'
);
disp
(
'-------------------------------------------------------------------'
);
disp
(
'-------------------------------------------------------------------'
);
disp
([
'Sorti
eren
: '
num2str
(
t1
)]);
disp
([
'Sorti
ng
: '
num2str
(
t1
)]);
disp
([
'
Schleife
: '
num2str
(
t2
)]);
disp
([
'
Loop
: '
num2str
(
t2
)]);
disp
([
'
Gesamt
: '
num2str
(
t1
+
t2
)]);
disp
([
'
Total
: '
num2str
(
t1
+
t2
)]);
disp
(
' '
);
disp
(
' '
);
close
(
h
)
close
(
h
)
else
% frequency dependent boundary conditions
else
% frequency dependent boundary conditions
...
...
applications/Numeric/FluidFEM/ModalAnalysis.m
View file @
476328d5
...
@@ -26,7 +26,7 @@ if nargin <6
...
@@ -26,7 +26,7 @@ if nargin <6
else
else
if
isnan
(
varargin
{
6
})
if
isnan
(
varargin
{
6
})
mode
=
varargin
{
6
};
mode
=
varargin
{
6
};
if
~
strcmp
(
mode
,
'
k
omplex'
)
&&
~
strcmp
(
mode
,
'matrix'
)
if
~
strcmp
(
mode
,
'
c
omplex'
)
&&
~
strcmp
(
mode
,
'matrix'
)
error
(
'ModalAnalysis:: Wrong input Parameter mode!'
)
error
(
'ModalAnalysis:: Wrong input Parameter mode!'
)
end
end
else
else
...
@@ -42,7 +42,7 @@ if fTmp == 0, noEx=1; end
...
@@ -42,7 +42,7 @@ if fTmp == 0, noEx=1; end
if
noEx
==
0
if
noEx
==
0
switch
mode
% solver method
switch
mode
% solver method
case
'
komplex'
% Modal analysis with k
omplex eigenvectors
case
'
complex'
% Modal analysis with c
omplex eigenvectors
try
try
ind
=
0
;
ind
=
0
;
for
i1
=
1
:
length
(
SysMat
.
A
)
for
i1
=
1
:
length
(
SysMat
.
A
)
...
@@ -54,7 +54,7 @@ if noEx==0
...
@@ -54,7 +54,7 @@ if noEx==0
disp
(
'============================='
);
disp
(
'============================='
);
else
else
p
=
MAkomplex
(
SysMat
,
GUI
,
dMax
,
groupMaterial
,
fluid
);
p
=
MAkomplex
(
SysMat
,
GUI
,
dMax
,
groupMaterial
,
fluid
);
disp
(
'Solution: modal analysis
k
omplex'
);
disp
(
'Solution: modal analysis
c
omplex'
);
disp
(
'================================'
);
disp
(
'================================'
);
end
end
catch
catch
...
...
applications/Numeric/FluidFEM/ita_ModeSolve.m
View file @
476328d5
...
@@ -22,9 +22,14 @@ structField = fieldnames(GUI);
...
@@ -22,9 +22,14 @@ structField = fieldnames(GUI);
if
isempty
(
strfind
(
structField
{
1
},
'coord'
))
% old or manual version
if
isempty
(
strfind
(
structField
{
1
},
'coord'
))
% old or manual version
ita_ModeSolveManualInput
(
GUI
);
ita_ModeSolveManualInput
(
GUI
);
[
coord
,
elements
,
groupMaterial
]
=
niceObject
(
GUI
.
meshFilename
,
GUI
.
propertyFilename
);
% generate coordinate, element and group material objects
[
coord
,
elements
,
groupMaterial
]
=
niceObject
(
GUI
.
meshFilename
,
GUI
.
propertyFilename
);
% generate coordinate, element and group material objects
if
size
(
elements
{
2
}
.
nodes
,
2
)
<
10
,
elements
=
{
elements
{
1
}
elements
{
2
}};
if
size
(
elements
{
2
}
.
nodes
,
2
)
<
10
else
elements
=
{
elements
{
2
}
elements
{
1
}};
end
elements
=
{
elements
{
1
}
elements
{
2
}};
if
nargout
~=
1
,
error
(
'Wrong number of outputs'
);
end
else
elements
=
{
elements
{
2
}
elements
{
1
}};
end
if
nargout
~=
1
error
(
'Wrong number of outputs'
);
end
else
% GUI version: This version uses renumberated groups and elements
else
% GUI version: This version uses renumberated groups and elements
coord
=
GUI
.
coord
;
coord
=
GUI
.
coord
;
elements
=
{
GUI
.
volElem
,
GUI
.
surfElem
};
elements
=
{
GUI
.
volElem
,
GUI
.
surfElem
};
...
@@ -37,12 +42,13 @@ fluid = itaMeshFluid(1,'ModeSolve',343.7,1.2);
...
@@ -37,12 +42,13 @@ fluid = itaMeshFluid(1,'ModeSolve',343.7,1.2);
%% System matrices
%% System matrices
if
isempty
(
sArgs
.
SystemMatrix
)
if
isempty
(
sArgs
.
SystemMatrix
)
SysMat
=
sys_mat
(
coord
,
elements
,
groupMaterial
);
SysMat
=
sys_mat
(
coord
,
elements
,
groupMaterial
);
else
SysMat
=
sArgs
.
SystemMatrix
;
else
SysMat
=
sArgs
.
SystemMatrix
;
end
end
%% Pressure calculation
%% Pressure calculation
if
strcmp
(
GUI
.
solveMode
,
'particular'
)
% particular solution of fe- helmholtzequation
if
strcmp
(
GUI
.
solveMode
,
'particular'
)
% particular solution of fe- helmholtzequation
[
p
]
=
particularS
(
GUI
,
SysMat
,
coord
,
elements
,
groupMaterial
,
fluid
);
[
p
]
=
particularS
(
GUI
,
SysMat
,
coord
,
elements
,
groupMaterial
,
fluid
);
elseif
strcmp
(
GUI
.
solveMode
,
'
k
omplex'
)
||
strcmp
(
GUI
.
solveMode
,
'real'
)
% pressure calculation with modalanalysis
elseif
strcmp
(
GUI
.
solveMode
,
'
c
omplex'
)
||
strcmp
(
GUI
.
solveMode
,
'real'
)
% pressure calculation with modalanalysis
dMax
=
sqrt
((
max
(
coord
.
x
)
-
min
(
coord
.
x
))
^
2
+
(
max
(
coord
.
y
)
-
min
(
coord
.
y
))
^
2
+
(
max
(
coord
.
z
)
-
min
(
coord
.
z
))
^
2
);
dMax
=
sqrt
((
max
(
coord
.
x
)
-
min
(
coord
.
x
))
^
2
+
(
max
(
coord
.
y
)
-
min
(
coord
.
y
))
^
2
+
(
max
(
coord
.
z
)
-
min
(
coord
.
z
))
^
2
);
[
p
,
GUI
]
=
ModalAnalysis
(
SysMat
,
GUI
,
dMax
,
groupMaterial
,
fluid
);
[
p
,
GUI
]
=
ModalAnalysis
(
SysMat
,
GUI
,
dMax
,
groupMaterial
,
fluid
);
else
% eigenvalue and frequency calculation
else
% eigenvalue and frequency calculation
...
@@ -53,7 +59,6 @@ end
...
@@ -53,7 +59,6 @@ end
%% Output
%% Output
if
isempty
(
strfind
(
structField
{
1
},
'coord'
))
||
sArgs
.
display
==
0
% old or manual version
if
isempty
(
strfind
(
structField
{
1
},
'coord'
))
||
sArgs
.
display
==
0
% old or manual version
pRes
=
itaResult
;
pRes
=
itaResult
;
pRes
.
freqVector
=
GUI
.
Freq
'
;
pRes
.
freqVector
=
GUI
.
Freq
'
;
pRes
.
freqData
=
p
.'
;
pRes
.
freqData
=
p
.'
;
...
...
applications/Numeric/FluidFEM/particularS.m
View file @
476328d5
...
@@ -55,7 +55,8 @@ for i1 = 1:length(GUI.Freq) % loop over all frequencies
...
@@ -55,7 +55,8 @@ for i1 = 1:length(GUI.Freq) % loop over all frequencies
p_knownElem
=
unique
(
elements
{
2
}(
groupMaterial
{
dirichlet
(
i4
,
1
)}
.
ID
,:));
p_knownElem
=
unique
(
elements
{
2
}(
groupMaterial
{
dirichlet
(
i4
,
1
)}
.
ID
,:));
p_unknownElem
(
p_knownElem
)
=
[];
p_unknownElem
(
p_knownElem
)
=
[];
K_temp
=
K
;
l_knownElem
=
length
(
p_knownElem
);
K_temp
=
K
;
l_knownElem
=
length
(
p_knownElem
);
K_temp
(
p_knownElem
,
p_knownElem
)
=
eye
(
l_knownElem
,
l_knownElem
);
K_temp
(
p_knownElem
,
p_knownElem
)
=
eye
(
l_knownElem
,
l_knownElem
);
K_temp
(
p_knownElem
,
p_unknownElem
)
=
zeros
(
length
(
p_knownElem
),
length
(
p_unknownElem
));
K_temp
(
p_knownElem
,
p_unknownElem
)
=
zeros
(
length
(
p_knownElem
),
length
(
p_unknownElem
));
K_temp
(
p_unknownElem
,
p_knownElem
)
=
zeros
(
length
(
p_unknownElem
),
length
(
p_knownElem
));
K_temp
(
p_unknownElem
,
p_knownElem
)
=
zeros
(
length
(
p_unknownElem
),
length
(
p_knownElem
));
...
@@ -78,6 +79,6 @@ end
...
@@ -78,6 +79,6 @@ end
t3
=
toc
;
t3
=
toc
;
disp
(
'Time particular'
);
disp
(
'Time particular'
);
disp
(
'-------------------------------------------------------------------'
);
disp
(
'-------------------------------------------------------------------'
);
disp
([
'
Gesamt
: '
num2str
(
t3
)]);
disp
([
'
Total
: '
num2str
(
t3
)]);
disp
(
' '
);
disp
(
' '
);
close
(
h
);
close
(
h
);
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment