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:
- 2020-10-22
- Last query:
- 2020-10-22
- Last reply:
- 2020-10-22
This question was reopened
- 2020-10-21 by Othman Sh
Robert Caulk (rcaulk) said : | #1 |
Hello,
> I found this function in Yade documentation:
volume( [ (int)id=0 ] ) → float
Returns the volume of Voronoi’s cell of a sphere
Please link to the documentation!
>My code is copied below. The packing txt file link is here [2]
Please don't link to external sources! Please review our posting guidelines if you wish to receive efficient assitance with your Yade related problems -> -> -> [1] <- <- <-
>1- Is this the correct approach to get the pore volume for each individual cell ID?
No, use getCellVolume [2]
>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)?
getCellVolume [2] is the full volume of the tetrahedra. getInvVoidVolume [3] is the inverse of the void volume.
Thanks again for following our forum guidelines ([1]) for your follow up posts/questions :-)
Cheers,
Robert
[1]https:/
[2]https:/
[3]https:/
Othman Sh (othman-sh) said : | #2 |
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 getCellInvVoidV
What is (int) arg2?
Also in the code blow, I tried using flow.getInvVoid
'FlowEngine' object has no attribute 'getInvVoidVolume'
Thanks for helping with this issue.
Othman
[1]https:/
-------
from yade import plot,pack, export, ymport
import numpy as np
young=1e6
compFricDegree = 3
mn,mx=Vector3(
O.materials.
O.materials.
walls=aabbWalls
wallIds=
sp=pack.
sp.makeCloud(
sp.toSimulation
yade.qt.View()
print ('porosity = ', utils.porosity())
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=1e-3
flow.bndCondIsP
flow.bndCondVal
flow.boundaryUs
O.dt=1e-6
O.dynDt=False
flow.emulateAct
################## 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(
ys = np.linspace(
zs = np.linspace(
v = np.array([0,0,0])
for x,y,z in itertools.
cellId = flow.getCell(x,y,z)
if cellId in cellsHit: continue
vv=flow.
print(vv)
Robert Caulk (rcaulk) said : | #3 |
>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?
Yup. Except you should use getCellInvVoidV
>What is (int) arg2?
The id of the cell of interest.
>'FlowEngine' object has no attribute 'getInvVoidVolume'
FlowEngine does not have that attribute. It does, however, have the attribute the getCellInvVoidv
Robert Caulk (rcaulk) said : | #4 |
This function, getCellInvVoidV
Othman Sh (othman-sh) said : | #5 |
My bad, looks like I just copied getInvVoidVolume from post #1 and I should have copied it from the reference link. I tried the correct function getCellInvVoidV
Thanks for your help. This solved my problem
Othman Sh (othman-sh) said : | #6 |
Hello,
It has been a couple of weeks since the merge request mentioned in reply #4 but the getCellInvVoidV
Thank you,
Othman
-------
from yade import plot,pack, export, ymport
import numpy as np
young=1e6
compFricDegree = 3
mn,mx=Vector3(
O.materials.
O.materials.
walls=aabbWalls
wallIds=
sp=pack.
sp.makeCloud(
sp.toSimulation
yade.qt.View()
print ('porosity = ', utils.porosity())
O.engines=[
ForceResetter(),
InsertionSortC
InteractionLoop(
[Ig2_
[Ip2_
[Law2_
),
FlowEngine(
GlobalStiffnes
NewtonIntegrat
]
flow.dead=0
flow.useSolver=3
flow.permeabili
flow.viscosity=1e-3
flow.bndCondIsP
flow.bndCondVal
flow.boundaryUs
O.dt=1e-6
O.dynDt=False
flow.emulateAct
################## 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(
ys = np.linspace(
zs = np.linspace(
v = np.array([0,0,0])
for x,y,z in itertools.
cellId = flow.getCell(x,y,z)
if cellId in cellsHit: continue
vv=flow.
print(vv)
Robert Caulk (rcaulk) said : | #7 |
Hello,
Your Yade version/
if you hope for any kind of assistance regarding Yade versions [1].
Assuming you have the correct Yade version: you do not appear to be
following the instructions dictated by the doc [2].
Cheers,
Robert
[1]https:/
[2]
https:/
On Thu, Oct 22, 2020 at 1:36 AM Othman Sh <
<email address hidden>> wrote:
> Question #693297 on Yade changed:
> https:/
>
> Status: Solved => Open
>
> Othman Sh is still having a problem:
> Hello,
>
> It has been a couple of weeks since the merge request mentioned in reply
> #4 but the getCellInvVoidV
> always return 0 values. I tried it using the code below. I appreciate
> any help in fixing this issue.
>
> Thank you,
> Othman
>
> -------
> from yade import plot,pack, export, ymport
> import numpy as np
>
>
> young=1e6
> compFricDegree = 3
> mn,mx=Vector3(
>
>
> O.materials.
>
> O.materials.
> walls=aabbWalls
> wallIds=
>
>
> sp=pack.
> sp.makeCloud(
> sp.toSimulation
>
> yade.qt.View()
>
> print ('porosity = ', utils.porosity())
> O.engines=[
> ForceResetter(),
> InsertionSortCo
> InteractionLoop(
> [Ig2_Sphere_
> [Ip2_FrictMat_
> [Law2_ScGeom_
> ),
> FlowEngine(
>
> GlobalStiffness
> NewtonIntegrato
> ]
>
>
> flow.dead=0
> flow.useSolver=3
> flow.permeabili
> flow.viscosity=1e-3
> flow.bndCondIsP
> flow.bndCondVal
> flow.boundaryUs
> O.dt=1e-6
> O.dynDt=False
> flow.emulateAct
>
>
> ################## 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(
> ys = np.linspace(
> zs = np.linspace(
> v = np.array([0,0,0])
>
> for x,y,z in itertools.
> cellId = flow.getCell(x,y,z)
> if cellId in cellsHit: continue
> vv=flow.
> print(vv)
>
> --
> You received this question notification because your team yade-users is
> an answer contact for Yade.
>
> _______
> Mailing list: https:/
> Post to : <email address hidden>
> Unsubscribe : https:/
> More help : https:/
>
Othman Sh (othman-sh) said : | #8 |
Hi Robert,
I am using Yadedaily. I have added this "flow.iniVoidVo