Navier Stokes equations

Numerical methods and mathematical models of Elmer
Post Reply
Auray
Posts: 12
Joined: 11 Oct 2011, 12:12
Antispam: Yes

Navier Stokes equations

Post by Auray »

Hi everyone!

I have some problems using ElmerSolver to solve Navier Stokes equations. My geometry is generated with GMSH. I work on Windows, and when trying to run ElmerSolver to solve my SIF file, I have a box that says ElmerSolver.exe stopped working... Could someone tell me where is my mistake?
Here are my geometry and sif files :

Geometry file in GMSH

Code: Select all

lc = 0.0005;
L = 0.04;
H = 0.02;

Point(1) = {H, 0, 0, lc};
Point(2) = {L, 0, 0, lc};
Point(3) = {L, L, 0, lc};
Point(4) = {0, L, 0, lc};
Point(5) = {0, H, 0, lc};
Point(6) = {H, H, 0, lc};

Line(1) = {1, 2};
Line(2) = {2, 3};
Line(3) = {3, 4};
Line(4) = {4, 5};
Line(5) = {5, 6};
Line(6) = {6, 1};
Line Loop(7) = {1, 2, 3, 4, 5, 6};
Plane Surface(8) = {7};

Physical Line(1) = {1};
Physical Line(2) = {2};
Physical Line(3) = {3};
Physical Line(4) = {4};
Physical Line(5) = {5};
Physical Line(6) = {6};

Physical Surface(1) = {8};

SIF File for ElmerSolver

Code: Select all

Check Keywords Warn

Header
  Mesh DB "." "mesh"
  Include Path ""
  Results Directory ""
End

Simulation
  Coordinate System =  Cartesian
  Simulation Type = Transient 
  Timestep sizes = 0.01
  Timestep Intervals = 10!nb of times that the time step is repeted
  Timestepping Method = BDF
  BDF Order = 1
  Output Intervals = 1
  Solver Input File = "arrondi.sif"
End

Constants
  Stefan Boltzmann = 5.67e-8
  Permittivity Of Vacuum = 1.0
  Gravity(4) = 0 -1 0 9.81
End

Body 1
  Name = "Body1"
  Equation = 1
  Material = 1
  Initial Condition = 1
End

Material 1
  Density = Real 1.2
  Viscosity = Real 19e-6
End

Solver 1
  Equation = Navier-Stokes
  Procedure = "FlowSolve" "FlowSolver"
  Variable = Flow Solution[Velocity:2 Pressure:1]
  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-8
  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 = BiCGStab
  Linear System Max Iterations = 500
  Linear System Convergence Tolerance = 1.0e-8
  Linear System Preconditioning = ILU1
  Linear System ILUT Tolerance = 1.0e-3
  Linear System Abort Not Converged = False
  Linear System Residual Output = 20
  Linear System Precondition Recompute = 1

  Optimize bandwidth = False

End

Solver 2
  Equation = String "ResultOutput"
  Procedure = File "ResultOutputSolve" "ResultOutputSolver"
  Output File Name = String "kinetic" 
  Output Format = String "vtu"
End


Equation 1
  Navier-Stokes = TRUE
  Active Solvers(2) = 1 2
End

Initial Condition 1
	Velocity 1 = Real 0
	Velocity 2 = Real 0
End

Boundary Condition 1
  Name = "INLET"
  Target Boundaries = 5
  !Velocity 1 = Variable Coordinate 2
  !  MATC "0.3*(tx-0.03)*(1-(tx-0.03))"
  Velocity 1 = 0.3
  Velocity 2 =  0                     
End

Boundary Condition 2
  Name = "No-slip"
  Target Boundaries(6) = 2 3 4 6 7 8
  Velocity 1 = 0
  Velocity 2 = 0
End

Boundary Condition 3
  Name = "OUTLET"
  Target Boundaries = 1
  Velocity 2 = 0
  Pressure = 0
End
Thanks for your attention!
Attachments
arrondi.sif
(2.34 KiB) Downloaded 326 times
arrondi.msh
(60.11 KiB) Downloaded 315 times
arrondi.geo
(777 Bytes) Downloaded 312 times
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Navier Stokes equations

Post by mzenker »

Hi Auray,

I have downloaded your files and made a quick test to see if I can reproduce your problem. I can: Elmersolver crashes right at the beginning with a memory access error. Normally this is due to a trivial error in the sif file (like missing material), but I don't see it, maybe due to my lack of experience with the NS solver. So I can' help here.

@Elmerteam:
* Could someone have a look on this case?
* It would be very helpful if the solver could spit more instructive error messages and not just crash...

Matthias
cemg
Posts: 26
Joined: 02 Feb 2012, 17:41
Antispam: Yes
Location: Vigo, Spain

Re: Navier Stokes equations

Post by cemg »

Hi Auray,

your problem seems to be in the geo file, last line:

Physical Surface (91) ...

To avoid this kind of numeration issues with gmsh, when converting the mesh from the msh file format to the Elmer one (mesh.header, mesh.nodes, ...) with ElmerGrid add the flag "-autoclean". This flag changes all the ids to start in 1.

Besides, check your outlet BC, it seems to be wrong.

Hope this helps,

Cesar
Auray
Posts: 12
Joined: 11 Oct 2011, 12:12
Antispam: Yes

Re: Navier Stokes equations

Post by Auray »

Thanks a lot cemg, adding -autoclean solved my problem :). Everything works fine now.
raback
Site Admin
Posts: 4868
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Navier Stokes equations

Post by raback »

Hi

Generally if you are using the ElmerGUI it is often not necessary to define the physical entities. It just introduces additional error sources, since the user may then easily omit some entity. Choosing the "Save All (Ignore physical entities)" in Gmsh will ensure that everything is saved, and will automatically be renumbered starting from 1.

-Peter
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Navier Stokes equations

Post by mzenker »

Hi,

may I add my 2 cents:

Indeed after regenerating the mesh in gmsh and saving with "ignore physical entities", the solver crash is gone.
The solver had given no indication that a problem with the mesh caused the crash.
ElmerGUI sometimes adds "phantom" bodies which are in fact not existing, and finding out the numbers for bodies and boundaries is a pain - it was much better in ElmerFront. This is why I have started to work without the GUI, which is a pity because I found it very comfortable most of the time.

Matthias
Post Reply