2PFV - Cell Velocity

Asked by Luis Barbosa

Hi guys,

I am using 2PFV, but have trouble to getCellVelocity.

Triangulation does not exist. Sorry.
Traceback (most recent call last):
  File "/usr/bin/yade", line 343, in runScript
    execfile(script,globals())
  File "/usr/lib/python3/dist-packages/past/builtins/misc.py", line 87, in execfile
    exec_(code, myglobals, mylocals)
  File "matrix_drain_scaled21_Calibrado2.py", line 344, in <module>
    celsVel1=unsat.getCellVelocity(ii)
Boost.Python.ArgumentError: Python argument types in
    TwoPhaseFlowEngineT.getCellVelocity(TwoPhaseFlowEngine, int)
did not match C++ signature:
    getCellVelocity(yade::TemplateFlowEngine_TwoPhaseFlowEngineT<yade::TwoPhaseCellInfo, yade::TwoPhaseVertexInfo, yade::CGT::_Tesselation<yade::CGT::TriangulationTypes<yade::TwoPhaseVertexInfo, yade::TwoPhaseCellInfo> >, yade::CGT::FlowBoundingSphereLinSolv<yade::CGT::_Tesselation<yade::CGT::TriangulationTypes<yade::TwoPhaseVertexInfo, yade::TwoPhaseCellInfo> >, yade::CGT::FlowBoundingSphere<yade::CGT::_Tesselation<yade::CGT::TriangulationTypes<yade::TwoPhaseVertexInfo, yade::TwoPhaseCellInfo> > > > > {lvalue}, Eigen::Matrix<double, 3, 1, 0, 3, 1> pos)

I modified the example - https://gitlab.com/yade-dev/trunk/-/blob/master/examples/FluidCouplingPFV/oedometer.py

#######################################################
## Drainage Test under oedometer conditions ###
#######################################################
##Instantiate a two-phase engine
unsat=TwoPhaseFlowEngine()
#meanDiameter=(O.bodies[-1].shape.radius + O.bodies[6].shape.radius) / 2.

##set boundary conditions, the drainage is controlled by decreasing W-phase pressure and keeping NW-phase pressure constant
unsat.bndCondIsPressure=[0,0,1,1,0,0]
unsat.bndCondIsWaterReservoir=[0,0,1,0,0,0]
unsat.bndCondValue=[0,0,-1e8,0,0,0]
unsat.isPhaseTrapped=True #the W-phase can be disconnected from its reservoir
unsat.initialization()
unsat.surfaceTension = 0.0728
unsat.updateTriangulation=True
unsat.meshUpdateInterval=200
unsat.defTolerance=0.3

#unsat.breakControlledRemesh=True

#start invasion, the data of normalized pc-sw-strain will be written into pcSwStrain.txt

f1=open('MatrixCellsa4'+str(YM)+'_'+str(BS)+'.txt',"w")

ts=O.dt
pgstep= 40 #45000000*ts #30Pa/s
print (pgstep)
pgmax= 10000#9316 #Pa
mi=0.00089 #Pa.s

for pg in arange(1.0e-8,pgmax,pgstep):
  unsat.bndCondValue=[0,0,(-1.0)*pg,0,0,0]
  unsat.invasion()
  unsat.computeCapillaryForce()
  unsat.permeabilityMap=True

  q=unsat.averageVelocity()
  L=0.0016*(1+triax.strain[1]+ei1)
  P=abs((mi*q*L)/pg)
  print(unsat.getSaturation(isSideBoundaryIncluded=False),pg,-triax.strain[1],P,triax.porosity)

  for b in O.bodies:
    O.forces.setPermF(b.id, unsat.fluidForce(b.id))

  if pg==520.00000001:
    cels=unsat.nCells()
    celsW1 = [0.0]*cels
    celsV1 = [0.0]*cels
    celsBar1 = [0.0]*cels
    celsPore1 = [0.0]*cels
    celsVel1 = [0.0]*cels
    celsSA1 = [0.0]*cels
    for ii in range(cels):
      celsW1=unsat.getCellIsWRes(ii)
      celsV1=unsat.getCellVolume(ii)
      celsBar1=unsat.getCellCenter(ii)
      celsPore1=unsat.getPoreThroatRadiusList(ii)
      celsVel1=unsat.getCellVelocity(ii)
      celsSA1=unsat.getSolidSurfaceAreaPerParticle(ii)
      f1.write(str(celsW1)+" "+str(celsV1)+" "+str(celsBar1)+" "+str(celsPore1)+" "+str(celsVel1)+" "+str(celsSA1)+"\n")
    f1.close()

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Robert Caulk
Solved:
Last query:
Last reply:
Revision history for this message
Best Robert Caulk (rcaulk) said :
#1

Hello,

You need to provide the coordinates of the cell to this function [1]:

unsat.getCellVelocity((1,1,1))

To get velocity at the location of (1,1,1).

Cheers,

Robert

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

Revision history for this message
Luis Barbosa (luis-pires-b) said :
#2

Thanks Robert Caulk, that solved my question.