change in volume of meniscus as a function of capillary pressure

Asked by Seungcheol Yeom

Hello all,

I hope you all well. I have a simple question.
I am wondering whether I can simulate the change in volume of meniscus as a function of capillary pressure.
It seems like I can change the capillary pressure in the loop but the interaction between the spheres are not updated.
Here is my script:

from yade import plot, geom

r = 3e-6 #particle radius of clay, meter
h = 1e-6 #praticle distance, meter

#create two sphere paticles#
O.bodies.append([
   utils.sphere(center=(0,0,0),radius=r,fixed=True),
   utils.sphere((0,0,2*r+h),r,fixed=True)
])

#define engines#
O.engines=[
   ForceResetter(), #0
   InsertionSortCollider([Bo1_Sphere_Aabb(aabbEnlargeFactor=2)]), #1
   InteractionLoop(
      [Ig2_Sphere_Sphere_ScGeom(interactionDetectionFactor=2)], #2
      [Ip2_FrictMat_FrictMat_MindlinCapillaryPhys()],
      [Law2_ScGeom_MindlinPhys_Mindlin(neverErase=True)]
   ),
   Law2_ScGeom_CapillaryPhys_Capillarity(capillaryPressure=10000,label='capillary'), #3
   NewtonIntegrator(damping=0.4,gravity=(0,0,0)), #4
   PyRunner(command='change_capillary()',iterPeriod=100,label='start'), #5
]

O.trackEnergy = True

capillary.createDistantMeniscii=True
O.run(1,True)
capillary.createDistantMeniscii=False

#define the force on the sphere#
def change_capillary():
 global cur_capillary,delta_V,count
 count = 0
 while (count<1):
  cur_capillary = capillary.capillaryPressure - 100
  i = O.interactions[0,1]
  delta_V = i.phys.vMeniscus
  i.phys.isBroken = True
  O.engines = O.engines[:3]+[Law2_ScGeom_CapillaryPhys_Capillarity(capillaryPressure=cur_capillary,label='capillary')]+O.engines[3:]
  count = count + 1
  print cur_capillary,delta_V
  if cur_capillary < 9000:
   O.pause()

O.dt=0.5*PWaveTimeStep()
O.run()

Any helps are appreciated.

Sincerely,

Seungcheol

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Christian Jakob
Solved:
Last query:
Last reply:
Revision history for this message
Christian Jakob (jakob-ifgt) said :
#1

Hi,

O.engines = O.engines[:3]+[Law2_ScGeom_CapillaryPhys_Capillarity(capillaryPressure=cur_capillary,label='capillary')]+O.engines[3:]

Maybe this line is the problem in your script (not tested, not sure what it does). If the engine label is 'capillary' you can try this line instead:

capillary.capillaryPressure = cur_capillary

Revision history for this message
Seungcheol Yeom (scyeom79) said :
#2

Hi Chris,

I have tried that way but the volume of meniscus became 0 after 9900 of capillary pressure.
I think I need something to reactivate is.Broken = False to create the meniscus.
Thank you.

Seungcheol

Revision history for this message
Best Christian Jakob (jakob-ifgt) said :
#3

I think you do not need i.phys.isBroken at all. What you need is at least 1 step between parameter change and measurement.

Good luck

Revision history for this message
Seungcheol Yeom (scyeom79) said :
#4

Wow, I thought them too much complicated.
Thanks!!!

Revision history for this message
Seungcheol Yeom (scyeom79) said :
#5

Thanks Christian Jakob, that solved my question.