VTK Export gives zeroes in calculated absolute value

General discussion about Elmer
Post Reply
3WayFir
Posts: 24
Joined: 30 Jan 2012, 22:00
Antispam: Yes

VTK Export gives zeroes in calculated absolute value

Post by 3WayFir »

Hey there,

after a year im finally back to Elmer, this time with Helmholtz BEM. I want to export something like the Amplitude of my pressure field p=abs(p_complex). But VTK export only gives me zeros, what i going wrong?? In the *.ep file, it seems there are the correct values. The pressure.field.1 and pressure.field.2 are visible in Mayavi2 in the right way. One can also choose Press_dB in myavi, but it equals zero everywhere!

Here my sif file:

Code: Select all

$ fem = 0
$ r =  1.224
$ c = 340
$ w = 15000
$ k = w / c

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

Simulation
  Max Output Level = 3
  Angular Frequency = $k
  Coordinate System = Axi Symmetric
  Coordinate Mapping(3) = 1 2 3
  Simulation Type = "Steady State"
  Steady State Max Iterations = 1
  Output Intervals = 1
 Output File = "CircleInBox.dat"
 Post File = "CircleInBox.ep"
End

Constants
  Gravity(4) = 0 -1 0 9.82
  Stefan Boltzmann = 5.67e-08
End

Body 1
  Equation = 1
  Material = 1
End




Equation 1
  Helmholtz = Logical True
  Active Solvers(2) = 1 2
End

Solver 1
  Equation = "Helmholtz"
  Variable = "Pressure"
  Variable Dofs = 2
  Procedure = "HelmholtzBEM" "HelmholtzBEMSolver"
  Exported Variable 1 = Press_dB
  Exported Variable 1 DOFs = 1
  Linear System Solver = "Iterative"
  Linear System Iterative Method = "BiCGStab"
  Linear System Max Iterations = 300
  Linear System Convergence Tolerance = 1.0e-08
  Linear System Abort Not Converged = True
  Linear System Preconditioning = "ILU0"
  Linear System Residual Output = 1
  Linear System Precondition Recompute = 1
  Steady State Convergence Tolerance = 1.0e-8
  Nonlinear System Convergence Tolerance = 1.0e-08
  Nonlinear System Max Iterations = 1
  Nonlinear System Newton After Iterations = 3
  Nonlinear System Newton After Tolerance = 1.0e-08
  Nonlinear System Relaxation Factor = 1
  Optimize Bandwidth = FALSE
End

Material 1
  Density = $ r
  Sound Speed = $ c
End

Boundary Condition 1
  Normal Target Body = 0  ! Change normal direction if desired
  Target Boundaries(1) = 6
  $ if( ~fem ) { "Body Id = 1" }
  !Wave Flux 1 = 100 ! fem
  Flux 1 = Real 100 ! bem
End

Boundary Condition 3
  Normal Target Body = 0  ! Change normal direction if desired
  Target Boundaries(3) = 3 4 5 
  $ if( ~fem ) { "Body Id = 1" }
  !Wave Flux 1 = 0 ! fem
  Flux 1 = Real 0 ! bem
End
Boundary Condition 2
  Target Boundaries(3) = 1 2 7
  Wave Impedance 2 = Real $ c
End


Body Force 1
      Press_dB = Variable Pressure Wave 1, Pressure Wave 2
      Real MATC "20*log(((sqrt(tx(0)^2+tx(1)^2))/sqrt(2)))"
End

Solver 2
Equation = Result Output
Single Precision = True
Binary Output = True
Procedure = "ResultOutputSolve" "ResultOutputSolver"
Output Format = Vtk
Scalar Field 1 = Press_dB
Output File Name = case
End
And my Solverfile:

Code: Select all

ELMER SOLVER (v 7.0) STARTED AT: 2013/02/10 18:38:24
MAIN: 
MAIN: =============================================================
MAIN: ElmerSolver finite element software, Welcome!
MAIN: This program is free software licensed under (L)GPL
MAIN: Copyright 1st April 1995 - , CSC - IT Center for Science Ltd.
MAIN: Webpage http://www.csc.fi/elmer, Email elmeradm@csc.fi
MAIN: Library version: 7.0 (Rev: 6043)
MAIN:  HYPRE library linked in.
MAIN:  MUMPS library linked in.
MAIN: =============================================================
MAIN: 
MAIN: 
MAIN: -------------------------------------
MAIN: Reading Model: case.sif
Model Input:  Unlisted keyword: [helmholtz] in section: [equation 1]
Model Input:  Unlisted keyword: [press_db] in section: [body force 1]
MAIN: 
MAIN: -------------------------------------
MAIN:  Steady state iteration:            1
MAIN: -------------------------------------
MAIN: 
 Assembly (s):   3.69950000000000001E-002
       1 0.3114E+01
       2 0.3760E+00
       3 0.2361E+00
       4 0.1326E+00
       5 0.1908E+00
       6 0.4593E-01
       7 0.1584E-01
       8 0.9816E-03
       9 0.3513E-04
      10 0.3018E-05
      11 0.2631E-06
      12 0.5783E-08
      12 0.5783E-08
 Solve (s):      1.99900000000002853E-003
 Post Processing (s):       3.0395380000000003     
ComputeChange: SS (ITER=1) (NRM,RELC): ( 0.73804732      2.0000000     ) :: helmholtz
ElmerSolver: *** Elmer Solver: ALL DONE ***
ElmerSolver: The end
SOLVER TOTAL TIME(CPU,REAL):         3.80        4.06
ELMER SOLVER FINISHED AT: 2013/02/10 18:38:28

So what is going wrong there?? For visualization, as told above i am currently using mayavi2!

Thank a lot for help!!

Tobi
raback
Site Admin
Posts: 4828
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: VTK Export gives zeroes in calculated absolute value

Post by raback »

Hi Tobi

I guess the VTK output cannot understand the field with two components being a complex scalar field. You might rather give the both components separately. Also the VTK output is no longer developed as the XML based VTU format is much more versatile. I recommend using that instead.

-Peter
3WayFir
Posts: 24
Joined: 30 Jan 2012, 22:00
Antispam: Yes

Re: VTK Export gives zeroes in calculated absolute value

Post by 3WayFir »

Hey Peter,

Vtu is not working ,too. I am calculating

Body Force 1
Press_dB = Variable Pressure Wave 1, Pressure Wave 2
Real MATC "20*log(((sqrt(tx(0)^2+tx(1)^2))/sqrt(2)))"
End

Solver 2
Equation = Result Output
Single Precision = True
Binary Output = True
Procedure = "ResultOutputSolve" "ResultOutputSolver"
Output Format = Vtk
Scalar Field 1 = Press_dB
Output File Name = case
End

and want to export that, but there are only zeroes! so there is no complex field i want to export!! :shock:

Ciao, tobi
raback
Site Admin
Posts: 4828
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: VTK Export gives zeroes in calculated absolute value

Post by raback »

Hi

Probably you need to say something like "Compute Exported Variables = Logical True" in the solver section.

-Peter
MohamedAmine
Posts: 1
Joined: 07 Jan 2016, 19:04
Antispam: Yes

Re: VTK Export gives zeroes in calculated absolute value

Post by MohamedAmine »

Hello,
I don't know if you still need a solution.
I'm facing the same problem, And I've solved it finally.
I think the problem is that Result Output is a solver, so it may be executed before the equation, for your case "Helmholtz".
So the solution is to specify a priority value to the solver you are using. Try to give it the value 1 (in the Equation window), so it will be executed first.

Hope this helps.
Regards.
Post Reply