3D Helmholtz Structure

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

3D Helmholtz Structure

Post by CrocoDuck »

Hi there!

I am trying to replicate this case, but simplified as a single aluminium bar in air. I couldn't get it to work until I noticed that in each Helmholtz Structure sif I read (also in the tests folder) there is this line:

Code: Select all

Displacement Variable EigenMode = Integer 1
From the Models Manual:
Displacement Variable Eigenmode Integer
If eigenmode is used for the interface this keyword is used to specify the number of the mode.
However, it isn't really clear to me why I need it.

Is it because the analysis on the elastic structure is harmonic? Also, why the value 1? Should I choose another value if I choose another frequency?

My sif file:

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 = 1
  Output Intervals = 1
  Timestepping Method = BDF
  BDF Order = 1
  Solver Input File = case.sif
  Post File = case.ep
Coordinate Scaling = 0.001
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

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

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

Solver 1
  Equation = Linear elasticity
  Calculate Stresses = True
  Procedure = "StressSolve" "StressSolver"
  Variable = -dofs 3 Displacement
  Frequency = 821
  Harmonic Analysis = True
  Exec Solver = Always
  Stabilize = True
  Bubbles = False
  Lumped Mass Matrix = False
  Optimize Bandwidth = True
  Steady State Convergence Tolerance = 1.0e-5
  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 System Solver = Iterative
  Linear System Iterative Method = GCR
  Linear System Max Iterations = 1000
  Linear System Convergence Tolerance = 1.0e-10
  BiCGstabl polynomial degree = 2
  Linear System Preconditioning = ILU1
  Linear System ILUT Tolerance = 1.0e-3
  Linear System Abort Not Converged = False
  Linear System Residual Output = 1
  Linear System Precondition Recompute = 1
End

Solver 2
  Equation = Helmholtz Equation
  Variable = -dofs 2 Pressure Wave
Displacement Variable Eigenmode = Integer 1
  Procedure = "HelmholtzSolve" "HelmholtzSolver"
  Exec Solver = Always
  Stabilize = True
  Bubbles = False
  Lumped Mass Matrix = False
  Optimize Bandwidth = True
  Steady State Convergence Tolerance = 1.0e-5
  Nonlinear System Convergence Tolerance = 1.0e-7
  Nonlinear System Max Iterations = 20
  Nonlinear System Newton After Iterations = 3
  Nonlinear System Newton After Tolerance = 1.0e-3
  Nonlinear System Relaxation Factor = 1
  Linear System Solver = Iterative
  Linear System Iterative Method = BiCGStabl
  Linear System Max Iterations = 500
  Linear System Convergence Tolerance = 1.0e-10
  BiCGstabl polynomial degree = 2
  Linear System Preconditioning = ILUT
  Linear System ILUT Tolerance = 1.0e-3
  Linear System Abort Not Converged = False
  Linear System Residual Output = 1
  Linear System Precondition Recompute = 1
End

Equation 1
  Name = "bar"
  Calculate Stresses = True
  Plane Stress = True
  Active Solvers(1) = 1
End

Equation 2
  Name = "air"
Frequency = 821
  Active Solvers(1) = 2
End

Material 1
  Name = "Aluminium (generic)"
  Electric Conductivity = 37.73e6
  Relative Permeability = 1.000022
  Youngs modulus = 70.0e9
  Heat Conductivity = 237.0
  Electric Conductivity = 37.73e6
  Electric Conductivity = 37.73e6
  Poisson ratio = 0.35
  Youngs modulus = 70.0e9
  Heat Capacity = 897.0
  Youngs modulus = 70.0e9
  Relative Permeability = 1.000022
  Sound speed = 5000.0
  Poisson ratio = 0.35
  Heat expansion Coefficient = 23.1e-6
  Poisson ratio = 0.35
  Porosity Model = Always saturated
  Mesh Poisson ratio = 0.35
  Electric Conductivity = 37.73e6
  Density = 2700.0
  Relative Permeability = 1.000022
End

Material 2
  Name = "Air (room temperature)"
  Relative Permeability = 1.00000037
  Heat Conductivity = 0.0257
  !Turbulent Prandtl Number = 0.713
  Heat Capacity = 1005.0
  Relative Permittivity = 1.00059
  Relative Permeability = 1.00000037
  Viscosity = 1.983e-5
  Viscosity = 1.983e-5
  Sound speed = 343.0
  Heat expansion Coefficient = 3.43e-3
  Relative Permittivity = 1.00059
  Porosity Model = Always saturated
  Relative Permittivity = 1.00059
  Density = 1.205
  Relative Permeability = 1.00000037
End

Body Force 1
  Name = "barexcite"
  Stress Bodyforce 3 = Variable Coordinate 3; Real MATC "tx * 1e3 * 2000"
End

Boundary Condition 1
  Target Boundaries(1) = 6 
  Name = "bar-fixed"
  Displacement 3 = 0
  Displacement 1 = 0
  Displacement 2 = 0
End

Boundary Condition 2
  Target Boundaries(1) = 2 
  Name = "outline"
  Plane Wave BC = True
End

Boundary Condition 3
  Target Boundaries(1) = 3 
  Name = "baffle"
  Wave Flux 1 = 0
  Wave Flux 2 = 0
End

Boundary Condition 4
  Target Boundaries(1) = 5 
  Name = "interface"
Structure Interface = Logical True
End
raback
Site Admin
Posts: 4823
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: 3D Helmholtz Structure

Post by raback »

Hi

Helmholtz assumes harmonic wake so an eigenmode is a natural way to generate nicely looking fields. Of course you could also do transient time-dependent simulation and take a Fourier transform of it but that is much more tedious.

The 1st eigenmode is chosen because it is the dominant one. Higher eigenmodes will look even more interesting but there is probably not much energy associated with those. You could choose a higher mode though.

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

Re: 3D Helmholtz Structure

Post by CrocoDuck »

Thank you Peter, this clarifies a lot. So, if I get it properly, the air volume is being driven by the displacement of the bar though as if varying sinusoidally in time at the specified bar's eigenfrequency?
pilafa
Posts: 56
Joined: 17 Apr 2012, 00:33
Antispam: Yes
Location: Barcelona

Re: 3D Helmholtz Structure

Post by pilafa »

Hi,

I re-open this topic.

It is not clear to me...

If the elasticity equation has the harmonic option on:

Code: Select all

Solver 1
  Equation = String Linear elasticity
  Procedure = "StressSolve" "StressSolver"
  Variable = -dofs 3 Displacement
  Exec Solver = Always
  
  Frequency = $FR
  Harmonic Analysis = True

  Linear System Solver = Direct
  Linear System Symmetric = Logical True
  Linear System Scaling = Logical False
  Linear System Iterative Method = BiCGStab
  Linear System Direct Method = UMFPACK
  Linear System Convergence Tolerance = 1.0e-8
  Linear System Max Iterations = 200
  Linear System Preconditioning = ILU2

  Nonlinear System Convergence Tolerance = Real 1.0e-7
  Nonlinear System Max Iterations = Integer 1
  Nonlinear System Relaxation Factor = Real 1

  Steady State Convergence Tolerance= 1.0e-6
  Optimize Bandwidth = True

End
I understand that for the Helmholtz equation, the Displacements of the harmonic solution should be used (we do an harmonic solution, not a modal):

Code: Select all

Solver 2 
  Equation = String Helmholtz Equation
  Displacement Variable = String "Displacement"
  Frequency = $FR
  (...)
  
End
The problem when doing that is that this error message is returned:
ERROR:: HelmholtzSolver: Harmonic displacement field should have 2*dim components
The manual says:
Note that normal real valued displacement
field is not suitable, its complex valued eigenmode however is.
So, how to pass "its complex valued eigenmode" to the "Displacement Variable" ?

Thanks,
Pierre
raback
Site Admin
Posts: 4823
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: 3D Helmholtz Structure

Post by raback »

Hi

Test case "HelmholtzStructure2" does it. Maybe you can compare your version with that. Cannot say without deeper analysis...

-Peter
pilafa
Posts: 56
Joined: 17 Apr 2012, 00:33
Antispam: Yes
Location: Barcelona

Re: 3D Helmholtz Structure

Post by pilafa »

Hi Peter

Test case "HelmholtzStructure2" (as wall as 1 and 3) uses:

Displacement Variable EigenMode = Integer 1

and not:

Displacement Variable = String "Displacement"

I cannot find any example working with the displacement, and not with the modal shapes.

Thanks,
Pierre
raback
Site Admin
Posts: 4823
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: 3D Helmholtz Structure

Post by raback »

Hi,

Certainly case 2 does not solve for eigenmodes. I think it may a convention to save a harmonic solution as one eigenmode.

-Peter
pilafa
Posts: 56
Joined: 17 Apr 2012, 00:33
Antispam: Yes
Location: Barcelona

Re: 3D Helmholtz Structure

Post by pilafa »

Ok, Peter, thanks. I will continue assuming that this is the correct way.

However, I still have problems validating the simulation.

To simplify: let say I have a plate of plastic, and water above it. I apply an harmonic load on the bottom of the plastic plate, and calculate the acoustic pressure in the the water:

---------------------------------------------------------------------------------------


WATER (Equation = "Helmholtz")


-------------------------------------------------------------------------------------
Plastic plate (Equation = "Stress Analysis")
----------------------------------------harmonic load--------------------------


I validate the results with comsol.

+ Only acoustic problem: good :D
+ Only elasticity (harmonic): good :D
+ Coupled problem: very different results (shape of pressure and values). :cry:

Here is the sif, any suggestions are welcome

Code: Select all


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


! *********************************************
! PARAMETERS VALUES
! *********************************************

$FR    = 26588
$nout  = 2

Simulation
  Frequency = $FR   !Give simulation frequency in units of 1/s
  Max Output Level = 12
  Coordinate System = Cartesian
  Coordinate Mapping(3) = 1 2 3
  Simulation Type = Steady state
  Steady State Max Iterations = 12  
  Output Intervals = 1
  Timestepping Method = BDF
  BDF Order = 1
  Solver Input File = case.sif
  Post File = case.ep
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


! *************************************
! BODIES
!
! ----- names for bodies -----
!$ CONTAINER = 4
!$ WATER = 5
! ----- names for boundaries -----
!
! *************************************

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

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


! *************************************
! SOLVERS
! *************************************

Solver 1
  Equation = "Stress Analysis"
  Variable = Displacement
  Variable Dofs = 3
  Plane Stress = Logical True

  Frequency = $FR 
  Harmonic Analysis = True

  Linear System Solver = Direct
  Linear System Symmetric = Logical True
  Linear System Scaling = Logical False
  Linear System Iterative Method = BiCGStab
  Linear System Direct Method = UMFPACK
  Linear System Convergence Tolerance = 1.0e-8
  Linear System Max Iterations = 200
  Linear System Preconditioning = ILU2

  Nonlinear System Convergence Tolerance = Real 1.0e-7
  Nonlinear System Max Iterations = Integer 1
  Nonlinear System Relaxation Factor = Real 1

  Steady State Convergence Tolerance= 1.0e-6
  Optimize Bandwidth = True  
  
  
End


! Direct 

Solver 2
  Equation = "Helmholtz"
  Variable = Pressure
  Variable Dofs = 2

  Procedure = "HelmholtzSolve" "HelmholtzSolver" 

  Linear System Solver = Direct

  Linear System Direct Method = umfpack

  Displacement Variable EigenMode = Integer 1
!   Displacement Variable = String "Displacement"!"Displacement"  ! NOT WORKING
  Frequency = $FR
  
  Linear System Symmetric = Logical True
  Linear System Scaling = Logical False
  Linear System Iterative Method = BiCGStab
  Linear System Direct Method = UMFPACK
  Linear System Convergence Tolerance = 1.0e-8
  Linear System Max Iterations = 200
  Linear System Preconditioning = ILU2  
  
  Steady State Convergence Tolerance = 1.0e-05

  Nonlinear System Convergence Tolerance = 1.0e-05
  Nonlinear System Max Iterations = 1
  Nonlinear System Newton After Iterations = 3
  Nonlinear System Newton After Tolerance = 1.0e-02
  Nonlinear System Relaxation Factor = 1
End

! VTU
Solver 3

 Exec interval = Integer 1
 
 Equation = String "ResultOutput"
 Procedure = File "ResultOutputSolve" "ResultOutputSolver"
 !Output File Name = File "IR_test." !or any other output file name of your choice
 Output Format = String "vtu"
 Vtu Format = Logical True
 Binary Output = Logical True
 Exec Solver = String "after timestep"
 Save Geometry Ids = Logical True
 Calculate Loads=True
End 

! *************************************
! EQUATIONS
! *************************************

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

Equation 2
  Name = "water"
  Active Solvers(1) = 2
End


! *************************************
! MATERIALS
! *************************************

Material 1
  Name = "Polycarbonate (generic)"
  Rayleigh Damping = Logical True
  Rayleigh alpha = Real 0.0
  Rayleigh beta = Real 4.25e-8
  Youngs modulus = 2.2e9
  Density = 1220.0
  Poisson ratio = 0.37
End


Material 2
  Name = "water"
  Density = 1000
  Sound speed = 1484.0
End


! *************************************
! BCs
! 
! 
! $ top = 1
! $ trans_C = 2
! $ trans_Q = 3
! $ interface = 6
! $ sym_X = 7
! $ sym_Y = 8

! *************************************


! Pressure on transducers
Boundary Condition 1
  Target Boundaries(1) = 2
  Normal Force = 7690  !N/m^2
End

Boundary Condition 2
  Target Boundaries(1) = 3
  Normal Force = 7690  !N/m^2
End

! Sym plan normal to X
Boundary Condition 3
  Target Boundaries(1) = 7
  Displacement 1 = 0  
End

! Sym plan normal to Y
Boundary Condition 4
  Target Boundaries(1) = 8
  Displacement 2 = 0  
End

!TOP WATER SURFACE
Boundary Condition 5
 Target Boundaries(1) =  1
 Wave impedance 1 = 0.4116
 Wave impedance 2 = 0.0
End

!Interface
Boundary Condition 6
  Target Boundaries(1) = 6
  Structure Interface = Logical True
End 


I know the difference can come from many different sources...but maybe looking at the sif file you will have good advice!

Thanks,
PL
Attachments
post.sif
(4.55 KiB) Downloaded 331 times
raback
Site Admin
Posts: 4823
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: 3D Helmholtz Structure

Post by raback »

Hi

Do I understand that you need fully coupled rather than hierarchical system? Probably that's the problem.

Coupled problem is much more difficult. Not of course impossible, and that has been solved before. Just don't know if the current version enables it without any coding effort.

-Peter
pilafa
Posts: 56
Joined: 17 Apr 2012, 00:33
Antispam: Yes
Location: Barcelona

Re: 3D Helmholtz Structure

Post by pilafa »

Hi Peter,

Very interesting. But I don't know what you mean by "hierarchical system".

Some definitions, the way I understand them:

Single-way coupling : The structure is deformed, and the deformation is applied to the fluid as boundary condition. No iterations.
...versus:
Two way coupling : The deformation of the structure perturbs the fluid, and the fluid perturbs back the structure, and so on until convergence.

Fully Coupled: All the unknowns (pressures and displacements) are solve at the same time in the same matrix
...versus:
Segregated: Treats each physics sequentially, and iterates until convergence.

So, by "hierarchical" do you mean "Segregated"??

Thanks again,
Pierre
Post Reply