← Back to team overview

yade-users team mailing list archive

Re: [Question #643798]: gridpfacet.cylinder interacting with walls, spheres, facetbox etc.

 

Question #643798 on Yade changed:
https://answers.launchpad.net/yade/+question/643798

    Status: Open => Answered

Klaus Thoeni proposed the following answer:
Hi Andrea,

you have to understand how "rounded cylinders" work in yade. They are
made of gridNodes (equivalent to a sphere) and a connection/interaction.
The interaction between such a cylinder and a wall would only be via the
gridNodes. In addition, for these cylinders you should use pFactes
instead of facets. I adapted one of my scripts, see below.

HTH
Klaus

from yade.gridpfacet import *

##### Parameter ####
r=1		# radius cylinder
phi=30.	# friction angle
E=1e7		# Young's modulus

#### Engines ####
O.engines=[
	ForceResetter(),
	InsertionSortCollider([
		Bo1_Sphere_Aabb(),
		Bo1_Wall_Aabb(),
		Bo1_PFacet_Aabb(), 
	]),
	InteractionLoop([
		Ig2_GridNode_GridNode_GridNodeGeom6D(),
		Ig2_Wall_Sphere_ScGeom(),
		Ig2_Sphere_PFacet_ScGridCoGeom(),
	],
	[
		Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=True,setCohesionOnNewContacts=False),	# internal cylinder physics
		Ip2_FrictMat_FrictMat_FrictPhys()	# physics for external interactions, i.e., cylinder-cylinder interaction
	],
	[
		Law2_ScGeom6D_CohFrictPhys_CohesionMoment(),	# contact law for "internal" cylinder forces
		Law2_ScGeom_FrictPhys_CundallStrack(),
	]
	),
	NewtonIntegrator(gravity=(-0.,0,-10),damping=0.5,label='newton'),
]

#### Creat materials ####
O.materials.append( CohFrictMat( young=E,poisson=0.3,density=1000,frictionAngle=radians(phi),normalCohesion=1e10,shearCohesion=1e10,momentRotationLaw=True,label='cMat' ) )  # material to create the gridConnections
O.materials.append( FrictMat( young=E,poisson=0.3,density=1000,frictionAngle=radians(phi),label='fMat' ) )  # material for general interactions

#### Create box and wall ####
wallId = O.bodies.append( wall(position=(0,0,-r),sense=0, axis=2,color=[0,1,1],material='fMat') )
O.bodies[wallId].state.vel=Vector3(1.,0,0)
O.bodies[wallId].mask=3

#### Create cylinder ####
nodeIds=[]
cylIds=[]
nodeIds.append( O.bodies.append( gridNode([0,2*r,0],r,wire=False,fixed=False,material='cMat',color=[1,0,0]) ) )
nodeIds.append( O.bodies.append( gridNode([0,2*r,2*r],r,wire=False,fixed=False,material='cMat',color=[1,0,0]) ) )

for id in nodeIds:
  O.bodies[id].bounded=1
  O.bodies[id].mask=2

cylIds.append( O.bodies.append(
gridConnection(nodeIds[1],nodeIds[0],r,color=[1,0,0],material='fMat') )
)


#### Creat a pFacets -> based on 3 vertices ####

v1=Vector3(0,4*r,0)
v2=Vector3(20*r,-r,0)
v3=Vector3(20*r,-r,10*r)
vertices=[v1,v2,v3]
pfacetCreator1(vertices,r/2.,nodesIds=[],cylIds=[],pfIds=[],wire=False,color=[1,1,1],fixed=True,materialNodes='cMat',material='fMat')


#### For viewing ####
from yade import qt
qt.View()
Gl1_Sphere.stripes=True
qtr = qt.Renderer()
#qtr.wire=True
#qtr.intrWire=True
#qtr.intrPhys=True

#### Set a time step ####
O.dt=1e-05

#### Allows to reload the simulation ####
O.saveTmp()

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.