Obtaining Volume Fraction of Filled Cylinder

Asked by Kevin on 2020-04-26

Hey guys! So I have been having trouble finding a way in which to obtain the volume fraction for a filled coaxial cylinder model of spheres using utils.getDepthProfiles. I imported a quarter cylinder model via solidworks (to minimize computational complexity) and filled the outer coaxial cylinder with thousands of spheres with varying radii. The objective here is to use the utils.getDepthProfile for a portion of the cylinder volume and I am unsure how to print out the resultant volume fraction. YadeBook helps me with the parameters (the volume of the right cylinder is the first float parameter that I had calculated previously), but I am unsure about how to use the latter two parameters, or better yet, how to use the function to extract the volume fraction at all (I am a novice at programming). Under "Tracking Volume Fraction" is where I am having trouble implementing or finding a spot to extract the overall volume fraction after filling the model. How should I approach this based on this code sample?

Thank you for any help or advice given!

#Module Setup
from yade import ymport, plot
import time

utils.readParamsFromTable(descriptionIn = 'fill',
  frIn = 0.5, enIn=0.01, etIn=0.01, tcIn=0.0001, # Frictionangle (rad), strength-parameter
  rhoIn = 2300.0, # Density
  dumpVTKIn = 100000 # Periods of dumps in iterations

#Sweep Parameters using Table
from yade.params.table import
import shutil

except OSError:

folderNameBase = 'step1/' + str(descriptionIn)
folderName = folderNameBase

o = Omega()
o.dt = 0.05*1E-7

#Define Material Properties of Spheres
mat1 = o.materials.append(ViscElMat(frictionAngle=frIn, density=rhoIn, en=enIn, et=etIn))

#Build Geometry

o.engines = [
    #Following Default Workflow
# SpatialQuickSortCollider(),
    NewtonIntegrator(damping=0.5,gravity=Vector3(0,-90.81,0), label='newt'),
    #Particles will drop from a circular plane
    CircularFactory(maxParticles=5000, #Number of generated particles
        radius = (3.5e-3),
        PSDsizes = [125e-6,
        PSDcum = [0.0250,
    #Delete Particles that fly out of domain
    #Shake the domain to help settling
    #Record output to VTK Files, Spheres,Interactions,Facets
        recorders=['spheres','velocity','colors','intr','ids','mask','materialId','stress'], label='VTK_sphere'),
    #FIXME Snapshot Taker
# SnapshotEngine(iterPeriod=dumpVTKIn,fileBase=folderName+'/spheres-',viewNo=0,label='snapshooter'),
    #Execute Python Commands
# PyRunner(iterPeriod=1000,command='addPlotData()')

#Enable Track Energy - Can be used to determine if sim is done

#Volume Fraction Tracking
from yade import utils

#Run Yade Simulation
o.stopAtIter=5000001 #Maximum Iterations

def stop_condition():
    o.dt=0.5*utils.PWaveTimeStep() #auto timesetup
    print('iter,time,dt,iter/sec=',o.iter,o.iter*o.dt,o.dt,o.speed) #print to screen iteration

Question information

English Edit question
Yade Edit question
No assignee Edit question
Last query:
Last reply:
Jérôme Duriez (jduriez) said : #1

I'm not really familiar with that function and am even less sure I understood your question, but :

if getDepthProfiles() returns a tuple of "local" quantities, the overall quantity could probably be obtained averaging the local ones.

Did you try averaging the elements of the returned tuple (with appropriate weights ?)

PS : if the question is about getDepthProfiles(), why not include it in the title ? I could help reduce confusion..

Can you help with this problem?

Provide an answer of your own, or ask Kevin for more information if necessary.

To post a message you must log in.