How to Run a CalculiX Simulation in FreeCAD
This article provides a concise, step-by-step guide to setting up and executing a Finite Element Analysis (FEA) using the CalculiX solver directly within FreeCAD. By utilizing FreeCAD's built-in FEM (Finite Element Method) workbench, you will learn how to prepare a 3D CAD model, define materials, apply mechanical constraints and loads, generate a mesh, run the CalculiX solver, and inspect the resulting stresses and displacements.
1. Prepare the Model and Open the FEM Workbench
- Open your 3D model in FreeCAD. Ensure your model is a clean, single solid object (typically created via the Part Design or Part workbench).
- In the workbench dropdown menu at the top of the interface, switch to the FEM workbench.
2. Create an Analysis Container
- Click on the Analysis container icon (a yellow folder with a red "A") or select Model > Analysis container from the top menu.
- An Analysis container will appear in your tree view. All subsequent materials, constraints, meshes, and solver objects must reside inside this container to function properly.
3. Assign Material Properties
- Select your 3D part in the tree view.
- Click the Material for solid button (looks like a red ball with an "M").
- Choose a predefined material (such as Steel-Generic or Aluminum-Generic) from the dropdown list, or manually enter the Young's Modulus and Poisson's Ratio.
- Click OK to add the material to the Analysis container.
4. Apply Boundary Conditions (Constraints and Loads)
You must secure the part and apply external forces to run a static structural simulation:
- Fixed Constraint: Select the face, edge, or vertex you want to lock in place, then click Constraint fixed (padlock icon). Click Add to confirm the geometry selection, then click OK.
- Force / Load: Select the face where the load is applied, then click Constraint force (arrow icon). Enter the load magnitude in Newtons, set the direction (or reverse it if needed), click Add to include the selected face, and click OK.
5. Mesh the Geometry
- Select your solid part in the tree view.
- Click FEM mesh from shape by Netgen (or use the Gmsh tool if configured).
- In the task panel, choose the element order (typically Second Order for structural analysis) and adjust the Max size of the elements based on the model dimensions.
- Click Apply to generate the mesh, then click OK.
6. Run the CalculiX Solver
- Expand your Analysis container in the tree view.
FreeCAD automatically includes a default CalculiX
solver object (typically named
CalculiXccxTools). - Double-click the CalculiX object in the tree view to open its task panel.
- Choose your Analysis type (e.g., Static).
- Click Write .inp file to generate the input deck for CalculiX.
- Click Run CalculiX. The console output will display the solver's progress. Once it outputs "CalculiX done without error," click Close.
7. View and Interpret Results
- Once the run completes, a new results object (e.g.,
CCX_Resultsor a pipeline object) will appear in the tree view inside the Analysis container. - Double-click the results object to view the results panel.
- Select which output field to display, such as Von Mises stress or Displacement magnitude.
- Adjust the visual scaling to view exaggerated deformations or display contour plots across the surface of the mesh.