Page 1 of 3

Navier-Stokes solver does not converge

Posted: 29 Apr 2016, 15:46
by mzenker
Hi,

I am doing my first steps with the Navier-Stokes solver, and I am having problems.
I want to simulate a flow of air going through a narrow tube which faces a wall. The case is set up with a 2D mesh and cylindric symmetry.
My case is attached. The problem is that the solver diverges and finishes with a crash. What am I doing wrong?
Elmer Version: 8.2 (Rev: Release, Compiled: 2016-03-15) Windoze 7 64-bit
Error message:

Code: Select all

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

Backtrace for this error:
#0  ffffffffffffffff
Thanks for a pointer or hint,

Matthias

Re: Navier-Stokes solver does not converge

Posted: 10 May 2016, 18:12
by mzenker
Anyone...?

Re: Navier-Stokes solver does not converge

Posted: 11 May 2016, 12:00
by mzenker
I changed from ideal gas to incompressible. The error message now says:

Code: Select all

ComputeChange: Computed Norm: Infinity
ERROR:: ComputeChange: Norm of solution exceeded given bounds
Could someone please give me a hint what I can try to achieve convergence?

Thanks,

Matthias

Re: Navier-Stokes solver does not converge

Posted: 12 May 2016, 14:50
by mzenker
Hi again,

in case this lowers the threshold for someone to have a look at my case, here is my sif file:

Code: Select all

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

Simulation
  Max Output Level = 5
  Coordinate System = Cylindric Symmetric
  Coordinate Mapping(3) = 1 2 3
  Simulation Type = Steady state
  Steady State Max Iterations = 50
  Output Intervals = 1
  Timestepping Method = BDF
  BDF Order = 1
  Solver Input File = case.sif
  Post File = case.vtu
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) = 12
  Name = "Innen"
  Equation = 1
  Material = 1
  Initial condition = 1
End

Body 2
  Target Bodies(1) = 14
  Name = "Aussen"
  Equation = 1
  Material = 1
  Initial condition = 1
End

Solver 1
  Equation = Navier-Stokes
  Variable = Flow Solution[Velocity:2 Pressure:1]
  Procedure = "FlowSolve" "FlowSolver"
  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 = BiCGStab
  Linear System Max Iterations = 500
  Linear System Convergence Tolerance = 1.0e-10
  BiCGstabl polynomial degree = 2
  Linear System Preconditioning = Diagonal
  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 = "Equation 1"
  Active Solvers(1) = 1
End

Material 1
  Name = "Air (room temperature)"
  Reference Temperature = 300
  Viscosity = 1.983e-5
  Heat expansion Coefficient = 3.43e-3
  Compressibility Model = Perfect Gas
  Reference Pressure = 1e5
  Heat Conductivity = 0.0257
  Relative Permittivity = 1.00059
  Sound speed = 343.0
  Heat Capacity = 1005.0
  Density = 1.205
End

Initial Condition 1
  Name = "Temperatur"
  Temperature = 300
End

Boundary Condition 1
  Target Boundaries(4) = 2 7 8 9 
  Name = "Noslip"
  Noslip wall BC = True
End

Boundary Condition 2
  Target Boundaries(1) = 3 
  Name = "Inlet"
  Velocity 1 = 0.0
  Velocity 2 = Variable Coordinate 1; Real MATC "2.07e8 *tx*tx-41.9175" 
End

Boundary Condition 3
  Target Boundaries(2) = 1 5 
  Name = "Axis"
  Velocity 1 = 0.0
End
Changing the compressibility to incompressible doesn't really help.

I really would be grateful for some help here.

Thanks,

Matthias

Re: Navier-Stokes solver does not converge

Posted: 12 May 2016, 15:54
by annier
Hi Matthias,
The run of SIF input in ElmerSolver converges when:
1.

Code: Select all

Compressibility Model = Incompressible
2.

Code: Select all

Boundary Condition 2
  Target Boundaries(1) = 3 
  Name = "Inlet"
  Velocity 1 = 0.0
  Velocity 2 = 1.0  !Variable Coordinate 1; Real MATC "2.07e8 *tx*tx-41.9175" 
End
Please design on how to adjust with the velocity 2 in your solver.

Cheers.

Yours Sincerely,
Anil Kunwar

Re: Navier-Stokes solver does not converge

Posted: 12 May 2016, 17:43
by mzenker
Hi Anil,

thank you for your help!
So the velocity is the main cause of the problem. I thought my definition was correct, but I will review it and report back.

Thanks again,

Matthias

Re: Navier-Stokes solver does not converge

Posted: 16 May 2016, 19:27
by raback
Hi Matthias

I had a go with your case. It seems that your variable and the coordinate system are conflicting. The difference between "axi symmetric" and "cylindric symmetric" is that the latter includes the rotational component also i.e. it espects three velocity components and pressure. In your case rather use "axi symmetric".

This should be checked by the code since the conflict will result to problems. Unfortunately this is not currently done.

If you want to use the ideal gas law I think that Bubbles work better than stabilization. On the other hand if compressibility effects may be neglected you could also use incompressible flow.

-Peter

Re: Navier-Stokes solver does not converge

Posted: 17 May 2016, 05:29
by annier
Hi Peter,
- Thank you for highlighting the requirements of "cylindric symmetric" and "axi symmetric" coordinate system.
- When i ran the SIF with coordinate system = Axi symmetric , with the original Velocity 2 settings by Matthias, it underwent a prolonged iteration of N-s equations with log of Error::Itersolve: Failed convergence tolerances. In context of "cylindric symmetric", this error would be prompted quickly. How does the solve go differently in these two cases? Does the coordinates system affect so much in the iteration ease of the solve?

Yours Sincerely,
Anil Kunwar

Re: Navier-Stokes solver does not converge

Posted: 17 May 2016, 09:24
by raback
Hi

The problem was that the Variable was explicitely given to have two velocity components whereas cylindrical symmetry assumes three. Therefore only parts of the local matrix were fulled up and there was zero rows in the matrix which means that it cannot have a solution. One could also solve the system as cylindric symmetric but there should be three velocity components and some BCs should be given for them too. However, the rotational velocity would be introduced only if there is rotation. The symmetry was originally coded to deal with crystal growth processes where the crystal rotates with respect to the fluid.

-Peter

Re: Navier-Stokes solver does not converge

Posted: 17 May 2016, 11:04
by mzenker
Hi Peter,

I didn't reply earlier since yesterday was a holiday in Germany...
Thank you for having a look at my case.
I reran it with Axi Symmetric and Bubbles instead of Stabilization. Unfortunately the solver still spits

Code: Select all

ComputeChange:  Computed Norm:                  Infinity
ERROR:: ComputeChange: Norm of solution exceeded given bounds
after some iterations. Did it converge for you?
I will now check the velocity as Anil suggested.

Matthias