Removing a box side
How to drop particles in the box to a certain void ratio and then remove one side of the box and see them roll?
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Carine Tanissa
- Solved:
- Last query:
- Last reply:
Revision history for this message
|
#1 |
Hello,
next time, please do not merge two problems into one question ([1], point 5).
Also more information then just very general one sentence description is usually better for good answers [1]
> How to drop particles in the box
Depends on definition of "drop" and "the box".
E.g. using gravity deposition [2].
Or triaxial test tutorial [3].
Or ...
> to a certain void ratio
In general modifying material parameters, "drop" loading or particle size distribution.
One version in [3] does exactly a process how to match certain void ratio
> remove one side of the box
O.bodies.
> see them roll
depends on definition of "see".
Probably just using Yade GUI..
Or export them and use external visualizing software (Paraview).
Or ...
Cheers
Jan
[1] https:/
[2] https:/
[3] https:/
[4] https:/
Revision history for this message
|
#2 |
Thanks,
For the cubePPscaled.py example where would i add O.bodies.
I was adding O.bodies.erase(bD) after
def removeLid():
global lidID
if (O.bodies[lidID]):
O.bodies.
but i am getting an error.
Can you please tell me where to incorporate it?
Thanks.
Here s the unedited code:
# -*- encoding=utf-8 -*-
# CWBoon 2015
from yade import pack
import math
# 7-15. The code block is trying to create a directory named "vtk" if it doesn't exist already. This directory is used for storing VTK files.
import os
import errno
try:
os.mkdir(
except OSError as exc:
if exc.errno != errno.EEXIST:
raise
pass
#Enable the storage of potential particles in the simulation.
Gl1_PotentialPa
O.engines=[
ForceResetter(),
InsertionSortC
InteractionLoop(
[Ig2_
[Ip2_
[Law2_
),
NewtonIntegrat
PotentialParti
]
#Define the density of the powder material.
powderDensity = 2000
#Define the distance to the center for particles.
distanceToCentre= 0.5
# Define the mean size of particles.
meanSize = 1.
#Calculate the wall thickness based on the mean size.
wallThickness = 0.5*meanSize
#this material represents frictionless particles and sets some parameters such as density.
O.materials.
lengthOfBase = 9.0*meanSize
heightOfBase = 14.0*meanSize
# create empty sphere packing
# sphere packing is not equivalent to particles in simulation, it contains only the pure geometry
sp=pack.
mn,mx=Vector3(
R=sqrt(
sp.makeCloud(
#initialize the counter variable
count= 0
#Calculate the radius of particles based on the mean size.
r=0.05*meanSize
for s in sp:
b=Body()
b.mask=1
b.aspherical=True
wire=False
color=
highlight=False
b.shape=
V=(2*distanceT
geomInert=
utils.
b.state.pos = s[0] #s[0] stores center
b.state.ori = Quaternion(
O.bodies.append(b)
count=count+1
#Bottom faces of the box
r=0.1*wallThickness
bbb=Body()
bbb.mask=3
wire=False
color=[0,0.5,1]
highlight=False
bbb.shape=
length=
V=length*
geomInertX=
geomInertY=
geomInertZ=
utils._
bbb.state.pos = [0,0,0]
lidID = O.bodies.
count=count+1
b1=Body()
b1.mask=3
wire=False
color=[0,0.5,1]
highlight=False
b1.shape=
length=
V=length*
geomInertX=
geomInertY=
geomInertZ=
utils._
b1.state.pos = [lengthOfBase/
O.bodies.append(b1)
count=count+1
b2=Body()
b2.mask=3
wire=False
color=[0,0.5,1]
highlight=False
b2.shape=
length=
V=length*
geomInertX=
geomInertY=
geomInertZ=
utils._
b2.state.pos = [-lengthOfBase/
O.bodies.append(b2)
count=count+1
b3=Body()
b3.mask=3
wire=False
color=[0,0.5,1]
highlight=False
b3.shape=
length=
V=length*
geomInertX=
geomInertY=
geomInertZ=
utils._
b3.state.pos = [0,0,lengthOfBa
O.bodies.append(b3)
count=count+1
b4=Body()
b4.mask=3
wire=False
color=[0,0.5,1]
highlight=False
b4.shape=
length=
V=length*
geomInertX=
geomInertY=
geomInertZ=
utils._
b4.state.pos = [lengthOfBase/
O.bodies.append(b4)
count=count+1
b5=Body()
b5.mask=3
wire=False
color=[0,0.5,1]
highlight=False
b5.shape=
length=
V=length*
geomInertX=
geomInertY=
geomInertZ=
utils._
b5.state.pos = [0,0,-lengthOfB
O.bodies.append(b5)
count=count+1
b6=Body()
b6.mask=3
wire=False
color=[0,0.5,1]
highlight=False
b6.shape=
length=
V=length*
geomInertX=
geomInertY=
geomInertZ=
utils._
b6.state.pos = [-lengthOfBase/
O.bodies.append(b6)
count=count+1
b7=Body()
b7.mask=3
wire=False
color=[0,0.5,1]
highlight=False
b7.shape=
length=
V=length*
geomInertX=
geomInertY=
geomInertZ=
utils._
b7.state.pos = [-lengthOfBase/
O.bodies.append(b7)
count=count+1
b8=Body()
b8.mask=3
wire=False
color=[0,0.5,1]
highlight=False
b8.shape=
length=
V=length*
geomInertX=
geomInertY=
geomInertZ=
utils._
b8.state.pos = [lengthOfBase/
O.bodies.append(b8)
count=count+1
#Vertical faces A-B-C-D of the box
bA=Body()
bA.mask=3
wire=False
color=[0,0.5,1]
highlight=False
bA.shape=
#length=
V=lengthOfBase*
geomInertX=
geomInertY=
geomInertZ=
utils._
bA.state.pos = [0.5*lengthOfBa
O.bodies.append(bA)
count=count+1
bB=Body()
bB.mask=3
wire=False
color=[0,0.5,1]
highlight=False
bB.shape=
#length=
V=lengthOfBase*
geomInertX=
geomInertY=
geomInertZ=
utils._
bB.state.pos = [-0.5*lengthOfB
O.bodies.append(bB)
count=count+1
bC=Body()
bC.mask=3
wire=False
color=[0,0.5,1]
highlight=False
bC.shape=
#length=
V=lengthOfBase*
geomInertX=
geomInertY=
geomInertZ=
utils._
bC.state.pos = [0,0.5*
O.bodies.append(bC)
count=count+1
bD=Body()
bD.mask=3
wire=False
color=[0,0.5,1]
highlight=False
bD.shape=
#length=
V=lengthOfBase*
geomInertX=
geomInertY=
geomInertZ=
utils._
bD.state.pos = [0,0.5*
O.bodies.append(bD)
escapeNo=0
def myAddPlotData():
global escapeNo
global wallThickness
global meanSize
uf=utils.
if isnan(uf):
uf = 1.0
KE = utils.kineticEn
for b in O.bodies:
if b.state.pos[1] < -5.0*meanSize and len(b.state.
escapeNo = escapeNo+1
O.bodies.
if O.iter>25000:
removeLid()
plot.addData(
from yade import plot
plot.plots=
#plot.plot() #Uncomment to view plots
O.engines=
def removeLid():
global lidID
if (O.bodies[lidID]):
O.bodies.
O.dt = 0.2*sqrt(
##Control the rendering quality
#Gl1_PotentialP
#Gl1_PotentialP
#Gl1_PotentialP
#Gl1_PotentialP
from yade import qt
qt.Controller()
v=qt.View()
O.saveTmp()
Revision history for this message
|
#3 |
> For the cubePPscaled.py example where would i add O.bodies.
Just at the point "once the particles are all deposited in the box" :-)
You will have to define it yourself.
E.g. using unbalanced force check inside a PyRunner.
> but i am getting an error.
please be spefific, i.e. copy here the full error message ([1], point 2)
Cheers
Jan