Bug in Calculating getSaturation in TwoPhaseFlow Engine

Asked by Saeed

hi there
I had a problem using TwoPhaseFlow Engine
The value of Saturation Degree 'getSaturation(False)' was shown properly while doing drainage,but after the dry, I close the pressure related to water in bottom of box by 'bndCondIsPressure=[0,0,0,1,0,0]' . I provide Oedometer conditions for the loading

According to the formula
Porosity=VolumeOfVoids/BoxVolume
VoidVolumes=Porosity*BoxVolume

The volume of Voids containing the air and Water.
We have blocked the way out water by 'bndCondIsPressure=[0,0,0,1,0,0]' While Loading, So Volume of Water while loading is Constant.
And only the volume of air in the ٰVoid decreases

According to the formula
DegreeOfSaturation=VolumeOfWater/VolumeOfVoids
while Oedometer loading:
VolumeOfWater > Constant
VolumeOfVoids > Decresed
So DegreeOfSaturation must be Increased while loading but in TwoPhaseFlow Engine , Degree of Saturation No changed!!!
-----------------------------------
CODE:

import matplotlib; matplotlib.rc('axes',grid=True)
from yade import pack
import pylab
from numpy import *

utils.readParamsFromTable(seed=1,num_spheres=1000,compFricDegree = 15.0)
from yade.params import table

seed=table.seed
num_spheres=table.num_spheres
compFricDegree = table.compFricDegree
confiningS=-1e5

psdSizes,psdCumm=[.599,0.6,0.849,0.85,1.0,1.40],[0.,0.35,0.35,0.70,.70,1.]
sp=pack.SpherePack()
mn,mx=Vector3(0,0,0),Vector3(10,10,10)
sp.makeCloud(minCorner=mn,maxCorner=mx,psdSizes=psdSizes,psdCumm=psdCumm,distributeMass=True,num=num_spheres,seed=seed)

O.materials.append(FrictMat(young=15e7,poisson=.4,frictionAngle=radians(compFricDegree),density=2600,label='spheres'))
O.materials.append(FrictMat(young=15e7,poisson=.4,frictionAngle=0,density=0,label='frictionless'))

walls=aabbWalls((mn,mx),thickness=0,material='frictionless')
wallIds=O.bodies.append(walls)

O.bodies.append([utils.sphere(center,rad,material='spheres') for center,rad in sp])

triax=TriaxialStressController(
 internalCompaction=True,
 goal1=confiningS,
 goal2=confiningS,
 goal3=confiningS,
 max_vel=10,
 label="triax"
)

newton=NewtonIntegrator(damping=0.4)

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()]
 ),
 GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8),
 triax,
 newton
]

while 1:
  O.run(1000,True)
  unb=unbalancedForce()
  if unb<0.01 and abs(triax.goal1-triax.meanStress)/abs(triax.goal1)<0.01:
    break

#############################
## REACH NEW EQU. STATE ###
#############################
finalFricDegree = 30 # contact friction during the deviatoric loading
triax.internalCompaction=False
setContactFriction(radians(finalFricDegree))

while 1:
  O.run(1000,True)
  unb=unbalancedForce()
  if unb<0.01 and abs(triax.goal1-triax.meanStress)/abs(triax.goal1)<0.01:
    break

triax.depth0=triax.depth
triax.height0=triax.height
triax.width0=triax.width

O.run(1000,True)
ei0=-triax.strain[0];ei1=-triax.strain[1];ei2=-triax.strain[2]
si0=-triax.stress(0)[0];si1=-triax.stress(2)[1];si2=-triax.stress(4)[2]

from yade import plot
O.engines=O.engines+[PyRunner(iterPeriod=20,command='history()',dead=1,label='recorder')]

def history():
   plot.addData(e11=-triax.strain[0]-ei0, e22=-triax.strain[1]-ei1, e33=-triax.strain[2]-ei2,
      s11=-triax.stress(0)[0]-si0,
      s22=-triax.stress(2)[1]-si1,
      s33=-triax.stress(4)[2]-si2,
      pc=-unsat.bndCondValue[2],
      sw=unsat.getSaturation(False),
      i=O.iter
      )

plot.plots={'pc':('sw',None,'e22')}
plot.plot()

######################################
## Drainage Test under oedometer conditions ###
######################################
triax.stressMask=2
triax.goal1=triax.goal3=0
goalTop=triax.stress(3)[1]
triax.goal2=goalTop
triax.wall_bottom_activated=0
recorder.dead=0
unsat=TwoPhaseFlowEngine()
meanDiameter=(O.bodies[-1].shape.radius + O.bodies[6].shape.radius) / 2.
unsat.bndCondIsPressure=[0,0,1,1,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 = 10

for pg in arange(1.0e-5,5.0,0.1):
  unsat.bndCondValue=[0,0,(-1.0)*pg*unsat.surfaceTension/meanDiameter,0,0,0]
  unsat.invasion()
  unsat.computeCapillaryForce()
  for b in O.bodies:
    O.forces.setPermF(b.id, unsat.fluidForce(b.id))
  while 1:
    O.run(1000,True)
    unb=unbalancedForce()

    if unb<0.01:
      break
  print 'PC:',-unsat.bndCondValue[2],' Sw:',unsat.getSaturation(False),' VoidVolume:',triax.porosity*triax.boxVolume

print '----------LOADING--------------'
## Oedometer conditions
unsat.bndCondIsPressure=[0,0,0,1,0,0]
triax.stressMask=2
triax.goal1=triax.goal3=0
goalTop=triax.stress(3)[1]
triax.goal2=goalTop
triax.wall_bottom_activated=False
loadingMatrix=[-500e3,-1000e3,-1500e3,-2000e3,-2500e3,-3000e3]
for i in arange(0,len(loadingMatrix),1):
 triax.goal2=loadingMatrix[i]
 O.run(2000,True)
 print 'Load:',loadingMatrix[i],' Sw:',unsat.getSaturation(False),' VoidVolume:',triax.porosity*triax.boxVolume

-------------------------------------------------------------------------
end of code
-------------------------------------------------------------------------

The answer I see is wrong:

Load: -500000.0 Sw : 0.342644313462 VoidVolume: 416.023513815
Load: -1000000.0 Sw : 0.342644313462 VoidVolume: 397.169630442
Load: -1500000.0 Sw : 0.342644313462 VoidVolume: 379.874928145
Load: -2000000.0 Sw : 0.342644313462 VoidVolume: 364.400131389
Load: -2500000.0 Sw : 0.342644313462 VoidVolume: 349.46032174
Load: -3000000.0 Sw : 0.342644313462 VoidVolume: 336.874781629
---------------------------------------------------------
It is observed that due to the closure of the water outlet, the volume of Voids decreased but the amount of saturation remained constant during loading, which is incorrect

Question information

Language:
English Edit question
Status:
Invalid
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Jérôme Duriez
Solved:
Last query:
Last reply:
Revision history for this message
Jérôme Duriez (jduriez) said :
#1