Linear / Non-linear Static >> 4-Parts with 4-plastic materials tutorial and results
Moderator: bernd
Forum rules
and Helpful information for the FEM forum
and Helpful information for the FEM forum
Linear / Non-linear Static >> 4-Parts with 4-plastic materials tutorial and results
Hello All
here I like to provide a tutorial and the results of simulations of 4 parts and 4 plastic materials,
as linear and non-linear simulation’s in different load cases.
Here the link how to get plastic material stress and strain values incl. calculation sheets
https://forum.freecadweb.org/viewtopic.php?f=18&t=51756
Ideas or feedback for iumprovement are welcomed
Greetings
Nanayaw
here I like to provide a tutorial and the results of simulations of 4 parts and 4 plastic materials,
as linear and non-linear simulation’s in different load cases.
Here the link how to get plastic material stress and strain values incl. calculation sheets
https://forum.freecadweb.org/viewtopic.php?f=18&t=51756
Ideas or feedback for iumprovement are welcomed
Greetings
Nanayaw
- Attachments
-
- FEM_Material_Non_Linear_Mat_Values_for_INP.zip
- (3.85 KiB) Downloaded 98 times
-
- FreeCAD_Import_Materialdaten.zip
- (3.52 KiB) Downloaded 96 times
-
- 4_Parts_Design_FEM_Definiert.FCStd
- (770.06 KiB) Downloaded 98 times
-
- Simulation_4Parts_4Materials_Linear_Static_RESULTS.pdf
- (921.65 KiB) Downloaded 132 times
-
- Simulation_4Parts_4Materials_Linear_Static Setup.pdf
- (499.83 KiB) Downloaded 119 times
Re: Linear / Non-linear Static >> 4-Parts with 4-plastic materials tutorial and results
wow this is cool stuff.
Would it be possible to add it to the wiki and may be write some words here and there? https://wiki.freecadweb.org/FEM_Module#Tutorials
Would it be possible to add it to the wiki and may be write some words here and there? https://wiki.freecadweb.org/FEM_Module#Tutorials
Re: Linear / Non-linear Static >> 4-Parts with 4-plastic materials tutorial and results
Hello Bernd
it will be possible but first i like to get validation results from ansys as an reference
At the moment i m working on a macro to get more automatization inside I hope this weekend I will provide it
Greetings
Nanayaw
it will be possible but first i like to get validation results from ansys as an reference
At the moment i m working on a macro to get more automatization inside I hope this weekend I will provide it
Greetings
Nanayaw
Re: Linear / Non-linear Static >> 4-Parts with 4-plastic materials tutorial and results
Hello Bernd
it will be possible but first i like to get validation results from ansys as an reference
At the moment i m working on a macro to get more automatization inside I hope this weekend I will provide it
Greetings
Nanayaw
it will be possible but first i like to get validation results from ansys as an reference
At the moment i m working on a macro to get more automatization inside I hope this weekend I will provide it
Greetings
Nanayaw
Re: Linear / Non-linear Static >> 4-Parts with 4-plastic materials tutorial and results
Hello All
as promised here a macro wizard to get more automatization see pictures
Start
After Macro
The macro contains some fault and is not finished but in a condition to show what it is doing
If somebody could help to get it running then it will be nice feature cause it work like a wizard
Following functions are implemented
>> Creating Boolean Fragment (CompSolid) = Funktion = OK
>> Creat Analyse Container = Funktion = OK
>> Ask by input box how much materials should created = Function OK
>> Ask by input box how much non-linear materials should created = Function OK
>> Ask for Gmsh target mesh size by input box = Function OK
>> Create Gmsh container = !!!! Function will be executed but from my thinking the part (CompSolid) must be selected because at starting the
meshing process the error occurs >>> Unexpected error when creating mesh: <class 'AttributeError'>
>> Create a mesh groupe by yes / no input box = Function = Function OK
>> By creating the mesh group the target mesh size is asked by input box = Function OK
>> Create a Fixed constrain container = Function OK
>> Create a Force constrain container = Function OK
>> Start Meshing if no mesh region is selected (no refinement) = Function >> NOT IMPLEMENTED
Additional features not set yet
>> If non linear material is selected then suggest that the mesh elements should 1st order because with non linear materials the 2nd order will occur errors during solving
>> Start Meshing after setting the mesh group regions >> It could be done macro wait until min one mesh group areas is selected and the mesh region window closed
here the complete code, I tried my best by knowing that there will be mybee faults or unneeded code parts.
I hope we get it running
Thanks and Greetings
Nanayaw
as promised here a macro wizard to get more automatization see pictures
Start
After Macro
The macro contains some fault and is not finished but in a condition to show what it is doing
If somebody could help to get it running then it will be nice feature cause it work like a wizard
Following functions are implemented
>> Creating Boolean Fragment (CompSolid) = Funktion = OK
>> Creat Analyse Container = Funktion = OK
>> Ask by input box how much materials should created = Function OK
>> Ask by input box how much non-linear materials should created = Function OK
>> Ask for Gmsh target mesh size by input box = Function OK
>> Create Gmsh container = !!!! Function will be executed but from my thinking the part (CompSolid) must be selected because at starting the
meshing process the error occurs >>> Unexpected error when creating mesh: <class 'AttributeError'>
>> Create a mesh groupe by yes / no input box = Function = Function OK
>> By creating the mesh group the target mesh size is asked by input box = Function OK
>> Create a Fixed constrain container = Function OK
>> Create a Force constrain container = Function OK
>> Start Meshing if no mesh region is selected (no refinement) = Function >> NOT IMPLEMENTED
Additional features not set yet
>> If non linear material is selected then suggest that the mesh elements should 1st order because with non linear materials the 2nd order will occur errors during solving
>> Start Meshing after setting the mesh group regions >> It could be done macro wait until min one mesh group areas is selected and the mesh region window closed
here the complete code, I tried my best by knowing that there will be mybee faults or unneeded code parts.
Code: Select all
import FreeCAD
import FreeCADGui
import ObjectsFem
import Fem
import FemGui
import BOPTools.SplitFeatures
from PySide import QtGui
from PySide import QtCore
#----------------------------------------------------------------------------------------------+
# This macro should help prepare a multi-part-analysis as much as possible with automatization |
#----------------------------------------------------------------------------------------------+
# Create a Bollean Fragment CompSolid
#------------------------------------
j = BOPTools.SplitFeatures.makeBooleanFragments(name=QtGui.QInputDialog.getText(None, "Part Label", "Enter new label:")[0])
j.Objects = Gui.Selection.getSelection()
j.Mode = 'CompSolid'
j.Proxy.execute(j)
j.purgeTouched()
j.recompute(True)
for obj in j.ViewObject.Proxy.claimChildren():
obj.ViewObject.hide()
# Creat FEM Analysis Container
#-----------------------------
Gui.activateWorkbench("FemWorkbench")
ObjectsFem.makeAnalysis(FreeCAD.ActiveDocument, 'Analysis')
FemGui.setActiveAnalysis(FreeCAD.ActiveDocument.ActiveObject)
ObjectsFem.makeSolverCalculixCcxTools(FreeCAD.ActiveDocument)
FemGui.getActiveAnalysis().addObject(FreeCAD.ActiveDocument.ActiveObject)
FreeCAD.ActiveDocument.recompute()
# Create the materials you will asked about the amount of materials and non Linear materials
#-------------------------------------------------------------------------------------------
#Input material amount needed
anzah=QtGui.QInputDialog.getInt(None, "Input", "How much materials are needed:")[0]
#Input non-linear material amount needed
anzahNL=QtGui.QInputDialog.getInt(None, "Input", "How much NON-LINEAR materials are needed:")[0]
if anzahNL ==0 & anzah >0:
while anzah > 0:
FemGui.getActiveAnalysis().addObject(ObjectsFem.makeMaterialSolid(FreeCAD.ActiveDocument))
#FreeCADGui.ActiveDocument.setEdit(FreeCAD.ActiveDocument.ActiveObject.Name)
anzah = anzah - 1
print (anzah)
else:
while anzah > 0:
FemGui.getActiveAnalysis().addObject(ObjectsFem.makeMaterialSolid(FreeCAD.ActiveDocument))
#FreeCADGui.ActiveDocument.setEdit(FreeCAD.ActiveDocument.ActiveObject.Name)
anzah = anzah - 1
FemGui.getActiveAnalysis().addObject(ObjectsFem.makeMaterialMechanicalNonlinear(FreeCAD.ActiveDocument, FreeCAD.ActiveDocument.getObject('MaterialSolid')))
#FreeCADGui.ActiveDocument.setEdit(FreeCAD.ActiveDocument.ActiveObject.Name)
FreeCAD.ActiveDocument.recompute()
#Create a Gmsh container with question if mesh region for refinement is also needed
#
# Here is a problem the gmsh container is placed but after meshing an error occurs
# >>> Unexpected error when creating mesh: <class 'AttributeError'>
# I think it is because the part(CompSolid) was not selected
#----------------------------------------------------------------------------------
#Input mesh size needed
mshsiz=QtGui.QInputDialog.getDouble(None, "Input", "Enter your target mesh size (0 = automatic):")[0]
j=ObjectsFem.makeMeshGmsh(FreeCAD.ActiveDocument, 'FEMMeshGmsh')
#FreeCAD.ActiveDocument.ActiveObject.Part = FreeCAD.ActiveDocument.Cylinder
FemGui.getActiveAnalysis().addObject(FreeCAD.ActiveDocument.ActiveObject)
#FreeCADGui.ActiveDocument.setEdit(FreeCAD.ActiveDocument.ActiveObject.Name)
j.CharacteristicLengthMax = mshsiz # from msgbox input mesh size
FreeCAD.ActiveDocument.recompute()
reply = QtGui.QMessageBox.question(None, "", "Did you like to select a mesh region for refinement?",
QtGui.QMessageBox.Yes | QtGui.QMessageBox.No, QtGui.QMessageBox.No)
if reply == QtGui.QMessageBox.Yes:
# Dialog for selecting mesh regions for refinement
App.activeDocument().addObject("Fem::ConstraintForce","ConstraintForce")
App.activeDocument().ConstraintForce.Force = 1.0
App.activeDocument().ConstraintForce.Reversed = False
App.activeDocument().ConstraintForce.Scale = 1
App.activeDocument().Analysis.addObject(App.activeDocument().ConstraintForce)
# This deactivated code below I don't know if its needed it should be checked
#--------------------------------------------------------------------------------
# for amesh in App.activeDocument().Objects:
# if "ConstraintForce" == amesh.Name:
# amesh.ViewObject.Visibility = True
# elif "Mesh" in amesh.TypeId:
# aparttoshow = amesh.Name.replace("_Mesh","")
# for apart in App.activeDocument().Objects:
# if aparttoshow == apart.Name:
# apart.ViewObject.Visibility = True
# amesh.ViewObject.Visibility = False
App.ActiveDocument.recompute()
App.activeDocument().addObject("Fem::ConstraintFixed","ConstraintFixed")
App.activeDocument().ConstraintFixed.Scale = 1
App.activeDocument().Analysis.addObject(App.activeDocument().ConstraintFixed)
# This deactivated code below I don't know if its needed it should be checked
#--------------------------------------------------------------------------------
# for amesh in App.activeDocument().Objects:
# if "ConstraintFixed" == amesh.Name:
# amesh.ViewObject.Visibility = True
# elif "Mesh" in amesh.TypeId:
# aparttoshow = amesh.Name.replace("_Mesh","")
# for apart in App.activeDocument().Objects:
# if aparttoshow == apart.Name:
# apart.ViewObject.Visibility = True
# amesh.ViewObject.Visibility = False
App.ActiveDocument.recompute()
# Creat mesh groupe and open the dialog for refinement
#Input mesh size needed
mshrefsiz=QtGui.QInputDialog.getDouble(None, "Input", "Enter your target refinement mesh size (0 = automatic):")[0]
k=ObjectsFem.makeMeshRegion(FreeCAD.ActiveDocument, FreeCAD.ActiveDocument.FEMMeshGmsh)
k.CharacteristicLength =mshrefsiz
FreeCADGui.ActiveDocument.setEdit(FreeCAD.ActiveDocument.ActiveObject.Name)
FreeCAD.ActiveDocument.recompute()
# If no mesh region for refinement is selected
#---------------------------------------------
if reply == QtGui.QMessageBox.No:
App.activeDocument().addObject("Fem::ConstraintForce","ConstraintForce")
App.activeDocument().ConstraintForce.Force = 1.0
App.activeDocument().ConstraintForce.Reversed = False
App.activeDocument().ConstraintForce.Scale = 1
App.activeDocument().Analysis.addObject(App.activeDocument().ConstraintForce)
# This deactivated code below I don't know if its needed it should be checked
#--------------------------------------------------------------------------------
# for amesh in App.activeDocument().Objects:
# if "ConstraintForce" == amesh.Name:
# amesh.ViewObject.Visibility = True
# elif "Mesh" in amesh.TypeId:
# aparttoshow = amesh.Name.replace("_Mesh","")
# for apart in App.activeDocument().Objects:
# if aparttoshow == apart.Name:
# apart.ViewObject.Visibility = True
# amesh.ViewObject.Visibility = False
App.ActiveDocument.recompute()
App.activeDocument().addObject("Fem::ConstraintFixed","ConstraintFixed")
App.activeDocument().ConstraintFixed.Scale = 1
App.activeDocument().Analysis.addObject(App.activeDocument().ConstraintFixed)
# This deactivated code below I don't know if its needed it should be checked
#--------------------------------------------------------------------------------
# for amesh in App.activeDocument().Objects:
# if "ConstraintFixed" == amesh.Name:
# amesh.ViewObject.Visibility = True
# elif "Mesh" in amesh.TypeId:
# aparttoshow = amesh.Name.replace("_Mesh","")
# for apart in App.activeDocument().Objects:
# if aparttoshow == apart.Name:
# apart.ViewObject.Visibility = True
# amesh.ViewObject.Visibility = False
App.ActiveDocument.recompute()
# Run Gmsh and create the mesh >> that only will be done if no refinement must be done
#-------------------------------------------------------------------------------------
# here the gmsh process should start
I hope we get it running
Thanks and Greetings
Nanayaw
- Attachments
-
- Result_Macro.FCStd
- (14.13 KiB) Downloaded 71 times
-
- Before_Macro.FCStd
- (6 KiB) Downloaded 88 times
Re: Linear / Non-linear Static >> 4-Parts with 4-plastic materials tutorial and results
Hello All
the analysis with Ansis is done and I will review it this week
and then I will share the results and a compare result between
FreeCAD and Ansis
Greetings
Nanayaw
the analysis with Ansis is done and I will review it this week
and then I will share the results and a compare result between
FreeCAD and Ansis
Greetings
Nanayaw
Re: Linear / Non-linear Static >> 4-Parts with 4-plastic materials tutorial and results
COOL! Looking forward to the result comparison!
Re: Linear / Non-linear Static >> 4-Parts with 4-plastic materials tutorial and results
Hello James
last week we was bussy, hopefully coming week I could provide.
A 100% compare will not be possible cause Ansys handle things different
specially it is not possible to cerate a mesh with 1th Order, but we will see.
Greetings
Nanayaw
last week we was bussy, hopefully coming week I could provide.
A 100% compare will not be possible cause Ansys handle things different
specially it is not possible to cerate a mesh with 1th Order, but we will see.
Greetings
Nanayaw
- Pauvres_honteux
- Posts: 728
- Joined: Sun Feb 16, 2014 12:05 am
- Location: Far side of the moon
Re: Linear / Non-linear Static >> 4-Parts with 4-plastic materials tutorial and results
Hello All
here the results, they are different.
I will try to also get the von mieses stress
Any ideas why the results are suxch different?
Greetings
Nanayaw
here the results, they are different.
I will try to also get the von mieses stress
Any ideas why the results are suxch different?
Greetings
Nanayaw
- Attachments
-
- Simulation_4Parts_4Materials_Linear_Static_RESULTS.odp
- (646.23 KiB) Downloaded 81 times