Unable to run a CapillaryTriaxialTest

Asked by Gary Pekmezi

Hello everyone,

I successfully ran a triaxial compression test using the TriaxialTest() preprocessor. However, if I try to add capillary physics the simulation does not appear to work.

The only differences between my working TriaxialTest() script and CapillaryTriaxialTest() are as follows:
1) Change "TriaxialTest" to "CapillaryTriaxialTest"
2) Change "radiusStdDev" to "Rdispersion"
3) Add "collider.verletDist=0" (I added this because the collider complained about not finding NewtonIntegrator)

I have capillary pressure at 0 as I am currently just trying to get it working. The particle packing does not appear to happen at all, I just get a porosity of 1.0. I tried it with Yade1.07 as well as the daily 1.20 build.

I confess to being a novice, am I missing something obvious?

Below is my script

Thanks,
Gary

############################################
### DEFINING VARIABLES AND MATERIALS ###
############################################

num_spheres=7000# number of spheres
key='_triax_base_'
compFricDegree = 15 # initial contact friction during the confining phase
finalFricDegree = 15 # contact friction during the deviatoric loading
rate=25.0 # loading rate (strain rate)
damp=0.2 # damping coefficient
young=50.0e6 # contact stiffness
mn,mx=Vector3(0,0,0),Vector3(0.00004,0.00004,0.00004) # corners of the initial packing
confinement_p = 10000.0
triaxial_p = 1.0e4
cap_p = 10000.0

############################
### Triaxial Test ###
############################

ttest=CapillaryTriaxialTest(
 Key=key,
 boxYoungModulus=young,
 compactionFrictionDeg=compFricDegree,
# capillaryPressure=cap_p,
 dampingForce=damp,
 finalMaxMultiplier=1.+2e3/young, # spheres growing factor (slow growth)
# internalCompaction=True,
 lowerCorner=mn,
 maxMultiplier=1.+2e4/young, # spheres growing factor (fast growth)
 numberOfGrains=num_spheres,
 radiusMean=0.0000008,
 Rdispersion=0.1,
 recordIntervalIter=200,
 sigmaIsoCompaction=confinement_p,
 sigmaLateralConfinement=triaxial_p,
 sphereFrictionDeg=finalFricDegree,
 sphereYoungModulus=young,
 strainRate=rate,
 timeStepUpdateInterval=100,
 upperCorner=mx,
# water=False,
)

ttest.load()

triax=typedEngine('TriaxialCompressionEngine')
recorder=typedEngine('TriaxialStateRecorder')
newton=typedEngine('NewtonIntegrator')
collider=typedEngine('InsertionSortCollider')

collider.verletDist=0
#####################################################
### Record and plot data ###
#####################################################

from yade import plot
from yade import timing

## a function saving variables
def history():
   plot.addData(e11=triax.strain[0], e22=triax.strain[1], e33=triax.strain[2],
        ev=-triax.strain[0]-triax.strain[1]-triax.strain[2],
      s11=triax.stress(triax.wall_top_id)[0],
      s22=triax.stress(triax.wall_right_id)[1],
      s33=triax.stress(triax.wall_front_id)[2],
      i=O.iter)

O.engines=O.engines[0:5]+[PyRunner(iterPeriod=200,command='history()',label='recorder')]+O.engines[5:7]

O.timingEnabled=True
totalTime=0
import sys
for i in range(0,1000):
 O.run(100,True)
 totalTime+=sum([e.execTime for e in O.engines])
 print '\r Total time: %g s'%(totalTime/1e9)," state:",triax.currentState," progress:",(i/10.0),"%\r",
 timing.reset()
 sys.stdout.flush()

O.save('finalState'+key+'.yade.gz')
print "\n### Final state saved ###"

plot.plots={'i':('e11','e22','e33',None,'s11','s22','s33')}

plot.plot()
plot.saveDataTxt('results'+key)
plot.saveGnuplot('plotScript'+key)

Question information

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

Hello,

I'm not used to preprocessor functions (your CapillaryTriaxialTest() function) to define simulations, but some significant problems can be inferred from your description

- the fact the collider does not find NewtonIntegrator is very annoying since this engine is central to most (all for beginners, probably) YADE simulations. You may check if it is indeed absent prompting for the engines list: just type "O.engines" (then Enter key)

- second, the absence of spheres is also, obviously, a problem. It may be related to the internals of the CapillaryTriaxialTest() function.

As suggestions:
* what about generating a default CapillaryTriaxialTest preprocessor, with ttest=CapillaryTriaxialTest() (without specifying yourself any argument). It seems to work here on my PC (with a kind of private YADE version)
* or using the preprocessor from the "Generate" of Graphical Interface (just type F9 and you should get the corresponding window)

If this works, you may then changing, if necessary, the default arguments step by step. This would probably allow you to isolate the problem, if any.

Jerome

Revision history for this message
Jérôme Duriez (jduriez) said :
#2

Re-thinking about it, starting from some "TriaxialTest" script to switch to a "CapillaryTriaxialTest" script could work only if the argument lists between the 2 preprocessor functions are consistent.. You seem to have taken care of it for what concerns radiusStdDev / Rdispersion. Is it enough ?

(I do not know myself but the possible presence of error messages should help you -- unfortunately I could not try your script as it is too long with non-needed lines such as the ones about saving data)

Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#3

Hello,
My suggestion is to use either the preprocessors through the GUI _OR_ python scripts. Don't mix scripting and preprocessing.
There is no fundamental reason for not doing such a mix. What you are trying to do is possible in principle, but it is awkward and it adds unnecessary levels of compexity.
My suggestion is to just forget preprocessors and learn the triaxial tutorials.

Bruno

Revision history for this message
Gary Pekmezi (gpekmezi) said :
#4

Jerome,
Thank you for your assistance. Your suggestion of using "Generate" with the graphical interface worked, which led me to believe the problem was with my plot commands. Sure enough, the command below which I had copied from one of the example scripts actually deleted some of my engines... whooops!

O.engines=O.engines[0:5]+[PyRunner(iterPeriod=200,command='history()',label='recorder')]+O.engines[5:7]

It worked for TriaxialTest() because TriaxialTest() contains the same number of engines as the triaxial sample script, however CapillaryTriaxialTest() contains a few more engines. After changing the above line to the line below, everything appears to work.

O.engines=O.engines[:]+[PyRunner(iterPeriod=200,command='history()',label='recorder')]

Thanks,
Gary

Revision history for this message
Gary Pekmezi (gpekmezi) said :
#5

Thanks for you reply Bruno,

I tried to do what you suggest initially (modifying the sample triaxial script to add capillary physics), then focused my efforts on the preprocessor when that failed. I now realize my problem was one and the same for both, I was deleting engines with my plot command. Both approaches are now working that I actually understand how to insert a periodical history command.

Thanks
Gary

Revision history for this message
Chareyre (bruno-chareyre-9) said :
#6

Good to hear (or "read")!