WaveSolver and Eigen Analysis

Numerical methods and mathematical models of Elmer
CrocoDuck
Posts: 79
Joined: 12 May 2016, 13:15
Antispam: Yes

Re: WaveSolver and Eigen Analysis

Post by CrocoDuck »

I see, that clarifies. Thanks.

As for your question:
raback wrote: 21 Aug 2020, 16:59 The same applies to "Pressure Velocity". That being said, I don't really recall what it would do in harmonic case. Does it play a role whether you have it or not? This is also taken care by the library.
I commented out and used a sort of "blank" boundary condition:

Code: Select all

Boundary Condition 1
  ! Pressure Velocity = Real 0
End
It delivered the same results.
CrocoDuck
Posts: 79
Joined: 12 May 2016, 13:15
Antispam: Yes

Re: WaveSolver and Eigen Analysis

Post by CrocoDuck »

Hey guys. If you are interested, I did a little accuracy study of the solution. I am quite satisfied. Results are here: https://computational-acoustics.gitlab. ... ed-part-2/.

Cheers!
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: WaveSolver and Eigen Analysis

Post by raback »

Hi Croco

Nice work! This kind of diligent work is needed to push the code into new areas. And actually before your tests this was not possible since the wave equation hadn't been tested for eigen analysis.

A note on the output of eigenmodes. You will get the modes as timesteps in vtu file if you add in Simulation section "vtu: Eigen Analysis = Logical True". This will tell the vtu output to number the files according to eigenmodes. There could be iterative or time dependent problems where for each iteration we solve a slightly modified eigenvalue problem. So therefore this is not the default in output.

I don't remember whether the solver can deal with p-elements. However, you might want to test whether "Element = p:2" improves results.Certainly there is always a significant cost in increasing the element order but for wave problems going quadratic may pay off.

-Peter
CrocoDuck
Posts: 79
Joined: 12 May 2016, 13:15
Antispam: Yes

Re: WaveSolver and Eigen Analysis

Post by CrocoDuck »

Hi!
raback wrote: 13 Sep 2020, 01:19 Hi Croco

Nice work! This kind of diligent work is needed to push the code into new areas. And actually before your tests this was not possible since the wave equation hadn't been tested for eigen analysis.
Cool! I am glad this was interesting for you.
raback wrote: 13 Sep 2020, 01:19 A note on the output of eigenmodes. You will get the modes as timesteps in vtu file if you add in Simulation section "vtu: Eigen Analysis = Logical True". This will tell the vtu output to number the files according to eigenmodes. There could be iterative or time dependent problems where for each iteration we solve a slightly modified eigenvalue problem. So therefore this is not the default in output.
Ha! Nice, I did not know that. I will try. I definitely need to give another good read at the manuals, so many things I keep on missing.
raback wrote: 13 Sep 2020, 01:19 I don't remember whether the solver can deal with p-elements. However, you might want to test whether "Element = p:2" improves results.Certainly there is always a significant cost in increasing the element order but for wave problems going quadratic may pay off.
Cool stuff. I will try that too.
CrocoDuck
Posts: 79
Joined: 12 May 2016, 13:15
Antispam: Yes

Re: WaveSolver and Eigen Analysis

Post by CrocoDuck »

Tested both of "vtu: Eigen Analysis = Logical True" and "Element = p:2". They work like a charm, and p:2 boost the accuracy a lot. Good stuff.
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: WaveSolver and Eigen Analysis

Post by raback »

Nice!

In your case can you determine that it is more efficient to get the added accuracy using the p strategy (vs. h strategy)? The theory says that for smooth problems p should be better. You can go p=3, 4, 5,... but I would suspect that the sweep spot is p=2 or p=3.

The integration rules for the p-elements may be rather costly. There might be some room for improvement here. The number of points grow now as p^3.

-Peter
andcic
Posts: 1
Joined: 05 Aug 2021, 09:21
Antispam: Yes

Re: WaveSolver and Eigen Analysis

Post by andcic »

Hi all,

Following CrocoDuck's work, I am doing some trials on ElmerFEM for eigenvalue study applications in room acoustics.

I would be interested in calculating the complex Eigenvalues when the room boundaries present an impedance / admittance value. I see that ElmerSolver runs the 'rigid' case by default, providing with real eigenvalues.

By looking at ElmerSolver manual, the following option could be activated:

Code: Select all

Eigen System Damped = Logical True
This is in order to consider damping in the eigenvalue analysis.

However, when running the study, I encounter the following error:

Code: Select all

WaveSolver: Solving the divergence pressure wave
WaveSolver: We have a harmonic or eigenmode system


Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
#0  0xde18c3eb
#1  0xde107034
#2  0xbba62201
#3  0x64c87ff7
#4  0x65f1217e
#5  0x65ec1453
#6  0x65f10cad
#7  0xb3847e3f
#8  0xb39c7b65
#9  0xb39cc916
#10  0xb39d504b
#11  0xb38fd83c
#12  0xb3981912
#13  0xb397a8c9
#14  0xb3b1a872
#15  0x22d643e7
#16  0xb398ed6a
#17  0xb39a73db
#18  0xb39a8c76
#19  0xb39a9f32
#20  0xb3c3171f
#21  0xbba61707
#22  0xbba62a93
#23  0xbba613c0
#24  0xbba614f5
#25  0x64297033
#26  0x65ec2650
#27  0xffffffff
Apparently the option does not work with the WaveSolver module. Could you please help with this or give some insight on an alternative way to get complex eigenfrequencies and corresponding eigenfunctions?

SIF file here, trying with 1 anechoic boundary:

Code: Select all

Header
  CHECK KEYWORDS Warn
  Mesh DB "." "."
  Include Path ""
  Results Directory ""
End

Simulation
  Max Output Level = 5
  Coordinate System = Cartesian
  Coordinate Mapping(3) = 1 2 3
  Simulation Type = Steady state
  Steady State Max Iterations = 10
  Output Intervals = 1
  Timestepping Method = BDF
  BDF Order = 1
  ! Coordinate Scaling = 0.001
  Solver Input File = case.sif
  Post File = case.vtu
End

Constants
  Gravity(4) = 0 -1 0 9.82
  Stefan Boltzmann = 5.67e-08
  Permittivity of Vacuum = 8.8542e-12
  Boltzmann Constant = 1.3807e-23
  Unit Charge = 1.602e-19
End

Solver 1

  ! Equation
  Equation = "Wave Equation"
  Procedure = "WaveSolver" "WaveSolver"
  Variable = "Pressure"
  Variable DOFs = 1
  
  ! Solver
  
  ! Steady State
  Steady State Convergence Tolerance = 1e-09
  
  ! Nonlinear
  ! Nonlinear System Convergence Tolerance = 1.0e-7
  ! Nonlinear System Max Iterations = 1
  ! Nonlinear System Newton After Iterations = 3
  ! Nonlinear System Newton After Tolerance = 1.0e-3
  ! Nonlinear System Relaxation Factor = 1
  
  ! Linear
  ! Linear System Scaling = Logical True
  ! Linear System Symmetric = Logical True
  Linear System Solver = string "Iterative"
  Linear System Direct Method = Umfpack
  Linear System Iterative Method = BiCGStabl
  Linear System Max Iterations = 10000
  Linear System Convergence Tolerance = real 1e-8
  BiCGstabl polynomial degree = 4
  Linear System Preconditioning = ILU2
  Linear System ILUT Tolerance = 1.0e-3
  Linear System Abort Not Converged = True
  Linear System Residual Output = 50
  Linear System Precondition Recompute = 1
  
  ! Special
  Eigen Analysis = True
  Eigen System Damped = Logical True
  Eigen System Values = 15
  Eigen System Select = smallest magnitude
  Eigen System Convergence Tolerance = Real 1.0e-9
  Eigen System Max Iterations = 10000
  ! Eigen System Shift = Real 1000
  Eigen System Normalize To Unity = Logical True
  
  
End

Solver 2
  Equation = "SaveScalars"
  Filename = eigenvalues.dat

  Procedure = "SaveData" "SaveScalars"
  Save EigenValues = True

  !Compare the norm of the 15th eigenvalue
  Show Norm Index = 15
  
End

Equation 1
  Name = "Wave Equation"
  Active Solvers(1) = 1
End

Material 1
  Name = "Air (room temperature)"
  Sound Speed = Real 343.0
  Sound Damping = Real 0.0
  Sound Reaction Damping = Real 0.0
End

Body 1
  Target Bodies(1) = 1
  Name = "Body 1"
  Equation = 1
  Material = 1
End

Boundary Condition 1
  Target Boundaries(5) = 2 3 4 5 6
  Name = "Soft"
  Pressure Velocity = Real 0 
End

Boundary Condition 2
  Target Boundaries(1) = 1
  Name = "Soft"
  Wave Impedance 1 = Real 343.0 
End
The Geometry is a simple box 5x4x3 m.
CuboidRoom.msh
Mesh file
(525.9 KiB) Downloaded 155 times
Many thanks in advance.
Andrea
Post Reply