FEM tutorial: Difference between revisions

From FreeCAD Documentation
(Module to Workbench renaming.)
(Update for FC 0.20)
Line 8: Line 8:
|Time=10 minutes + Solver time
|Time=10 minutes + Solver time
|Author=[http://freecadweb.org/wiki/index.php?title=User:Drei Drei]
|Author=[http://freecadweb.org/wiki/index.php?title=User:Drei Drei]
|FCVersion=0.16.6700 or above
|FCVersion=0.17 or above
}}
}}


Line 18: Line 18:
</translate>
</translate>
[[Image:FEM_tutorial_result.png|600px]]
[[Image:FEM_tutorial_result.png|600px]]

<translate>
<translate>


Line 23: Line 24:


<!--T:10-->
<!--T:10-->
* FreeCAD version 0.16.6700 or above
* FreeCAD version 0.17 or above
* [http://sourceforge.net/projects/netgen-mesher/ Netgen] and/or [http://geuz.org/gmsh/ GMSH] is installed on the system
* [http://sourceforge.net/projects/netgen-mesher/ Netgen] and/or [http://geuz.org/gmsh/ GMSH] is installed on the system (included in FreeCAD instalation)
* [http://www.calculix.de/ Calculix] is installed on the system (included in FreeCAD instalation)
* In the case of GMSH, install [[Macro_GMSH|Macro GMSH]] from the [[Std_AddonMgr|AddonManager]], developed by [https://github.com/psicofil/Macros_FreeCAD psicofil]
* [http://www.calculix.de/ Calculix] is installed on the system
* The reader has the basic knowledge to use the [[Part_Workbench|Part]] and [[PartDesign_Workbench|PartDesign Workbenches]]
* The reader has the basic knowledge to use the [[Part_Workbench|Part]] and [[PartDesign_Workbench|PartDesign Workbenches]]


Line 41: Line 41:
# Create a Cube
# Create a Cube
# Change its '''Dimensions''' to the following:
# Change its '''Dimensions''' to the following:
## Height: 1.000 mm
## Length: 8.000 m
## Length: 8.000 mm
## Width: 1.000 m
## Width: 1.000 mm
## Height: 1.000 m


<!--T:13-->
<!--T:13-->
Line 49: Line 49:


=== Creating the Analysis === <!--T:32-->
=== Creating the Analysis === <!--T:32-->
# Activate the [[Image:Workbench_FEM.svg|24px|link=FEM_Workbench]] [[FEM_Workbench|FEM Workbench]]

# Select the {{MenuCommand|Model → [[Image:FEM_Analysis.svg|16px]] Analysis container‏‎}} option from the menu.
==== Netgen ==== <!--T:33-->

<!--T:15-->
# Select the model
# Click [[Image:FEM_Analysis.svg|24px]] [[FEM_Analysis|New mechanical analysis]] from the menu to create an analysis from the object that was selected
# In the meshing dialog, click {{Button|OK}}

<!--T:16-->
You can also drag and drop a mesh to a Mechanical Analysis that does not have a mesh within the [[Tree_view|Tree view]].

==== GMSH ==== <!--T:34-->

<!--T:17-->
The usage of psicofil's macro is recommended, and is used for this example.
# Activate the macro
# Select the object you wish to use, in this case our Cube
# Check the box '''Create Mechanical Analysis from mesh'''
# Click {{Button|OK}}

<!--T:18-->
We have now meshed our object and are ready to add constraints and forces.


=== Constraints and Forces === <!--T:35-->
=== Constraints and Forces === <!--T:35-->
Line 78: Line 58:
# Show the original model
# Show the original model
# Select [[Image:FEM_ConstraintFixed.svg|24px|link=FEM_ConstraintFixed]] [[FEM_ConstraintFixed|Create FEM fixed constraint]]
# Select [[Image:FEM_ConstraintFixed.svg|24px|link=FEM_ConstraintFixed]] [[FEM_ConstraintFixed|Create FEM fixed constraint]]
# Select the back face of the Cube (face on the '''YZ''' axis) and click OK
# Click {{Button|Add}}, select the back face of the Cube object (face on the '''YZ''' axis) and click OK
# Select [[Image:FEM_ConstraintForce.svg|24px|link=FEM_ConstraintForce]] [[FEM_ConstraintForce|Create FEM force constraint]]
# Select [[Image:FEM_ConstraintForce.svg|24px|link=FEM_ConstraintForce]] [[FEM_ConstraintForce|Create FEM force constraint]]
# Select the front face of the Cube (the face parallel to the back face) and set the '''Area load''' value to 9000000.00
# Click {{Button|Add}}, select the front face of the Cube object (the face parallel to the back face) and set the '''Load [N]''' value to 9000000
# Set the '''Direction''' to '''-Z''' by selecting one of the face edges parallel to that direction.
# Set the '''Direction''' to '''-Z''' by selecting one of the face edges parallel to that direction.
# Click OK
# Click OK
Line 87: Line 67:
We now have established the restrictions and forces for our static study.
We now have established the restrictions and forces for our static study.


=== Final preparations === <!--T:36-->
=== Material === <!--T:36-->


<!--T:21-->
<!--T:21-->
# Select [[Image:FEM_MaterialSolid.svg|24px]] [[FEM_MaterialSolid|Mechanical material...]] and choose Calculix as the material
# Select [[Image:FEM_MaterialSolid.svg|24px]] [[FEM_MaterialSolid|Material for solid]] and choose Calculix-Steel as the material
# Click {{Button|OK}}
# Click {{Button|OK}}

=== Meshing === <!--T:41-->
It is recommended to make a mesh as the last step in the analysis preparations due to association to a geometry in FreeCAD.
Depending on FreeCAD installation, there can be Netgen or GMSH meshers, you can use any of them.

==== Netgen ==== <!--T:33-->

<!--T:15-->
# Select the model
# [[Image:FEM_MeshNetgenFromShape.svg|24px]] [[FEM_MeshNetgenFromShape|FEM mesh from shape by Netgen]]: Generates a finite element mesh for a model using Netgen.
# In the meshing dialog, click {{Button|Apply}} and {{Button|OK}}

<!--T:16-->
You can also drag and drop a mesh to a Mechanical Analysis that does not have a mesh within the [[Tree_view|Tree view]].

==== GMSH ==== <!--T:34-->

<!--T:17-->
# Select the model
# [[Image:FEM_MeshGmshFromShape.svg|24px]] [[FEM_MeshGmshFromShape|FEM mesh from shape by Gmsh]]: Generates a finite element mesh for a model using Gmsh.
# In the meshing dialog, click {{Button|Apply}} and {{Button|OK}}

<!--T:18-->
We have now meshed our object and are ready to add constraints and forces.


=== Running the Solver === <!--T:37-->
=== Running the Solver === <!--T:37-->
Line 98: Line 102:


<!--T:22-->
<!--T:22-->
# Select the solver object [[Image:FEM_SolverCalculixCxxtools.svg|24px]] contained in the '''Mechanical Analysis'''
# Select the solver object [[Image:FEM_SolverCalculixCxxtools.svg|24px]] contained in the '''Analysis''' container
# Select [[Image:FEM_SolverControl.svg|24px]] [[FEM_SolverControl|Start calculation]] from the menu
# Select [[Image:FEM_SolverControl.svg|24px]] [[FEM_SolverControl|Solver job control]] from the menu
# Select '''Write Calculix Input File'''
# Select '''Write .inp File'''
# Select '''Run Calculix'''
# Select '''Run CalculiX'''
# Click '''Close'''
# Click '''Close'''


Line 107: Line 111:


<!--T:25-->
<!--T:25-->
# Select the solver object [[Image:FEM_SolverCalculixCxxtools.svg|24px]] contained in the '''Mechanical Analysis'''
# Select the solver object [[Image:FEM_SolverCalculixCxxtools.svg|24px]] contained in the '''Analysis''' container
# Click on [[Image:FEM_SolverRun.svg|24px]] [[FEM_SolverRun|Quick Analysis]].
# Click on [[Image:FEM_SolverRun.svg|24px]] [[FEM_SolverRun|Run solver calculations]].


=== Analyzing Results === <!--T:40-->
=== Analyzing Results === <!--T:40-->


<!--T:23-->
<!--T:23-->
# From the '''Object Tree''', select the '''Results''' object
# From the '''Object Tree''', select the '''CCX_Results''' object
# Select [[Image:FEM_ResultShow.svg|24px|link=FEM_ResultShow]] [[FEM_ResultShow|Show result]]
# Select [[Image:FEM_ResultShow.svg|24px|link=FEM_ResultShow]] [[FEM_ResultShow|Show result]]
# Choose among the different Result types to view the results
# Choose among the different Result types to view the results
# The slider at the bottom can be used to alter the mesh visualization. This allows us to visualize the deformation experienced by the object, keep in mind that this is an approximation.
# The slider at the bottom can be used to alter the mesh visualization. This allows us to visualize the deformation experienced by the object, keep in mind that this is an approximation.
# To remove the results select [[Image:FEM_ResultsPurge.svg|24px|link=FEM_ResultsPurge]] [[FEM_ResultsPurge|Purge results]]
# To remove the results select [[Image:FEM_ResultsPurge.svg|24px|link=FEM_ResultsPurge]] [[FEM_ResultsPurge|Purge results]]



Revision as of 16:32, 23 July 2022

Tutorial
Topic
Finite Element Analysis
Level
Beginner
Time to complete
10 minutes + Solver time
Authors
Drei
FreeCAD version
0.17 or above
Example files
None
See also
None

Introduction

This tutorial is meant to introduce the reader to the basic workflow of the FEM Workbench, as well as most of the tools that are available to perform a static analysis.


Requirements

  • FreeCAD version 0.17 or above
  • Netgen and/or GMSH is installed on the system (included in FreeCAD instalation)
  • Calculix is installed on the system (included in FreeCAD instalation)
  • The reader has the basic knowledge to use the Part and PartDesign Workbenches

Procedure

Modeling

In this example a Cube is used as the study object, but models created in the Part or PartDesign Workbenches can be used instead.

  1. Create a new document (press on the button)
  2. Activate the Part Workbench
  3. Create a Cube
  4. Change its Dimensions to the following:
    1. Length: 8.000 m
    2. Width: 1.000 m
    3. Height: 1.000 m

Now we have a model with which to work with.

Creating the Analysis

  1. Activate the FEM Workbench
  2. Select the Model → Analysis container‏‎ option from the menu.

Constraints and Forces

  1. Hide the mesh from the Tree View.
  2. Show the original model
  3. Select Create FEM fixed constraint
  4. Click Add, select the back face of the Cube object (face on the YZ axis) and click OK
  5. Select Create FEM force constraint
  6. Click Add, select the front face of the Cube object (the face parallel to the back face) and set the Load [N] value to 9000000
  7. Set the Direction to -Z by selecting one of the face edges parallel to that direction.
  8. Click OK

We now have established the restrictions and forces for our static study.

Material

  1. Select Material for solid and choose Calculix-Steel as the material
  2. Click OK

Meshing

It is recommended to make a mesh as the last step in the analysis preparations due to association to a geometry in FreeCAD. Depending on FreeCAD installation, there can be Netgen or GMSH meshers, you can use any of them.

Netgen

  1. Select the model
  2. FEM mesh from shape by Netgen: Generates a finite element mesh for a model using Netgen.
  3. In the meshing dialog, click Apply and OK

You can also drag and drop a mesh to a Mechanical Analysis that does not have a mesh within the Tree view.

GMSH

  1. Select the model
  2. FEM mesh from shape by Gmsh: Generates a finite element mesh for a model using Gmsh.
  3. In the meshing dialog, click Apply and OK

We have now meshed our object and are ready to add constraints and forces.

Running the Solver

Standard Procedure

  1. Select the solver object contained in the Analysis container
  2. Select Solver job control from the menu
  3. Select Write .inp File
  4. Select Run CalculiX
  5. Click Close

Quick Procedure

  1. Select the solver object contained in the Analysis container
  2. Click on Run solver calculations.

Analyzing Results

  1. From the Object Tree, select the CCX_Results object
  2. Select Show result
  3. Choose among the different Result types to view the results
  4. The slider at the bottom can be used to alter the mesh visualization. This allows us to visualize the deformation experienced by the object, keep in mind that this is an approximation.
  5. To remove the results select Purge results
Comparison to previous example file

If you select the Z displacement result type, you can see that the obtained value is almost identical to the test example provided by FreeCAD. Differences may occur due to the quality of the mesh and the number of nodes it possesses.


We are now finished with the basic workflow for the FEM Workbench.


Template:Tutorials navi