Re: [Yade-users] [Question #706560]: Removing a box side

2023-05-16 Thread Carine Tanissa
Question #706560 on Yade changed:
https://answers.launchpad.net/yade/+question/706560

Status: Needs information => Solved

Carine Tanissa confirmed that the question is solved:
Thanks, it worked

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #706560]: Removing a box side

2023-05-16 Thread Jan Stránský
Question #706560 on Yade changed:
https://answers.launchpad.net/yade/+question/706560

Status: Open => Needs information

Jan Stránský requested more information:
> For the cubePPscaled.py example where would i add
O.bodies.erase(bodyID) to remove bD once the particles are all deposited
in the box?

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

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #706560]: Removing a box side

2023-05-11 Thread Carine Tanissa
Question #706560 on Yade changed:
https://answers.launchpad.net/yade/+question/706560

Status: Answered => Open

Carine Tanissa is still having a problem:
Thanks,

For the cubePPscaled.py example where would i add O.bodies.erase(bodyID) to 
remove bD once the particles are all deposited in the box?
I was adding O.bodies.erase(bD) after 
def removeLid():
global lidID
if (O.bodies[lidID]):
O.bodies.erase(lidID)   
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('./vtk/')
except OSError as exc:
   if exc.errno != errno.EEXIST:
  raise
   pass

#Enable the storage of potential particles in the simulation.

Gl1_PotentialParticle().store=True

O.engines=[
ForceResetter(),
InsertionSortCollider([PotentialParticle2AABB()],verletDist=0.01, 
avoidSelfInteractionMask=2),
InteractionLoop(
[Ig2_PP_PP_ScGeom(twoDimension=False, unitWidth2D=1.0, 
calContactArea=True, areaStep=5)],
[Ip2_FrictMat_FrictMat_KnKsPhys(kn_i=1e8, ks_i=1e7, Knormal = 
1e8, Kshear = 1e7, useFaceProperties=False, viscousDamping=0.05)],
[Law2_SCG_KnKsPhys_KnKsLaw(label='law',neverErase=False)]
),

NewtonIntegrator(damping=0.0,exactAsphericalRot=True,gravity=[0,-9.81,0]),

PotentialParticleVTKRecorder(fileName='./vtk/cubePPscaled',label='vtkRecorder',twoDimension=False,iterPeriod=5000,sampleX=50,sampleY=50,sampleZ=50,maxDimension=0.2)
]


#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.append(FrictMat(young=-1,poisson=-1,frictionAngle=radians(0.0),density=powderDensity,label='frictionless'))
 #The normal and shear stifness values are determined in the IPhys functor, 
thus the young, poisson parameters of the FrictMat are not used.
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.SpherePack()
mn,mx=Vector3(-0.5*(lengthOfBase-wallThickness),0.5*meanSize,-0.5*(lengthOfBase-wallThickness)),Vector3(0.5*(lengthOfBase-wallThickness),7.0*heightOfBase,0.5*(lengthOfBase-wallThickness))
R=sqrt(3.0)*distanceToCentre
sp.makeCloud(mn,mx,R,0,100,False)

#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=Vector3(random.random(),random.random(),random.random())
highlight=False
b.shape=PotentialParticle(k=0.2, r=r, R=R, a=[1,-1,0,0,0,0], 
b=[0,0,1,-1,0,0], c=[0,0,0,0,1,-1], 
d=[distanceToCentre-r,distanceToCentre-r,distanceToCentre-r,distanceToCentre-r,distanceToCentre-r,distanceToCentre-r],
 isBoundary=False, color=color, wire=wire, highlight=highlight, 
minAabb=sqrt(3)*Vector3(distanceToCentre,distanceToCentre,distanceToCentre), 
maxAabb=sqrt(3)*Vector3(distanceToCentre,distanceToCentre,distanceToCentre), 
maxAabbRotated=1.02*Vector3(distanceToCentre,distanceToCentre,distanceToCentre),
 
minAabbRotated=1.02*Vector3(distanceToCentre,distanceToCentre,distanceToCentre),
 AabbMinMax=True, id=count)
V=(2*distanceToCentre)**3 # (approximate) Volume of cuboid
geomInert=(1./6.)*V*(2*distanceToCentre)**2 # (approximate) Principal 
inertia of cuboid to its centroid
utils._commonBodySetup(b, V, Vector3(geomInert,geomInert,geomInert), 
material='frictionless', pos=[0,0,0], fixed=False)
b.state.pos = s[0] #s[0] stores center
b.state.ori = 
Quaternion((random.random(),random.random(),random.random()),random.random()) 
#s[2]
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=PotentialParticle(k=0.1, r=0.1*wallThickness, 
R=0.2*lengthOfBase,a=[1,-1,0,0,0,0], b=[0,0,1,-1,0,0], c=[0,0,0,0,1,-1], 
d=[lengthOfBase/6.0-r,lengthOfBase/6.0-r,0.5*wallThickness-r,0.5*wallThickness-r,lengthOfBase/6.0-r,lengthOfBase/6.0-r],
 
id=count,isBoundary=True,color=color,wire=wire,highlight=highlight,AabbMinMax=True,
 
minAabb=1.02*Vector3(lengthOfBase/6.0,0.5*wallThickness,lengthOfBase/6.0),maxAabb=1.02*Vector3(lengthOfBase/6.0,0.5*wallThickness,lengthOfBase/6.0),maxAabbRotated=1.02*Vector3(lengthOfBase/6.0,0.5*wallThickness,lengthOfBase/6.0),

Re: [Yade-users] [Question #706560]: Removing a box side

2023-05-10 Thread Jan Stránský
Question #706560 on Yade changed:
https://answers.launchpad.net/yade/+question/706560

Status: Open => Answered

Jan Stránský proposed the following answer:
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.erase(bodyID) # [4]

> 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://www.yade-dem.org/wiki/Howtoask
[2] https://yade-dem.org/doc/tutorial-examples.html#gravity-deposition
[3] https://gitlab.com/yade-dev/trunk/-/tree/master/examples/triax-tutorial
[4] https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.BodyContainer.erase

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


[Yade-users] [Question #706560]: Removing a box side

2023-05-09 Thread Carine Tanissa
New question #706560 on Yade:
https://answers.launchpad.net/yade/+question/706560

How to drop particles in the box to a certain void ratio and then remove one 
side of the box and see them roll?

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp