Python Multiphysics Simulations with FEniCS and FEATool

Python Multiphysics Simulations with FEniCS and FEATool
FEniCS Project Logo

The FEniCS Project is a popular and open-source finite element analysis (FEA) framework for mathematical modeling and physics simulations using the Python programming language. In contrast to specialized solvers (such as OpenFOAM and SU2 for fluid dynamics (CFD), or CalculiX and Code Aster for structural mechanics) FEniCS is aimed at modeling and solving general systems of partial differential equations (PDE), such as can be found in coupled multiphysics, continuum mechanics, and computer aided engineering (CAE) problems.

Simulation and visualization courtesy of the fenics-hpc project.

FEniCS Solver Interface

One of the really unique features of FEATool Multiphysics is that it provides convenient “one-click interfaces” to several different physics solvers. This means that you only have to set up your mesh and model once, and then can seamlessly switch between using the built-in multiphysics solver, the OpenFOAM and SU2 CFD solvers, and now also the FEniCS FEA solver. The multi-simulation solver functionality allows you to use the best and most efficient solver for the job, as well as verify your simulations by easily comparing results produced by different solvers and discretization methods.

Run FEniCS and Python multiphysics simulations without having to learn a complex PDE language and syntax!

FEniCS GUI and Python multiphysics simulations

Python Multiphysics Scripts

As both FEATool and FEniCS use the finite element method (FEM) formulation to discretize equations, FEATool can automate and directly translate PDE equation syntax and FEA simulation models to equivalent Python multiphysics scripts for FEniCS. These scripts can both be inspected, edited, and customized directly in the FEniCS GUI allowing for running and interfacing Python simulation scripts directly with FEATool.

Python multiphysics script converted by the FEATool-FEniCS solver interface

FEATool-FEniCS Integration Features

The FEATool-FEniCS solver integration makes it fast and convenient to set up physics and engineering simulation models with main features including

  • Set up and perform fully coupled FEniCS multiphysics simulations in an easy to use GUI with fully integrated CAD, geometry modeling, and automatic mesh generation in 1D, 2D, axisymmetry, and 3D.

  • Designed for high performance computing (HPC) and solving systems in parallel with a large selection of efficient sparse linear, non-linear and iterative solvers with the included PETSc solver framework.

  • Run stationary as well as time dependent, linear and non-linear simulations.

  • Connect and interface with both Python and MATLAB for advanced scripting, model customization, postprocessing, analysis and visualization of results.

Furthermore, as FEATool fully automates the simulation set up process it is not anymore necessary to know or learn either Python or the FEniCS PDE syntax. However, advanced users can still inspect and modify the PDE forms and Python scripts to customize simulations.

FEATool-FEniCS Python Finite Element Method (FEM) Simulation Interface

  • As FEniCS does not feature built-in time dependent solvers FEATool automatically converts instationary equations to either use first order implicit backward Euler or second order Crank-Nicolson time discretization schemes.

  • Constant, and complex non-linear equation and boundary coefficients are also supported, and can involve expressions of dependent variables, derivatives, time, space, mathematical expressions, and logical expressions (such as for example x>1 & y<=0). When required FEATool automatically converts these expressions to valid Python or C++ syntax.

  • FEATool and FEniCS both use the same finite element FEM basis functions and PDE discretizations with full support for higher-order FEM spaces ensuring accurate solutions and calculation of quantities such as boundary and subdomain integrals, and evaluating and analyzing simulation results.

  • In addition to supporting FEniCS, the exported Python simulation scripts should technically also be compatible with the Firedrake project solver which also uses the FEniCS Unified Form Language (UFL) for problem definitions.

Download and try FEATool Multiphysics
with FEniCS solver integration