How to set the particle size when generating particles
How to set the particle size when generating particles
I have referred to the particle gradation curves of sand in some literatures and recorded the data.
Can I define the particle gradation I want when the particles are generated?
I really need your help. Thank you
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Revision history for this message
|
#1 |
>>Can I define the particle gradation I want when the particles are generated?
Yes, you can [1].
Cheers,
Robert
[1]https:/
Revision history for this message
|
#2 |
Thank you very much for your reply!
I still haven't solved my problem. I have carefully read the link you provided,
but I still haven't come up with a method that can be incorporated into my existing particle grading
Revision history for this message
|
#3 |
> particle gradation curves
is it particle size distribution? On horizontal axis size, on vertical axis % passing?
If yes, then read [1] and focus on psdSizes, psdCumm, "psdSizes and psdCumm, two arrays specifying points of the particle size distribution function" etc.
If no, please be more specific.
Cheers
Jan
Revision history for this message
|
#4 |
Thank you for your answer. This is the code of my three-axis generation. When creating particles, I want to use the grading curve I already have to create particles with specific data, but I am confused about how to modify this code.
# unicode: UTF-8
# For 2D biaxial simulation
# 21/10/2016
# Yade version 2016.06a-
#######
### Defining parameters and variables ###
#######
#Material constants
Density = 3000
FrictionAngle = 35
PoissonRatio = 0.5
Young = 300e6
Damp = 0.5
AvgRadius = 0.0027
N_particles = 25000
#Wall constants
WDensity = 0
WFrictionAngle = 0.0
WPoissonRatio = 0.5
WYoung = 50e9
#Packing variables
mn = Vector3(0.,0.,0.)
mx = Vector3(
targetPorosity = 0.2
Porosity = 0.
#Confining variables
ConfPress1 = -90000 #pre-compression
ConfPress = -1.0e5
#Loading control
LoadRate = -0.01
#time calculation
startT = O.time
endT = O.time
timeSpent = endT - startT
#######
#import necessary packages
from yade import pack,plot,os,timing
import matplotlib; matplotlib.
import pylab
#######
### Sample Preparing ###################
#######
#Create materials for spheres and plates
SphereMat = O.materials.
WallMat = O.materials.
#Create walls for packing
wallIds = O.bodies.
#Use SpherePack object to generate a random loose particles packing
#O.periodic = True
#O.cell.
sp = pack.SpherePack()
#psdSizes,
#pylab.
sp.makeCloud(
#pylab.
#pylab.legend()
#pylab.show()
sp.toSimulation
O.usesTimeStepp
O.trackEnerty=True
#######
#####Defining triaxil engines####
#######
###first step: compression#######
triax1=
#define wall ids
#wall_bottom_id = wallIds[4],
#wall_top_id = wallIds[5],
#wall_left_id = wallIds[1],
#wall_right_id = wallIds[0],
#wall_back_id = wallIds[2],
#wall_front_id = wallIds[3],
#wall_
#wall_
thickness = 0.001,
maxMultipli
finalMaxMul
#maxMultiplier = 1.002,
internalCom
#max_vel = 1.5,
stressMask = 7,
computeStre
goal1 = ConfPress1,
goal2 = ConfPress1,
goal3 = ConfPress1,
)
#O.dt=0.
newton=
###engine
O.engines=[
ForceResett
InsertionSo
Interaction
[Ig2_
[Ip2_
[Law2_
),
GlobalStiff
triax1,
newton,
PyRunner(
PyRunner(
TriaxialSta
]
# Simulation stop conditions defination
def checkUnbalanced():
unb=
mStress = (triax1.
s1 = triax1.
s2 = triax1.
s3 = triax1.
if unb<0.01 and abs(ConfPress1-
O.pause()
f = open("particlei
f.write('# This is the result data of 2D simulation\n\n')
f.write('# There are 8 types of varibles in this data as follows:\n\n')
for b in O.bodies:
if isinstance(
pos = b.state.pos
rad = b.shape.radius
displ = b.state.displ()
#vel = b.state.vel #vector3
f.close()
# collect history of data
def addPlotData():
unb = unbalancedForce()
mStress = -(triax1.
plot.
ev=
s11=
s22=
s33=
i=O.iter,
)
print ('unbalanced force: %f, mean stress: %f, s11: %f, s22: %f,s33:%f, coordination number: %f, porosity: %f' %(unb,mStress,
plot.
#plot.
###display
#yade.qt.
### declare what is to plot. "None" is for separating y and y2 axis
plot.plots=
#plot.plots=
### the traditional triaxial curves would be more like this:
##plot.
## display on the screen (doesn't work on VMware image it seems)
#plot.plot()
O.run()#; O.wait()
Revision history for this message
|
#5 |
Please provide a MWE [1], M = minimal. I.e. if it is about initial particle packing, please remove all unnecessary code not related to the problem (materials, triax, checkUnbalanced, even the O.engines?).
Cheers
Jan
Revision history for this message
|
#6 |
Thank you for your answer.This is my particle generation code.
#psdSizes,
#pylab.
sp.makeCloud(
#pylab.
I want to use my existing particle sizing to generate particles. I don't know how to modify my code.
Revision history for this message
|
#7 |
Please provide a MWE [1], W = working, i.e. we can copy-paste it and test it.
Here e.g. N_particles is not defined, 'sp' is not defined etc..
M part is perfect :-)
Have a look at example script [2] and let us know if it helps or if you need further help.
Cheers
Jan
[1] https:/
[2] https:/
Can you help with this problem?
Provide an answer of your own, or ask 黎犴dada for more information if necessary.