stressIdeal

Asked by dan.wang

The following code is taken from the example "peri3dController_triaxialCompression.py".
In the second "O.engines",
(1)What is the function of the code "strain=p3d.strain" ?
(2)In the vector of "stressIdeal", what do the last four items mean? I guess they are strain ez, exy, eyz, exz respectively.

Moreover,

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------

from yade import pack,plot,qt

# define material
O.materials.append(FrictMat())

# create periodic assembly of particles
initSize=1.2
sp=pack.randomPeriPack(radius=.05,initSize=Vector3(initSize,initSize,initSize),memoizeDb='/tmp/packDb.sqlite')
angle=0
rot=Matrix3(cos(angle),0,-sin(angle), 0,1,0, sin(angle),0,cos(angle))
sp.toSimulation(rot=rot)

# plotting
plot.live=False
plot.plots={'iter':('sx','sy','sz','syz','szx','sxy',),'iter_':('ex','ey','ez','eyz','ezx','exy',),'ez':('sz',)}
def plotAddData():
 plot.addData(
  iter=O.iter,iter_=O.iter,
  sx=p3d.stress[0],sy=p3d.stress[1],sz=p3d.stress[2],
  syz=p3d.stress[3],szx=p3d.stress[4],sxy=p3d.stress[5],
  ex=p3d.strain[0],ey=p3d.strain[1],ez=p3d.strain[2],
  eyz=p3d.strain[3],ezx=p3d.strain[4],exy=p3d.strain[5],
 )

O.dt=PWaveTimeStep()/2

mm,mx=[pt[axis] for pt in aabbExtrema()]
coord=mm,mm,mm

# define the first part of simulation, hydrostatic compression
O.engines=[
 ForceResetter(),
 InsertionSortCollider([Bo1_Sphere_Aabb()]),
 InteractionLoop(
  [Ig2_Sphere_Sphere_ScGeom()],
  [Ip2_FrictMat_FrictMat_FrictPhys()],[Law2_ScGeom_FrictPhys_CundallStrack()]),
 NewtonIntegrator(),
 Peri3dController( goal=(-1e7,-1e7,-1e7, 0,0,0), # Vector6 of prescribed final values
       stressMask=0b000111,
       nSteps=500,
       doneHook='print "Hydrostatic load reached."; O.pause()',
       youngEstimation=.5e9, # needed, when only nonzero prescribed values are stress
       maxStrain=.5,
       label='p3d'
       ),
 PyRunner(command='plotAddData()',iterPeriod=1),
]
O.run(); O.wait()

# second part, z-axis straining and constant transversal stress
O.engines=[
 ForceResetter(),
 InsertionSortCollider([Bo1_Sphere_Aabb()]),
 InteractionLoop(
  [Ig2_Sphere_Sphere_ScGeom()],
  [Ip2_FrictMat_FrictMat_FrictPhys()],[Law2_ScGeom_FrictPhys_CundallStrack()]),
 NewtonIntegrator(),
 Peri3dController( goal=(-1e7,-1e7,-4e-1, 0,0,0), # Vector6 of prescribed final values
       stressMask=0b000011,
       nSteps=1000,
       xxPath=[(0,1),(1,1)], # the first (time) zero defines the initial value of stress considered nonzero
       yyPath=[(0,1),(1,1)],
       doneHook='print "Simulation with Peri3dController finished."; O.pause()',
       maxStrain=.5,
       label='p3d',
       strain=p3d.strain, # continue from value reached in previous part
       stressIdeal=Vector6(-1e7,-1e7,0, 0,0,0), # continue from value reached in previous part
       ),
 PyRunner(command='plotAddData()',iterPeriod=1),
]
O.run();O.wait()
plot.plot(subPlots=False)
----------------------------------------------------------------------------------------------------------------------------------------------------------------

Above is the example in your source code. And what i do is like this:

   O.engines=[
    ForceResetter(),
    InsertionSortCollider([Bo1_Sphere_Aabb(aabbEnlargeFactor=EnlargeFactor,label='bo1s')]),
    InteractionLoop(
     [Ig2_Sphere_Sphere_ScGeom(interactionDetectionFactor=EnlargeFactor,label='ig2ss')],
     [Ip2_CpmMat_CpmMat_CpmPhys()],[Law2_ScGeom_CpmPhys_Cpm()]),
    NewtonIntegrator(),
    Peri3dController( goal=(ag[0],ag[1],ag[2], ag[4],ag[5],ag[3]), # Vector6 of prescribed final values
       stressMask=0b000000,
       nSteps=100,
       ),

    ]
   O.run();O.wait()
   check[0]=check[0]+1

  else:
   O.engines=[
    ForceResetter(),
    InsertionSortCollider([Bo1_Sphere_Aabb(aabbEnlargeFactor=EnlargeFactor,label='bo1s')]),
    InteractionLoop(
     [Ig2_Sphere_Sphere_ScGeom(interactionDetectionFactor=EnlargeFactor,label='ig2ss')],
     [Ip2_CpmMat_CpmMat_CpmPhys()],[Law2_ScGeom_CpmPhys_Cpm()]),
    NewtonIntegrator(),
    Peri3dController( goal=(-3e5,-3e5,arr[2],0,0,0), # Vector6 of prescribed final values
       stressMask=0b000011,
       nSteps=100,
    xxPath=[(0,1),(1,1)], # the first (time) zero defines the initial value of stress considered nonzero
    yyPath=[(0,1),(1,1)],
    doneHook='print "Simulation with Peri3dController finished."; O.pause()',
    maxStrain=.5,
    label='p3d',
    #strain=p3d.strain, # continue from value reached in previous part
    stressIdeal=Vector6(-3e5,-3e5,arrcc[2], 0,0,0), # continue from value reached in previous part
       ),
   ]

the first engine means we give a 3e5Pa Hydrostatic load using ag which means strain.
and then in the second engine, we want to keep constan of the xxpath and yypath and give strain in the zzpath. arrcc[2] means the strain of last commit state in zzpath, and arr[2] means the total strain we give at current step in zzpath.
I want to know if i am right with the code above?

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
Jan Stránský (honzik) said :
#1

Hello,

> (1)What is the function of the code "strain=p3d.strain" ?

you can have a look at source code [1]. Strain is computed incrementally with defined strainRate. Components of strainRate are either prescribed (for prescribed strain) or estimated such that actual stress is as close as possible to idealStress (for prescribed stress)

> (2)In the vector of "stressIdeal", what do the last four items mean? I guess they are strain ez, exy, eyz, exz respectively.

as the variable name suggests, its components are stress, so it is sz, syz, szx, sxy. For the components, where strain is prescribed, it has no influence (I guess).

> I want to know if i am right with the code above?

after a **very quick** look it seems ok. Please try it and in case it does not what you want, let us know.

cheers
Jan

[1] https://github.com/yade/trunk/blob/master/pkg/dem/PeriIsoCompressor.cpp#L235

Can you help with this problem?

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

To post a message you must log in.