Torque output for STL

Asked by Nima Goudarzi

Hi

I'm trying to plot the torque-rotation curve for a vane rotating inside a granular sample. The vane has been imported as .stl file as
.
.
.
EO = ymport.stl('/home/ngoudarzi/Desktop/Vane Shear Test/Light PSD Version/Homogeneous/YADE/Executables/Cad/Scaled_Vane_Regular_PSD2.stl',material=Stiff,shift=Vector3(0,0,-0.0635),wire=False,color=Vector3(0.5,0.6,0.8))
Vane= O.bodies.append(EO)
for i in Vane:
  shearVane= O.bodies[i]
  shearVane.dynamic=True
  shearVane.state.blockedDOFs='xyzXYZ' # THE ONLY FREE DOFs ARE TRANSLATION ALONG AND ROTATION ABOUT Z. AT FIRST ALL DOFs ARE RESTRIANED. MOVEMENT (USING CombinedKinematicEngine)
# WILL FREE DOFs IN THE DIRECTION OF MOVEMENT. ALL OTHER DOFs ARE STILL CONSTRAINED TO AVOID DEVIATION OF THE TOOL FROM Z AXIS.
VaneID = [b for b in O.bodies if isinstance(b.shape,Facet)] # LIST OF FACETS IN THE IMPORTED VANE
.
.
.

I can easily get the forces in all directions for the vane, but it seems that the torque calculation is not correct. I use a function as

def history():
  global vaneFx,vaneFy,vaneFz,vaneTx,vaneTy,vaneTz,vaneDx,vaneDy,vaneDz,vaneRotZ
  vaneFx=0
  vaneFy=0
  vaneFz=0
  vaneTx=0
  vaneTy=0
  vaneTz=0
  for b in VaneID:
    vaneFx+=O.forces.f(b.id,sync=True)[0]
    vaneFy+=O.forces.f(b.id,sync=True)[1]
    vaneFz+=O.forces.f(b.id,sync=True)[2]
    vaneTx+=O.forces.t(b.id,sync=True)[0]
    vaneTy+=O.forces.t(b.id,sync=True)[1]
    vaneTz+=O.forces.t(b.id,sync=True)[2]
  vaneDx=rotEngine.zeroPoint[0]
  vaneDy=rotEngine.zeroPoint[1]
  vaneDz=rotEngine.zeroPoint[2]
  vaneRotZ=(shearVane.state.rot().norm())*(180/math.pi)
  yade.plot.addData({'i':O.iter,'vaneFx':vaneFx,'vaneFy':vaneFy,'vaneFz':vaneFz,'vaneTx':vaneTx,'vaneTy':vaneTy,'vaneTz':vaneTz,'vaneDx':vaneDx,'vaneDy':vaneDy,'vaneDz':vaneDz,'vaneRotZ':vaneRotZ,})

The values of torque are so small (e-20). Noteworthy that I have experimental results of the same test and know the trend of the torque rotation.

Am I missing anything regarding torque calculation for the imported stl?

Thanks so much

Question information

Language:
English Edit question
Status:
Answered
For:
Yade Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Karol Brzezinski (kbrzezinski) said :
#1

Hi Nima,

I guess that you want to compute 'global' torque acting on your 'vane' (driving torque of your tool/probe). So you need to include the torque from all the forces:
Moment of force = F x d
F is the force applied, d is the distance from the fixed axis (vane axis).

Cheers,
Karol

Revision history for this message
Karol Brzezinski (kbrzezinski) said :
#2

Just a comment: instead of using CombinedKinematicEngine, I would clump all the facets together, and drive them as one body.

Cheers,
Karol

Revision history for this message
Nima Goudarzi (nimagoudarzi58) said :
#3

Hi
Thanks for the comment. How to do so for my case ( the part of the script I posted earlier). Also, do you mean that I need to avoid combinedKinematicEngine and using simple translation and rotation?

Best,

Nima

> On Sep 11, 2022, at 2:56 AM, Karol Brzezinski <email address hidden> wrote:
>
> Your question #703121 on Yade changed:
> https://answers.launchpad.net/yade/+question/703121
>
> Karol Brzezinski posted a new comment:
> Just a comment: instead of using CombinedKinematicEngine, I would clump
> all the facets together, and drive them as one body.
>
> Cheers,
> Karol
>
> --
> You received this question notification because you asked the question.

Revision history for this message
Karol Brzezinski (kbrzezinski) said :
#4

Hi,

I cannot test it right now on the computer, but it would be something like this:

clumpId = O.bodies.appendClumped(EO)

You, can drive this clump as one body by changing velocity, and angular velocity (angVel).

O.bodies[clumpId].state.angVel = (0,0,1)

All the degrees of freedom should stay blocked. This way you obtain kinematic boundary condition. If you want to have constant force or moment, you will need to program a servo.

You can alternatively make clump dynamic, apply mass and inertia and release degrees of freedom. In such a way, you will be able to controll it by applying force.

Cheers,
Karol

PS I don't know if it works well with mpi.

Revision history for this message
Vasileios Angelidakis (vsangelidakis) said :
#5

Hello,
I think you will find the TorqueRecorder [1] useful in your case, which implements exactly what Karol suggests.
Clumping is an option, but I think the Kinematic Engines should work well for groups of facets even without it (I have used them to rotate groups of facets several times).

Hope this helps,
Vasileios

[1] https://yade-dem.org/doc/yade.wrapper.html?highlight=torquerecorder#yade.wrapper.TorqueRecorder

Revision history for this message
Nima Goudarzi (nimagoudarzi58) said :
#6

Thanks, Vasileios

Is there any working example for the TorqueRecorder?

Regards

Revision history for this message
Vasileios Angelidakis (vsangelidakis) said :
#7

Hi Nima,

I don' think we have one in the examples. You can verify how the function works yourself: Give a set of torques to a body using the TorqueEngine [1], and then record them using TorqueRecorder(ids=[...], rotationAxis=Vcetor3(...), zeroPoint=Vector3(...), file='...', iterPeriod=...). I think each attribute is described adequately in the docs.

Best,
Vasileios

[1] https://yade-dem.org/doc/yade.wrapper.html?highlight=torqueengine#yade.wrapper.TorqueEngine

Can you help with this problem?

Provide an answer of your own, or ask Nima Goudarzi for more information if necessary.

To post a message you must log in.