How to calculate the height of particle accumulation?
First, I use o.bodies.append (geom.facetbox ((,), (,), wallmask=)) to generate particles in the specified area. These particles are not next to each other. There is a gap between these particles. After I run, these particles will sink under the action of gravity, the gap will be reduced, and finally accumulate together. How do I know the height of the stack?
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Karol Brzezinski
- Solved:
- Last query:
- Last reply:
Revision history for this message
|
#1 |
Hi,
Function aabbExtrema() returns boundary box of particle packing (min and max corner positions).
If you are only interested in dimension, you can use aabbDim().
Both functions work for spherical bodies.
Cheers
Karol
[1] https:/
[2] https:/
Revision history for this message
|
#2 |
And one more comment
Are you sure that you generate particles with this function geom.facetbox ((,), (,), wallmask=)?
You generate bodies (facets), but I wouldn't call them particles by default.
Cheers,
Karol
Revision history for this message
|
#3 |
My code for generating particles is as follows:
O.bodies.
sp = pack.SpherePack()
sp.makeCloud(
sp.toSimulation()
What I understand is that o.bodies.append (geom. Facetbox ((,), (,), wallmask =) is used to create faces and generate six faces, that is, a cuboid or other shaped objects with a certain size. Then I can fill them with sp.makecloud. I don't know whether this understanding is correct.
Revision history for this message
|
#4 |
Hi,
Yes, first you generate facets, next particles. I only meant that facetbox() function creates facets, not particles (as stated in the first post).
Referring to your question, this is how you can obtain the height of spherical particle packing:
#################
O.bodies.
sp = pack.SpherePack()
sp.makeCloud(
sp.toSimulation()
O.engines[
O.run(3000,True)
(xmin,ymin,
height = zmax-zmin
print("Height is ",height)
################
Cheers,
Karol
Revision history for this message
|
#5 |
For example:
O.bodies.
sp = pack.SpherePack()
sp.makeCloud(
sp.toSimulation()
(xmin,ymin,
height = zmax-zmin
print("Height is ",height)
Is that okay? Is there something wrong with the code?
Revision history for this message
|
#6 |
aabbDim() gives you dimensions (three values), so it should rather be:
#####
O.bodies.
sp = pack.SpherePack()
sp.makeCloud(
sp.toSimulation()
(xdim,ydim,zdim) = aabbDim()
print("Height is ",zdim)
####
Cheers,
Karol
Revision history for this message
|
#7 |
I just tried it and I found that the code works, but there is no zdim output in the console, why is that?
Revision history for this message
|
#8 |
Are you sure? What is the console output after running this code?
Revision history for this message
|
#9 |
I tried the code again and there was no output from zdim.
The code is as follows:
from yade import pack,plot
O.bodies.
sp = pack.SpherePack()
sp.makeCloud(
sp.toSimulation()
(xdim,ydim,zdim)= aabbDim()
print("Height is ",zdim)
for b in O.bodies:
if isinstance(
circleRadius=1.5
circleCenter = Vector3(0.05,6,6)
circleRadius1=1.5
circleCenter1 = Vector3(0.05,12,6)
#
O.engines = [
# handle sphere+sphere and facet+sphere collisions
),
# call the checkUnbalanced function (defined below) every 2 seconds
# call the addPlotData function every 200 steps
]
O.dt = 0.5 * PWaveTimeStep()
# enable energy tracking; any simulation parts supporting it
# can create and update arbitrary energy types, which can be
# accessed as O.energy[
O.trackEnergy = True
# if the unbalanced forces goes below .05, the packing
# is considered stabilized, therefore we stop collected
# data history and stop
def checkUnbalanced():
if unbalancedForce() < .05:
O.pause()
plot.
for b in O.bodies:
if isinstance(
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
# collect history of data which will be plotted
def addPlotData():
# each item is given a names, by which it can be the unsed in plot.plots
# the **O.energy converts dictionary-like O.energy to plot.addData arguments
plot.addData(
# define how to plot data: 'i' (step number) on the x-axis, unbalanced force
# on the left y-axis, all energies on the right y-axis
# (O.energy.keys is function which will be called to get all defined energies)
# None separates left and right y-axis
plot.plots = {'i': ('unbalanced', None, O.energy.keys)}
# show the plot on the screen, and update while the simulation runs
plot.plot()
O.saveTmp()
# to see it
from yade import qt
qt.Controller()
qt.View()
qt.View()
Revision history for this message
|
#10 |
Hi,
The information about the height is printed. It is just between "initial lines".
If you want to know the height anytime later during the simulation, you need to run those two lines again:
###
(xdim,ydim,zdim)= aabbDim()
print("Height is ",zdim)
###
Cheers,
Karol
Revision history for this message
|
#11 |
Yes, I added these two lines of code again, and zdim got the output. What does zdim mean? Is it the highest point? Nadir? Or is it an average?
Revision history for this message
|
#12 |
If you use
####
(xmin,ymin,
####
zmax is the highest point.
If you use
####
(xdim,ydim,zdim)= aabbDim()
####
zdim is packing height (the highest point minus the lowest)
Karol
Revision history for this message
|
#13 |
Thanks Karol Brzezinski, that solved my question.