uniaxial compression test of particulate material

Asked by Yuan

Dear YADE users,

I am trying to do a simulation about an uniaixial compression test of particulate material and the task can be described as follow.

(1) The material is composed of particles which are bounded together.

(2) The bound between particles needs to have resistance from normal, shear, rotation and twist motions (i.e. normal stiffness, shear stiffness, rotation stiffness and twist stiffness).

(3) Creation of compound particles namely pair of particles between which the stiffnesses are very high so that the bond can not break.

(4) Before each run the number of compound particles can be increased without changing the initial configuration of the particles.

(5) Performing an unaxial compression test to the material and draw the stress-strian curve including post-peak

I have almost no experience in YADE. So my first question is whether all the above tasks can be achieved in YADE and if so what procedure should I follow to perform this simulation.

Any help will be appreciated.

Yuan

Question information

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

Hello,

- Yes, all these tasks you plan can be achieved in YADE.

- So, it will be worth for you to jump into documentation (https://yade-dem.org/doc/introduction.html and https://yade-dem.org/doc/tutorial.html and https://yade-dem.org/doc/user.html), and practice with examples to learn how to use Yade. Then, you should be able to enjoy the code building an appropriate simulation to achieve your final goals !

Revision history for this message
Yuan (xuyuan-bjer) said :
#2

Hi Jérôme and all YADE users,

Thank you so much for you kindly help last time.

After learning some basics of YADE, I started building my simulation by modifying a file(uniax.py) I found on GitHub. However when I ran the simulation it became unstable. All the particles were flying around. I believe there must be some problems with my coding and yet I could not spot them. I've attached my code. Could you please tell me where I went wrong?

from yade import pack,plot

idParticulate=O.materials.append(CohFrictMat(young=30e9,poisson=0.2,alphaKr=3,alphaKtw=3,density=2700,frictionAngle=0.6))

pred=pack.inCylinder((0,0,0),(0,0,3),0.5)

TS=pack.randomDensePack(pred,radius=0.05,material=idParticulate)
O.bodies.append(TS)

relRadList1=[1,1]
relPosList1=[[1,0,0],[-1,0,0]]
templates=[]
templates.append(clumpTemplate
(relRadii=relRadList1,relPositions=relPosList1))

O.bodies.replaceByClumps(templates,[.5])

bb=uniaxialTestFeatures()
negIds,posIds,axis,crossSectionArea=bb['negIds'],bb['posIds'],bb['axis'],bb['area']

O.dt=0.8*PWaveTimeStep()

O.engines=[
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb(aabbEnlargeFactor=1.5),],verletDist=.05*3.5e-3),
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom6D()],
[Ip2_CohFrictMat_CohFrictMat_CohFrictPhys()],
[Law2_ScGeom6D_CohFrictPhys_CohesionMoment()],
),
NewtonIntegrator(damping=0.4),
UniaxialStrainer(strainRate=-0.5,axis=axis,asymmetry=0,posIds=posIds,negIds=negIds,crossSectionArea=crossSectionArea,blockDisplacements=False,blockRotations=False,setSpeeds=True,label='strainer'),
PyRunner(virtPeriod=1e-6/0.5,realPeriod=1,command='addPlotData()',label='plotDataCollector',initRun=True)
]

plot.plots={'eps':('sigma',)}

def addPlotData():
       yade.plot.addData(t=O.time,i=O.iter,eps=-strainer.strain,sigma=-strainer.avgStress)

Any help is appreciated.

Yuan

Revision history for this message
Jan Stránský (honzik) said :
#3

Hi Yuan,
accodring to your description, it seems like time step instability problem.
Could you try your script with decreased time step? PWaveTimeStep takes
into account only normal stiffnes and does not include rolling nor twist
stiffness, which might be the source of problems.
cheers
Jan

2014-10-20 7:16 GMT+02:00 Yuan <email address hidden>:

> Question #255528 on Yade changed:
> https://answers.launchpad.net/yade/+question/255528
>
> Status: Answered => Open
>
> Yuan is still having a problem:
> Hi Jérôme and all YADE users,
>
> Thank you so much for you kindly help last time.
>
> After learning some basics of YADE, I started building my simulation by
> modifying a file(uniax.py) I found on GitHub. However when I ran the
> simulation it became unstable. All the particles were flying around. I
> believe there must be some problems with my coding and yet I could not
> spot them. I've attached my code. Could you please tell me where I went
> wrong?
>
> from yade import pack,plot
>
>
> idParticulate=O.materials.append(CohFrictMat(young=30e9,poisson=0.2,alphaKr=3,alphaKtw=3,density=2700,frictionAngle=0.6))
>
> pred=pack.inCylinder((0,0,0),(0,0,3),0.5)
>
> TS=pack.randomDensePack(pred,radius=0.05,material=idParticulate)
> O.bodies.append(TS)
>
> relRadList1=[1,1]
> relPosList1=[[1,0,0],[-1,0,0]]
> templates=[]
> templates.append(clumpTemplate
> (relRadii=relRadList1,relPositions=relPosList1))
>
> O.bodies.replaceByClumps(templates,[.5])
>
> bb=uniaxialTestFeatures()
>
> negIds,posIds,axis,crossSectionArea=bb['negIds'],bb['posIds'],bb['axis'],bb['area']
>
> O.dt=0.8*PWaveTimeStep()
>
>
> O.engines=[
> ForceResetter(),
>
> InsertionSortCollider([Bo1_Sphere_Aabb(aabbEnlargeFactor=1.5),],verletDist=.05*3.5e-3),
> InteractionLoop(
> [Ig2_Sphere_Sphere_ScGeom6D()],
> [Ip2_CohFrictMat_CohFrictMat_CohFrictPhys()],
> [Law2_ScGeom6D_CohFrictPhys_CohesionMoment()],
> ),
> NewtonIntegrator(damping=0.4),
>
> UniaxialStrainer(strainRate=-0.5,axis=axis,asymmetry=0,posIds=posIds,negIds=negIds,crossSectionArea=crossSectionArea,blockDisplacements=False,blockRotations=False,setSpeeds=True,label='strainer'),
>
> PyRunner(virtPeriod=1e-6/0.5,realPeriod=1,command='addPlotData()',label='plotDataCollector',initRun=True)
> ]
>
> plot.plots={'eps':('sigma',)}
>
> def addPlotData():
>
> yade.plot.addData(t=O.time,i=O.iter,eps=-strainer.strain,sigma=-strainer.avgStress)
>
>
>
> Any help is appreciated.
>
> Yuan
>
> --
> You received this question notification because you are a member of
> yade-users, which is an answer contact for Yade.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-users
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~yade-users
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
Yuan (xuyuan-bjer) said :
#4

Hello Jan and all YADE users,

Thank you for your help last time.

So I decreased the time step. The particles were still flying apart only in this time they fell apart slowly. From the stress-strain curve I did not see any increasing in stress hence there was no peak stress. The stress just kept decreasing from initial point.

Is there anything you think that is wrong with my code?

Any help is appreciated.

Yuan

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

Hello,

I'm afraid your particle sample is not a cohesive one, since you did not define appropriate (e.g. setCohesionNow) arguments in Ip2_CohFrictMat_CohFrictMat_CohFrictPhys. See corresponding doc (*)
You might easily check if I am right, using the "Inspect" window of the graphical interface, and checking randomly interaction properties.

(*) https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.Ip2_CohFrictMat_CohFrictMat_CohFrictPhys.setCohesionNow

Revision history for this message
Yuan (xuyuan-bjer) said :
#6

Hi Jérôme and all YADE users,

Thank you for you help last time.

So I set the setCohesion to be true and checked my engine. Sadly the simulation is still unstable.

As you advised I used the "inspect" window and checked for the interaction properties. Now my question is where can I set the strength of the bond between particles. I can see that all the stiffnesses I need are there from 'inspect'. But as long as I start the simulation all particles still keep flying around. My guess is that although I set the stiffnesses I have not set the strength of the bond. But I could not find where I can set it. I tried to give normalCohesion and shearCohesion to the material but it seems that is not correct(simulation is still unstable).

Another thing is while I was trying to debug my code I tried to give etaTwist to the material however I got "AttributeError: No such attribute etaTwist". So I think there might be a bug there.

Again I appreciate for your help.

Cheers,

Yuan

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

It is the role of Ip2_CohFrictMat_CohFrictMat_CohFrictPhys to set bond strengths for interaction between particles. Assuming you defined right values of Ip2 attributes, and CohFrictMat attributes. So these correct definitions is the only (but mandatory) task you have to perform.

If you get e.g. "AttributeError: No such attribute etaTwist", that's because you did not define CohFrictMat as the material of your particles. Again, using Inspector would help to check it.

Probably, it could be useful to start with only 2 particles, and check if you might achieve to define one cohesive interaction between both.

Revision history for this message
Yuan (xuyuan-bjer) said :
#8

Hi Jérôme and all YADE users,

Thank you for your last reply.

I am sorry that I did not make myself clear about the "AttributeError: No such attribute etaTwist" thing last time. That error appeared when I tried to set the material using the following command:

O.materials.append(CohFrictMat(*)).

I was able to add properties like young, poisson, alphaKr, etaRoll etc. However when I tried to add etaTwist that AttributeError appeared.

Cheers,

Yuan

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

Is it really this command that returns the AttributeError ?

- With the "*" in CohFrictMat(*) It get another kind of error
- (Reasonnably) Assuming the "*" was a typo, I do not get, as expected, any error with the command you quote

Revision history for this message
Yuan (xuyuan-bjer) said :
#10

Hello Jérôme and all YADE users,

Thank you for your reply last time.

Below is my part of my script

idParticulate=O.materials.append(CohFrictMat(young=30e9,poisson=0.2,alphaKr=3,alphaKtw=3,density=2700,frictionAngle=0.6,isCohesive=True,momentRotationLaw=True,normalCohesion=-3.5e6,shearCohesion=-10e6,etaRoll=-3,etaTwist=-3))

This gave me the AttributeError.

Yuan

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

Ok, it is more clear.
This command does not return any error with my yade version 2014-10-01.git-7cc0fd6. So, the problem is that you surely use another (too old I guess..) version, in which CohFrictMat indeed does not have any "etaTwist" parameter. I did not check in git history if this could be true (you could do it if necessary thanks to https://github.com/yade/trunk/commits/master/pkg/dem/CohesiveFrictionalContactLaw.hpp for ex), but I do not see any other reason up to now

The solution would be to update..

Revision history for this message
Yuan (xuyuan-bjer) said :
#12

Hello Jérôme,

Thank you for your advice last time.

I have updated my YADE to 1.12.0 and that Attribute Error has been solved.

However now I can not get any plot from my script. I did not change my script so it was the same one I used with my old version of YADE which is 1.07 and in that version the plot was ok.

I checked the terminal while I ran my script and there was no error shown. So my script was unchanged and no error shown in terminal however the plot was gone.

I attached my script

from yade import pack,plot

idParticulate=O.materials.append(CohFrictMat(young=30e9,poisson=0.2,alphaKr=3000,alphaKtw=3000,density=2700,frictionAngle=0.6,isCohesive=True,momentRotationLaw=True,normalCohesion=-3.5e6,shearCohesion=-10e6,etaRoll=-3,etaTwis=-3))

pred=pack.inCylinder((0,0,0),(0,0,0.2),0.05)

TS=pack.randomDensePack(pred,radius=0.008,material=idParticulate)
O.bodies.append(TS)

bb=uniaxialTestFeatures()
negIds,posIds,axis,crossSectionArea=bb['negIds'],bb['posIds'],bb['axis'],bb['area']

O.dt=1e-5*PWaveTimeStep()

O.engines=[
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb(aabbEnlargeFactor=1.5,label='bo1s')]),
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom6D(interactionDetectionFactor=1.5,label='ig2ss')],
[Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=True,setCohesionOnNewContacts=False)],
[Law2_ScGeom6D_CohFrictPhys_CohesionMoment()]
),
NewtonIntegrator(),
UniaxialStrainer(strainRate=-0.00005,axis=axis,asymmetry=0,posIds=posIds,negIds=negIds,crossSectionArea=crossSectionArea,blockDisplacements=False,blockRotations=False,setSpeeds=False,label='strainer'),
PyRunner(virtPeriod=1e-6/0.5,realPeriod=1,command='addPlotData()',label='plotDataCollector',initRun=True)
]

bo1s.aabbEnlargeFactor=1.0
ig2ss.interactionDetectionFactor=1.0

plot.plots={'eps':('sigma')}

def addPlotData():
       yade.plot.addData(t=O.time,i=O.iter,eps=-strainer.strain,sigma=-strainer.avgStress)

O.step()

Yuan

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

plot.plots only defines what kind of curves you would like to plot. To actually display them, type plot.plot(), or F8.

 Do not know why it worked without that in previous versions..

Revision history for this message
Yuan (xuyuan-bjer) said :
#14

Hi Jérôme,

Thank you for the reply however I know I need F8 to display the plot. What I meant was there was no plot even I hit F8 or added plot.plot(). All it showed was a window with grid on it. And when I started my simulation nothing was shown.

Revision history for this message
Yuan (xuyuan-bjer) said :
#15

Hi Jérôme,

In addition to my last reply. I checked the area from uniaxialTestFeatures and it showed the area was 0.0 however in YADE 1.07 the area was fine.

Again I appreciated your patience and help.

Thank you

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

plot.plots definition and plot.plot() command take care of displaying graphically data stored in the dictionary "plot.data". If nothing is displayed while you're correctly using these two functions , the problem should be in plot.data dictionary itself (I guess you can disregard the risk of bug in plot.plot/plots functions itself)
You might check what's stored inside plot.data typing ....
        plot.data
See https://yade-dem.org/doc/user.html#running-python-code
Related to this is the way you defined your PyRunner that takes care of filling this plot.data. It's strange for me you are using both "virtPeriod" and "realPeriod". Check the documentation of PyRunner for the meaning of these attributes, a convenient choice would maybe to use "iterPeriod"

For the uniaxial attributes, I do not know, I rarely used this Engine. The method in such case is to track very closely how things are computed, including giving a look to source code (which is the advantage of open source codes !). But, please, try to isolate your different questions in different Launchpad questions.

I'm sorry for you that you face problems only after updating, but all these problems should be solvable, good luck and take it as a good opportunity to dive into Yade..

Revision history for this message
Yuan (xuyuan-bjer) said :
#17

Thank you very much Jérôme, I appreciated your help and patience.

Revision history for this message
Leonard (z2521899293) said :
#18

Hi Yuan and Jérôme,
I am also working at simulate an uniaxial compression test, from your discussion, I found that Yuan has set "aabbEnlargeFactor=1.5 and interactionDetectionFactor=1.5" in engines but you didn't set it back to default value, while I saw that it has been set back to default value after the engines in several other uniaxial test scripts.
It may lead to a difference to the results.
It has been several years since the question proposed, have you totally solve the uniaxial test, Yuan?
Best regards.