Question #629227 on Yade changed:
https://answers.launchpad.net/yade/+question/629227

Summary changed to:
TriaxialStressController does not compute

Description changed to:
Hi everybody,

I'm having a bit of a trouble here with the TriaxialStressController.
Sad thing is, I'm sure it is stupid, but I really can't get round the
problem.

I have adapted the agglomerate examples from github, in order to create
a packed sample of agglomerates ( which it already did, but in three
different simulations, and I wanted just one).

I am having trouble with the compaction process, it seems like the triax would 
simply not work.
I ran the simulation, and found the sample had'nt been packed. I have modifies 
the code in order that when I run the simulation, it will produce the 
agglomerates, and I could press run so that I see if anything is going wrong or 
happening. Well, seems that the walls don't move.

I tried activating the walls, like in the triax example (scenery 2), but that 
didn't change much.
Do you think maybe it is the clump function ? I haven't found that 
O.bodies.clump is much used, you can find much more on appendClumped, so I 
wondered if maybe the clump function did not fix particles in space or 
something...

the code is there :

# -*- coding: utf-8 -*-

from yade import export
from yade import export,ymport
import random


        
dim    = (15,15,15) # dimensions for makeCloud
radius = 1
fuzz   = 0.2

# use of makeCloud function
sp = pack.SpherePack()
sp.makeCloud((0,0,0), dim, rMean=radius, rRelFuzz=fuzz, seed=1)


random.seed(1) # to make colors always the same

attrs = []

colors = [randomColor() for s in sp]
# each macroparticle is filled randomDensePack
for si,s in enumerate(sp):
        sphere = pack.inSphere(s[0],s[1])
        sp1 = pack.randomDensePack(
                sphere,
                spheresInCell = 500,
                radius = .2,
                memoizeDb = '/tmp/agglomeratepackaux.db',
                returnSpherePack = True,
        )
        ids = sp1.toSimulation(color=colors[si]) # add the result to simulation 
with uniform color
        

        for i in ids:
                O.bodies[i].agglomerate = si # tell each particle who is its 
agglomerate
                attrs.append(O.bodies[i].agglomerate)

#random.seed(1)

sp2 = []
for b in O.bodies :
        if isinstance(b.shape,Sphere):
                sp2.append(b)

# add walls first
dim = (15,15,15)
walls = aabbWalls(((0,0,0),(dim)))
wallIds = O.bodies.append(walls)

# clump agglomerates
n = max(a for a in attrs)+1
colors = [randomColor() for _ in xrange(n)]
agglomerates = [[] for _ in xrange(n)]


for s,a in zip(sp2,attrs):
        aa = a
        s.agglomerate = aa
        s.shape.color = colors[aa]
        agglomerates[aa].append(s.id)

for g in agglomerates:
        O.bodies.clump(g)

triax=TriaxialStressController(
        maxMultiplier=1.005,
        finalMaxMultiplier=1.002,
        thickness = 0,
        stressMask = 7,
        internalCompaction=False,
        
)

triax.wall_bottom_activated=True
triax.wall_top_activated=True
triax.wall_left_activated=True
triax.wall_right_activated=True
triax.wall_back_activated=True
triax.wall_front_activated=True


O.engines = [
        ForceResetter(),
        InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Box_Aabb()]),
        InteractionLoop(
                [Ig2_Sphere_Sphere_ScGeom(),Ig2_Box_Sphere_ScGeom()],
                [Ip2_FrictMat_FrictMat_FrictPhys()],
                [Law2_ScGeom_FrictPhys_CundallStrack()]
        ),
        triax,
        TriaxialStateRecorder(iterPeriod=100,file='WallStresses'),
        NewtonIntegrator(damping=.6),
]


O.dt = PWaveTimeStep()
O.usesTimeStepper=True

# compress the sample
triax.goal1 = triax.goal2 = triax.goal3 = -1e-7

#O.run(50000,True) 
        
#triax.goal1 = triax.goal2 = triax.goal3 = -1e-5
#O.run(30000,True)



# save the result, including information of agglomerates which the particle 
belongs to
export.textExt('/tmp/compressed.txt','x_y_z_r_attrs',attrs=['b.agglomerate'])

try:
        from yade import qt
        qt.View()
except:
        pass


def getClumpInfo():
        for b in O.bodies:
                if b.isClump:
                        print 'Clump ',b.id,' has following members:'
                        keys = b.shape.members.keys()
                        for ii in range(0,len(keys)):
                                print '- Body ',keys[ii]
                        print 'inertia:',b.state.inertia
                        print 'mass:',b.state.mass,'\n'
                else: 
                        print 'no clumps'

Thanks in advance to anybody that can help !

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.

_______________________________________________
Mailing list: https://launchpad.net/~yade-users
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp

Reply via email to