← Back to team overview

yade-users team mailing list archive

Re: [Question #688345]: Precrack

 

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

    Status: Answered => Open

mrhappy is still having a problem:
Hey Robert,

Thanks for your help. I used i.phys.isCohesive = False; however, I
noticed that the nodes are still bonded. I then made a funtion that
removes the bond every iteration step. I check to see if the bond
exisits by pressing the inspect button, then going to bodies, and syping
in the element number to see whos attached to it.  Can you have a look
at my code and suggest a method that will permanently delete the bond
between these specific spheres? I want to create a precrack.

Thank you sooo much!


#MATERIAL PROPERTIES 
intR =   3.00 #connectivity parameter 
DENS = 2500.00 #Density (kg/mm^3) 
YOUNG = 1800.00 #Young's modulus (N/mm^2) 
FRICT =  18.00 #Friction angle (degrees) 
ALPHA =   0.20 #Poisson's ratio 
TENS = 100000000.00 #Tensile strength (N/mm^2) 
COH = 100000000000000.00 #Shear strength (N/mm^2) 
iterMax =   1.00 #Max Itteration 
rate =   0.00 #pull rate 

O.materials.append(JCFpmMat(type=1,density=DENS,young=YOUNG,poisson=ALPHA,frictionAngle=radians(FRICT),tensileStrength=TENS,cohesion=COH,label='mat1'))

# PARTICLES 
O.bodies.append([ 
#ALOT OF SPHERES WHICH I AM NOT SHOWING NOW.
])
nbSpheres = 400.00

# BOUNDARY CONDITIONS

# FUNCTIONAL COMPONENTS 
def addPlotData1(): 
	plot.addData(t=O.time,Displacement = O.bodies[209].state.pos[1] - 11.000, DX1 = O.bodies[210].state.pos[0], DY1 = O.bodies[210].state.pos[1], DX2 = O.bodies[211].state.pos[0], DY2 = O.bodies[211].state.pos[1], DX3 = O.bodies[212].state.pos[0], DY3 = O.bodies[212].state.pos[1], DX4 = O.bodies[213].state.pos[0], DY4 = O.bodies[213].state.pos[1], DX5 = O.bodies[214].state.pos[0], DY5 = O.bodies[214].state.pos[1], DX6 = O.bodies[215].state.pos[0], DY6 = O.bodies[215].state.pos[1], DX7 = O.bodies[216].state.pos[0], DY7 = O.bodies[216].state.pos[1], DX8 = O.bodies[217].state.pos[0], DY8 = O.bodies[217].state.pos[1], DX9 = O.bodies[218].state.pos[0], DY9 = O.bodies[218].state.pos[1], DX10 = O.bodies[219].state.pos[0], DY10 = O.bodies[219].state.pos[1],  ) 

def saveData1(): 
	plot.saveDataTxt('/home/nabid/Desktop/SCRIPTS/Fracture_Model/ForceBC/ForceFD.txt',vars=('t','Displacement'))

def saveData2(): 
	plot.saveDataTxt('/home/nabid/Desktop/SCRIPTS/Fracture_Model/ForceBC/Data.txt',vars=('t','DX1', 'DY1','DX2', 'DY2','DX3', 'DY3','DX4', 'DY4','DX5', 'DY5','DX6', 'DY6','DX7', 'DY7','DX8', 'DY8','DX9', 'DY9','DX10', 'DY10',) ), 

def ForceBC(): 
	if O.time < 800: 
		O.forces.setPermF(209,(0,0.01000*O.time,0)) 
		O.forces.setPermF(210,(0,0.01000*O.time,0)) 
		O.forces.setPermF(189,(0,-0.01000*O.time,0)) 
		O.forces.setPermF(190,(0,-0.01000*O.time,0)) 
	else: 
		O.forces.setPermF(209,(0,8.00000,0)) 
		O.forces.setPermF(210,(0,8.00000,0)) 
		O.forces.setPermF(189,(0,-8.00000,0)) 
		O.forces.setPermF(190,(0,-8.00000,0)) 
 
# PRINTING 
from yade import plot 
from pprint import pprint 

# SIMULATION LOOP 
O.engines=[ 
PyRunner(command='addPlotData1()',iterPeriod=1), 
PyRunner(command='saveData1()',iterPeriod=1000), 
PyRunner(command='saveData2()',iterPeriod=1000), 
PyRunner(command='DelEle()',iterPeriod=1), 
PyRunner(command='ForceBC()',iterPeriod=1), 
ForceResetter(), 
InsertionSortCollider([Bo1_Sphere_Aabb()]), 
InteractionLoop( 
[Ig2_Sphere_Sphere_ScGeom(interactionDetectionFactor=intR)], 
[Ip2_JCFpmMat_JCFpmMat_JCFpmPhys(cohesiveTresholdIteration=1)], 
[Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM()] 
), 
GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=10,timestepSafetyCoefficient=0.5, defaultDt=utils.PWaveTimeStep()), 
NewtonIntegrator(damping=  0.80), 
]

#TIME STEP 
O.dt=0.5e-4*PWaveTimeStep() 

#Precrack 
def DelEle(): 
    ncrack = 0 
    for i in O.interactions: 
        if (i.id1 == 189 and i.id2 == 208): 
            i.phys.isCohesive = False 
            ncrack = ncrack + 1
        if (i.id1 == 189 and i.id2 == 209): 
            i.phys.isCohesive = False 
            ncrack = ncrack + 1
        if (i.id1 == 189 and i.id2 == 210): 
            i.phys.isCohesive = False 
            ncrack = ncrack + 1
        if (i.id1 == 208 and i.id2 == 189): 
            i.phys.isCohesive = False 
            ncrack = ncrack + 1
        if (i.id1 == 209 and i.id2 == 189): 
            i.phys.isCohesive = False 
            ncrack = ncrack + 1
        if (i.id1 == 210 and i.id2 == 189): 
            i.phys.isCohesive = False 
            ncrack = ncrack + 1
        if (i.id1 == 190 and i.id2 == 209): 
            i.phys.isCohesive = False 
            ncrack = ncrack + 1
        if (i.id1 == 190 and i.id2 == 210): 
            i.phys.isCohesive = False 
            ncrack = ncrack + 1
        if (i.id1 == 190 and i.id2 == 211): 
            i.phys.isCohesive = False 
            ncrack = ncrack + 1
        if (i.id1 == 209 and i.id2 == 190): 
            i.phys.isCohesive = False 
            ncrack = ncrack + 1
        if (i.id1 == 210 and i.id2 == 190): 
            i.phys.isCohesive = False 
            ncrack = ncrack + 1
        if (i.id1 == 211 and i.id2 == 190): 
            i.phys.isCohesive = False 
            ncrack = ncrack + 1
        if (i.id1 == 210 and i.id2 == 191): 
            i.phys.isCohesive = False 
            ncrack = ncrack + 1
        if (i.id1 == 209 and i.id2 == 188): 
            i.phys.isCohesive = False 
            ncrack = ncrack + 1
        print("Total crack length " +str(ncrack) +" out of " +str(6))

#PLOTTING 
plot.plots={'t':('Displacement')} 
plot.plot()

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