# Simulating periodic triaxial test-both consolidated drained and undrained for different porosities

Asked by Debdeep Sarkar on 2019-11-18

Hello,

I am a beginner to YADE (about 1 week old). I am trying to learn using tutorials and the various queries on launchpad.net
My focus is on simulating consolidated drained and undrained triaxial tests under various effective confining pressures (80kPa, 100kPa, 150 kPa and 300kPa).

As a first step, I am trying to simulate round glass beads with porosity of 1.127 and 0.613 respectively. Most of the queries online are dealing with walls during isotropic consolidation, however I would like to have periodic boundary conditions. I have the following code as obtained from this forum and modified it accordingly through the help of tutorials:

Below is the code:
----------------------------------------------------------------------------------------------------------------------------------------
from __future__ import print_function

#import matplotlib#matplotlib.use('Agg')
# generate loose packing
num_spheres=2000,# number of spheres
compFricDegree = 44, # contact friction during the confining phase
key='_triax_CD0.61_', # put you simulation's name here
unknownOk=True
)

from yade import pack, qt, plot

sigmaIso=-1e5

O.periodic=True

num_spheres=table.num_spheres
key=table.key

targetPorosity = 0.4 #the porosity we want for the packing
compFricDegree = table.compFricDegree # initial contact friction during the confining phase (will be decreased during the REFD compaction process)
damp=0.2 # damping coefficient
stabilityThreshold=0.01 # we test unbalancedForce against this value in different loops (see below)
young=50e6 # contact stiffness

psdSizes,psdCumm=[0.25,.5,.75],[0.,0.5,1.]

sp=pack.SpherePack()
sp.makeCloud((0,0,0),(10,10,10),psdSizes=psdSizes,psdCumm=psdCumm,distributeMass=True,periodic=True)
sp.toSimulation()

print('Number of particles =',len(O.bodies))

O.engines=[
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb()]),
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom()],
[Ip2_FrictMat_FrictMat_FrictPhys()],
[Law2_ScGeom_FrictPhys_CundallStrack()]
),

PeriTriaxController(label='triax',
dynCell=True,maxStrainRate=(.001,.001,.001),
maxUnbalanced=.1,relStressTol=1e-3,
doneHook='compactionFinished()'
),
NewtonIntegrator(damping=damp),
]

O.dt=.5*PWaveTimeStep()
sxx=triax.stress,syy=triax.stress,szz=triax.stress,
exx=triax.strain,eyy=triax.strain,ezz=triax.strain,# save all available energy data
ev=triax.strain+triax.strain+triax.strain,
qq=triax.stress-0.5*(triax.stress+triax.stress),
Etot=O.energy.total(),**O.energy
)
#plot.plots={'i':('sxx','syy','szz'),}
#plot.plots={'i':('exx','eyy','ezz'),}

plot.plots={'ezz':'qq',}
plot.plot()

def compactionFinished():
print('Isotropic state achieved')
print(triax.stress,triax.stress,triax.stress)
O.cell.trsf=Matrix3.Identity
triax.goal=(sigmaIso,sigmaIso,-.1)
triax.maxStrainRate=(0.5,0.5,.0001)
triax.doneHook='triaxFinished()'
triax.maxUnbalanced=10
def triaxFinished():
print('Finished')
O.pause()
---------------------------------------------------------------------------------------------------------

Some parts have not at all been used but has been simply copy-pasted into the code.

My question is: how can I control the initial porosity using periodic triaxial controller? I tried but it showed error: AttributeError: 'PeriTriaxController' has no attribute 'porosity'.

Also, as I understand, the code above is only for Consolidated drained (CD) case. I would like to simulate undrained cases (CU) for both low and high porosities. Can someone point me in the right direction as to what changes need to be incorporated into the code so that I can control the porosity, as well as drained/undrained condition?

Debdeep.

## Question information

Language:
English Edit question
Status:
Expired
For: