← Back to team overview

yade-dev team mailing list archive

Fwd: Another script with clumps

 

---------- Forwarded message ----------
From: Vincent Richefeu <richefeu@xxxxxxxxx>
Date: 2009/6/18
Subject: Another script with clumps
To: eudoxos@xxxxxxxx


Another script...
VR
# Parameters ====================================================================================

Kn = 1e6
Ks = 0.8e6
FrictionAngle = 0.5
en = 0.5 # this velocity after a choc / velocity before a choc

Density = 2500.0
Gravity = [0.0,-9.81,0.0]
Damping = 0.0 # Cundall damping

vx_init = 0.1

#================================================================================================
import math
ln_en = math.log(en)
Cn = -ln_en/math.sqrt((math.pow(ln_en,2) + math.pi*math.pi))
Cs = 0.0
print Cn
#================================================================================================

from yade import utils

O=Omega()

O.initializers=[
  BoundingVolumeMetaEngine([InteractingSphere2AABB(),InteractingBox2AABB(),MetaInteractingGeometry2AABB()])
  ]

O.engines=[
  PhysicalActionContainerReseter(),
  BoundingVolumeMetaEngine([
	InteractingSphere2AABB(),
	InteractingBox2AABB(),
	MetaInteractingGeometry2AABB()
	]),
  PersistentSAPCollider(),
  InteractionGeometryMetaEngine([
  InteractingSphere2InteractingSphere4SpheresContactGeometry(),
  InteractingBox2InteractingSphere4SpheresContactGeometry()
  ]),
  InteractionPhysicsMetaEngine([BasicViscoelasticRelationships()]),
  ConstitutiveLawDispatcher([ef2_Spheres_Viscoelastic_SimpleViscoelasticContactLaw()]),
  GravityEngine(gravity=Gravity),
  NewtonsDampedLaw(damping=Damping),
  StandAloneEngine('PositionRecorder',{'outputFile':'pos_1.dat'}),
  StandAloneEngine('VelocityRecorder',{'outputFile':'vel_1.dat'}),
#  StandAloneEngine('HistoryRecorder',{'interval':5000})
  ]

s =utils.box(center=[0,0,0],extents=[.05,.0001,.01],frictionAngle=FrictionAngle,dynamic=False,color=[1,0,0],density=1e10,physParamsClass='SimpleViscoelasticBodyParameters',physParamsAttr={'kn':Kn,'cn':Cn,'ks':Ks,'cs':Cs})
s['groupMask']=1

O.bodies.append(s)

s1 =utils.sphere(center=[0,0.02,0],frictionAngle=FrictionAngle,radius=0.0005,dynamic=True,color=[0,0,1],density=Density,physParamsClass='SimpleViscoelasticBodyParameters',physParamsAttr={'kn':Kn,'cn':Cn,'ks':Ks,'cs':Cs})
s1['groupMask']=1
#s.phys['velocity']=[vx_init,0,0]
O.bodies.append(s)

s2 =utils.sphere(center=[0,0.02,0.001],frictionAngle=FrictionAngle,radius=0.0005,dynamic=True,color=[0,0,1],density=Density,physParamsClass='SimpleViscoelasticBodyParameters',physParamsAttr={'kn':Kn,'cn':Cn,'ks':Ks,'cs':Cs})
s2['groupMask']=1
#s.phys['velocity']=[vx_init,0,0]
O.bodies.append(s)

clb,sph = O.bodies.appendClumped([s1,s2])
O.bodies[clb].phys['velocity']=[vx_init,0,0]
print O.bodies[clb].phys['inertia']
print O.bodies[clb].phys['mass']

O.dt = 1e-6
O.saveTmp('init')

from yade import qt
qt.Controller()
qt.View()