~yade-dev/yade/0.80

« back to all changes in this revision

Viewing changes to examples/test/sphere-sphere-ViscElBasic-peri.py

  • Committer: Anton Gladky
  • Date: 2012-05-02 21:50:42 UTC
  • Revision ID: gladky.anton@gmail.com-20120502215042-v1fa9r65usqe7kfk
0.80.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- coding: utf-8
 
2
 
 
3
# Testing sphere-sphere interaction in periodic case.
 
4
# Pass, if the spheres moves along the X axis, interacting through the period.
 
5
 
 
6
from yade import utils
 
7
 
 
8
sphereRadius=0.1
 
9
tc=0.001# collision time 
 
10
en=1  # normal restitution coefficient
 
11
es=1  # tangential restitution coefficient
 
12
density=2700
 
13
frictionAngle=radians(35)# 
 
14
params=utils.getViscoelasticFromSpheresInteraction(tc,en,es)
 
15
sphereMat=O.materials.append(ViscElMat(density=density,frictionAngle=frictionAngle,**params))
 
16
 
 
17
 
 
18
# Spheres
 
19
sphId=O.bodies.append([
 
20
        utils.sphere( (0.4,0.5,0.5), 0.1, material=sphereMat),
 
21
        utils.sphere( (0.6,0.5,0.5), 0.1, material=sphereMat)
 
22
        ])
 
23
O.bodies[sphId[-1]].state.vel=(0.5,0,0)
 
24
O.bodies[sphId[0]].state.vel=(-0.5,0,0)
 
25
 
 
26
## Engines 
 
27
O.engines=[
 
28
        ForceResetter(),
 
29
        InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
 
30
        InteractionLoop(
 
31
                [Ig2_Sphere_Sphere_ScGeom()],
 
32
                [Ip2_ViscElMat_ViscElMat_ViscElPhys()],
 
33
                [Law2_ScGeom_ViscElPhys_Basic()],
 
34
        ),
 
35
        NewtonIntegrator(damping=0),
 
36
]
 
37
 
 
38
O.periodic=True
 
39
O.cell.setBox(1,1,1)
 
40
 
 
41
O.dt=.01*tc
 
42
 
 
43
O.saveTmp()
 
44