← Back to team overview

yade-users team mailing list archive

Re: [Question #556907]: Apply cohesive interaction on JCFpmMat

 

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

weijy posted a new comment:
Hi Luc, here is my script:

from yade import pack,export

compFricDegree = 30
confiningPressure = 1e4

O.materials.append(JCFpmMat(young=5e6, poisson=0.5, frictionAngle = radians(compFricDegree), cohesion = 1e3, tensileStrength = 1e2, density=2770, label='spheres'))
O.materials.append(FrictMat(young=5e6, poisson=0.5, frictionAngle = 0, density=0, label='walls'))
walls=aabbWalls([Vector3(0,0,0),Vector3(0.10,0.2,0.10)],thickness=0,material='walls')
wallIds=O.bodies.append(walls)
sp=pack.SpherePack()
sp.makeCloud(Vector3(0,0,0),Vector3(0.10,0.2,0.10),rRelFuzz = 0.2,num = 500,porosity = 0.95,seed = 1)
O.bodies.append([sphere(center,rad,material='spheres') for center,rad in sp])
triax=TriaxialStressController(maxMultiplier=1.+5e-4,finalMaxMultiplier=1.+3e-5,thickness = 0,stressMask = 7,internalCompaction = True)
triax.goal1=triax.goal2=triax.goal3=-confiningPressure

O.engines=[
    ForceResetter(),
	InsertionSortCollider([Bo1_Sphere_Aabb(label = 'bo1s'),Bo1_Box_Aabb()]),
	InteractionLoop(
		[Ig2_Sphere_Sphere_ScGeom(label = 'ig2ss'),Ig2_Box_Sphere_ScGeom()],
		[Ip2_FrictMat_FrictMat_FrictPhys(),Ip2_JCFpmMat_JCFpmMat_JCFpmPhys(label = 'ip2jj')],
		[Law2_ScGeom_FrictPhys_CundallStrack(),Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM()]
	),
    GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8),
    triax,
    NewtonIntegrator(),
    PyRunner(command = 'set_friction()', iterPeriod = 1000, label = 'checker'),
]

def set_friction():
    global compFricDegree
    print '*************************************************'
    print 'current step is ',O.iter
    print 'unbalanced force:',unbalancedForce(),' mean stress: ',triax.meanStress
    if unbalancedForce()<0.01 and abs(-confiningPressure-triax.meanStress)/confiningPressure<0.001:
        checker.command = 'set_interaction()'
        checker.ietrPeriod = 1

def set_interaction():
    num_intr = 0
    bo1s.aabbEnlargeFactor = 1.2
    ig2ss.interactionDetectionFactor = 1.2
    for i in O.interactions:
        num_intr = num_intr + 1
    print '*************************************************'
    print 'current step is ',O.iter
    print 'total interactions before setting intR is ', num_intr
    ip2jj.cohesiveTresholdIteration = O.iter + 1
    checker.iterPeriod = 1
    checker.command = 'check_cohesion()'
        
def check_cohesion():
    num_intr = 0
    num_coh = 0
    bo1s.aabbEnlargeFactor = -1
    ig2ss.interactionDetectionFactor = -1   
    for i in O.interactions:
        if isinstance(O.bodies[i.id1].shape,Sphere) and isinstance(O.bodies[i.id2].shape,Sphere):
            num_intr += 1
            if i.phys.FnMax > 0:
                num_coh +=1
    print '*************************************************'
    print 'current step is ',O.iter
    print 'total interactions after setting intR is ', num_intr 
    print 'number of cohesive interactions is ',num_coh
    O.pause()

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