Principal Stress Plots

About the development of the FEM module/workbench.

Moderator: bernd

User avatar
HarryvL
Veteran
Posts: 1285
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

Re: Principal Stress Plots

Post by HarryvL »

HarryvL wrote: Tue Dec 25, 2018 2:32 am 1) download this file
2) change the file extension from ".txt" to ".psvm".
3) open in ParaView with file>load state.
4) when prompted ("Load Stata Data File Options") select "Choose File Names" and look for your .vtk file (here: cubetestprincipalstress.vtk)
5) investigate the settings of the Glyph filter
6) try to add Glyphs for major and intermediate principal stresses (first select cursor on cubetestprincipalstress.vtk when adding a Glyph !!!)
7) have fun !
Well, I couldn't resist and added two more Glyphs, so in total three, one for each principal stress. Usage same as described above.

TestCubePrincipalStress (2).txt
(569.47 KiB) Downloaded 81 times

TestCubePrincipalStress(2).png
TestCubePrincipalStress(2).png (370.07 KiB) Viewed 1767 times

Green = Major Principal Stress
Blue = Intermediate Principal Stress
Red = Minor Principal Stress
User avatar
HarryvL
Veteran
Posts: 1285
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

Re: Principal Stress Plots

Post by HarryvL »

And using the same State File on the Plate with Hole from here: https://forum.freecadweb.org/viewtopic. ... 30#p267160

Both stress plots are at the same scale !!

At 25% load:

Plate_with_Hole_0.25_Load.png
Plate_with_Hole_0.25_Load.png (532.11 KiB) Viewed 1763 times

At 100% load:

Plate_with_Hole_1.00_Load.png
Plate_with_Hole_1.00_Load.png (649.19 KiB) Viewed 1763 times

The stress concentration near the hole "evens out" at the expense of plastic strain.
EkaitzEsteban
Posts: 108
Joined: Wed Sep 12, 2018 1:31 pm

Re: Principal Stress Plots

Post by EkaitzEsteban »

Hello!

Merry Christmas 2018 everyone.
HarryvL wrote: Mon Dec 24, 2018 8:13 pm
HarryvL wrote: Sun Dec 23, 2018 8:56 am Ah ok, that's a ParaView quetion. Simply load the VTK file twice and select Surface representation for one and Glyphs for the other.
Oops, that's not quite right.

1) Open the VTK file and set filter to surface, with opacity reduced.
2) Add Glyph (Icon on toolbar) and set to Line.
3) Play with scaling etc. to get acceptable result.

See my next post for example.
It starts working (I am using my own scripts...) However, I am using first order elements (tetrahedral mesh) and the paraview option uniform spatial distribution doesnt work properly...

1) Open the VTK file and set filter to surface, with opacity reduced. (0.6 in my case)
2) Add Glyph (Icon on toolbar) and set to Line.
2a) Masking glyph mode - all points.
3) Play with scaling etc. to get acceptable result.
PrincipalStress_C3D4.PNG
PrincipalStress_C3D4.PNG (137.37 KiB) Viewed 1755 times
Harry, how do you do for coloring the glyphs (principal stress vectors)?

Can you share an .vtk file as an example?

best regards,
Ekaitz.
User avatar
HarryvL
Veteran
Posts: 1285
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

Re: Principal Stress Plots

Post by HarryvL »

EkaitzEsteban wrote: Tue Dec 25, 2018 7:30 am
Can you share an .vtk file as an example?
TestCubePrincipalStress_vtk.txt
(79.86 KiB) Downloaded 78 times
User avatar
HarryvL
Veteran
Posts: 1285
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

Re: Principal Stress Plots

Post by HarryvL »

HarryvL wrote: Sat Jun 23, 2018 11:05 pm Perforated (10x100mm) steel strip under uni-axial tension
Here are the FC file and Paraview State FIle for those who want to replicate the example of a perforated strip:

Perforated_Strip.fcstd
(22.8 KiB) Downloaded 70 times
Perforated_Strip_pvsm.txt
(269.43 KiB) Downloaded 74 times

Rename the last file to Perforated_Strip.pvsm
User avatar
HarryvL
Veteran
Posts: 1285
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

Re: Principal Stress Plots

Post by HarryvL »

HarryvL wrote: Thu Jun 21, 2018 9:10 pm A concrete wall 4.00x2.00x0.15m on 0.50x2.00x0.15m columns, loaded by self weight and 1MN distributed load on top ...
Concrete_Wall_2D.png
Concrete_Wall_2D.png (412.91 KiB) Viewed 1699 times


A 2D version of the earlier 3D analysis. Here I show Major, Minor and Intermediate Principal Stresses all with the same color convention, i.e.:

Blue = Compression
Red = Tension

Here are the FC and Paraview files:

Concrete_Wall_2D.fcstd
(11.96 KiB) Downloaded 66 times
Concrete_Wall_2D_pvsm.txt
(563.91 KiB) Downloaded 67 times

with the usual renaming required.
User avatar
HarryvL
Veteran
Posts: 1285
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

Re: Principal Stress Plots

Post by HarryvL »

HarryvL wrote: Wed Dec 26, 2018 10:25 pm
HarryvL wrote: Sat Jun 23, 2018 11:05 pm Perforated (10x100mm) steel strip under uni-axial tension
Here are the FC file and Paraview State FIle for those who want to replicate the example of a perforated strip:
And now in 2D:


Perforated_Strip_2D.png
Perforated_Strip_2D.png (946.3 KiB) Viewed 1694 times


White = Tension
Black = Compression (yes there is !)

The files:
Perforated_Strip_2D.fcstd
(34.02 KiB) Downloaded 63 times
Perforated_Strip_2D_pvsm.txt
(584.94 KiB) Downloaded 61 times

WARNING: The export of principal stresses to VTK in 2D only works for CalculiXccxTools object parameter "Beam Shell Result Output 3D" = False.
EkaitzEsteban
Posts: 108
Joined: Wed Sep 12, 2018 1:31 pm

Re: Principal Stress Plots

Post by EkaitzEsteban »

HarryvL wrote: Tue Dec 25, 2018 11:33 am
EkaitzEsteban wrote: Tue Dec 25, 2018 7:30 am
Can you share an .vtk file as an example?

TestCubePrincipalStress_vtk.txt
Thank you so much!
DamianBod
Posts: 5
Joined: Fri Jun 12, 2020 11:37 pm

Re: Principal Stress Plots

Post by DamianBod »

HarryvL wrote: Sat Dec 22, 2018 9:40 pm Thanks @EkaitzEsteban.

I calculate eigenvectors in src/Mod/Fem/feminout/importToolsFem.py and export them to VTK in src/Mod/Fem/App/FemVTKTools.cpp so that they are available in ParaView for plotting.

The white arrows are indeed the maximum principal stress vectors and the colors the von Mises stresses.

I will try to create a git repository re-based on the most recent FreeCAD master with the version that exports principal stresses to VTK so you can compile and test.

Harry
Hello Harry,

I admit your work around plotting principal stress vectors is exactly what I was looking for and what is missed in FreeCAD for successful post-processing.

Best regards
Damian
DamianBod
Posts: 5
Joined: Fri Jun 12, 2020 11:37 pm

Re: Principal Stress Plots

Post by DamianBod »

HarryvL wrote: Sat Dec 22, 2018 9:40 pm
I calculate eigenvectors in src/Mod/Fem/feminout/importToolsFem.py and export them to VTK in src/Mod/Fem/App/FemVTKTools.cpp so that they are available in ParaView for plotting.

Harry
Hello,

I am the new FreeCAD user, that is why please forgive if my questions will be trivial or it will look like I would be lazy and did not want to check it myself (please believe me I am not, and I decided to contact with forum members after many tries to deal on my own with my problem with FreeCAD :cry: ) . I started to work with FreeCAD about one month ago and I find it is a very powerful package. I work with FreeCAD 0.18 on Windows 10 platform. After couple days in FreeCAD and performed analyses, I started to look how I can review principal stress vectors and their orientation/direction that is an important issue for me. That is why I looked for such postprocessing feature in FreeCAD, unfortunately as you all know it is not a default feature yet. Afterwards, I found HarryvL's post (https://forum.freecadweb.org/viewtopic. ... 18&t=29381) that gave me a hope for further usage of FreeCAD.
I would like to get the same results as Harry doing two steps that he mentioned in one of his posts. Unfortunately, it is not clear for me how to use two functions he wrote:

1. calculate eigenvectors in src/Mod/Fem/feminout/importToolsFem.py
2. export them to VTK in src/Mod/Fem/App/FemVTKTools.cpp so that they are available in ParaView for plotting

Question no.1 : "importToolsFem.py" I can use by executing a macro. Am I right?

Question no.2 : Unfortunately I do not know how to use "FemVTKTools.cpp" (I understand that it is C++ file - probably I should compile it in some way). I found this file in master repository on https://github.com/FreeCAD/FreeCAD, but I do not know how to deal with it. I would very appreciate if someone could explain to me how execute file "FemVTKTools.cpp" and to obtain such results postprocessing like presented under the link https://wiki.freecadweb.org/Post-Proces ... h_Paraview (subsection "Representation of Vector Results with the Glyph 3D Filter" of the post). Unfortunately when I export VTK file from FreeCAD to ParaView (without usage of importToolsFem.py and FemVTKTools.cpp) I can only choose glyphs orientation like you can see below (DisplacementVectors, StressVectors, StraiVectors - NO MAJOR, MID, MINOR principal stress):

Attachment_2.png
Attachment_2.png (556.29 KiB) Viewed 1299 times

I hope someone will help me or at least give me some advices that will lead me to the goal. Any advice is precious for me :)

Best regards
FreeCAD beginner ... Damian :)
Post Reply