FEM SolverElmer SolverSettings: Difference between revisions

From FreeCAD Documentation
m (→‎General: typo)
mNo edit summary
 
(41 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<languages/>
<languages/>
{{TOCright}}
<translate>
<translate>


<!--T:1-->
This page describes the possible solver settings for [[FEM SolverElmer| Elmer]].
This page describes the possible settings for [[FEM_SolverElmer|solver Elmer]].


=General=
=General= <!--T:2-->


<!--T:3-->
Elmer is a multiphysics solver. Therefore you can use several main equations to solve problems. The different equations are listed [[FEM_SolverElmer#About_Equations|here]].
Elmer is a multiphysics solver. Therefore you can use several main equations to solve problems. The different equations are listed [[FEM_SolverElmer#About_Equations|here]].


<!--T:4-->
There are solver settings, available for all equations. These are described here. Settings only available for a particular equation are described in the pages of the corresponding equation.
There are solver settings, available for all equations. These are described here. Settings only available for a particular equation are described in the pages of the corresponding equation.


<!--T:5-->
Elmer offers two main solving systems, [[#Linear_System|linear system]] and [[#Nonlinear_System|nonlinear system]]. The nonlinear system is used for the [[Image:FEM_EquationFlow.svg|32px]] [[FEM_EquationFlow|Flow equation]] and [[Image:FEM_EquationHeat.svg|32px]] [[FEM_EquationHeat|Heat equation]].
Elmer offers the [[#Type|solving types]] ''steady-state'' and ''transient'' and two main solving systems, [[#Linear_System|linear system]] and [[#Nonlinear_System|nonlinear system]]. The nonlinear system is used for the [[Image:FEM_EquationFlow.svg|24px]] [[FEM_EquationFlow|Flow equation]] and [[Image:FEM_EquationHeat.svg|24px]] [[FEM_EquationHeat|Heat equation]].


=Editing Settings=
=Editing Settings= <!--T:6-->


<!--T:7-->
The solver settings can be found in the [[Property_editor|property editor]] after clicking on an equation in the [[Tree_view|tree view]]. You can edit them there directly like any other property.
The solver settings can be found in the [[Property_editor|property editor]] after clicking on an equation in the [[Tree_view|tree view]]. You can edit them there directly like any other property.


==Solver==
==Solver== <!--T:8-->


===Coordinate System=== <!--T:29-->
===Timestepping===


<!--T:30-->
The solver provides the following settings:
The default coordinate system is ''Cartesian 3D''. For some equations, not all coordinate systems can be can be used. This is noted on the Wiki pages of the corresponding equations.


===Timestepping (transient analyses)=== <!--T:9-->
===Type===


<!--T:31-->
* {{PropertyData|Simulation type}}: If the simulation is ''Steady state'', ''Transient'' or just ''Scanning''. Transient means the development over time is calculated. See section [[#Timestepping|Timestepping]] for the necessary settings.
'''Note''': FreeCAD 0.20.x already provides the following settings but only the last time result is output. Starting with FreeCAD 0.21 you will get an output for the different times.
* {{PropertyData|Steady State Max Iterations}}:The maximal number of steady-state solver runs.
* {{PropertyData|Steady State Min Iterations}}: The minimal number of steady-state solver runs.


<!--T:10-->
==Equation==
For transient analyses the time steps need to be defined. This is done by the following settings:


<!--T:11-->
===Base===
* {{PropertyData|BDFOrder}}: Order for the method ''BDF'' ([https://en.wikipedia.org/wiki/Backward_differentiation_formula Backward Differentiation Formula]). It is recommended to use the default of ''2''.
* {{PropertyData|Output Intervals}}: An array of intervals. A solver result file will be output every interval time step. For example, if a result file should be output every third time step, set it to ''3''. The array corresponds to the {{PropertyData|Timestep Intervals}}.</br>'''Note:''' The first result in every case will be created for the first time step. To get for example results after 25 % of the total time and if the last result should be the final time, set {{PropertyData|Output Intervals}} to ''5'' and {{PropertyData|Timestep Intervals}} to ''21''. {{Version|0.21}}
* {{PropertyData|Timestep Intervals}}: An array of time intervals. The solver will perform one time interval after another. For example, if the solver should calculate the first 10 seconds in steps of 0.1 second, then 50 seconds in steps of 1 second and then stop, you need to set the timestep intervals [100, 50] and the timestep size intervals [0.1, 1.0].
* {{PropertyData|Timestep Sizes}}: An array of timestep sizes. The time unit is second. The array corresponds to the {{PropertyData|Timestep Intervals}}.


<!--T:32-->
'''Note:''' Although the terms "times" and "seconds" are used the times are actually solver progressions if the analysis is not time-dependent.

<!--T:33-->
For how to visualize the results, see the [[FEM_SolverElmer#Visualization|Elmer visualization]] info.

===Type=== <!--T:12-->

<!--T:13-->
* {{PropertyData|Simulation type}}: If the simulation is ''Steady state'', ''Transient'' or just ''Scanning''. Transient means the development over the solver time is calculated. See section [[#Timestepping_(transient_analyses)|Timestepping]] for the necessary settings.
* {{PropertyData|Steady State Max Iterations}}: The maximum number of steady-state solver runs.
* {{PropertyData|Steady State Min Iterations}}: The minimum number of steady-state solver runs.

==Equation== <!--T:14-->

===Base=== <!--T:15-->

<!--T:16-->
All equations have these properties:
All equations have these properties:
* {{PropertyData|Label}}: name of the equation in the tree view.
* {{PropertyData|Label}}: Name of the equation in the tree view.
* {{PropertyData|Priority}}: number determining the priority of this equation to the other equations in the analysis. The equation with the highest number in the analysis will be output as first to the Elmer input file (file ''case.sif''). If two equations have the same priority number, the one that is first in the tree view will be output first.
* {{PropertyData|Priority}}: Number determining the priority of this equation to the other equations in the analysis. The equation with the highest number in the analysis will be solved as first. If two equations have the same priority number, the one that is first in the tree view will be solved first.
* {{PropertyData|Stabilize}}: If set to ''true'', the solver will use stabilized finite element method when solving the heat equation with a convection term. If set to ''false'' the Residual Free Bubble (RFB) stabilization is used instead. If convection dominates, stabilization must be used in order to successfully solve the equation.
* {{PropertyData|Stabilize}}: If set to ''true'', the solver will use the stabilized finite element method when solving the heat equation with a convection term. If set to ''false'', the Residual Free Bubble (RFB) stabilization is used instead. If convection dominates, stabilization must be used to successfully solve the equation.


===Linear System===
===Linear System=== <!--T:17-->


<!--T:18-->
This system has the following properties:
This system has the following properties:
* {{PropertyData|BiCGstabl Degree}}: polynomial degree for the iterative solver method ''BiCGStabl ''. This has only an effect if {{PropertyData|Linear Solver Type}} is ''Iterative'' and {{PropertyData|Linear Iterative Method}} is ''BiCGStabl''. Starting with the default of 2 is recommended.
* {{PropertyData|BiCGstabl Degree}}: Polynomial degree for the iterative solver method ''BiCGStabl ''. This has only an effect if {{PropertyData|Linear Solver Type}} is ''Iterative'' and {{PropertyData|Linear Iterative Method}} is ''BiCGStabl''. Starting with the default of 2 is recommended.
* {{PropertyData|Idrs Parameter}}: Parameter for the iterative solver method ''Idrs ''. This has only an effect if {{PropertyData|Linear Solver Type}} is ''Iterative'' and {{PropertyData|Linear Iterative Method}} is ''Idrs''. Starting with the default of 2 is recommended. Setting the parameter to 3 might increase the solving speed a bit. For flow analyses the ''Idrs'' method is up to 30&nbsp;% faster than the default ''BiCGStab'' method.
* {{PropertyData|Idrs Parameter}}: Parameter for the iterative solver method ''Idrs ''. This has only an effect if {{PropertyData|Linear Solver Type}} is ''Iterative'' and {{PropertyData|Linear Iterative Method}} is ''Idrs''. Starting with the default of 2 is recommended. Setting the parameter to 3 might increase the solving speed a bit. For flow analyses the ''Idrs'' method is up to 30&nbsp;% faster than the default ''BiCGStab'' method.
* {{PropertyData|Linear Direct Method}}: method used for direct solving. This has only an effect if {{PropertyData|Linear Solver Type}} is ''Direct''.</br>The possible methods are ''Banded'', ''MUMPS'' and ''Umpfpack''. Note that ''MUMPS'' usually needs to be installed before you can use it.</br>'''Note''': when you use more than one CPU core for the solver ({{Version|1.0}}) only ''MUMPS'' can be used.
* {{PropertyData|Linear Direct Method}}: Method used for direct solving. This has only an effect if {{PropertyData|Linear Solver Type}} is ''Direct''.</br>The possible methods are ''Banded'', ''MUMPS'' and ''Umpfpack''. Note that ''MUMPS'' usually needs to be installed before you can use it.</br>'''Note''': when you use more than one CPU core for the solver ({{Version|0.21}}) only ''MUMPS'' can be used. [https://mumps-solver.org/ MUMPS] has to be installed manually to Elmer. It is only available as a download per request via email.
* {{PropertyData|Linear Iterations}}: maximal number of iterations for an iterative solver run. This has only an effect if {{PropertyData|Linear Solver Type}} is ''Iterative''.
* {{PropertyData|Linear Iterations}}: Maximal number of iterations for an iterative solver run. This has only an effect if {{PropertyData|Linear Solver Type}} is ''Iterative''.
* {{PropertyData|Linear Iterative Method}}: method used for iterative solving This has only an effect if {{PropertyData|Linear Solver Type}} is ''Iterative''.
* {{PropertyData|Linear Iterative Method}}: Method used for iterative solving. This has only an effect if {{PropertyData|Linear Solver Type}} is ''Iterative''.
* {{PropertyData|Linear Preconditioning}}: method used for the preconditioning. For info about preconditioning, see [http://www.nic.funet.fi/index/elmer/slides/ElmerLinearSolvers.pdf this presentation] (page 8) from Elmer.
* {{PropertyData|Linear Preconditioning}}: Method used for the preconditioning. For info about preconditioning, see [http://www.nic.funet.fi/index/elmer/slides/ElmerLinearSolvers.pdf this presentation] (page 8) from Elmer.
* {{PropertyData|Linear Solver Type}}: if the solving is done ''Direct'' or ''Iterative''.
* {{PropertyData|Linear Solver Type}}: If the solving is done ''Direct'' or ''Iterative''.
* {{PropertyData|Linear System Solver Disabled}}: Disables the linear solver. Only use this for special cases.</br>It can be used to disable temporarily an equation since its solving is then not performed. There are, however cases there the solver is send to an infinite loop instead.
* {{PropertyData|Linear System Solver Disabled}}: Disables the linear solver. Only use this for special cases.</br>It can be used to disable temporarily an equation since its solving is then not performed. There are, however cases where the solver is sent into an infinite loop instead.
* {{PropertyData|Linear Tolerance}}: the tolerance for the solver to stop. If the error is smaller than the tolerance, the solver run will be is finished. Otherwise the full number of {{PropertyData|Linear Iterations}} will be performed.</br>In the Elmer solver log you see how the error is minimized while the solver is running. (Look in the log at the end off every solver iteration for the value behind ''Relative Change''). In case it does not go down below a certain value but reaches a value above the current tolerance that is acceptable for you, you can increase the tolerance.
* {{PropertyData|Linear Tolerance}}: The tolerance for the solver to stop. If the error is smaller than the tolerance, the solver run will be finished. Otherwise, the full number of {{PropertyData|Linear Iterations}} will be performed.</br>In the Elmer solver log you see how the error is minimized while the solver is running. (Look in the log at the end of every solver iteration for the value behind ''Relative Change''). If it does not go down below a certain value but reaches a value above the current tolerance that is acceptable for you, you can increase the tolerance.


===Nonlinear System===
===Nonlinear System=== <!--T:19-->


<!--T:20-->
This system is iterative and has the following properties:
This system is iterative and has the following properties:


<!--T:21-->
* {{PropertyData|Nonlinear Iterations}}: maximal number of iterations.
* {{PropertyData|Nonlinear Newton After Iterations}}:
* {{PropertyData|Nonlinear Iterations}}: Maximal number of iterations.
* {{PropertyData|Nonlinear Newton After Iterations}}: The nonlinear solver starts with the robust ''Picard'' algorithm. After some iterations, the algorithm is changed to the ''Newton'' algorithm which converges faster but is less robust if the results temporarily diverge (oscillations might occur). This setting sets the number of iterations after which the switch from the ''Picard'' to the ''Newton'' algorithm is made.</br>'''Note''': the switch is made whatever is reached first, {{PropertyData|Nonlinear Newton After Iterations}} or {{PropertyData|Nonlinear Newton After Tolerance}}.
* {{PropertyData|Nonlinear Newton After Tolerance}}:
* {{PropertyData|Nonlinear Tolerance}}: the tolerance for the solver to stop. If the error is smaller than the tolerance, the solver run will be is finished. Otherwise the full number of {{PropertyData|Nonlinear Iterations}} will be performed.</br>In the Elmer output you see in how the error is minimized while the solver is running. In case it does not go down below a certain value that is acceptable but above the current tolerance, you can increase the tolerance.
* {{PropertyData|Nonlinear Newton After Tolerance}}: The same as {{PropertyData|Nonlinear Newton After Iterations}} but here a tolerance is set. The tolerance is the norm of the nonlinear residual. If this is reached, the switch from the ''Picard'' to the ''Newton'' algorithm is made.
* {{PropertyData|Nonlinear Tolerance}}: The tolerance for the solver to stop. If the error is smaller than the tolerance, the solver run will be finished. Otherwise, the full number of {{PropertyData|Nonlinear Iterations}} will be performed.</br>In the Elmer output you see how the error is minimized while the solver is running. If it does not go down below a certain value that is acceptable but above the current tolerance, you can increase the tolerance.
* {{PropertyData|Relaxation Factor}}: This is THE most important setting in case the solver does not converge:
* {{PropertyData|Relaxation Factor}}: This is THE most important setting in case the solver does not converge:


====Relaxation Factor====
====Relaxation Factor==== <!--T:22-->


<!--T:23-->
If the solver iteration results oscillate numerically, the solver results cannot converge to a final, stable value. To avoid that, the calculated variable <math>T_{i}</math> of the i-th iteration/solver run is not taken as input for the next iteration, but <math>T_{i}^{'}</math>, a value that is "damped" with the result from the previous iteration. The relaxation factor <math>\lambda</math> is thereby defined as
If the solver iteration results oscillate numerically, the solver results cannot converge to a final, stable value. To avoid that, the calculated variable <math>T_{i}</math> of the i-th iteration/solver run is not taken as input for the next iteration, but <math>T_{i}^{'}</math>, a value that is "damped" with the result from the previous iteration. The relaxation factor <math>\lambda</math> is thereby defined as


<!--T:24-->
<math>\quad
<math>\quad
T_{i}^{'} = \lambda T_{i}+\left(1-\lambda\right)T_{i-1}
T_{i}^{'} = \lambda T_{i}+\left(1-\lambda\right)T_{i-1}
</math>
</math>


<!--T:25-->
So for the default of 1.0, no damping is used. The smaller <math>\lambda</math>, the greater the damping and the the longer the convergence time. Therefore if the solver does not converge, start changing the relaxation factor to 0.9, then to 0.8 and so on. Values below 0.3 are unusual and if you need this, you should have a closer look to the math of your analysis.</br>
So for the default of 1.0, no damping is used. The smaller <math>\lambda</math>, the greater the damping and the longer the convergence time. Therefore if the solver does not converge, start changing the relaxation factor to 0.9, then to 0.8 and so on. Values below 0.3 are unusual and if you need this, you should have a closer look to the math of your analysis.</br>
For cases, where you get a proper convergence you can set <math>\lambda</math> above 1.0 to speed the convergence up.
For cases, where you get a proper convergence you can set <math>\lambda</math> above 1.0 to speed the convergence up.


===Steady State===
===Steady State=== <!--T:26-->


<!--T:27-->
This part of the settings has only one property:
This part of the settings has only one property:
* {{PropertyData|Steady State Tolerance}}: The specific steady state or coupled system convergence tolerance. All the equation solvers must meet their own tolerances for the variable <math>\omega^2</math> they calculate, before the whole system is deemed converged. The tolerance criterion is:
* {{PropertyData|Steady State Tolerance}}: The specific steady state or coupled system convergence tolerance. All the equation solvers must meet their own tolerances for the variable <math>\omega^2</math> they calculate before the whole system is deemed converged. The tolerance criterion is:
<math>\quad
<math>\quad
\left\Vert u_{i}-u_{i-1}\right\Vert <\epsilon\left\Vert u_{i}\right\Vert
\left\Vert u_{i}-u_{i-1}\right\Vert <\epsilon\left\Vert u_{i}\right\Vert
</math>
</math>


<!--T:28-->
whereas <math>\epsilon</math> is the steady state tolerance and <math>u_{i}</math> is the calculated variable in the i-th iteration/solver run.
whereas <math>\epsilon</math> is the steady state tolerance and <math>u_{i}</math> is the calculated variable in the i-th iteration/solver run.



Latest revision as of 11:40, 2 January 2024

Other languages:

This page describes the possible settings for solver Elmer.

General

Elmer is a multiphysics solver. Therefore you can use several main equations to solve problems. The different equations are listed here.

There are solver settings, available for all equations. These are described here. Settings only available for a particular equation are described in the pages of the corresponding equation.

Elmer offers the solving types steady-state and transient and two main solving systems, linear system and nonlinear system. The nonlinear system is used for the Flow equation and Heat equation.

Editing Settings

The solver settings can be found in the property editor after clicking on an equation in the tree view. You can edit them there directly like any other property.

Solver

Coordinate System

The default coordinate system is Cartesian 3D. For some equations, not all coordinate systems can be can be used. This is noted on the Wiki pages of the corresponding equations.

Timestepping (transient analyses)

Note: FreeCAD 0.20.x already provides the following settings but only the last time result is output. Starting with FreeCAD 0.21 you will get an output for the different times.

For transient analyses the time steps need to be defined. This is done by the following settings:

  • DataBDFOrder: Order for the method BDF (Backward Differentiation Formula). It is recommended to use the default of 2.
  • DataOutput Intervals: An array of intervals. A solver result file will be output every interval time step. For example, if a result file should be output every third time step, set it to 3. The array corresponds to the DataTimestep Intervals.
    Note: The first result in every case will be created for the first time step. To get for example results after 25 % of the total time and if the last result should be the final time, set DataOutput Intervals to 5 and DataTimestep Intervals to 21. introduced in version 0.21
  • DataTimestep Intervals: An array of time intervals. The solver will perform one time interval after another. For example, if the solver should calculate the first 10 seconds in steps of 0.1 second, then 50 seconds in steps of 1 second and then stop, you need to set the timestep intervals [100, 50] and the timestep size intervals [0.1, 1.0].
  • DataTimestep Sizes: An array of timestep sizes. The time unit is second. The array corresponds to the DataTimestep Intervals.

Note: Although the terms "times" and "seconds" are used the times are actually solver progressions if the analysis is not time-dependent.

For how to visualize the results, see the Elmer visualization info.

Type

  • DataSimulation type: If the simulation is Steady state, Transient or just Scanning. Transient means the development over the solver time is calculated. See section Timestepping for the necessary settings.
  • DataSteady State Max Iterations: The maximum number of steady-state solver runs.
  • DataSteady State Min Iterations: The minimum number of steady-state solver runs.

Equation

Base

All equations have these properties:

  • DataLabel: Name of the equation in the tree view.
  • DataPriority: Number determining the priority of this equation to the other equations in the analysis. The equation with the highest number in the analysis will be solved as first. If two equations have the same priority number, the one that is first in the tree view will be solved first.
  • DataStabilize: If set to true, the solver will use the stabilized finite element method when solving the heat equation with a convection term. If set to false, the Residual Free Bubble (RFB) stabilization is used instead. If convection dominates, stabilization must be used to successfully solve the equation.

Linear System

This system has the following properties:

  • DataBiCGstabl Degree: Polynomial degree for the iterative solver method BiCGStabl . This has only an effect if DataLinear Solver Type is Iterative and DataLinear Iterative Method is BiCGStabl. Starting with the default of 2 is recommended.
  • DataIdrs Parameter: Parameter for the iterative solver method Idrs . This has only an effect if DataLinear Solver Type is Iterative and DataLinear Iterative Method is Idrs. Starting with the default of 2 is recommended. Setting the parameter to 3 might increase the solving speed a bit. For flow analyses the Idrs method is up to 30 % faster than the default BiCGStab method.
  • DataLinear Direct Method: Method used for direct solving. This has only an effect if DataLinear Solver Type is Direct.
    The possible methods are Banded, MUMPS and Umpfpack. Note that MUMPS usually needs to be installed before you can use it.
    Note: when you use more than one CPU core for the solver (introduced in version 0.21) only MUMPS can be used. MUMPS has to be installed manually to Elmer. It is only available as a download per request via email.
  • DataLinear Iterations: Maximal number of iterations for an iterative solver run. This has only an effect if DataLinear Solver Type is Iterative.
  • DataLinear Iterative Method: Method used for iterative solving. This has only an effect if DataLinear Solver Type is Iterative.
  • DataLinear Preconditioning: Method used for the preconditioning. For info about preconditioning, see this presentation (page 8) from Elmer.
  • DataLinear Solver Type: If the solving is done Direct or Iterative.
  • DataLinear System Solver Disabled: Disables the linear solver. Only use this for special cases.
    It can be used to disable temporarily an equation since its solving is then not performed. There are, however cases where the solver is sent into an infinite loop instead.
  • DataLinear Tolerance: The tolerance for the solver to stop. If the error is smaller than the tolerance, the solver run will be finished. Otherwise, the full number of DataLinear Iterations will be performed.
    In the Elmer solver log you see how the error is minimized while the solver is running. (Look in the log at the end of every solver iteration for the value behind Relative Change). If it does not go down below a certain value but reaches a value above the current tolerance that is acceptable for you, you can increase the tolerance.

Nonlinear System

This system is iterative and has the following properties:

  • DataNonlinear Iterations: Maximal number of iterations.
  • DataNonlinear Newton After Iterations: The nonlinear solver starts with the robust Picard algorithm. After some iterations, the algorithm is changed to the Newton algorithm which converges faster but is less robust if the results temporarily diverge (oscillations might occur). This setting sets the number of iterations after which the switch from the Picard to the Newton algorithm is made.
    Note: the switch is made whatever is reached first, DataNonlinear Newton After Iterations or DataNonlinear Newton After Tolerance.
  • DataNonlinear Newton After Tolerance: The same as DataNonlinear Newton After Iterations but here a tolerance is set. The tolerance is the norm of the nonlinear residual. If this is reached, the switch from the Picard to the Newton algorithm is made.
  • DataNonlinear Tolerance: The tolerance for the solver to stop. If the error is smaller than the tolerance, the solver run will be finished. Otherwise, the full number of DataNonlinear Iterations will be performed.
    In the Elmer output you see how the error is minimized while the solver is running. If it does not go down below a certain value that is acceptable but above the current tolerance, you can increase the tolerance.
  • DataRelaxation Factor: This is THE most important setting in case the solver does not converge:

Relaxation Factor

If the solver iteration results oscillate numerically, the solver results cannot converge to a final, stable value. To avoid that, the calculated variable of the i-th iteration/solver run is not taken as input for the next iteration, but , a value that is "damped" with the result from the previous iteration. The relaxation factor is thereby defined as

So for the default of 1.0, no damping is used. The smaller , the greater the damping and the longer the convergence time. Therefore if the solver does not converge, start changing the relaxation factor to 0.9, then to 0.8 and so on. Values below 0.3 are unusual and if you need this, you should have a closer look to the math of your analysis.
For cases, where you get a proper convergence you can set above 1.0 to speed the convergence up.

Steady State

This part of the settings has only one property:

  • DataSteady State Tolerance: The specific steady state or coupled system convergence tolerance. All the equation solvers must meet their own tolerances for the variable they calculate before the whole system is deemed converged. The tolerance criterion is:

whereas is the steady state tolerance and is the calculated variable in the i-th iteration/solver run.