← Back to team overview

yade-users team mailing list archive

Simple test with 2 particles

 

Hi guys!

I just tried to figure out how I can make a simple test with 2 particles. The 
script is attached. However, I am not sure if everything is right since I got 
strange output results (but simulation seems to be ok). I used the 
StepDisplacer since it should be used to test such configurations. Furthermore, 
I used CFpmMat, just for testing.

I got zero normal force in the data file. Someone knows why?

The StepDisplacer seems not to depend on the time step (time step for the first 
iteration is smaller but displacement increment is always the same). Why?

The output starts with the second iteration. Why?

Can I use UniaxialStrainer as well for such tests?

By the way, are there some simple scripts for such tests available? It would 
be great to have something with a simpler materials. 

Thanks

Klaus
# -*- coding: utf-8 -*-
# encoding: utf-8
from yade import utils, ymport, qt

## definition of some colors for colored text output in terminal
BLUE = '\033[94m'
GREEN = '\033[92m'
YELLOW = '\033[93m'
RED = '\033[91m'
BLACK = '\033[0m'

#### short description of script
print BLUE+'Simple test for two particles to test contact law.'+BLACK

#### define parameters for the net
# mesh opening size
mos = 80/1000.
a = mos/sqrt(3)
# wire diameter
d = 2.7/1000.
# particle radius
radius = d*5


#### material definition
netMat = O.materials.append(CFpmMat(type=0,young=1e5,poisson=0.3,frictionAngle=radians(30),density=1000))

O.bodies.append( utils.sphere([0,0,0], radius, dynamic=False, wire=False, color=[1,0,0], highlight=False, material=netMat) )
O.bodies.append( utils.sphere([0,a,0], radius, dynamic=False, wire=False, color=[0,1,0], highlight=False, material=netMat) )

FixedSphere=O.bodies[0]
MovingSphere=O.bodies[1]


#### define simulation
interactionRadius=2.
O.engines=[
	StepDisplacer( ids=[1],mov=Vector3(0,+1e-3,0),rot=Quaternion().Identity,setVelocities=True ),
	ForceResetter(),
	InsertionSortCollider( [Bo1_Sphere_Aabb(aabbEnlargeFactor=interactionRadius,label='aabb')] ), 

	InteractionLoop(
	[Ig2_Sphere_Sphere_ScGeom(interactionDetectionFactor=interactionRadius,label='Ig2ssGeom')],
	[Ip2_CFpmMat_CFpmMat_CFpmPhys(cohesiveTresholdIteration=1,useAlphaBeta=True,Alpha=0.3,Beta=0.5,eta=1,tensileStrength=1e6,cohesion=1e6,strengthSoftening=0.5,label='interactionPhys')],
	[Law2_ScGeom_CFpmPhys_CohesiveFrictionalPM(label='interactionLaw')]
	),
	PyRunner(iterPeriod=1,command='myAddPlotData()')
]

#### time step definition for first time step to create cohesive link
O.dt=0.00001*utils.PWaveTimeStep();
O.step() # create cohesive link (cohesiveTresholdIteration=1)

#### initializes now the interaction detection factor
aabb.aabbEnlargeFactor=-1.
Ig2ssGeom.interactionDetectionFactor=-1.

## time step definition
O.dt=0.3*utils.PWaveTimeStep();

#### to see it
v=qt.Controller()
v=qt.View()

#### plot some results
from math import *
from yade import plot

plot.plots={'un':('Fn',)}

def myAddPlotData():
	try:
		i=O.interactions[FixedSphere.id,MovingSphere.id]
		plot.addData( Fn=i.phys.normalForce[0], un=(O.bodies[1].state.pos[1]-O.bodies[0].state.pos[1])-a )
		plot.saveGnuplot('net-2part')
	except:
		print "No interaction!"
		O.pause()

Follow ups