plot the stress and strain

Asked by Mehrad on 2018-12-07

Hi
my problem is that I can't plot the stress and strein curve of my script.
I need to know how can I write appropriate code to export and plot stress and strien of my problem.
my script:

readParamsFromTable(rMean=.05,rRelFuzz=.3)
from yade.params.table import *
from yade import polyhedra_utils,pack,qt,plot,utils,export,ymport

polyMat = PolyhedraMat(density=8050,young=210e9,poisson=.29,frictionAngle=atan(0.8))
O.materials.append(polyMat)

t=polyhedra_utils.polyhedra(polyMat,(.6,.6,.6),v=[(0,0,0),(0,0,-1.5),(0,1.5,0),(1.5,0,0)])
t.state.pos = (1,1,6)
t.state.vel = (0, 0, -20)
O.bodies.append(t)

O.bodies.append(geom.facetBox((1,1,1),(1,1,1),wallMask=31))

O.materials.append(ViscElMat(young=4e9,poisson=0.25, density=1400, frictionAngle=radians(30), label='sphereMat'))
partCloud = pack.SpherePack()

#Specify the property of the particle cloud wanted
O.bodies.append(pack.regularHexa(pack.inAlignedBox((0,0,0),(2,2,2)),radius=.08,gap=0.0001,color=(0,0,1)))

#send to simulation assigning the material
partCloud.toSimulation(material='sphereMat')
O.engines=[
   ForceResetter(),
   InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb(),Bo1_Polyhedra_Aabb()]),
   InteractionLoop(
      [Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom(),Ig2_Sphere_Polyhedra_ScGeom()],
      [Ip2_FrictMat_FrictMat_FrictPhys()],
      [Law2_ScGeom_FrictPhys_CundallStrack()]
   ),
   NewtonIntegrator(gravity=(0,0,-9.81),damping=0.4),
   # call the checkUnbalanced function (defined below) every 2 seconds
   PyRunner(command='checkUnbalanced()',realPeriod=2),
]

def checkUnbalanced():
   if unbalancedForce()<.05:
      O.pause()
      plot.saveDataTxt('bbb.txt.bz2')

O.dt=.5*PWaveTimeStep()
O.trackEnergy=True
O.saveTmp()

Question information

Language:
English Edit question
Status:
Answered
For:
Yade Edit question
Assignee:
No assignee Edit question
Last query:
2018-12-07
Last reply:
2018-12-17
Jérôme Duriez (jduriez) said : #1

Hi,

Did you look at https://yade-dem.org/doc/user.html#tracking-variables ?

In addition to YADE plot module (see above, and https://yade-dem.org/doc/yade.plot.html), and because YADE terminal is Python terminal, and because all (most certainly) YADE variables of interest can be accessed from Python, some Python basics in Input/Output do not harm

Luc Scholtès (luc) said : #2

Hi,
Could you please be more specific?
To be able to "plot the stress and strain" in a problem, you need to define some sort of (closed) domain that will deform under a predefined solicitation (e.g., a sample that will deform in a triaxial cell). From what I can see in your script, the only engine that would define a solicitation is the gravityEngine(). The problem is that I can see several things in your simulation (assembly of particles, some polyhedra and a facetBox)... but I don't see how all these things are supposed to interact one with each other...
What do you want to simulate exactly? if you want to simulate a triaxial compression (just a guess given the different elements in your simulation), I would suggest you to have a look at the tutorial and example scripts (https://yade-dem.org/doc/tutorial.html)
Luc

Can you help with this problem?

Provide an answer of your own, or ask Mehrad for more information if necessary.

To post a message you must log in.