Pore volume - FlowEngine
Hi All,
I am trying to obtain the volume of individual pores in my sphere packing. I found this function in Yade documentation:
volume( [ (int)id=0 ] ) → float
Returns the volume of Voronoi’s cell of a sphere
I have few questions here:
1- Is this the correct approach to get the pore volume for each individual cell ID?
2- Does this function gives the volume of the whole tetrahedron element (which includes part of the spheres surrounding the pore as in Fig.3a in [1]) or just the pore (i.e. fluid phase)?
3- In my code below, this function is not working and I get this error: Segmentation fault (core dumped)
I have tried using this function in the terminal and I found that it sometimes give a value for some cell IDs and most of the time it will crush and this error occurs. My code is copied below. The packing txt file link is here [2]
I will appreciate your help in answering my questions.
Thank you,
Othman
[1] https:/
[2] https:/
-------
from yade import plot,pack, export, ymport
import numpy as np
P=4347 #Pa
visc=1e-3 #Pa.sec
density=1000 #kg/m3
g=9.81 #m/s2
radiuscyl=.05
########## create walls ##########
allx,ally,
mnx=min(allx)*0.999
mny=min(ally)*0.999
mnz=min(allz)*0.999
mxx=max(allx)*1.001
mxy=max(ally)*1.001
mxz=max(allz)*1.001
mn,mx=Vector3(
walls=aabbWalls
wallIds=
########## spheres ##########
spheres=
yade.qt.View()
Height=
dP=P/Height #Pa/m
for i in spheres:
body= O.bodies[i]
body.state.
print ('porosity = ', utils.porosity())
Height=
O.engines=[
ForceResetter(),
InsertionSortC
InteractionLoop(
[Ig2_
[Ip2_
[Law2_
),
FlowEngine(
GlobalStiffnes
NewtonIntegrat
]
#B. Activate flow engine and set boundary conditions in order to get permeability
flow.dead=0
flow.useSolver=3
flow.permeabili
flow.viscosity=visc
flow.bndCondIsP
flow.bndCondVal
flow.boundaryUs
O.dt=1e-6
O.dynDt=False
flow.emulateAct
#######
#######
#######
cellsHit = []
numPoints = 20
xs = np.linspace(
ys = np.linspace(
zs = np.linspace(
v = np.array([0,0,0])
for x,y,z in itertools.
cellId = flow.getCell(x,y,z) #getCell return cell id for a point position xyz
if cellId in cellsHit: continue #this prevents counting a cell multiple times
cellsHit.
VV=flow.
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Othman Sh
- Solved:
- Last query:
- Last reply:
This question was reopened
- by Othman Sh