Hi there! Internet Explorer is no longer supported.

Please use a modern web browser such as Firefox, Chromium or Edge. Thank you!

Getting Started With FEM

FEM is a highly specialized workbench used to simulate various physical phenomena with the finite element method. The workbench is very actively developed, and thus it’s recommended to always use the newest available FreeCAD version (possibly up-to-date weekly builds).

The FEM workbench supports two main solvers:

CalculiX is provided with the Windows version, other solvers require installation.

Geometry preparation

Before proceeding to run FEM simulations on your design, you should prepare the geometry as described on the FEM Geometry Preparation and Meshing wiki page. This mainly involves:

For the purpose of this tutorial, go to the Part workbench, add Cube (Part_Box), and only change the Length property to 100 mm. We will use this geometry to simulate bending and torsion of a cantilever beam with a square cross-section.

Image 16

Analysis container, meshing, and material assignment

After opening the FEM workbench, you have to add an Analysis container to activate the grayed-out tools. This will also add the default solver’s object if set in the Preferences. Otherwise, add the solver’s object manually. Here we will use CalculiX.

Image 11

Now it’s time to mesh the geometry-divide it into finite elements of simple shapes. Two meshers are available-Gmsh and Netgen. You can choose whichever you want, but the latter may be trickier to install. Gmsh is typically included with FreeCAD.

Select the single geometry object (Cube in this case) and click on the proper mesher button:

Image 15

Now you just have to specify the maximum element size (use 2 mm in this case) and click Apply, then OK.

Image 21

You can locally refine meshes (the FEM_MeshRegion command) when you need to increase the accuracy of the results in some critical locations, such as around holes.

It’s also necessary to assign material(s).

Select Solid Material (yellow button next to New Analysis) and pick one from the list. Here, select “CalculiX-Steel”.

Image 12

Optionally, you can use the task panel to change the properties used in analyses. Mechanical simulations need Young’s modulus, Poisson’s ratio, and density (only for frequency calculations or gravity/centrifugal force loads). Leaving a material with no geometry reference selected means that it will be applied to all geometry regions without material assignments.

To account for permanent (non-elastic) deformation, you can add a Non-Linear Mechanical Material object to the existing MaterialSolid and define plasticity using points from the material’s stress-strain curve specified according to CalculiX’s syntax.

Simulations with surface geometries (shell or 2D elements) also require thickness definition (the FEM_ElementGeometry2D tool), while for line geometries (beam elements), you need to define a profile (the FEM_ElementGeometry1D tool).

Boundary conditions and loads

Static simulations require boundary conditions (supports) sufficient for static equilibrium. In most cases, they are applied as a Fixed Boundary Condition or a Displacement Boundary Condition. The first one restrains movement in all directions, while the second one lets you select the directions (degrees of freedom) and displacement values (0 means fix, non-zero values enforce motion). Keep in mind that rotations can be controlled only for shell and beam elements.

Image 13

Sometimes it’s necessary to specify boundary conditions (or force loads) in cylindrical coordinates. After that, you can use the local coordinate system.

In this case, you just have to fix one square face of the beam.

Image 17

There are several types of loads available:

Image 14

For this tutorial, follow these steps:

  1. Add the Force load and set it to 200 N.

  2. Select the square face of the beam opposite to the one with the Fixed boundary condition.

  3. Select a vertical edge, and click on Direction to change the direction in which the force acts to follow that edge.

  4. Invert it by checking the Reverse direction box at the bottom.

Image 19

In the case of assemblies, you may have to define tie constraints (perfectly bonded surface pairs) or contact (surface pairs where surfaces may press against or slide on each other).

There are also several boundary conditions and loads for thermal (initial temperature, prescribed temperature, heat flux, and body heat source) and electromagnetic analyses, but let’s skip those for now.

Running an analysis and post-processing the results

If you need to change the analysis type or some solver settings, select the CalculiX solver’s object in the tree and use the Property view to access the appropriate Data properties. Many analysis features also have additional options in their Property view.

When everything is defined, just double-click on the solver’s object in the tree and click Apply. Or Write .inp File and then Run CalculiX if you have an older CalculiX solver implementation enabled (“Result object: Pipeline only” CalculiX preference unchecked in FreeCAD 1.1). When it completes, close the task panel and check the results.

Older CalculiX solver generates CCX_Results objects that don’t have a legend and require double-clicking on them to display the results, but offer quick insight into minimum and maximum values of the selected outputs. Both solvers also generate results pipeline objects. Those have a color legend and show the results all the time if visible.

Note that the older ccx solver has displacements in meters and stresses in Pascals in its pipelines, while the refactored one uses more convenient mm and MPa units, respectively.

Here, do the following:

Image 24

The displacement should be around 0.381 mm, according to hand calculations.

You can also select the results pipeline and add the Warp filter to visualize the deformation with a given scale factor (or use the slider in CCX_Results). Other filter types (e.g., for section cuts or probing results at the selected points) are also available.

Rerunning the simulation with torsion

Before finishing this basic tutorial, let’s go back to the available analysis features and discuss the Rigid body constraint shortly. It was added in FreeCAD 1.0 and can be very useful since it transfers the specified force, moment, or displacement/rotation boundary condition from one reference point to the selected region of the model (usually a face).

The reference point’s coordinates can be specified. With this feature, it’s possible to apply remote loads or simulate torsion of arbitrarily shaped parts. We will use it for exactly this purpose.

Follow these steps:

  1. Hide or delete the results of the cantilever beam analysis._

  2. Suppress (right-click → Suppressed) and hide or just delete the Force object.

  3. Add Rigid Body Constraint.

  4. Select the same face on which the force load was applied, and set the reference point coordinates to (100,5,5).

  5. In the Rotational Mode section, set X to Load.

  6. In the Moment section, specify 10 Nm (or 10 J in FreeCAD 1.0 because it didn’t support the Nm units) for X. This will apply torque around the X axis to twist the beam.

Image 20
Image 18

Rerun the analysis and:

Image 23

The maximum shear stress result should be around 48.08 MPa, according to hand calculations.

What’s next?

Now you are ready to continue exploring the FEM workbench on your own or with the help of wiki tutorials and built-in FEM Examples. There is also a similar beam analysis within the Start page example files. Just remember that the wiki documentation pages for this workbench’s features (listed on the main FEM Workbench page) are the best up-to-date reference. Practicing is really crucial for mastering FEM simulations. If you get stuck and encounter some issues, reach out to us on the FEM forum.