← Back to team overview

yade-users team mailing list archive

Re: [Question #693297]: Pore volume - FlowEngine

 

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

    Status: Answered => Open

Othman Sh is still having a problem:
Hi Robert,

I rearranged my code to have the packing made during the simulation
without the need for external link. Sorry about not following the forum
guideline in my previous post.

I was able to get the cell volumes as in the code below, but I actually
want to get the volume of individual pores/voids. So I believe the voids
volume = 1/getInvVoidVolume, right?

Sorry if this looks like a dumb question, but I couldn't figure out how
to use the getInvVoidVolume tool. In [1], the documentation reads
getCellInvVoidVolume((FlowEngineT)arg1, (int)arg2)

What is (int) arg2?

Also in the code blow, I tried using flow.getInvVoidVolume((x,y,z)) but
I got this error (I am using Yadedaily):

'FlowEngine' object has no attribute 'getInvVoidVolume'

Thanks for helping with this issue.

Othman


[1]https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.FlowEngine.getCellInvVoidVolume


-------------------------------------------------------------------------
from yade import plot,pack, export, ymport
import numpy as np


young=1e6
compFricDegree = 3 
mn,mx=Vector3(0,0,0),Vector3(1,1,1) # corners of the initial packing

O.materials.append(FrictMat(young=young,poisson=0.5,frictionAngle=radians(compFricDegree),density=2600,label='spheres'))
O.materials.append(FrictMat(young=young,poisson=0.5,frictionAngle=0,density=0,label='walls'))
walls=aabbWalls([mn,mx],thickness=0,material='walls')
wallIds=O.bodies.append(walls)


sp=pack.SpherePack()
sp.makeCloud(mn,mx,0.05,.2) 
sp.toSimulation(material='spheres')

yade.qt.View()

print ('porosity = ', utils.porosity())
O.engines=[
	ForceResetter(),
	InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Box_Aabb()]),
	InteractionLoop(
		[Ig2_Sphere_Sphere_ScGeom(),Ig2_Box_Sphere_ScGeom()],
		[Ip2_FrictMat_FrictMat_FrictPhys()],
		[Law2_ScGeom_FrictPhys_CundallStrack()],label="iloop"
	),
	FlowEngine(dead=1,label="flow"),
	GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8),
	NewtonIntegrator(damping=0.2)
]

#B. Activate flow engine and set boundary conditions in order to get permeability
flow.dead=0
flow.useSolver=3  
flow.permeabilityFactor=1
flow.viscosity=1e-3
flow.bndCondIsPressure=[1,1,1,1,1,1] 
flow.bndCondValue=[0,0,0,0,0,10]
flow.boundaryUseMaxMin=[1,1,1,1,1,1] 
O.dt=1e-6
O.dynDt=False
flow.emulateAction()


################## Get pores volume ################## 
box=aabbExtrema()
lower_corner=box[0]
upper_corner=box[1]
mnx=lower_corner[0]
mxx=upper_corner[0]
mny=lower_corner[1]
mxy=upper_corner[1]
mnz=lower_corner[2]
mxz=upper_corner[2]
cellsHit = []
numPoints = 20
xs = np.linspace(0.95*mnx,1.05*mxx,numPoints) 
ys = np.linspace(0.95*mny,1.05*mxy,numPoints) 
zs = np.linspace(0.95*mnz,1.05*mxz,numPoints)
v = np.array([0,0,0]) 

for x,y,z in itertools.product(xs, ys, zs):
	cellId = flow.getCell(x,y,z) 
	if cellId in cellsHit: continue 
	vv=flow.getCellVolume((x,y,z))
	print(vv)

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