Applying a torque using FORCE and TRANSFORM constraints

About the development of the FEM module/workbench.

Moderator: bernd

user1234
Veteran
Posts: 3512
Joined: Mon Jul 11, 2016 5:08 pm

Re: Applying a torque using FORCE and TRANSFORM constraints

Post by user1234 »

What should i say? I also though (think) that is the case, but only can inform what i can see.

Greetings
user1234
user1234
Veteran
Posts: 3512
Joined: Mon Jul 11, 2016 5:08 pm

Re: Applying a torque using FORCE and TRANSFORM constraints

Post by user1234 »

Minimum example.

For the simplest case (short shaft, no bending), to get the tension of a torque is:

Code: Select all

D = 200.0 #mm
d = 180.0 #mm
T = 10000.0 #Nm

WP = math.pi / 16.0 * ( D ** 4.0 - d ** 4 ) / D

tau = T * 1000.0 / WP

print ( "D = " + str( D ) + " mm" )
print ( "d = " + str( d ) + " mm" )
print ( "T = " + str( T ) + " Nm" )
print ( "WP = " + str( WP ) + " mm³")
print ( "tau = " + str( tau ) + " N/mm²" ) #18.5N/mm²
Method A: 24 segments, every force in the rectangular lever direction. The problem on plane faces is, that you can not add force transformation tools.
method_A.png
method_A.png (265.79 KiB) Viewed 1495 times
displacement_A.gif
displacement_A.gif (699.01 KiB) Viewed 1495 times
mises_a.png
mises_a.png (329.07 KiB) Viewed 1495 times
tresca_A.png
tresca_A.png (244.52 KiB) Viewed 1495 times
test32_FEM_torque_A.FCStd
(39.63 KiB) Downloaded 34 times
Seems OK. Tresca (shear) around 18.5 N/mm². I will add a method B with transformation.

Greetings
user1234
user1234
Veteran
Posts: 3512
Joined: Mon Jul 11, 2016 5:08 pm

Re: Applying a torque using FORCE and TRANSFORM constraints

Post by user1234 »

So, now with transformation tools. Never used that before, because i never get that working. but with the example from the OP it works. The transformation tools only works, when the force is set in the Y-direction. In X not. Also you can only transform forces on radial surfaces, not on plane surfaces, also when they have radial boundaries.
Method_B_error.png
Method_B_error.png (230.64 KiB) Viewed 1476 times
Method_B.png
Method_B.png (447.23 KiB) Viewed 1476 times
mises_B.png
mises_B.png (145.93 KiB) Viewed 1476 times
tresca_B.png
tresca_B.png (144.86 KiB) Viewed 1476 times
test32_FEM_torque_B.FCStd
(19.67 KiB) Downloaded 32 times
The shear stress is also OK.

Greetings
user1234
user1234
Veteran
Posts: 3512
Joined: Mon Jul 11, 2016 5:08 pm

Re: Applying a torque using FORCE and TRANSFORM constraints

Post by user1234 »

Just saying that the displacements on both examples are also on point.

Code: Select all

import math

D = 200.0 # mm
d = 180.0 # mm
T = 10000.0 # Nm
l = 200.0 # mm
ny = 0.3 # 1
E = 210000.0 # N/mm²

G = 1.0 / ( 2.0 * ( 1.0 + ny ) ) * E
IP = math.pi / 32.0 * ( D ** 4.0 - d ** 4.0 )
phi = T * 1000.0 * l / ( G * IP )

print ( "G = " + str( G ) + " N/mm²" )
print ( "IP = " + str( IP ) + " N/mm⁴" )
print ( "phi = " + str( phi ) + " rad")
print ( "phi = " + str( phi * 180 / math.pi ) + " degree" )
while phi is

Code: Select all

phi = asin( displacement / D) 
On example A
FEM = 45.8640µm --> 0.026278degree
classic calculated = 0.026263degree

On example B (length is shorter)
FEM = 45.3326µm --> 0.025973degree
classic calculated = 0.024950degree

Greetings
user1234
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Applying a torque using FORCE and TRANSFORM constraints

Post by bernd »

cool example :D
user1234
Veteran
Posts: 3512
Joined: Mon Jul 11, 2016 5:08 pm

Re: Applying a torque using FORCE and TRANSFORM constraints

Post by user1234 »

The question if there are useful for you? You reactivate this thread, so what do you need?

In the usefulness i see some points:

- the transform only works if the force before is set in the Y direction (if the axis is in Z direction)
- you can not transform the face side of a diameter which leads me to an other question

I think that set a torque on a face side is not less important (clutches, flanges, heavy-walled shafts, .....). I am pretty sure, that the transforms only works on cylinder faces, because the force on every node is constant and on a face side of a cylinder not ( F(x,y) ). So here a some questions:

- do the TRANSFORM command feed the force direction up in Calulix after a iteration, because the vector of the force is every iteration a little bit an other because of the displacement (very small but there). In my example A this is clearly not the case. For very long shaft (10m) this can be important. The rule in the machine construction is a max. displacement of ~ 0.25° / 1m .

- if i a able to get a algorithm to get a array (list) of the nodes and their forces for a torque replacement, does it blow up the inp file?

Sorry for the noob questions.

Greetings
user1234
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Applying a torque using FORCE and TRANSFORM constraints

Post by bernd »

ATM we do not have such example in the FEM GUI examples. Thus I reactivated the topic because there might be someone who can help to do the math for the first example of the topic. I was not able to do them. The firste example is coded already but just not merged into the main FreeCAD. https://github.com/berndhahnebach/FreeC ... _torque.py IMHO for this we should use a example for which we are able to calculate the result with mechanical formulas.

I may have a look at your example too. But for this I would have need to write the code to generate the example by Python.
user1234
Veteran
Posts: 3512
Joined: Mon Jul 11, 2016 5:08 pm

Re: Applying a torque using FORCE and TRANSFORM constraints

Post by user1234 »

The load of the example is way to high to get serious results. 500Nm for a 1 mm thick pipe with 10mm outer diameter is way to high. I would set the load in Line 141 from:

Code: Select all

    force_constraint.Force = 100000.0
to

Code: Select all

    force_constraint.Force = 2500.0
. If i do that, i get good displacements results.

0.03340 calculated
0.0333980 FEM
.

Code: Select all

D = 10.0     # mm
d = 8.0      # mm
z = 50.0     # mm
T = 12.5     # Nm

ny = 0.3     # 1
E = 210000.0 # N/mm²

Wp = math.pi / 16.0 * ( D ** 4.0 - d ** 4 ) / D
G = 1.0 / ( 2.0 * ( 1.0 + ny ) ) * E
Ip = math.pi / 32.0 * ( D ** 4.0 - d ** 4.0 )

phi = T * 1000.0 * z / ( G * Ip * 2 )

print ( "--------------------------------------------------\n" )
print ( "classical distributed load function" )

print ( "phi = " + str( phi ) + " rad" )
print ( "phi = " + str( phi * 180.0 / math.pi ) + " °" )
print ( "dis = " + str( math.sin( phi ) * D / 2.0 ) + " mm" )
print ( "\n--------------------------------------------------\n\n" )



# calculated through steps
steps = 1000        # 1
dz = z / steps      # mm
dT = T * 1000.0 / z # Mm/mm
dphi = []
phi = 0.0
#z = []

for i in range( steps ):
    #z.append( dz * i + 0.5 * dz )
    dphi.append( dT * dz * ( steps - i ) * dz / ( G * Ip ) )

phi = sum( dphi )

print ( "--------------------------------------------------" )
print ( "finite step load" )

print ( "phi = " + str( phi ) + " rad" )
print ( "phi = " + str( phi * 180.0 / math.pi ) + " °" )
print ( "dis = " + str( math.sin( phi ) * D / 2.0 ) + " mm" )
print ( "\n--------------------------------------------------\n\n" )

Code: Select all

--------------------------------------------------

classical distributed load function
phi = 0.006675100852350753 rad
phi = 0.38245510666387666 °
dis = 0.03337525641040786 mm

--------------------------------------------------


--------------------------------------------------
finite step load
phi = 0.006681775953203104 rad
phi = 0.3828375617705405 °
dis = 0.033408631170372884 mm

--------------------------------------------------
But i want also control the shear stress. What is the easiest function to get the tau(z)? I want to see if the curve fits.

Greetings
user1234
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Applying a torque using FORCE and TRANSFORM constraints

Post by bernd »

user1234 wrote: Thu Jul 08, 2021 10:32 pm The load of the example is way to high to get serious results. 500Nm for a 1 mm thick pipe with 10mm outer diameter is way to high. I would set the load in Line 141 from:

Code: Select all

    force_constraint.Force = 100000.0
to

Code: Select all

    force_constraint.Force = 2500.0
. If i do that, i get good displacements results.
oh yeah and stress too. Before I got 7606 MPa. Even the best of Scottys material would break ...

would you edit your python code to calculate the deformation? It misses a "import math" at the beginning. Just if some beginner would test the code he might not know what to do.

cheers bernd
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Applying a torque using FORCE and TRANSFORM constraints

Post by bernd »

https://github.com/FreeCAD/FreeCAD/comp ... 388722a70d

appreciate your help in this regard. :D
Post Reply