yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #23322
Re: [Question #691285]: Extract Normals and Shears/tangentials forces on a ballMill
Question #691285 on Yade changed:
https://answers.launchpad.net/yade/+question/691285
NGANDU KALALA Gauthier posted a new comment:
Hi Jan
Thank you for your last response. To be clear I complete somes informations to allow you to understand my project.
I'd like to controls the simulation of 0.5 m diameter and 0.3 m length laboratory ball mill. The aim is to extract and save at each time step of simulations the generalized forces(forces and torques), provided by interactions between facets and spheres, their contact point, and the overlap at each contact point. The shell was designed using CAD software and its mesh size file was obtained using GMSH software. and can be imported using ballmill.mesh in GMSH format.
I need to save periodically the informations , The mill is made of facets, and i need to save in the Txt format, which can be used with other softwares.
Here is my code
# DATA
# Geometry of the mill and Filling of the balls
length = 0.3 # [m] mill length
rMean = 0.75/2.0 # [m] profile mean radius (only for filling here)
rBall = 0.0075 # [m] ball radius
nBalls = 20000 # [-] number of balls
# Simulation
omega = 3.1416 # [rad/s] angular rotation speed
tEnd = 10 # [s] total simulation time
O.dt = 5.0e-6 # [s] fixed time step
tRec = 2.0e-2 # [s] recording interval
# imports of the modules necessary for reading the mesh
from yade import ymport,export
import math,os
if os.path.exists('output'):
print 'Delete old "output" directory.'
exit()
else:
os.makedirs('output')
print '\nBall Mill Simulation\n'
# Define the material of the mill and the balls.
millMat = O.materials.append(FrictMat(young=600.0e6,poisson=0.6,density=2.6e3,
frictionAngle=radians(26),label='Friction'))
ballMat = O.materials.append(FrictMat(young=600.0e6,poisson=0.6,density=2.6e3,
frictionAngle=radians(26),label='Friction'))
# Definition of geometry by importing to the simulation the mill mesh in
the GMSH format ".mesh".
mill = O.bodies.append(ymport.gmsh('mill.mesh',material=millMat,color=(1,1,1),
scale=1e-3))
walls = O.bodies.append([
utils.wall((0,0,0),1,material=millMat,color=(1,1,1)),
utils.wall((0,length,0),1,material=millMat,color=(1,1,1))
])
#The mill is filled by insering balls in horizontal planes which are
#progressively moving upwards until all balls have been added to the
#simulation.
#
# sweep gaps and initial coordinates
gap1 = 0.1*rBall # small gap to have no overlap
gap2 = 4*rBall # large gap to have no overlap (due to liner profile)
z = -rMean + rBall + gap2 # vertical coordinate
x = -math.sqrt((rMean-rBall)**2 - z**2) + gap2 # horizontal coordinate
y = rBall + gap1 # axial coordinate
for i in range(nBalls):
if y > length - rBall - gap1:
y = rBall + gap1
x = x + 2*rBall + gap1
if x > math.sqrt((rMean-rBall)**2 - z**2) - gap2:
z = z + 2*rBall + gap1
x = -math.sqrt((rMean-rBall)**2 - z**2) + gap2
O.bodies.append(utils.sphere(center=(x,y,z),radius=rBall,\
material=ballMat,color=(1,1,1)))
y = y + 2.0*rBall + gap1
print 'Number of balls: '+str(nBalls)+' [-]'
# the simulation is prepared by assembling the engines which
# will be successively called during the simulation loop.
#
rpm = omega*30/math.pi # [rpm] rotation speed
print 'Rotation speed: '+str(rpm)+' [rpm]'
O.engines=[
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb(),Bo1_Wall_Aabb()]),
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom(),
Ig2_Facet_Sphere_ScGeom(),
Ig2_Wall_Sphere_ScGeom()],
[Ip2_FrictMat_FrictMat_MindlinPhys()],
[Law2_ScGeom_MindlinPhys_Mindlin()] # The Hertz mindlin law or
),
RotationEngine(ids=mill,rotationAxis=[0,1,0],rotateAroundZero=True,
angularVelocity=omega),
NewtonIntegrator(damping=0,gravity=[0,0,-9.81]),
VTKRecorder(fileName=os.getcwd()+'/output/',
recorders=['spheres','facets','velocity'],
iterPeriod=int(math.ceil(tRec/O.dt)))
]
The simulation is run until reaching its end time.
O.run(int(math.ceil(tEnd/O.dt))+1)
What i need to do is, to add the code which can extract and save:
# - Generalized forces (forces and torque): normal and shear forces.
# - The contact points
# - The overlap corresponding of each contact point
# This can be done for each time-step of simulation
# The result can be saved in the files for post-processing
--
You received this question notification because your team yade-users is
an answer contact for Yade.