Looking for Direct Shear test script
I was looking for a direct shear test script on https:/
Thanks
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Revision history for this message
|
#1 |
Hello,
according to the amount of answers, the question provided is not motivating enough to answer.
Please provide more information, for example provide (not only!):
- material
- real - soil, concrete, ...
- how you want to simulate it
- 2D / 3D
- loading
- lateral stress?
- ...
- what results you are interested in
- forces
- failure mode
- ...
- do you have some ideas / have you tried something already?
- e.g. boundary conditions - using walls or directly prescribed motion of boundary spheres or ...
- ...
- what have you searched (googling 'yade "direct shear"' or 'dem "direct shear"' gives plenty of results) and why it did not help?
- ...
- ...
cheers
Jan
Revision history for this message
|
#2 |
Hi,
The following lines may help you build a direct shear test simulation (the script needs other scripts to work properly, i.e., one to generate the sample and one to do the identification of the contact along the joint) . Let us know if that's what you are after.
###
# -*- coding: utf-8 -*-
O=Omega()
from yade import ymport, utils, plot
################## parameters definition
PACKING=
intR=1.4
DENS=3000
YOUNG=12e9
FRICT=18
POISSON=0.15
TENS=11e6
COH=11e7
SMOOTH=True
jointNSTIFF=12e9
jointSSTIFF=12e8
jointFRICT=30
jointTENS=0.
jointCOH=0.
jointDIL=0.
DAMPING=0.5
dtCOEFF=0.5
iterMAX=100000
saveVTK=10
recCRACKS=True
Output=
normalSTRESS=1.e6
normalVEL=
shearVEL=
#######
### material definition
def sphereMat(): return JCFpmMat(
def wallMat(): return JCFpmMat(
## copy spheres from the packing into the scene
O.bodies.
## preprocessing to get dimensions
dim=utils.
xinf=dim[0][0]
xsup=dim[1][0]
X=xsup-xinf
yinf=dim[0][1]
ysup=dim[1][1]
Y=ysup-yinf
zinf=dim[0][2]
zsup=dim[1][2]
Z=zsup-zinf
## initial surface
S0=X*Z
## spheres factory
R=0
Rmax=0
numSpheres=0.
for o in O.bodies:
if isinstance(
o.shape.
numSpheres+=1
R+=o.
if o.shape.
Rmax=
Rmean=R/numSpheres
#### create the fracture directly here
import gts
ptA = gts.Vertex( xinf-X/4., yinf-Y/4., zinf+Z/2.)
ptB = gts.Vertex( xinf-X/4., ysup+Y/4., zinf+Z/2.)
ptC = gts.Vertex( xsup+X/4., yinf-Y/4., zinf+Z/2.)
ptD = gts.Vertex( xsup+X/4., ysup+Y/4., zinf+Z/2.)
e1 = gts.Edge(ptA,ptB)
e2 = gts.Edge(ptA,ptC)
e3 = gts.Edge(ptC,ptB)
f1 = gts.Face(e1,e2,e3)
e4 = gts.Edge(ptC,ptD)
e5 = gts.Edge(ptD,ptB)
f2 = gts.Face(e4,e5,e3)
s1 = gts.Surface()
s1.add(f1)
s1.add(f2)
facet = gtsSurface2Face
O.bodies.
execfile(
#######
thickness=Z/100.
oversizeFactor=1.3
### loading platens
O.bodies.
bottomPlate=
O.bodies.
topPlate=
#######
O.engines=[
ForceResetter(),
InsertionSortC
InteractionLoop(
[Ig2_
[Ip2_
[Law2_
),
GlobalStiffnes
TranslationEng
PyRunner(
NewtonIntegrat
PyRunner(
VTKRecorder(
]
#######
shearing=False
sigmaN=0
tau=0
Fs1=0
Fs2=0
Xdispl=0
px0=0
Zdispl=0
pz0=topPlate.
prevTranslation=0
n=0
def servoController():
global px0, pz0, sigmaN, n, Fn1, Fn2, shearing, butee, piston1, piston2
Fn1=
Fn2=
sigmaN=
#print yTranslation.
if shearing==False:
if zTranslation.
zTranslation.
if sigmaN>
zTranslation.
if shearing==False and abs((normalSTRE
zTranslat
print 'stress on joint plane = ', utils.forcesOnP
### top box
O.
,extents=
butee=
O.
extents=
O.
extents=
O.
extents=
### bottom box
O.
extents=
piston1=
O.
extents=
piston2=
O.
extents=
O.
extents=
### initialisation
O.
px0=
pz0=
shearing=True
print 'shearing now! || iteration=', O.iter
if shearing==True:
zTranslat
## Removes collider (lattice like) -> not really helpful in this particular case
#
zTranslat
if O.engines[
O.engines[
def dataCollector():
global Xdispl, Zdispl, tau, Fs1, Fs2
if shearing:
Fs1=
Fs2=
Xdispl=
tau=
Zdispl=
yade.
plot.
#plot.
################# to manage interaction detection factor during the first timestep
O.step();
################# initializes the interaction detection factor to its default value (new contacts will be created between strictly contacting particles only)
ss2d3dg.
aabb.aabbEnlarg
################# simulation starts here
O.run(int(iterMAX))
Revision history for this message
|
#3 |
Hello,
Sorry for the lack of infos. I’m new to the yade community.
Luc, thanks for your support. I’ve used a script that you posted on this forum:
###
from yade import pack,plot,export
import math
sp=pack.
O.periodic=True
# dimensions of sample (fixed by particle size such as L/D~15)
RADIUS=0.05
length=
height=length
width=length
thickness=RADIUS
# friction angles
compFRIC=10. # during compaction (controls porosity)
FRIC=30. # during shear
# boundary conditions
PI=1.e5 # sample preparation: pressure applied for the isotropic compaction
SN=5.e6 # normal stress
RATE=0.1 # shear velocity (top plate)
# simulation control
DAMPSHEAR=0.
ITER=2e5
VTK=20
OUT='TEST'
####
O.cell.
O.materials.
O.materials.
upBox = utils.box(
lowBox = utils.box(
O.bodies.
sp.makeCloud(
O.bodies.
effCellVol=
volRatio=
#print 'volRatio=
O.engines=[
ForceResetter()
,InsertionSort
,InteractionLoop(
[Ig2_
[Ip2_
[Law2_
)
,GlobalStiffne
,PeriTriaxCont
,NewtonIntegra
,PyRunner(
,VTKRecorder(
]
def dataRecorder():
h=vol=
h=O.bodies[
vol=h*
contactStress=
for o in O.bodies:
if isinstance(
nb_s+=1
vol_s += 4.*pi/3.
n = 1-vol_s/vol
nbFrictCont=0.
for i in O.interactions:
if i.isReal and i.phys.
nbFrictCont+=1
plot.addData(
iter=O.iter
,stress_
,contactStres
,xW=O.
,height=h
,volume=vol
,porosity=n
,k=2.
,unbF=
)
def triaxDone():
global phase
volRatio=
h=O.bodies[
vol=h*
contactStress=
vol_s=
Rmin=1e6
for o in O.bodies:
if isinstance(
nbSph+=1
Rmean+
if o.shape.
if o.shape.
vol_s += 4.*pi/3.
Rmean=Rmean/nbSph
n = 1-vol_s/vol
print 'DONE! iter=',O.iter,'| sample generated: nb spheres',nbSph,', Rmean=',Rmean,', Rratio=
print 'Changing contact properties now'
tt=TriaxialCom
tt.setContactP
triax.dead=True
O.pause()
#### Initialization
print 'SAMPLE PREPARATION!'
#recData.dead=False # uncomment to record what is happening during stress initialization
O.run(1000000,1)
saveSolid.
#saveSolid.
O.step()
saveSolid.dead=True
O.save(
print 'Normal stress (platen) = ',O.forces.
print 'Normal stress (contacts) = ',getStress(
#### Applying normal stress
print 'NORMAL LOADING! iter=',O.iter
stage=0
stiff=fnPlaten=
def servo():
global stage,stiff,
if stage==0:
currentSN=
unbF=
#print 'SN=',SN,'| current SN = ',currentSN,' | unbF=',unbF
boundaryVel=
O.bodies[
if ( (abs(currentSN-
stage+=1
fnPlaten=
print 'Normal stress =',currentSN,' | unbF=',unbF
## the following computes the stiffness of the plate (used for stress control of the top plate)
for i in O.interactions.
stiff+
print 'DONE! iter=',O.iter
O.pause()
if stage==1:
fnDesired=
#boundaryVel=
boundaryVel=
O.bodies[
O.engines = O.engines[
O.run(1000000,1)
print 'STABILIZING! iter=',O.iter
O.run(1000,1)
# coloring particles to see vertical stripes in material
dxi=4*(2*RADIUS) # can be a function of cell length dxi=O.cell.
n=int(length/dxi)
xmin=1e6
for i in range(0,n):
for o in O.bodies:
if o.id>1:
if o.state.
if (o.state.
o.shape.
for o in O.bodies:
if (o.state.
o.shape.
saveSolid.
#saveSolid.
O.step()
saveSolid.dead=True
O.save(
if recData.
print 'Normal stress (platen) = ',O.forces.
print 'Normal stress (contacts) = ',getStress(
#### preparing for shearing
Gl1_Sphere.
print 'Gluing spheres to boundary walls'
gluedSpheres=[]
## gluing particles in contact with the walls
for i in O.interactions:
if i.isReal:
if isinstance(
O.bodies[
gluedSpheres += [O.bodies[i.id2]]
if isinstance(
O.bodies[
gluedSpheres += [O.bodies[i.id1]]
for i in O.interactions:
if i.isReal and ( O.bodies[
O.bodies[
O.bodies[
O.bodies[
O.bodies[
i.phys.
print 'nb of glued spheres=
#### shearing
print 'SHEARING! iter=',O.iter
saveSolid.
O.step()
saveSolid.dead=True
O.save(
recData.dead=False
newton.
saveSolid.
saveSolid.
shearVel=0
iterShear=O.iter
while 1:
O.run(int(10),1)
if shearVel<RATE:
shearVel+
# only top wall moves
O.bodies[
## top and bottom walls move
#O.bodies[
#O.bodies[
if ( O.iter >= (int(iterShear+
print 'iter=',O.iter,' -> FINISHED!'
plot.
O.save(
sys.exit(0)
Is it suitable for a model of a direct shear test?
What about units of measurement? What’s the unit of RADIUS for example.
Thanks, and sorry for my poor English.
Amedeo
Revision history for this message
|
#4 |
> What about units of measurement? What’s the unit of RADIUS for example.
Yade has no units, just numbers [1,2,3,4].
If you use basic SI units for all inputs, you get all output in basic SI units, too.
Using only basic SI units is a good practice.
cheers
Jan
[1] https:/
[2] https:/
[3] https:/
[4] https:/
Can you help with this problem?
Provide an answer of your own, or ask Amedeo Galletti for more information if necessary.