← Back to team overview

yade-users team mailing list archive

[Question #685990]: Simulating periodic triaxial test-both consolidated drained and undrained for different porosities

 

New question #685990 on Yade:
https://answers.launchpad.net/yade/+question/685990

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
nRead=readParamsFromTable(
 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
from yade.params import table

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)
finalFricDegree = 44 # contact friction during the deviatoric loading
rate=-0.02 # loading rate (strain rate)
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',
		goal=(sigmaIso,sigmaIso,sigmaIso),stressMask=7,
		dynCell=True,maxStrainRate=(.001,.001,.001),
		maxUnbalanced=.1,relStressTol=1e-3,
		doneHook='compactionFinished()'
	),
	NewtonIntegrator(damping=damp),
	PyRunner(command='addPlotData()',iterPeriod=100),
]


O.dt=.5*PWaveTimeStep()
def addPlotData():
	plot.addData(unbalanced=unbalancedForce(),i=O.iter,
	sxx=triax.stress[0],syy=triax.stress[1],szz=triax.stress[2],
	exx=triax.strain[0],eyy=triax.strain[1],ezz=triax.strain[2],# save all available energy data
	ev=triax.strain[0]+triax.strain[1]+triax.strain[2],
	qq=triax.stress[2]-0.5*(triax.stress[0]+triax.stress[1]),
	Etot=O.energy.total(),**O.energy
	)
#plot.plots={'i':('sxx','syy','szz'),}
#plot.plots={'i':('exx','eyy','ezz'),}

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




setContactFriction(radians(finalFricDegree))

def compactionFinished():
	print('Isotropic state achieved')
	print(triax.stress[0],triax.stress[1],triax.stress[2])
	O.cell.trsf=Matrix3.Identity
	triax.goal=(sigmaIso,sigmaIso,-.1)
	triax.stressMask=7
	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?

Thank you in advance,
Debdeep.

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.