## [SOLVED but hack is required] *INITIAL CONDITIONS, TYPE=STRESS

About the development of the FEM module/workbench.

Moderator: bernd

EkaitzEsteban
Posts: 98
Joined: Wed Sep 12, 2018 1:31 pm

### [SOLVED but hack is required] *INITIAL CONDITIONS, TYPE=STRESS

Hello,

Reading the calculix manual, I found a card that allows to generate residual stresses at the beginning on the simulation.

CalculiX CrunchiX USER’S MANUAL version 2.13 (in page 291)

6.11.7 Initial(residual) stresses
In each integration point of an element a residual stress tensor can be specified
by the keyword *INITIAL CONDITIONS, TYPE=STRESS. The residual stress
should be defined before the first *STEP card.

and in page 406

Following line for TYPE=STRESS if USER is not specified:

Element number.
Integration point number. # (what is this?)
Value of first stress component (xx) in the GLOBAL coordinate system x-y-z.
Value of second stress component (yy) in the GLOBAL coordinate system x-y-z.
Value of third stress component (zz) in the GLOBAL coordinate system x-y-z.
Value of fourth stress component (xy) in the GLOBAL coordinate system x-y-z.
Value of fifth stress component (xz) in the GLOBAL coordinate system x-y-z.
Value of sixth stress component (yz) in the GLOBAL coordinate system x-y-z.
Etc.
Repeat this line if needed. The stress components should be given in the form of second Piola-Kirchhoff stresses.
...

The idea is to apply solely to one element (e.g. one C3D10 tetrahedron) an initial residual stress. Imagine that we have a cantilever beam, we select solely one element, and this element contains a residual stress due to some errors during a manufacturing process.

How can I simulate that?

I assume that the input file code should be something like that:

Code: Select all

``````*INITIAL CONDITIONS, TYPE=STRESS
22,?,(xx),(yy),(zz),(xy),(xz),(yz) # element 22 6 values of the stress tensor
28,?,(xx),(yy),(zz),(xy),(xz),(yz) # element 28 6 values of the stress tensor
33,?,(xx),(yy),(zz),(xy),(xz),(yz) # element 33 6 values of the stress tensor
... ``````
But I dont find examples in the literature about that...

Anyone knows or have experience about that?

If it is not possible to do that, is there any other way for simulating (initial) residual stresses?

I was thinking on applying a known pressure force to all faces of one element and then simulate using *perturbation card...

best regards,
Ekaitz.

EDIT: This question is related with my other doubts https://forum.freecadweb.org/viewtopic.php?f=18&t=31489 and https://forum.freecadweb.org/viewtopic.php?f=18&t=31421
Last edited by EkaitzEsteban on Tue Oct 16, 2018 10:02 am, edited 1 time in total.
Jee-Bee
Posts: 1869
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

### Re: [Help, info] *INITIAL CONDITIONS, TYPE=STRESS

maybe here are some clues...
http://www.feacluster.com/CalculiX/ccx_ ... conditions

(check examples!!)
fandaL
Posts: 327
Joined: Thu Jul 24, 2014 8:29 am

### Re: [Help, info] *INITIAL CONDITIONS, TYPE=STRESS

You can ask ccx to write element stresses into the .dat file by

Code: Select all

``````*EL PRINT
S``````
you will obtain something like:

Code: Select all

``````stresses (elem, integ.pnt.,sxx,syy,szz,sxy,sxz,syz) for set EALL and time  0.1000000E+01

109   1 -1.939353E+01 -1.272398E-03  2.760113E-01 -2.675997E-01  7.474604E-01  3.491194E-02
109   2 -2.050975E+01  2.643309E-01  3.492600E-01 -6.433597E-02  6.794285E-01  8.911350E-03
109   3  4.508082E+00 -5.421642E-01 -4.496278E-01  2.525728E-01  1.237072E+00  2.279122E-02
109   4 -2.058176E+01  2.601777E-01  3.340610E-01 -4.802395E-02  1.236241E+00  1.259256E-02
110   1  1.458711E+01 -9.622507E-02 -2.570379E-01  1.597888E-01  1.074414E+00 -2.492914E-01
110   2 -1.526543E+01 -8.273347E-02  1.337699E-01  2.954473E-01  1.423854E+00 -6.674795E-03
110   3 -1.393844E+01 -1.939466E-01  1.671769E-01 -8.237253E-02  1.243711E+00  4.504817E-02
110   4  1.463911E+01  7.136553E-01  2.175811E-02 -2.892563E-01  7.334136E-01 -1.173981E-01
...``````
which is the output for the element number 109 at integration points 1, 2, 3, 4, and the element 110 at its integration points 1, 2, 3, 4.

Integration points are points inside the element which are used during the integration over the element volume needed to calculate stresses. Mathematically you get the most precise stress values there. (Nodal stresses are extrapolated later from them.) Different element types have different integration scheme leading to different number of integration points (result precision). Look at figures related to C3D8, C3D8R, C3D20 elements
http://www.feacluster.com/CalculiX/ccx_ ... ode25.html
http://www.feacluster.com/CalculiX/ccx_ ... ode26.html
http://www.feacluster.com/CalculiX/ccx_ ... ode28.html
C3D10 has 4 integration points, C3D4 has only 1.
EkaitzEsteban
Posts: 98
Joined: Wed Sep 12, 2018 1:31 pm

### Re: [Help, info] *INITIAL CONDITIONS, TYPE=STRESS

Jee-Bee wrote:
Thu Oct 11, 2018 5:08 pm
maybe here are some clues...
http://www.feacluster.com/CalculiX/ccx_ ... conditions

(check examples!!)
Thank you Jee-Bee I will check the examples.
EkaitzEsteban
Posts: 98
Joined: Wed Sep 12, 2018 1:31 pm

### Re: [Help, info] *INITIAL CONDITIONS, TYPE=STRESS

fandaL wrote:
Thu Oct 11, 2018 8:12 pm
You can ask ccx to write element stresses into the .dat file by

Code: Select all

``````*EL PRINT
S``````
you will obtain something like:

Code: Select all

``````stresses (elem, integ.pnt.,sxx,syy,szz,sxy,sxz,syz) for set EALL and time  0.1000000E+01

109   1 -1.939353E+01 -1.272398E-03  2.760113E-01 -2.675997E-01  7.474604E-01  3.491194E-02
109   2 -2.050975E+01  2.643309E-01  3.492600E-01 -6.433597E-02  6.794285E-01  8.911350E-03
109   3  4.508082E+00 -5.421642E-01 -4.496278E-01  2.525728E-01  1.237072E+00  2.279122E-02
109   4 -2.058176E+01  2.601777E-01  3.340610E-01 -4.802395E-02  1.236241E+00  1.259256E-02
110   1  1.458711E+01 -9.622507E-02 -2.570379E-01  1.597888E-01  1.074414E+00 -2.492914E-01
110   2 -1.526543E+01 -8.273347E-02  1.337699E-01  2.954473E-01  1.423854E+00 -6.674795E-03
110   3 -1.393844E+01 -1.939466E-01  1.671769E-01 -8.237253E-02  1.243711E+00  4.504817E-02
110   4  1.463911E+01  7.136553E-01  2.175811E-02 -2.892563E-01  7.334136E-01 -1.173981E-01
...``````
which is the output for the element number 109 at integration points 1, 2, 3, 4, and the element 110 at its integration points 1, 2, 3, 4.

Integration points are points inside the element which are used during the integration over the element volume needed to calculate stresses. Mathematically you get the most precise stress values there. (Nodal stresses are extrapolated later from them.) Different element types have different integration scheme leading to different number of integration points (result precision). Look at figures related to C3D8, C3D8R, C3D20 elements
http://www.feacluster.com/CalculiX/ccx_ ... ode25.html
http://www.feacluster.com/CalculiX/ccx_ ... ode26.html
http://www.feacluster.com/CalculiX/ccx_ ... ode28.html
C3D10 has 4 integration points, C3D4 has only 1.
Thank you FandaL. I will report your inputs.
EkaitzEsteban
Posts: 98
Joined: Wed Sep 12, 2018 1:31 pm

### Re: [Help, info] *INITIAL CONDITIONS, TYPE=STRESS

Hello,

I will post some inputs.

Using *INITIAL CONDITIONS, TYPE=STRESS card it is possible to simulate residual stress without requiring fixed boundary conditions and without adding loads. This can be done by typing in input file (it is an example C3D10 element with 4 integration points):

Code: Select all

``````*INITIAL CONDITIONS,TYPE=STRESS
59,1,100000.,100000.,100000.,0.,0.,0. # element 59, integration point 1, xx,yy,zz,xy,xz,yz [Residual stress in Mpa]
59,2,100000.,100000.,100000.,0.,0.,0. # element 59, integration point 2, xx,yy,zz,xy,xz,yz [Residual stress in Mpa]
59,3,100000.,100000.,100000.,0.,0.,0. # element 59, integration point 3, xx,yy,zz,xy,xz,yz [Residual stress in Mpa]
59,4,100000.,100000.,100000.,0.,0.,0. # element 59, integration point 4, xx,yy,zz,xy,xz,yz [Residual stress in Mpa]

*STEP
*STATIC

***********************************************************
** Outputs --> frd file
** written by write_outputs_types function
*NODE FILE
U
*EL FILE
S, E
** outputs --> dat file
*NODE PRINT , NSET=Nall
U
*EL PRINT , ELSET=Eall
S

***********************************************************
** written by write_step_end function
*END STEP ``````
However, this is imposible to do using FreeCAD GUI because, material, boundary condition and input force is mandatory to simulate a static step.
It must be hacked by assuming for example a frequency analysis and then manually editing the .inp file including this kind of simulations and removing the frequency card.

It works and here the result. Element 59 has a residual stress colored in red
ResidualStress.PNG (65.24 KiB) Viewed 156 times
Thank you Jee-Bee and FandaL for your help!