← Back to team overview

yade-users team mailing list archive

Re: [Question #384899]: VoxelPorosity

 

Question #384899 on Yade changed:
https://answers.launchpad.net/yade/+question/384899

    Status: Answered => Open

Luis Barbosa is still having a problem:
Hi Bruno, thanks.

Yes, I've made the checks, here follow my complete script:

#!/usr/bin/python
# -*- coding: utf-8 -*-

#REPRODUCAO COM DADOS EXPERIMENTAIS

##################################Diameter by Class##########################################
#Class1 = 2.38 to 4.76
#Class2 = 4.76 to 6.65
#Class3 = 6.65 to 9.52
#Class4 = 9.52 to 19.1
##################################Radius by Class##########################################
aggregateclass = 1

if aggregateclass==1:
	rmin=0.00119
	rmax=0.00238
	print "class 1"

if aggregateclass==2:
	rmin=0.00238
	rmax=0.00325
	print "class 2"

if aggregateclass==3:
	rmin=0.00325
	rmax=0.00476
	print "class 3"

if aggregateclass==4:
	rmin=0.00476
	rmax=0.00955
	print "class 4"
##################################Import Modulus#############################################
from yade import plot
from yade import pack
from yade import utils
from yade import pack
import math
import random

####################################Material#################################################
O.materials.append(JCFpmMat(type=1,young=70e9,poisson=0.3,frictionAngle=radians(30),density=2500,tensileStrength=5e6,cohesion=5e6,jointNormalStiffness=1e7,jointShearStiffness=1e7,jointCohesion=5e6,jointFrictionAngle=radians(20),jointDilationAngle=0.0,label='spheres'))

###################################Aggregate Formation#######################################
rad,gap=.0002,0 #particle radius and gap
r=random.uniform(rmin, rmax) #aggregate radius random according to the class
ag = pack.regularHexa(pack.inSphere((0,0,r),r),radius=rad,gap=gap)
a = len(ag)
c = 0.25*a #percentage of maximum particle removal
d = 0.135*a #percentage of minimum particle removal
n=random.randint(int(d), int(c)) #number of spheres to exclude randomically

#randomly append spheres from packing
for i in range(0,len(ag)-n):
	b = ag[random.randint(0,len(ag)-1)]
	O.bodies.append(b)
	ag.remove(b)

print "total de particulas", a
print "numero de esferas removidas", n
print "raio do agregado m", r
######################################Planes#################################################
p1=O.bodies.append(utils.geom.facetBox((0,0,0),(0.01,-0.01,0),wallMask=1))
p2=O.bodies.append(utils.geom.facetBox((0,0,r),(0.01,-0.01,r),wallMask=32))# os r's se somam
########################################Interactions#########################################
O.engines=[
  ForceResetter(),

	InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
	InteractionLoop(
		[Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom()],
		[Ip2_JCFpmMat_JCFpmMat_JCFpmPhys(cohesiveTresholdIteration=1)],
		[Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM(smoothJoint=False)]
	),

  TranslationEngine(ids=p2,translationAxis=[0,0,-1],velocity=0.03),
  GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.5),
  NewtonIntegrator(damping=0.1,gravity=[0,0,-9.81]),
  ForceRecorder(ids=p2,file='rep1.txt',iterPeriod=500),

]

##########################Aggregate Mass############################
MA=utils.getSpheresMass()
print "Mass Aggregate kg", MA
##########################MODULE FOR POROSITY MEASUREMENT############################
VE=utils.getSpheresVolume()
VT=(4*math.pi*r*r*r)/3
P=(VT-VE)/VT
print "Porosidade", P

g=r/2
h=3*r/2
VP=utils.voxelPorosity(200,(-g,g,g),(g,-g,h))
print "VP", VP

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