Unexpected unbalancedForce when loading jcfpmMat sphere from txt file

Asked by weijy

Hi, all

When I tried to generate a jcfpmMat assembly from a txt file, I got unexpected unbalanced force and no triaxial meanstress. The txt file was previous saved from a isotropic compaction state, and unbalanced force& meanstress was checked before saving.

The script looks like this:

####output spheres####
....
    if unbalancedForce()<0.01 and abs(-confiningPressure-triax.meanStress)/confiningPressure<0.0001:
            a = open(filepath +'/spheres.txt', "a")
            for i in O.bodies:
                if isinstance(i.shape,Sphere):
                    a.write(str(i.state.pos[0])+' '+str(i.state.pos[1])+' '+str(i.state.pos[2])+' '+str(i.shape.radius)+'\n')

####read spheres(in a new .py file)####
...
O.materials.append(JCFpmMat(type = 0,young=young, poisson=mu, frictionAngle=radians(FricDegree), cohesion = c, tensileStrength = t, density=2600, label='spheres'))
O.materials.append(JCFpmMat(type = 1,young=young, poisson=mu, frictionAngle = radians(0), density=2600, label='walls'))
walls=aabbWalls([mn,mx],thickness=0,material='walls')
wallIds=O.bodies.append(walls)
O.bodies.append(ymport.textExt(filepath+'/spheres.txt',material='spheres'))

triax=TriaxialStressController(stressMask = 7,internalCompaction = True)
triax.goal1=triax.goal2=triax.goal3=-confiningPressure
newton=NewtonIntegrator(damping=0.4)

O.engines=[
    ForceResetter(),
 InsertionSortCollider([Bo1_Sphere_Aabb(aabbEnlargeFactor = intRadius,label = 'bo1s'),Bo1_Box_Aabb()]),
 InteractionLoop(
  [Ig2_Sphere_Sphere_ScGeom(interactionDetectionFactor = intRadius,label = 'ig2ss'),Ig2_Box_Sphere_ScGeom()],
  [Ip2_JCFpmMat_JCFpmMat_JCFpmPhys(cohesiveTresholdIteration=1,label = 'ip2jj')],
  [Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM(recordCracks = True)]
 ),
         PyRunner(command = 'check_force()', iterPeriod = 2, label = 'checker'),
 GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8),
        triax,
        newton,
]

def check_force():
    print '*************************************************'
    print 'current step is ',O.iter
    print 'unbalanced force:',unbalancedForce(),' mean stress: ',triax.meanStress
...

And it outputs:
Yade [1]: *************************************************
current step is 2
unbalanced force: 0.73017916357 mean stress: 0.0
*************************************************
current step is 4
unbalanced force: 0.440130806809 mean stress: 0.0
*************************************************
current step is 6
unbalanced force: 0.512598901926 mean stress: 0.0
*************************************************
current step is 8
unbalanced force: 0.426567319055 mean stress: 0.0
*************************************************
current step is 10
unbalanced force: 0.37998054497 mean stress: 0.0
*************************************************
current step is 12
unbalanced force: 0.332840783134 mean stress: -16062849.4928
*************************************************
current step is 14
unbalanced force: 0.300939867577 mean stress: -16062849.4928
*************************************************
current step is 16
unbalanced force: 0.26768156305 mean stress: -16062849.4928
*************************************************
current step is 18
unbalanced force: 0.242024099888 mean stress: -16062849.4928
*************************************************
current step is 20
unbalanced force: 0.216086711122 mean stress: -16062849.4928
*************************************************
current step is 22
unbalanced force: 0.197918966992 mean stress: -15054959.4126
*************************************************
current step is 24
unbalanced force: 0.178792695789 mean stress: -15054959.4126
*************************************************
current step is 26
unbalanced force: 0.160616897573 mean stress: -15054959.4126
*************************************************
current step is 28
unbalanced force: 0.146767620681 mean stress: -15054959.4126
*************************************************
current step is 30
unbalanced force: 0.132578789994 mean stress: -15054959.4126
*************************************************
current step is 32
unbalanced force: 0.122317201601 mean stress: -14753977.4581

(mean stress should be 7e6 = 7000000)
Material and size of the spheres& walls are the same. Why should this happened when I reload the state from the txt file?

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Luc Scholtès
Solved:
Last query:
Last reply:
Revision history for this message
weijy (weijy) said :
#1

Or maybe I should use O.save()
Since you guys may still be enjoying your weekend I'll have a try first :)

Revision history for this message
Best Luc Scholtès (luc) said :
#2

Hi Weijy,

Sorry but I get a bit confused.

You create an assembly by running an internal compaction and write it in a text file. This text file contains positions of spheres and radii of a (hopefully) dense sample. OK

Then, you load this dense sample in your simulation and run once again an internal compaction (stressMask = 7,internalCompaction = True)...

What is it that you want to achieve?

If you want to simulate a triaxial loading on this dense sample, just load it, create the cohesive bonds between particles, apply the confining pressure through the displacement of the boundary walls and then the deviatoric loading (cf. the script I sent you). Actually, you can create a dense sample using any other contact laws (you can even do it through the interface using the triaxial compression test which will create a packing of spheres and write it in a text file in the working folder at the end of the hydrostatic loading.

For you question: "Material and size of the spheres& walls are the same. Why should this happened when I reload the state from the txt file?"

It is normal since you load a packing that does not contain any information related to its mechanical state (the text file only contains the particles positions and radii). If you want to launch the simulation (packing+mechanical state), you have to use O.save() and then O.load().

Luc

Revision history for this message
weijy (weijy) said :
#3

Hi Luc

Thank you for your kind and detailed reply. I appreciate it very much.

I didn't mean to "create a dense sample and run internal compaction again". At first, I tried to start deviate loading immediately after I load the packing from the txt file. But the result showed weird( I don't remember specifically how). So I doubt that this reloaded packing is not stable as I thought I would be. I checked in this way:
1. Create a dense sample with confining pressure
2. Save the position and radii of each sphere in txt file
3. Open a new simulation, load the packing from the txt file, and apply exactly the same confining pressure, same materials, same engines...etc. And see what happens.

And here comes the question above.

I'm aware that the mechanical state can't be directly reloaded in this way. But since the txt file was saved at a stable state, the sphere position& size and their material properties should be able to decide the forces. Isn't it enough to reload the mechanical state?

Revision history for this message
weijy (weijy) said :
#4

Thanks Luc Scholtès, that solved my question.