Triaxial cohesive
Dear all,
I have done some small changes on cohesive triaxial script - changing the normal and cohesion values for two type of materials - but the results does not make sense - unbalace force nan and mean stress zero
can you please advise me what is my mistake thanks
#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import division
from yade import plot,pack,timing
import time, sys, os, copy
from yade import ymport, utils, pack, export
#from pylab import *
import math
import numpy as np
#######
### DEFINING VARIABLES AND MATERIALS ###
#######
# default parameters or from table
readParamsFromT
targetPorosity
num_spheres=3000,# number of spheres
young=236e9,
poisson=.2,
density=2600,
frictionAngle=
normalCohesion
shearCohesion=
etaRoll=0.1,
compFricDegree=30, # contact friction during the confining phase
finalFricDegre
key='_
rate=-0.02, # loading rate (strain rate)
damp=0.7, # damping coefficient
stabilityThres
)
from yade.params import table
from yade.params.table import *
mn,mx=Vector3(
## create materials for spheres and plates
mat1=CohFrictMa
mat_1=O.
mat2=CohFrictMa
mat_2=O.
O.materials.
## create walls around the packing
walls=aabbWalls
wallIds=
## use a SpherePack object to generate a random loose particles packing
sp=pack.
sp.makeCloud(
O.bodies.
cement=[]
glass_sphere=[]
for b in O.bodies:
if not isinstance(
continue
if random.random() < 0.5:
b.mat = mat1
b.shape.color = (1,0,0)
b.state.
cement.
else:
b.mat = mat2
b.shape.color = (0,1,1)
b.state.
glass_
#######
### DEFINING ENGINES ###
#######
triax=TriaxialS
maxMultiplier=
finalMaxMultip
thickness = 0,
stressMask = 7,
internalCompac
)
newton=
O.engines=[
ForceResetter(),
InsertionSortC
InteractionLoop(
#box-sphere interactions will be the simple normal-shear law, we use ScGeom for them
[Ig2_
#Boxes will be frictional (FrictMat), so the sphere-box physics is FrictMat vs. CohFrictMat, the Ip type will be found via the inheritance tree (CohFrictMat is a FrictMat) and will result in FrictPhys interaction physics
#and will result in a FrictPhys
[Ip2_
#Finally, two different contact laws for sphere-box and sphere-sphere
[Law2_
useIncrement
always_
label=
),
GlobalStiffnes
triax,
newton
]
triax.goal1=
while 1:
O.run(1000, True)
##the global unbalanced force on dynamic bodies, thus excluding boundaries, which are not at equilibrium
unb=unbalance
print 'unbalanced force:',unb,' mean stress: ',triax.meanStress
if unb<stabilityTh
break
print 'timestep at confinedState:
import sys #this is only for the flush() below
while triax.porosity>
## we decrease friction value and apply it to all the bodies and contacts
compFricDegree = 0.95*compFricDegree
setContactFric
#print "\r Friction: ",compFricDegree," porosity:
sys.stdout.flush()
## while we run steps, triax will tend to grow particles as the packing
## keeps shrinking as a consequence of decreasing friction. Consequently
## porosity will decrease
O.run(1000,1)
print 'porosity:
print 'timestep at compactedState:
print "### Compacted state saved ###"
#######
### DEVIATORIC LOADING ###
#######
##We move to deviatoric loading, let us turn internal compaction off to keep particles sizes constant
triax.internalC
## Change contact friction (remember that decreasing it would generate instantaneous instabilities)
setContactFrict
##set stress control on x and z, we will impose strain rate on y
triax.stressMask = 5
##now goal2 is the target strain rate
triax.goal2=rate
## we define the lateral stresses during the test, here the same 10kPa as for the initial confinement.
triax.goal1=-100000
triax.goal3=-100000
newton.damping=0.1
O.engines[
#We assign cohesion to all contacts at the next iteration
O.engines[
O.run(1000,True)
O.saveTmp()
#######
### Example of how to record and plot data ###
#######
#from yade import plot
### a function saving variables
def history():
plot.
s11=
s22=
s33=
i=O.iter)
if 1:
## include a periodic engine calling that function in the simulation loop
O.engines=
##O.engines.
else:
## With the line above, we are recording some variables twice. We could in fact replace the previous
## TriaxialRecorder
## by our periodic engine. Uncomment the following line:
O.engines[
O.run(1000,True)
### declare what is to plot. "None" is for separating y and y2 axis
#plot.plots=
### the traditional triaxial curves would be more like this:
#plot.plots=
plot.plots=
## display on the screen (doesn't work on VMware image it seems)
plot.plot()
##### PLAY THE SIMULATION HERE WITH "PLAY" BUTTON OR WITH THE COMMAND O.run(N) #####
## In that case we can still save the data to a text file at the the end of the simulation, with:
plot.saveDataTx
##or even generate a script for gnuplot. Open another terminal and type "gnuplot plotScriptKEY.
plot.saveGnuplo
rr=yade.
rr.shape=True
rr.intrPhys=True
Thanks
Question information
- Language:
- English Edit question
- Status:
- Expired
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply: