wet phase distribution
Hi all,
When using yade.wrapper.
Cheers,
Luis
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Robert Caulk
- Solved:
- 2021-03-16
- Last query:
- 2021-03-16
- Last reply:
- 2021-03-08
Robert Caulk (rcaulk) said : | #1 |
Sure. Iterate on the cells [1] and use [2] and [3].
[1]https:/
[2]https:/
[3]https:/
Luis Barbosa (luis-pires-b) said : | #2 |
Thanks Robert.
I have just two more questions:
1. getCellIsWRes is giving if there is wet phase or not. Wehrever if it is trapped or not. Is that right?
2. I want to spatially locate the wet cells, so what is the difference between getCellCenter and getCell?
Kind regards,
Luis
Hi, documentation might help here:
In [4]: TwoPhaseFlowEng
Docstring:
getCell( (TwoPhaseFlowEn
get id of the cell containing (X,Y,Z).
Type: function
In [5]: TwoPhaseFlowEng
Docstring:
getCellCenter( (TwoPhaseFlowEn
get voronoi center of cell 'id'.
They do nearly the opposite.
Bruno
Luis Barbosa (luis-pires-b) said : | #4 |
Thank you all.
When I run the code [1], getCellBarycenter giving some strange values (coordinates totally outside my sample):
For instance, these values 125107.48 or -125097.48:
True 0.01797170859509369 Vector3(
True 0.0116560838366
True 0.0205288705758
True 0.01815466910920833 Vector3(
is it some mistake in the usage?
[1]
import matplotlib; matplotlib.
from yade import pack
import pylab
from numpy import *
utils.readParam
from yade.params import table
seed=table.seed
#num_spheres=
compFricDegree = table.compFricD
confiningS=-1e5
## creat a packing with a specific particle side distribution (PSD)
#psdSizes,
sp=pack.
sp1=pack.
mn,mx=Vector3(
mnn,mxx=
mnc,mxc=
sp.makeCloud(
sp1.makeCloud(
## create material #0, which will be used as default
O.materials.
O.materials.
O.materials.
## create walls around the packing
walls=aabbWalls
wallIds=
O.bodies.
O.bodies.
triax=TriaxialS
internalCompac
goal1=confiningS,
goal2=confiningS,
goal3=confiningS,
max_vel=10,
label="triax"
)
newton=
O.engines=[
ForceResetter(),
InsertionSortC
InteractionLoop(
[Ig2_
[Ip2_
[Law2_
),
GlobalStiffnes
triax,
# VTKRecorder(
newton
]
while 1:
O.run(1000,True)
unb=unbalance
if unb<0.01 and abs(triax.
break
#######
## REACH NEW EQU. STATE ###
#######
finalFricDegree = 30 # contact friction during the deviatoric loading
#We move to deviatoric loading, let us turn internal compaction off to keep particles sizes constant
triax.internalC
# Change contact friction (remember that decreasing it would generate instantaneous instabilities)
setContactFrict
while 1:
O.run(1000,True)
unb=unbalance
if unb<0.001 and abs(triax.
break
triax.depth0=
triax.height0=
triax.width0=
O.save(
O.run(1000,True)
ei0=-triax.
si0=-triax.
from yade import plot
O.engines=
def history():
plot.addData(
s11=-
s22=-
s33=-
pc=-unsat.
sw=unsat.
i=O.iter
)
plot.plots=
plot.plot()
#######
## Drainage Test under oedometer conditions ###
#######
##oedometer conditions
triax.stressMask=2
triax.goal1=
goalTop=
triax.goal2=goalTop
triax.wall_
recorder.dead=0
##Instantiate a two-phase engine
unsat=TwoPhaseF
meanDiameter=
##set boundary conditions, the drainage is controlled by decreasing W-phase pressure and keeping NW-phase pressure constant
unsat.bndCondIs
unsat.bndCondVa
unsat.isPhaseTr
unsat.initializ
unsat.surfaceTe
#start invasion, the data of normalized pc-sw-strain will be written into pcSwStrain.txt
f1=open(
f5=open(
for pg in arange(
#increase gaz pressure at the top boundary
unsat.
#compute the evolution of interfaces
unsat.invasion()
#save the phases distribution in vtk format, to be displayed by paraview
# unsat.savePhase
#compute and apply the capillary forces on each particle
unsat.
for b in O.bodies:
O.forces.
if pg==0.60001:
cels=
celsW1 = [0.0]*cels
celsV1 = [0.0]*cels
celsBar1 = [0.0]*cels
for ii in range(cels):
celsW1=
celsV1=
celsBar1=
f1.
f1.close()
#reac
while 1:
O.run(
unb=
if unb<0.001:
break
f5.write(
f5.close()
|
#5 |
>When I run the code [1], getCellBarycenter giving some strange values (coordinates totally outside my sample):
Well, nCells includes all cells in the triangulation, including cells associated with the boundary. The boundary would by definition not be inside your specimen. You can filter those out using spatial coordinates if you only want cells "inside your specimen."
Luis Barbosa (luis-pires-b) said : | #6 |
Thank!
Luis Barbosa (luis-pires-b) said : | #7 |
Thanks Robert Caulk, that solved my question.