JCFPM: "neverErase" modifies the simulated behavior while it should not
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Yade |
New
|
Undecided
|
Unassigned |
Bug Description
I noticed that running the exact same simulation (with same initial packing) gives different behaviors (stress-strain response in, e.g., a compression test) when neverErase is True or False. Given the purpose of neverErase (keep record of broken contacts, primarily for DFNFlow), it should not. The difference can be more or less important depending on the situation but it always exists. I could not figure out the cause of this yet but it seems that it comes from the treatment of broken contacts (obviously).
Here is a simulation (uniaxial compression) that illustrates the problem. Running the same script using the exact same sample (to make sure the error does not come from a difference in the packings used) with either neverErase=True or neverErase=False produces 2 stress-strain curves which deviate at some point during the simulation. I made sure that the error is only due to neverErase by running the same simulations several times. The curves obtained with neverErase=True are always identical, as the curves obtained with neverErase=False. For those who would be interested, I also attach a packing and the python script to plot the curves (below the simulation script).
### yade script ###
from yade import ymport, pack, plot
#### material definition
def sphereMat(): return JCFpmMat(
##### create the specimen
#L=0.10
#D=0.05
#pred=pack.
#O.bodies.
#O.bodies.
#### import the specimen
O.bodies.
#### help define boundary conditions (see utils.uniaxialT
bb=utils.
negIds,
################# DEM loop + ENGINES DEFINED HERE
O.engines=[
ForceResetter(),
InteractionLoop(
[Ig2_
[Ip2_
[Law2_
),
UniaxialStrain
GlobalStiffnes
NewtonIntegrat
PyRunner(
]
################# RECORDER DEFINED HERE
def recorder():
yade.
plot.
################# PREPROCESSING
#### manage interaction detection factor during the first timestep and then set default interaction range
O.step();
### initializes the interaction detection factor
SSgeom.
Saabb.aabbEnlar
################# SIMULATION REALLY STARTS HERE
strainer.dead=0
O.run(50000)
### python script ###
# -*- coding: utf-8 -*-
from pylab import *
### processing function
def store(var,
data=
it=[]
e=[]
s=[]
tc=[]
sc=[]
uf=[]
for i in range(0,len(data)):
it.
e.
s.
tc.
sc.
uf.
var.append(it)
var.append(e)
var.append(s)
var.append(tc)
var.append(sc)
var.append(uf)
### data input
dataFile1=
a1=[]
store(a1,dataFile1)
dataFile2=
a2=[]
store(a2,dataFile2)
rcParams.
figure(
xlabel(
#axis(xmax=0.1)
plot([x*1e3 for x in a1[1]],[x/1e6 for x in a1[2]],
plot([x*1e3 for x in a2[1]],[x/1e6 for x in a2[2]],
ylabel(r'$\sigma_1$ [MPa]')
axis(ymin=0)
#savefig(
### show
show()
«neverErase» is only ok if another functor is taking care of erasing. It
doesn't seem to be the case here, so it should just be «false».
Bruno
Le ven. 31 août. 2018 17:01, Luc Scholtès <email address hidden> a écrit :
> Public bug reported: type=1, density= 3000,young= 1e9,poisson= 0.2,tensileStre ngth=1e6, cohesion= 10e6,frictionAn gle=radians( 30)) inCylinder( (0,0,0) ,(0,0,L) ,D/2.) append( pack.regularHex a(pred, radius= D/20.,gap= 0.,material= sphereMat) ) append( pack.randomDens ePack(pred, radius= D/20.,rRelFuzz= 0.4,spheresInCe ll=1000, memoizeDb= '/tmp/gts- triax-packings. sqlite' ,returnSpherePa ck=False, color=( 0.9,0.8, 0.6),material= sphereMat) ) append( ymport. text('121_ 3k.spheres' ,scale= 1.,shift= Vector3( 0,0,0), material= sphereMat) ) estFeatures) uniaxialTestFea tures() posIds, longerAxis, crossSectionAre a=bb['negIds' ],bb['posIds' ],bb['axis' ],bb['area' ] llider( [Bo1_Sphere_ Aabb(aabbEnlarg eFactor= 1.2,label= 'Saabb' )]), Sphere_ ScGeom( interactionDete ctionFactor= 1.2,label= 'SSgeom' )], JCFpmMat_ JCFpmPhys( cohesiveTreshol dIteration= 1,label= 'interactionPhy s')], JCFpmPhys_ JointedCohesive FrictionalPM( neverErase= False,label= 'interactionLaw ')] r(strainRate= -0.01,axis= longerAxis, asymmetry= 0,posIds= posIds, negIds= negIds, crossSectionAre a=crossSectionA rea,blockDispla cements= 1,blockRotation s=1,setSpeeds= 0,stopStrain= 0.1,dead= 1,label= 'strainer' ), TimeStepper( active= 1,timeStepUpdat eInterval= 10,timestepSafe tyCoefficient= 0...
>
> I noticed that running the exact same simulation (with same initial
> packing) gives different behaviors (stress-strain response in, e.g., a
> compression test) when neverErase is True or False. Given the purpose of
> neverErase (keep record of broken contacts, primarily for DFNFlow), it
> should not. The difference can be more or less important depending on
> the situation but it always exists. I could not figure out the cause of
> this yet but it seems that it comes from the treatment of broken
> contacts (obviously).
>
> Here is a simulation (uniaxial compression) that illustrates the
> problem. Running the same script using the exact same sample (to make
> sure the error does not come from a difference in the packings used)
> with either neverErase=True or neverErase=False produces 2 stress-strain
> curves which deviate at some point during the simulation. I made sure
> that the error is only due to neverErase by running the same simulations
> several times. The curves obtained with neverErase=True are always
> identical, as the curves obtained with neverErase=False. For those who
> would be interested, I also attach a packing and the python script to
> plot the curves (below the simulation script).
>
>
> ### yade script ###
>
>
> from yade import ymport, pack, plot
>
> #### material definition
> def sphereMat(): return
> JCFpmMat(
>
> ##### create the specimen
> #L=0.10
> #D=0.05
> #pred=pack.
> #O.bodies.
>
>
> #O.bodies.
>
> #### import the specimen
>
> O.bodies.
>
> #### help define boundary conditions (see utils.uniaxialT
> bb=utils.
>
> negIds,
>
> ################# DEM loop + ENGINES DEFINED HERE
>
> O.engines=[
> ForceResetter(),
>
> InsertionSortCo
> InteractionLoop(
>
> [Ig2_Sphere_
>
> [Ip2_JCFpmMat_
>
> [Law2_ScGeom_
> ),
>
> UniaxialStraine
>
> GlobalStiffness