yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #09390
[Question #247453]: viscelastic contact
New question #247453 on Yade:
https://answers.launchpad.net/yade/+question/247453
This is my script. I didn't know why the script doesn't work?
I want to define the property of my material ( young poisson density ) and i want utilise this contact law .
Where is the problem
# -*- coding: utf-8
from yade import qt, plot
# Parameters
tc=0.001# collision time
en=0.3 # normal restitution coefficient
es=0.3 # tangential restitution coefficient
frictionAngle=radians(35)#
density=2700
young=69.0e9
poisson= 0.346
params=getViscoelasticFromSpheresInteraction(tc,en,es)
# default spheres material
dfltSpheresMat=O.materials.append(ViscElMat(poisson=poisson,density=density,frictionAngle=frictionAngle,**params))
O.dt=.002*tc # time step
# add 2 particles to the simulation
# they the default material (utils.defaultMat)
O.bodies.append([
# fixed: particle's position in space will not change (support)
utils.sphere(center=(0.5,0.5,0.5),radius=.2,fixed=True,material=dfltSpheresMat),
# this particles is free, subject to dynamics
utils.sphere((0.5,0.5,1),radius=.2,material=dfltSpheresMat)
])
# FUNCTIONAL COMPONENTS
# simulation loop -- see presentation for the explanation
O.engines=[
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb()]),
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom()], # collision geometry
[Ip2_ViscElMat_ViscElMat_ViscElPhys()], # collision "physics"
[Law2_ScGeom_ViscElPhys_Basic()], # contact law -- apply forces
),
NewtonIntegrator(damping=0.0,gravity=(0,0,-9.81)),
PyRunner(command='myAddData()', iterPeriod=20)
]
plot.plots={
'i':('t',), # plot t(i)
't':('v1','z1') # v1(t)
}
def myAddData():
b=O.bodies[1]
plot.addData(z1=b.state.pos[2], v1=b.state.vel.norm(), i=O.iter, t=O.time)
plot.plot(subPlots=False)
O.saveTmp()
## to see it
qt.View()
O.run()
Best Regards
--
You received this question notification because you are a member of
yade-users, which is an answer contact for Yade.