bodies which are controlled by "setPermF" does not move. Is it right?

Asked by JINSUN LEE

I have assigned permanent forces of 1,000 acting along the z-axis to the facets.
I expected that the facets will move due to the unbalanced forces (because it has no reaction forces).
However, it will not move at all. Does the contacting force of body is different with the conventional forces acting on the rigid body surface?

Thanks in advance.

--
OS : Ubuntu 22.10
YADE : 2022.01a

The followings are MWE
===
from yade import pack, plot
import sys
sys.path.append('/home/jinsun/Dropbox/Yadee/CDSS')

def setGeomVars (): # initialize variables
     width = 0.05
     height = 0.03
     margin = 30
     # Calculate extra length
     dx = width/100/2*margin
     dy = width/100/2*margin
     dz = height/100/2*margin
     saveVars('geoms',loadnow=True,**locals())

setGeomVars ()
from yade.params.geoms import * # load initilized variables

# side pannel
p1s = (-width/2,-width/2-dy,-height/2-dz)
p5s = (-width/2,-width/2-dy,height/2+dz)
p6s = (-width/2,width/2+dy,height/2+dz)
p2s = (-width/2,width/2+dy,-height/2-dz)

side1_1 = utils.facet(vertices=[p1s,p5s,p2s], wire=True, highlight=False) #p1 p5 p2
side1_2 = utils.facet(vertices=[p2s,p5s,p6s], wire=True, highlight=False) #p1 p5 p2
O.bodies.append(side1_1)
O.bodies.append(side1_2)

p4s = (width/2,-width/2-dy,-height/2-dz)
p8s = (width/2,-width/2-dy,height/2+dz)
p7s = (width/2,width/2+dy,height/2+dz)
p3s = (width/2,width/2+dy,-height/2-dz)

side2_1 = utils.facet(vertices=[p4s,p8s,p3s], wire=True, highlight=False) #p1 p5 p2
side2_2 = utils.facet(vertices=[p3s,p8s,p7s], wire=True, highlight=False) #p1 p5 p2
O.bodies.append(side2_1)
O.bodies.append(side2_2)

# front pannel
p1f = (-width/2-dx,-width/2,-height/2-dz)
p5f = (-width/2-dx,-width/2,height/2+dz)
p4f = (width/2+dx,-width/2,-height/2-dz)
p8f = (width/2+dx,-width/2,height/2+dz)

front1 = utils.facet(vertices=[p1f,p5f,p8f], wire=True, highlight=False)
front2 = utils.facet(vertices=[p1f,p8f,p4f], wire=True, highlight=False)
O.bodies.append(front1)
O.bodies.append(front2)

# back pannel
p2b = (-width/2-dx,width/2,-height/2-dz)
p6b = (-width/2-dx,width/2,height/2+dz)
p3b = (width/2+dx,width/2,-height/2-dz)
p7b = (width/2+dx,width/2,height/2+dz)

back1 = utils.facet(vertices=[p2b,p6b,p7b], wire=True, highlight=False)
back2 = utils.facet(vertices=[p2b,p7b,p3b], wire=True, highlight=False)
O.bodies.append(back1)
O.bodies.append(back2)

#bottom pannel
p1bt = (-width/2-dx,-width/2-dy,-height/2)
p2bt = (-width/2-dx,width/2+dy,-height/2)
p3bt = (width/2+dx,width/2+dy,-height/2)
p4bt = (width/2+dx,-width/2-dy,-height/2)

bot1 = utils.facet(vertices=[p1bt,p2bt,p3bt], wire=True, highlight=False)
bot2 = utils.facet(vertices=[p1bt,p4bt,p3bt], wire=True, highlight=False)
O.bodies.append(bot1)
O.bodies.append(bot2)

# create topcap
p5t = (-width/2-dx,-width/2-dy,height/2+2*dz)
p6t = (-width/2-dx,width/2+dy,height/2+2*dz)
p7t = (width/2+dx,width/2+dy,height/2+2*dz)
p8t = (width/2+dx,-width/2-dy,height/2+2*dz)

topcap1 = utils.facet(vertices=[p5t,p6t,p7t], wire=True, highlight=False)
topcap2 = utils.facet(vertices=[p5t,p8t,p7t], wire=True, highlight=False)
O.bodies.append(topcap1)
O.bodies.append(topcap2)

no_bodies = len(O.bodies)
O.bodies[no_bodies-1].shape.highlight = True
O.bodies[no_bodies-2].shape.highlight = True

top_caps = range(no_bodies-2, no_bodies) #

O.materials.append(FrictMat(young=20e6, poisson=0.17, density=2000, label='frictmat'))

O.engines = [
    ForceResetter(),
    InsertionSortCollider([Bo1_Sphere_Aabb(), Bo1_Facet_Aabb()]),
    InteractionLoop(
            [Ig2_Sphere_Sphere_ScGeom(), Ig2_Facet_Sphere_ScGeom()], # collision geometry
            [Ip2_FrictMat_FrictMat_FrictPhys()], # collision "physics"
            [Law2_ScGeom_FrictPhys_CundallStrack()] # contact law -- apply forces
    ),
    NewtonIntegrator(gravity=(0, 0, -9.81), damping=0.02),
# PyRunner(command='addData()', iterPeriod=100),
    PyRunner(command='addPlotData()', iterPeriod=100),
# ForceEngine(force=(0,0,-1000),ids=top_caps, label="ovp"),
# ServoPIDController(axis=(0,0,1), ids=top_caps, target=servo_targetForce, kD=5.0, kI=5.0, kP=5.0, maxVelocity=-0.01, iterPeriod=100, label="servo_1"),
    DomainLimiter(lo=(-width,-width,-height+2*dz), hi=(width,width,2*height), iterPeriod = 100, label = 'Domain') # destroy balls outside domain in every 100 steps
]

def addPlotData():
    top_cap_force=(O.forces.f(no_bodies-2)[2] + O.forces.f(no_bodies-2)[2])
    top_cap_zdisp=O.bodies[no_bodies-2].state.displ()[2] # direction in z
    plot.addData(i=O.iter, top_cap_force=top_cap_force, w=O.iter, top_cap_zdisp=top_cap_zdisp)

plot.plots={'i':('top_cap_force',), 'w':('top_cap_zdisp',)}
plot.plot()

O.forces.setPermF(O.bodies[-1].id,(0,0,-1000))
O.forces.setPermF(O.bodies[-2].id,(0,0,-1000))

O.dt=0.5*PWaveTimeStep()
O.run()

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Karol Brzezinski
Solved:
Last query:
Last reply:
Revision history for this message
Best Karol Brzezinski (kbrzezinski) said :
#1

Hi Jinsun,

The major issue is not the setPermF function but the fact that facets are massless and not dynamic bodies by default. You can move such bodies by applying velocity to them. If you want to move them with force, they should have mass and be freed. You can achieve it by the following (example) code placed right before O.run():

for i in [-2,-1]:
    b = O.bodies[i]
    b.state.mass = 1# set 1 kg of mass to the facet
    b.state.blockedDOFs = 'xyXYZ'# block all the degrees of freedom except for z (by default everything is blocked, even z)

Please note, that the movement of the facets will also be affected by gravity. Also, it is strange that there is no particles in your simulation yet ;)

Cheers,
Karol

Revision history for this message
JINSUN LEE (ppk21) said :
#2

Thank you Brzezinski

appreciate.

Regards,

Revision history for this message
JINSUN LEE (ppk21) said :
#3

Thanks Karol Brzezinski, that solved my question.

Revision history for this message
JINSUN LEE (ppk21) said (last edit ):
#4

Thanks Karol Brzezinski

I have met another question.

I can apply overburden pressure as following your reply.

Question #1
When I use the command "O.bodies[-1].dynamic=True" instead of the command "O.bodies[-1].state.blockedDOFs=xyXYZ",
the facet will not interact with the spheres. Why?

Question #2
Finally, I can use either "ServoPIDController" or "O.bodies[-1].state.mass" to apply overburden pressure.
What is standard or preferred way in YADE now?

Thank you in advance for your kind answer.

Regards. :)

Revision history for this message
Karol Brzezinski (kbrzezinski) said :
#5

Hi,

Please open separate threads for new questions [1]. Also, remember about MVE (especially for the sphere-facet interaction question because there are no spheres in your first MVE ). Regarding your second question - it depends. Try to describe your problem in more detail when you open a new topic.

Cheers,
Karol
[1] https://www.yade-dem.org/wiki/Howtoask