Use of randomDensePack

Asked by Grace Mejico on 2019-06-18

Hi , Im from Peru and I started using yade like one month ago to make a model of the behaviour of a dry stone retaining wall called "pircas" here.

By now, Im looking for the angle of repose of the stones .I was trying to use makeclouds, but the porosity when changing parameters only gives me back something not representative for what im looking for. Im looking for a model with more density,thats why i looked for other ways and i found the function randomDensePack.

 I have two questions:

First, what function for densing the initial pack can be helpful to use?

Second,in case randomDensePack is the alternative:

1. In the manual,i could see that it is used for TriaxialTest but that is not the test that i want.
When using randomDensePack ,it can be used only to simulate an initial boundary? or how can i delete the triaxial test influence of the function? Is there any parameter to vary for the purpose?

2. Im sharing the script,in case im making some mistake please let me know.And if possible, could you let me know if this script can be representative for knowing the angle of repose.

from yade import pack, qt, plot
from math import *

acely=0 # aceleracion cte fuera de plano
damping=0.8 # simulacion pseudo estatica

# Definicion del material mat1 para la pirca **********
mat1=FrictMat()
mat1.density = 2.821e3 #kg/m3
mat1.frictionAngle = radians(58.74)
mat1.young = 31.04e8
mat1.poisson = 0.18
O.materials.append(mat1)

pred=pack.inAlignedBox((0,0,0),(4,4,4))
spheres=pack.randomDensePack(pred,spheresInCell=2000,radius=.15,rRelFuzz=0,material=mat1,returnSpherePack=True)
spheres.toSimulation()

#Imprime la cantidad total de cuerpos
Q=len(O.bodies)
print 'numero de cuerpos', Q

# Definicion del piso
piso=utils.wall(position=Vector3(0,0,0), axis=2, sense=0, material=mat1, color=(0.5,0.5,0.5))
O.bodies.append(piso)

# Definicion del verificador de la fuerza de desbalance
def checkUnbalanced():
 print ((O.iter, utils.unbalancedForce(), utils.sumForces([5],(0,0,1)), O.bodies[5].state.pos[2]))
#'iter %d, unbalanced forces = %f, suma de fuerzas en eje vertical = %f, posicion respecto de la base= %f'
#devuelve la fuerza resultante del body proyectado en el eje vertical

if unbalancedForce()<.0001: # para asegurar la estabilidad
 O.pause()

# Definicion de los sujetos a plotear
def addPlotData():
 plot.addData(iter_clumps=O.iter, unbal=unbalancedForce())
 plot.plots={'iter_clumps':'unbal'}

# MOTOR DEL ALGORITMO DEM

O.engines=[
 ForceResetter(),
 InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Wall_Aabb()]),
 InteractionLoop(
 [Ig2_Sphere_Sphere_ScGeom(),Ig2_Wall_Sphere_ScGeom()], # interaccion geometrica
 [Ip2_FrictMat_FrictMat_FrictPhys()], # interaccion fisica
 [Law2_ScGeom_FrictPhys_CundallStrack()] ),# leyes de contacto - aplicacion de fuerzas,
 NewtonIntegrator(damping=damping,gravity=[0,acely,-9.81]), # aplicacion de la gravedad
 PyRunner(command='checkUnbalanced()',iterPeriod=1000,label='checker'),
# llama al checkunbalanced cada 1000 iteraciones
 PyRunner(command='addPlotData()',iterPeriod=1000), # llama al addPlotData cada 1000 iteraciones

# Detalles de la simulacion
O.dt=0.5*PWaveTimeStep() # establece el intervalo de tiempo como una fraccion del
plot.live=True # ploteo en tiempo real
qt.Controller() # abre la ventana del controlador
V=qt.View() # abre la ventada de la vista
R=yade.qt.Renderer() # llama a la renderizacion
R.bgColor=(1.,1.,1.) # definel color blan

#end

Thank you in advance ,

Grace Mejico

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Jérôme Duriez
Solved:
2019-07-24
Last query:
2019-07-24
Last reply:
2019-06-19
Best Jérôme Duriez (jduriez) said : #1

Hello,

For generating samples with a controlled porosity, have a look at [1], the "Reaching a specified porosity" section. The porosity values that you will be able to attain may also depend on your particle size distribution and of the fact that you're using spherical shapes...

As for randomDensePack, the doc meant the packing returned by randomDensePack is obtained through a hidden TriaxialTest simulation (the isotropic compression part of it, actually).
But this packing is free to use by the user for any kind of simulation, not only TriaxialTest simulations (some understanding of the stress state of that packing --- after the hidden TriaxialTest simulation --- would be useful, though).

In all cases, the fact remains randomDensePack is kind of a (open-source ! see [2]) black box, which may be useful or not depending on your needs/understanding of that function.

[1] https://gitlab.com/yade-dev/trunk/blob/master/examples/triax-tutorial/script-session1.py, also on your computer.
[2] https://gitlab.com/yade-dev/trunk/blob/master/py/pack/pack.py#L464

Grace Mejico (mejicograce) said : #2

Thanks Jérôme Duriez, that solved my question.