Wall position doesn't change after applying force

Asked by Anqi H on 2019-08-07

Hi everyone,

I recently installed Yade version 2019-07022.git-585c6c1 on a Ubuntu 18.04 machine. I have an old script that used to run with yade 1.07.0 correctly, I have replaced O.forces.addF(upper_wall.id, (0,-force,0), permanent = True) with O.forces.setPermF(upper_wall.id, (0,-force,0)), but the wall position doesn't change during the simulation. I also tried to use the old code addF, other than getting the warning: method deprecated, the wall position still doesn't change.

Here's a code snippet:

bottom_wall = O.bodies[wall[2]]
bottom_wall.state.blockedDOFs = 'xzXYZ'
bottom_wall.state.mass = 1

upper_wall = O.bodies[wall[3]]
upper_wall.state.blockedDOFs = 'xzXYZ'
upper_wall.state.mass = 1

#set force
app_stress = range(2,26,2)
index = 0
force = app_stress[index]*1e6*0.02*0.02
O.forces.setPermF(upper_wall.id, (0,-force,0))
O.forces.setPermF(bottom_wall.id, (0,force,0))

Does anyone know what's causing this issue?

Thank you.

Question information

Language:
English Edit question
Status:
Open
For:
Yade Edit question
Assignee:
No assignee Edit question
Last query:
2019-08-10
Last reply:
2019-08-10
Jan Stránský (honzik) said : #1

Please provide a MWE [1] such that we can test it ourselves. (E.g. we don't know bottom_wall is. Wall, Box, Facet...?)
thanks
Jan

[1] https://yade-dem.org/wiki/Howtoask

Anqi H (analoq) said : #2

Hi Jan,

This is the script I used. The positions of the rock particles were imported from a text file.

from yade import utils
from yade import pack
from yade import plot
from yade import qt
from yade import export
from yade import ymport

# rock parameters
Young = 57e8
FrictAng = 0.5
Density = 2650
Poisson = 0.28
Cohesion = 38e6 # pa
TensileStr = 38e6 # pa

#proppant properties
FrictAng_p = 0.9
Density_p = 2650
Young_p = 100e6
TensileStr_p=3000
Cohesion_p=3000

#define rock and wall
# JCPpm used for cohesive frictional material
rock = JCFpmMat(type=1,young=Young,frictionAngle=FrictAng,density=Density,poisson=Poisson,tensileStrength=TensileStr,cohesion=Cohesion,label='rock')
wall = JCFpmMat(type=0,young=2e11,frictionAngle=FrictAng,density=Density,poisson=Poisson,tensileStrength=0,cohesion=0)
proppant = JCFpmMat(type=2,young=Young_p,frictionAngle=FrictAng_p,density=Density_p,tensileStrength=TensileStr_p,cohesion=Cohesion_p)

for Mat in (rock,wall,proppant):
 O.materials.append(Mat)

rock_assembly = O.bodies.append(ymport.textExt('rock.txt','x_y_z_r',shift=Vector3(0,0,0),scale=1,material=rock,color=(0.00,0.00,0.70)))

#add walls
wall = O.bodies.append(utils.aabbWalls(material=wall,thickness=0.000,color=(1,1,1)))
# delete other walls only save walls in y axis
O.bodies.erase(wall[0])
O.bodies.erase(wall[1])
O.bodies.erase(wall[4])
O.bodies.erase(wall[5])

bottom_wall = O.bodies[wall[2]]
bottom_wall.state.blockedDOFs = 'xzXYZ'
bottom_wall.state.mass = 1

upper_wall = O.bodies[wall[3]]
upper_wall.state.blockedDOFs = 'xzXYZ'
upper_wall.state.mass = 1

#set force
app_stress = range(2,26,2)
last_aper = 0.005599
index = 0
force = app_stress[index]*1e6*0.02*0.02
last_diff = 0.1
O.forces.setPermF(upper_wall.id, (0,-force,0))
O.forces.setPermF(bottom_wall.id, (0,-force,0))

#add proppant pack
pro_pred = pack.inCylinder((0.01,0.0126004,0.01),(0.01,0.0181994,0.01),radius=0.005)
sp=pack.randomDensePack(pro_pred, radius=0.000223,rRelFuzz=.33,returnSpherePack=True,spheresInCell=5000, material=proppant)
sp.toSimulation(color=(1.00,0.67,0.50))

###########################
# ENGINES
###########################

O.engines=[
 ForceResetter(),
 # enlarge interaction radius between spheres
 InsertionSortCollider([Bo1_Sphere_Aabb(aabbEnlargeFactor=1.2,label="bo1s"),Bo1_Box_Aabb()]),
 InteractionLoop(
  [Ig2_Sphere_Sphere_ScGeom(interactionDetectionFactor=1.2,label="ig2s"),Ig2_Box_Sphere_ScGeom()], #,Ig2_Wall_Sphere_ScGeom()
  [Ip2_JCFpmMat_JCFpmMat_JCFpmPhys(cohesiveTresholdIteration=1)],
  [Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM(recordCracks=True,label='lawFunctor')]
 ),
 GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.5),
 NewtonIntegrator(damping=0.3,gravity=(0,0,0)),
 #call addPlot() every 20 steps
 PyRunner(command='addPlot()', realPeriod=20)
]
O.trackEnergy=True
O.step()

bo1s.aabbEnlargeFactor=1
ig2s.interactionDetectionFactor=1

#set an optimal timestep
O.dt = utils.PWaveTimeStep()
O.usesTimeStepper = True

def addPlot():
 global force,last_diff,index,last_iter
 stress=force/(.02*.02)
 if O.iter-last_iter)>2500 and (O.iter-last_iter)<2800:
    if index==(len(app_stress)-1):
       O.pause()
       for b in rock_assembly:
    O.bodies.erase(b)
    else:
       index+=1
       force = app_stress[index]*1e6*0.02*0.02
       O.forces.setPermF(upper_wall.id, (0,-force,0))
       O.forces.setPermF(bottom_wall.id, (0,-force,0))
       last_iter=O.iter
 upper_pos = upper_wall.state.pos[1]
 numCohesive = 0
 for i in O.interactions:
    if i.phys.isCohesive:
 numCohesive+=1
 print "numCohesive "+str(numCohesive)

Can you help with this problem?

Provide an answer of your own, or ask Anqi H for more information if necessary.

To post a message you must log in.