Scanning simulation to aid convergence

Numerical methods and mathematical models of Elmer
Post Reply
mark smith
Posts: 215
Joined: 26 Aug 2009, 18:20
Location: Peterborough, England

Scanning simulation to aid convergence

Post by mark smith »

Hi Elmer team
In a scanning CFD+thermal simulation using the BiCGStabl iterative solver and ILU1 preconditioner is the following permitted in the material section?

Material 1
Name = "fluid properties"
! try to get convergence at inlet velocity v_in by starting off with high viscosity & ramp down to required value
Viscosity = variable time
Real
1 10*5.0e-3
2 3*5.0e-3
3 5.0e-3
End
Heat Conductivity = 0.174
Heat Capacity = 1500
Density = 1200
End

I ask as the high viscosity of the first run does not improve convergence no mater how big I make the multiplier, the simulation doesn't complain that this isn't something that cannot be done.
The Reynolds number of the problem at v_in and the final viscosity is < 100 so the flow should be laminar and well behaved?

I have tried ramping up the velocity with fixed viscosity and for the geometry under investigation this also will not converge, I get convergence at 0.95*v_in but not at v_in are there any other tricks that might aid convergence?
Thanks in advance
Regards
Mark
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Scanning simulation to aid convergence

Post by raback »

Hi Mark

The table should be plain numbers you cannot hide operations there in.

Somewhere there is a critical value after which simulation becomes unsteady. It can well be at Re=100. Going transient is one remedy. Also for thermal flow the large Nusselt number may be a problem. This would more be a problem on the coupled system level. Do you have natural convection? There are some test cases for natural convection that show some strategies to deal with that.

-Peter
mark smith
Posts: 215
Joined: 26 Aug 2009, 18:20
Location: Peterborough, England

Re: Scanning simulation to aid convergence

Post by mark smith »

HI Peter,
The table should be plain numbers you cannot hide operations there in.
Thank you this solved the problem, if I define $visc=5e-3 at the top of the sif file then I can do this & it works but time step 3 will still not converge.

Material 1
Name = "fluid properties"
! try to get convergence at inlet velocity v_in by starting off with high viscosity & ramp down to required value
Viscosity = variable time
Real
1 $visc*10
2 $visc*3*
3 $visc
End
Heat Conductivity = 0.174
Heat Capacity = 1500
Density = 1200
End

No I don't have any natural convection, just forced convection. I can solve the problem with the same conditions in Comsol if I use MUMPS, we are trying to recompile Elmer on Ubuntu to allow MUMPS as a direct solver to see if that solves the problem, but compiling Elmer is not so trivial even for my experienced colleague.
Regards
Mark
mark smith
Posts: 215
Joined: 26 Aug 2009, 18:20
Location: Peterborough, England

Re: Scanning simulation to aid convergence

Post by mark smith »

Hi Peter,
Although I'm doing a coupled CFD & thermal problem, at this moment my fluid properties are temperature independent so the temperature field in the fluid cannot change the flow, it is the Navier-Stokes solver which is having difficulties converging & not the heat solver, once I get it to work with constant properties I will extend to temperature dependent properties. One step at a time ;-)

If you have any other strategies to aid conversion I'd be most appreciative.

Best regards
Mark
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Scanning simulation to aid convergence

Post by raback »

Hi

You could try:

1) Set "Nonlinear System Relaxation Factor" to 0.5 or so.

2) Set tighter rules for using Newton linearization so that you never actually leave Picard (which has larger radius of convergence).

Could you confirm that you really get your convergence problems only at the nonlinear level?

-Peter
mark smith
Posts: 215
Joined: 26 Aug 2009, 18:20
Location: Peterborough, England

Re: Scanning simulation to aid convergence

Post by mark smith »

Hi Peter,
I eventually had success when I reduced Nonlinear System Relaxation Factor from 1.0 to 0.75 but time step 6 took a long time to converge, this time step was the only one that wouldn't converge with the "Nonlinear System Relaxation Factor=1.0" is there a way of changing this value dynamically or even specifying the value depending on the time step?

when you suggest
Set tighter rules for using Newton linearization so that you never actually leave Picard (which has larger radius of convergence).
do you mean reducing Nonlinear System Newton After Iterations = 3 to say 0 ? if not can you elaborate please?

I attach the output logs which might be of interest? successful had relaxation=0.75 & unsuccessful had relaxation=1.0

My settings for the Navier-Stokes solver are as shown below, if these could be better please suggest improvements.

Solver 1
Equation = Navier-Stokes
Procedure = "FlowSolve" "FlowSolver"
Variable = Flow Solution[Velocity:3 Pressure:1]
Exec Solver = Always
Stabilize = True
Bubbles = False
Lumped Mass Matrix = False
Optimize Bandwidth = True
Steady State Convergence Tolerance = 1.0e-6
Nonlinear System Convergence Tolerance = 1.0e-7
Nonlinear System Max Iterations = 100 !was 1
Nonlinear System Newton After Iterations = 3 !50 was 3
Nonlinear System Newton After Tolerance = 1.0e-3
Nonlinear System Relaxation Factor = 0.75 !was 1.0 but time step 6 wouldn't converge
Linear System Solver = Iterative
Linear System Iterative Method = BiCGStabl
BiCgStabl Polynomial Degree = 2 ! try 4 if this doesn't converge?
!Linear System Iterative Method = BiCGStab
Linear System Max Iterations = 5000
Linear System Convergence Tolerance = 1.0e-8
Linear System Preconditioning = ILU1
Linear System ILUT Tolerance = 1.0e-3
Linear System Abort Not Converged = True
Linear System Residual Output = 1
Linear System Precondition Recompute = 1
! Gradp Discretization = True
End

the viscosity ramp down for material 1 is

Material 1
Name = "fluid constant properties"
! try to get convergence at v_in by staring off with high vicosity & ramp down to required value
Viscosity = variable time
Real
1 $visc*10
2 $visc*3
3 $visc*2
4 $visc*1.3
5 $visc*1.15
6 $visc
End
Heat Conductivity = 0.174
Heat Capacity = $Cp
Density = $rho
c_rho = Real $Cp*rho
End

where
$Cp = 1632.0 ! Cp & rho for material 1 the fluid
$rho = 1194.5
$visc = 11.364e-3

with the relaxation set to 1.0 time step 6 would diverge

Thanks in advance.
Best regards
Mark
Attachments
unsuccessful run output log.txt
unconverging run log
(580.59 KiB) Downloaded 289 times
successful run ouput log.txt
converged run log
(509.33 KiB) Downloaded 288 times
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Scanning simulation to aid convergence

Post by raback »

Hi

It seems more like the nonlinear iteration failing, try

Code: Select all

Nonlinear System Newton After Iterations = 100
Nonlinear System Newton After Tolerance = 0.0
and Picard will always be used. With relaxation you could

Code: Select all

Nonlinear System Relaxation Factor = Variable "nonlin iter"
  Real
    1 1 
    2 0.5
    3 0.5
  End
-Peter
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Scanning simulation to aid convergence

Post by mzenker »

Hi,
this is a forum for simulation, where sometimes a domain of possible input values is scanned.
Not exactly what you are looking for... ;)
Matthias
Post Reply