FEM: Step by step instructions

A place to share learning material: written tutorials, videos, etc.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
ralph.malan
Posts: 2
Joined: Tue Nov 08, 2022 7:51 am

FEM: Step by step instructions

Post by ralph.malan »

Tips on using FreeCAD for Fusion users.

I use Fusion as a free personal use licensee. The FEM section is not open to personal users. In the USA you can upgrade to full paid up member on a monthly basis which then gives you access to the FEM module. I live in South Africa and here you need to take out a years subscription. I have little confidence that the local Autocad agents would everallow me to revert to the personal licence once I had moved to the subscription licence. So I used the FEM of FreeCAD. I am wanting to build a DIY CNC machining centre using epoxy granite. It needs to be stiff. The target is 10N causing 1 um (micro metre) deflection. FreeCAD showed me that epoxy granite was not up to the task & it guided me to a suitable design.
I met some issues getting FreeCAD to work. I made notes on how to operate it. I have tidied those notes up a bit & present them here. I hope they are of use to others. The first 3 steps are what must be done in Fusion

Preliminary notes
Workspace. Selected from drop down window in top toolbar. Choose FEM. It probably reads
“Start”. A new toolbar appears with the FEM buttons
Moving the model on the screen. Right mouse button. Wheel zooms.
View Cube is superior to Fusion’s. It has 45° steps & corners to click on. I find it particularly useful when viewing the deflection results.
To hide/restore the solid model or mesh model select the item in the tree & press spacebar.
You can have both displayed simultaneously.
In Combo View box there are 2 tabs at top Model & Task. You click the one you need.
Lost the Combo view. View\Panels The Panel is floating so you can click it & drag it into position
Check the second monitor – I found it there.
Google gives this “ close every project or open file. Close ALL panels. Click on every close button you see on the FreeCAD window. Combo view checkbox should be enabled again.”
View\Toolbars. There are many of them. Have to select each in turn

Terminology in this document
Master Assembly = the item at the top of the Fusion Browser.
DC = double click on mouse
RC = right click on mouse

Sequence for doing the FEM analysis.

‘0. To open an existing model. \File\Open rather than clicking on opening screen tile
1. Model requirements. To be able to anchor it & load it in FreeCAD I need pads at
the cars & spindle bolts. Then I can make these pads the Fixed Constraint in
FreeCAD
2. To prepare Component in Fusion.
1. New Design. This is the more complex method. You create a new Design in
Fusion. Then bring in each component you want in FreeCAD to this new
Design from the existing design & manipulated them there as needed before
making the STEP file for FreeCAD.
2. Changing an existing design. This is the simpler method. Create the new
Component within the existing Design either by copying & Create New
or editing the existing.
A condition of using this method is you can only work with Components (it does
not work with bodies within the Master Assembly). I had previously started
building a master assembly in Fusion where I brought bodies across from other
Designs & pasted them into the Master Assembly in the Browser so they were
not individual components. In that case display just the wanted body & Create
Component so new component appears in the Browser.
Composite bodies. If the body is made up of several materials they have to be
approximated by a body made of just a single material. This is done adjusting
the width in proportion to the relative Young’s Moduli. As an example: Steel has
E=200 GPa. Epoxy Granite has E= 30GPa. I have a 75x75x2 steel square
tube with 20mm of epoxy all around. The factor to convert the EG to equivalent
steel is 30/200=0.15. On the 2 sides normal to the neutral axis I add 20*0.15=
3mm of steel on the outside of the 75 sides (at the center it is just the two sides of
the steel tubes) . So the sides are 2 for the actual steel + 3 for the Epoxy Granite
converted to the equivalent steel. On the top and bottom parallel to the neutral
axis I add 20mm thick steel 190*0.15 = 28.5 wide because the EG was
75+75+20+20 wide. I split the EG to 2 pieces 14.25 wide which I placed under
the steel linear rails cars (which are on a steel plate). On the opposite it is just the
equivalent/ In each case the height of the equivalent piece retains its original
height but its width is adjusted. Thus I have transformed the EG to the equivalent
steel.

Picture 1 illustrates that.

Step by step to change an existing design
The only steps required are to make sure you have the bodies that you wish to
use in the FEA displayed. Usually it is dealing with the composite bodies. In my
case I had steel rectangular frame encased in 20mm of epoxy granite. I created
new steel bodies in each of the existing Components. The epoxy granite had
been converted to the equivalent steel.
The combining of those steel bodies takes place in the “make STEP in Fusion”

Step by step to make a new Design
Open the source Design.
Master Assy active (fish eye).
Wanted component selected (blue)
RC / Copy
New Untitled Design in Fusion.
Master Assy active (fish eye)
RC / Paste New.
It appears as new Component in the Browser.
Do the same for any other components you want at this time.
Move the body into the correct position.
Make the changes required. Like add pads for the Fixed Constraint in FreeCAD
Note. Doing it this way we get the sketches so it is easy to do editing etc.


3. To make STEP in Fusion
All the bodies are to be Combined into a single body.
Step by step
Master Assembly active (fish eye)
Make visible only the components (& the required bodies) you need to combine.
All the bodies to be combined must show.
Modify \ Combine
Operation: Join.
New Component: ticked. VIP (otherwise it replaces the existing.)
Keep Tools: ticked. (otherwise they get deleted)
Target Body: Select the one you prefer.
Tool Bodies: Select the others. All the bodies should be blue when done.
I find when there are many bodies that it is simpler to click each one in the Tree.
OK
Another Component appears in the Browser
VIP Now display only the Combined component & Body. Is it correct?
Rename the new Component
File \ Save. To save your work
File \ Export Beware: Only the single combined Body should be visible.
Name: I like to give yymmdd prefix to the file name so they are automatically
sorted.
Type: STEP
Location: I have a folder STEP where I place them.
Export

4. Import into FreeCAD.
Step by step
Create new. (Tile in Documents when you open FreeCAD) or File\New
File\Import & select the STEP
VIP Save the file now. File\Save As\ enter name & chose folder
The Combo View panel should be open & the body should be in the work panel
The Combo View panel has 2 tabs Model & Tasks. Model should now list your
project under Application

To re-open an existing FreeCAD file. At opening screen there will be a tile for it if
it was one of your latest. Otherwise \File\Open\find it on your computer

5. Workbench in drop down list in top toolbar (it probably reads “Start”). Select FEM

6. Analysis
Click the A icon at left in new FEM toolbar
Analysis added in Tree

7. Mesh. I do this first because it sometimes gives errors so rather do it before
doing the Material, Fixed & Force steps.
Step by step
First click on Part (yellow L shaped block) in Tree so it is selected & body is
translucent green in the workspace.
GMesh in FEM toolbar is greyed out.
Click > at Part to open the list.
Click Component (blue cube) to select it. Then GMesh is available.
You can not select more than 1 part when making the GMesh. GMesh will
then be greyed out.
Click GMesh icon (G on Rubick cube. It is now coloured).
Tasks panel opens.
Mesh element dimension: From Shape
Max element: 8.0mm (For my project I make it larger than “Auto”. But check
Errors section below.)
Min element size 0.00mm = Auto
Click Apply. Takes some seconds. Body should turn dark yellow with mesh.
In message panel it probably includes in red “Warning: 2 ill-shaped tets…”
Don’t worry about it. (tets=tetrahedrons= FEM elements)
If the Combo View panel disappears: View\Panels tick Selection View. The
Selection panel then opens & Combo View is sometimes behind it. Click the X
icon at TR to close the Selection panel.
Click OK in Task panel. This is VIP. If you don’t click OK then the FEM
toolbar is greyed out.


To run it again. Must again Click the Component so it is blue in the list.
Afterwards you must delete the first mesh in the Tree (multiple meshes are not
allowed). Then GMesh becomes available.

8 To see mesh. Click Component (blue cube) in Tree. Spacebar toggles hide it.
Open Analysis branch (click > symbol.)
Click Mesh in Tree (in Analysis branch)
Spacebar now shows it
To get the body back you sometimes need to click Part (L block) then spacebar.
Note: I had to delete a duplicate mesh that was in the Tree (RC & Delete from
drop down). Then displayed the mesh before Running the Solver

9. Material. With Analysis selected in Tree (violet). Click the yellow ball icon on
toolbar.
In dialogue box:
Material card. Leave as transient material or document material if you are going
to specify the Young’s modulus & Poisson’s ratio otherwise choose from the
list. I use Steel generic which gives Modulus 200 000 000 & Poisson’s Ratio
0.300. In this case do NOT tick use this task panel
At bottom (you need to slide the dialogue box up to see it) is Selection mode
Face, Edge or Solid. Accept default Face. (I have compared using Face & Solid;
I got the same results for deflection & stress.)
Tick “use this task panel” if you are entering your own modulus & Poisson’s
ratio.(small on R towards top).
Young’s Modulus enter 30 000 000 for epoxy granite. 200 000 000 for steel
Poissons Ratio 0.25 (have to arrow across to decimal portion then delete 2 digits
before you can enter new digits)
Other properties are not used in FEA
OK (at top) (I have not found how to add a material to the list of materials)

10. Fixed. With Analysis selected in Tree (violet)
Constraint Fixed icon (with padlock) in toolbar.
In Model panel (click Model to open it) the Part (blue cube) must be selected
(grey or blue). Model becomes translucent green.
Go back to Tasks panel.
Click on model workspace – model turns grey.
Click the fixed faces(ctrl to pick more than 1). They turn green. The model must
be grey before you can pick the faces. Click anywhere in the model screen to
make it grey if it was translucent green.
Click Add. They get added to the list & you get red bars with cones on the model
Click OK

11. Force. With Analysis selected in Tree (violet)
Step by step
Constraint force icon (arrow) in toolbar.
Choose the face you want the force applied to (it turns yellow or pale green).
Add. Part appears in the list. It gives the face number. Red mushrooms appear
Direction: Click an edge pointing in desired direction. Then click Direction
button.
Mushrooms switch to point in that direction. Nothing shows at present.
Load. 1000N (That is what I use)
May have to click front face again to select it
May need to tick Reverse direction button
OK
Note. For the direction you may only choose a plane edge or face. I wanted a
diagonal face which required creating such a face on the part in Fusion so that it
was available for defining the direction of the force.

To Edit the Force.
DC ConstraintForce in Tree
Change the direction or Load.
Remove & Add a different face
Click OK

Picture 2. Illustrates fixed & force icons



12 Calculix. With Analysis selected in Tree (violet)
Step by step
DC SolverCcxTools. First click changes the panel below. When that has
happened double click starts Calculix
Make sure that Static is selected.
Click Write .Inp file
Click Run Calculix. Takes some secs. Time will stop increasing but text will read
CalculiX is running for a while. Thereafter it will add a whole lot of lines ending
with Script box should have in green “CalculiX done without error” (May have to
scroll down to find it.)
If it takes long & you are absent when it finishes. Check there is no hourglass on
screen. If the Time: at bottom of dialogue is fixed & last line reads “Loading
result sets…” It has actually finished & you can click Close.
Click Close
Note: The Combo View panel may blank out. To restore it View\Panels & click
Selection. The Combo View panel should now show. Also the Selection View
panel opens. Close the Selection View panel
If that does not work. Diminish all open windows – particularly on second
monitor.

To run it again – after changing Force direction. DC SolverCcxTools. File
ccx_dat_file001 will appear.
If you get “Active Task Dialog found!…” switch to Tasks panel. Click Close.

13 See Results
There is now CCX_Results in Tree
You can flip between the Tree & Results dialogue by clicking Model or Task
at the head of the panel.
If you have both the Component (blue cube) & Gmsh (Rubick) displayed you can
see the original position and the displaced position. Slider max needs to be set
at around 250. With the slider at Factor 0 the image is poor but as soon as you
move it the image is clear & you can see the exaggerated displacement.

Step by step
DC CCX_Results & dialogue opens.
Select Displacement Magnitude
Lower down tick Displacement Show. Slider now available. Drag the slider.
Slider max lets you exaggerate the deflection. I set it to 250
Factor shows where the slider is.
The View Cube (TR) makes it easy to change your viewpoint.
Can choose Displacemnt X Y or Z & Stress von Mises, Max & Min principal or
Shear stress.
As an example. With Force at 1000N in X direction. Click Displacement
Magnitude. Max displacement is listed caused by the applied load. As you
move the Displacement slider you see the deflection. Click Displacement X & that
is shown. Click Max Principal Stress & that is listed.

If you change anything in the Tree (like force direction or magnitude) you have to
click Run icon (Yellow rectangle with grey dashed outline) again and do the Inp &
Calculix steps again.

Picture 2 illustrates this.



This is normal side view with the force in -Y direction.
The View Cube allows very convenient changes of view point.

21 Post Processing
Click GMesh in Tree & make the mesh visible (spacebar)
Click CCX_Results in Tree. Meshed object turns brown.
Click PostProcessor icon (green square with black window frame towards right in taskbar)
Screen clears with white box corners & colour scale
Make sure there is just one Pipeline object in tree. (delete older ones)
Click Warp Vector icon (green flip card alongside PostProcessor icon on taskbar)
Mode = Surface
Field = Displacement
Vector = Magnitude
Click Apply but nothing changes.
Click \Edit\Preference\Display\Tick backlight colour\Apply\OK
Body should be nicely coloured. Back in Warp options dialogue.
Press Apply & then OK
Now it shows the displacement magnitudes much more clearly.

Save your work. File\Save
File\Exit

I will append posts showing how to deal with 8 error messages I triggered.
EG as steel.jpg
EG as steel.jpg (142.74 KiB) Viewed 2767 times
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: FEM: Step by step instructions

Post by Kunda1 »

Nice! Would you be open to moving this to a github ? You can use markdown or rst formats. It'll be way easier for people to follow and contribute to!
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
ralph.malan
Posts: 2
Joined: Tue Nov 08, 2022 7:51 am

Re: FEM: Step by step instructions

Post by ralph.malan »

Sure. How do I do that. I am completely unfamiliar with Github.
There is a whole lot more about the errors that occur & how to fix them.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: FEM: Step by step instructions

Post by Kunda1 »

GitHub has some guides for that. Create an account and follow the instructions on how to upload your files there
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Post Reply