FEATool  v1.6
Finite Element Analysis Toolbox
 All Files Functions Pages
Solvers

This chapter describes the solver options available with FEATool. Solvers are used to compute solutions to the involved finitie element FEM discretizations.


Solve Mode

After a geometry, grid, and equation and boundary conditions have been defined one can change to solve mode by pressing the mode button.

The Solve menu similarly allows for switching to Solve Mode and also opening the Solver Settings... dialog box. The menu also features an option to Get Initial Solution which computes the expressions defined in the Initial Condition fields of the equation settings dialog box and returns this as the solution. Moreover, the default solver call command can be edited and changed through the Solver Call Command... option thus allowing for custom and external solvers to be employed.

In solve mode the available toolbar buttons and actions are the following.

  • Calls the default solver as defined by the solver settings with initial conditions prescribed in the equation settings. After the problem has been solved FEATool switches to postprocessing mode and plots the solution according to the chosen plot types.
  • Re-solves the problem using the last solution as initial value. Note that for this to work the geometry, grid, physics modes, and finite element shape functions must all remain the same.
  • Solves fluid flow problems with the FeatFlow external CFD solver.
  • Opens the Solver Settings dialog box.


Solver Settings Dialog Box

The Solver Settings dialog box shown below and can be opened by pressing the corresponding toolbar button. The solver settings allow advanced control over the default built-in FEATool solver.

gui_solve_50.png

Firstly, the Solver Type option allows for either stationary monolithic solver solvestat, or the time dependent instationary solver solvetime to be chosen. Monolithic means that all dependent variables are discretized and solved together in a large coupled system, rather than iteratively solving a segregated set of smaller decoupled systems.

Initial Condition controls whether the initial values should be computed from the equation expressions in the initial value fields, or taken from an old solution in which case the solution can be chosen from the corresponding list box. Note that for this to work the geometry, grid, physics modes, and finite element shape functions must all remain the same.

The Time Dependent Settings controls time-stepping parameters when using the time-dependent solver. The Time step selects a fixed time step size for single step schemes, or the average time step size for multi-step schemes. Time dependent simulations will terminate either when the accumulated time has reached the specified Simulation time, or the normed changes in the dependent solution variables are smaller than the Time stopping criteria indicating a stationary state. The Time stepping scheme allows choosing between the single-step first order Backward Euler and second order Crank-Nicolson schemes, as well as the second order (multi-step) Fractional-step-theta scheme. Lastly, one can choose between using standard row-sum lumped and full Mass matrix representations.

The non-linear solver is used then dependent variables are detected in the equation coefficients, which is the typical for multiphysics problems. Per default standard fixed point iterations are used while Newton iterations can be used if an analytical Jacobian is supplied by the user (see the Navier-Stokes fluid flow models for examples of this).The Non-Linear Solver Settings allows control over the Maximum number of non-linear iterations, and the Non-linear relaxation parameter which is the fraction of the new to old solution to weigh in the next non-linear iteration. The non-linear solver will terminate and stop when either of the Defect stopping criteria or Solution changes stopping criteria are met which can be chosen to be measured both absolute or relatively. Stopping criteria for the non-linear solver

In the General Settings frame there is also a setting to control the numerical integration rule and order used in the matrix assembly operations (it is necessary to increase this for higher order >2 shape functions).


FeatFlow CFD Solver

FEATool uses the default built-in linear solvers available in Matlab and Octave which currently is the direct Umfpack and SuiteSparse solver suites. These are very robust for a wide range of problems but not as efficient either in memory or speed as a specialized dedicated solver can be. Starting with FeatFlow, FEATool provides functionality for using more efficient specialized external solvers.

FeatFlow, is very fast and efficient FEM based computational fluid dynamics (CFD) solver for the incompressible Navier-Stokes equations. The FeatFlow solver makes it easy to perform high performance CFD simulations with FEATool Multiphysics directly in Matlab and Octave.

FeatFlow is a finite element CFD code based on using an efficient FEM discretization (Rannacher-Turek non-conforming ansatz functions) together with a geometric multigrid approach for solving linear systems [1],[2]. This results in a very fast and computationally efficient solver typically yielding a magnitude or more of speedup compared to the built-in direct solver in Matlab (UMFPACK). Additionally, an iterative solver, such as in FeatFlow, uses much less memory than a direct one allowing for much larger simulations. Being a very stable and tested CFD code, FeatFlow has been used and validated in many commercial CFD projects, and studies have shown FeatFlow to be significantly more efficient than both Ansys CFX and OpenFOAM with respect to the total CPU time required to achieve a target accuracy [3].

The video below is a tutorial showing how to set up and solve a backwards facing step CFD problem with the FEATool GUI. For this backwards facing step benchmark example the FeatFlow solver is about 50 times faster compared to using the default built-in solver.


FeatFlow Usage

FeatFlow strictly employs quadrilateral grids in two dimensions. In the FEATool GUI one can use the Grid > Convert Grid Cells menu option to change an unstructured triangular simplex grid into quadrilateral one. On the Matlab and Octave command lines one can also use the tri2quad, gridgen_quad, and grid primitive functions such as rectgrid, circgrid etc. to generate quadrilateral grids. Alternatively, one can also import a pre-made external quadrilateral grid in any of the import format that are supported in FEATool, such as for example from GiD and Gmsh.

In contrast to most CFD and physics simulation codes it is in FeatFlow desirable to start with a very coarse grid. FeatFlow will then internally uniformly refine this grid a prescribed number of times to generate the multigrid level hierarchies, and also adapt boundaries to the geometric boundary parametrization. In this way one can achieve optimal conditions for the geometric multigrid solver. This also means that the output from FeatFlow will correspond to a much finer grid and have a higher quality solution.

FeatFlow can be used instead of the usual solve button = to call the external FeatFlow solver for Navier-Stokes physics mode models. The FeatFlow solver control panel can be accessed in Solve Mode of the FEATool GUI by pressing the button labeled FeatFlow.

The FeatFlow solver dialog box allows one to first Export the current grid and model definition to FeatFlow data files. The Solve option calls the FeatFlow CC2D solver using the exported data. Import finally reads a computed FeatFlow solution and imports it into the FEATool GUI (refining the initial grid as necessary determined by the FeatFlow Grid refinement level setting).

featflow_dlg_50.png

The FeatFlow solver settings are described as follows

  • Grid refinement level - Number of grid refinements of the imported grid to compute on. FeatFlow uses a geometric multigrid solver approach where the initial coarse input grid is uniformly refined several times to generate the finer multigrid levels. Thus it is often desirable to start with a quite coarse input grid.
  • Artificial stabilization - Select between streamline diffusion and upwinding for artificial stabilization of convective terms.
  • Stabilization parameter - Stabilization tuning parameter.
  • Solver type - Select either Stationary (monolithic) or Time-Dependent problem and solver type.
  • Time stepping scheme - Choose between implicit 2nd order Fractional-step-theta, Crank-Nicolson, and 1st order Backward Euler time stepping schemes.
  • Time step - Sets the macro time step size (internally FeatFlow takes three sub-time steps for each macro time step).
  • Simulation time - Maximum/final simulation time.
  • Time stopping criteria - Stationary limit to stop a time dependent simulation.
  • Full settings - Access all FeatFlow CC2D and CC3D solver parameters (see the FeatFlow documentation for a description of these) [1].


Command Line (CLI) Usage

The featflow function can also be used on the command line as follows:

FEA = FEATFLOW( FEA, VARARGIN ) Export, solves, or imports the solved problem described in the FEA finite element struct using the FeatFlow CFD solver. Accepts the following property/value pairs

Input   Value/{Default}                Description
-----   ----------------------------   ---------------------------
mode    export/solve/import            Command mode to call
data    default                        Default solver parameters
solve   ''                             FeatFlow solver to use
fdir    featflow                       Processing directory
fname   ft2ff                          FeatFlow output filename
wbash   C:\Windows\System32\bash.exe   Windows bash path
Input   Value/{Default}                Description


Limitations

The following limitations apply to the FeatFlow solver.

  • Single geometry object with quadrilateral/hexahedral grid
  • FEATool Lite and Multiphysics versions are limited to 100000 grid points
  • Single Navier-Stokes physics mode
  • Constant density and viscosities
  • Zero initial conditions
  • Prescribed velocity, wall, and neutral Neumann outflow boundary conditions
  • Prescribed velocity boundary condition must be linear expressions and may not include dependent variables (velocities or pressure)


Advanced Usage

The FeatFlow solvers cc2d and cc3d included with FEATool are capable of performing large scale simulations. Although technically possible, for memory and stability reasons it is not advised to do this from within Matlab or Octave. For large scale simulations then it is instead recommended to manually launch the FeatFlow cc2d / cc3d binaries from the system command line. To do this first make sure the proper FeatFlow data and grid files have been exported. The data files cc2d.dat / cc3d.dat, bdry.dat, and expr.dat should be located in the featool/featflow/data subdirectory, and the grid files ft2ff.tri / ft2ff.prm in the featool/featflow/adc directory. The ccXd binaries can then simply be launched as, for example

cc2d

Convergence output will be printed to the terminal screen as well as mirrored in the log file featflow/data/ff.out. As memory FeatFlow is statically allocated, four different binaries may be supplied for each solver with a postfix 1 through 4. If the grid and memory requirements are too large for one binary one can try using the one with a higher number. Result output files can be found in the featool/featflow/output subdirectory for the pressure, velocities, cell centers, and cell edge/face midpoints. Moreover, the ascii input data files can be tuned accordingly to provide for example binary, GMV, and AVS output data (see the FeatFlow documentation for a full explanation of the solver input parameters).


Tutorial

An example of setting up and solving a flow over a backwards facing step problem using the FeatFlow external solver is given in the tutorial section Fluid Dynamics - Flow Over a Backwards Facing Step.


References

[1] S. Turek, C. Becker, FeatFlow, Finite element software for the incompressible Navier-Stokes equations, User Manual, Release 1.1, Heidelberg, 1998.

[2] S. Turek, Efficient Solvers for Incompressible Flow Problems: An Algorithmic and Computational Approach, Series: Lecture Notes in Computational Science and Engineering ,Volume 6, Springer-Verlag, 1999.

[3] E. Bayraktar, O. Mierka, S. Turek, Benchmark Computations of 3D Laminar Flow Around a Cylinder with CFX, OpenFOAM and FeatFlow, International Journal of Computational Science and Engineering, 7, 3, 253-266, 2012.