forcerecorder and O.force.t does not give correct value
Hi,
I am trying to insert a big clump into a bed of spheres, displace this clump in the spheres and record force and torque on this clump.
However, the torque I get does not seem to make sense.
I tried both O.forces.t and torque recorder.
The O.forces.t gives torque that does not match the force on the clump (the force is about 100 N and 0.15 meter away from the center of the clump but the torque recorded is only about 5N*m.
The torque recorder gives values that does not make much sense. I guess the value it recorded depends on the rotation axis and zeroPoint. How are these defined w.r.t to? Are they in the global coordinates or the clump's local coordinates?
Below is the code if you want to take a look at it.
Thanks,
Yifan
#!/usr/bin/python
# -*- coding: utf-8 -*-
import random
from yade import ymport
from yade import qt
from yade import plot
import sys,time
factor=1
test='2'
level=4700*factor
## PhysicalParameters
sand=O.
#default=
default=
# Clump
clump1=
sphere([0,0,0.1], radius=
sphere(
sphere([0,0,0.2], radius=
sphere([0,0,0.25], radius=
sphere([0,0,0.3], radius=
sphere([0,0,0.35], radius=
sphere([0,0,0.4], radius=
])
#s=O.bodies.
#get clump ids:
ClumpID = clump1[0]
SpheresID = clump1[1]
O.bodies[
O.bodies[
O.bodies[
#print id_clump2
#Default Material:
#FrictMat(
# Spheres
sphereRadius = 0.01
#nbSpheres = (45,45,60)
nbSpheres=
# with 32,32,11 spheres settle around -0.08555m after 2s
surfacesphere=[]
print "Creating %d spheres.
for i in xrange(
for j in xrange(
for k in xrange(
x = (i*2 - nbSpheres[
y = (j*2 - nbSpheres[
z = -k*sphereRadius
r = random.
fixed = False
color=
if (i==0 or i==nbSpheres[0]-1 or j==nbSpheres[1]-1 or j==0 or k==nbSpheres[2]-1):
fixed = True
color=
tmp=
if k==0 and not fixed:
surfacesphe
print "done\n"
## Estimate time step
#O.dt=PWaveTime
O.dt=0.0001
def changeforce():
if O.iter <15000*factor:
O.bodies[
O.bodies[
O.bodies[
elif O.iter == 15000*factor:
O.bodies[
O.bodies[
O.bodies[
elif O.iter > 15000*factor and O.iter < 15000*factor+16000:
O.bodies[
elif O.iter >= 15000*factor+16000:
O.bodies[
def addPlotdata():
plot.addData(
#print O.bodies[
def savedata():
#pass
if O.iter > 40000*factor:
plot.
O.engines=[
## Resets forces and momenta the act on bodies
ForceResetter(),
##display all kinds of info here
## Using bounding boxes find possible body collisions.
InsertionSortC
Bo1_Sphere_
Bo1_Facet_Aabb(),
]),
InteractionLoop(
[Ig2_
#[Ip2_
[Ip2_
[Law2_
),
NewtonIntegrat
## Save force onClump
ForceRecorder(
TorqueRecorder
TorqueRecorder
TorqueRecorder
PyRunner(
PyRunner(
PyRunner(
]
nbIter=50000*factor
qt.View()
O.stopAtIter=nbIter
O.run()
Question information
- Language:
- English Edit question
- Status:
- Expired
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply: