← Back to team overview

yade-users team mailing list archive

[Question #691548]: periodic boundary in axial direction for particles in cylinder pipe

 

New question #691548 on Yade:
https://answers.launchpad.net/yade/+question/691548

Hi.
I would like to set up the periodic boundary condition for cylinder pipe. I read some test cases given in examples folder. But most of them are in a box. I try to set up a test case as,

#!/usr/bin/python
# -*- coding: utf-8 -*-
from yade import pack,ymport,export,geom,bodiesHandling,qt
import array as arr
import numpy as np
import math
import random

import os
import errno

dp = 1e3
O.periodic=True

# Add material
O.materials.append(FrictMat(young=10e9,poisson=.25,frictionAngle=0.5,density=dp,label='Par'))

# Parameters, which will be passed into facets creators
kwMeshes={'color':[1,1,0],'wire':True,'dynamic':False,'material':0}
oriBody = Quaternion(Vector3(1,0,0),(pi/2.0)) 
# Cylinder  
O.bodies.append(geom.facetCylinder((0.0,0.0,0.0),radius=0.05,height=0.8,orientation=oriBody,segmentsNumber=10,wallMask=4,**kwMeshes))

# Pack
sp=pack.SpherePack()
sp.makeCloud(minCorner=(-0.05,-0.25,-0.05),maxCorner=(0.05,0.25,0.05),rMean=.006,rRelFuzz=.5,periodic=True)
predicate = pack.inCylinder((0,-0.2,0),(0,0.2,0),0.0486)
sp = pack.filterSpherePack(predicate,sp,returnSpherePack=True)

for c,r in sp: 
	O.bodies.append(utils.sphere(c,r))
# Make a wall
O.bodies.append(wall((0,0,-0.5),axis=2))
# Compute the number of particles
n=-1
for b in O.bodies:
	if isinstance(b.shape,Sphere):
		n=n+1
print(n)
# Set the velocity for particles
for b in O.bodies:
	if isinstance(b.shape,Sphere):
		v1=random.uniform(-1.0,1.0)*0.1
		v2=random.uniform(0,1.0)*0.0001
		v3=random.uniform(-1.0,1.0)*0.1
		b.state.vel=(v1,v2,v3)
O.engines=[
	# SubdomainBalancer(colorize=True,initRun=True,iterPeriod=100),
	ForceResetter(),
	InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb(),Bo1_Wall_Aabb()],label='collider',allowBiggerThanPeriod=True),
	# Represent the geometry of a contact point between twoSpheres
	InteractionLoop( 
		[Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom(),Ig2_Wall_Sphere_ScGeom()],
		[Ip2_FrictMat_FrictMat_FrictPhys()],
		[Law2_ScGeom_FrictPhys_CundallStrack()],
	),
	NewtonIntegrator(damping=.1,exactAsphericalRot=True,gravity=(0.0,0.0,0.0)),
	qt.SnapshotEngine(fileBase='3d-',iterPeriod=200,label='snapshot'),
	PyRunner(command='finish()',iterPeriod=200000)
]
# O.dt=5.e-6
O.dt=PWaveTimeStep()
O.run(1,True)
# we must open the view explicitly (limitation of the qt.SnapshotEngine)
qt.View()

# this function is called when the simulation is finished
def finish():
	# snapshot is label of qt.SnapshotEngine
	# the 'snapshots' attribute contains list of all saved files
	makeVideo(snapshot.snapshots,'3d.mpeg',fps=10,bps=10000)
	O.pause()
#O.run(10000,True)
#from yade import timing
#timing.stats()
#quit()

But it gave a strange result. 
Could you please figure out what is wrong? 
FYI, I used the yade 2018.02b, python 2.7.17 and ubuntu 18.04.
Thank you.

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