How to apply a constant force value

Asked by Felipe

Hello everybody,

I am doing some simulation with some parts that have imported from design software (CATIA, CREO, AUTOCAD). In fact, I had found some issues when I tried to apply a force value to compression the material, like a compression test where I have cylinder pack created and a plane that is applying force on it (see illustration on the link).

https://www.dropbox.com/s/5frs3x234loxma9/Apply%20Force.png?dl=0

I have looked some examples that it is possible to apply a force value on the surface that is moving at constant velocity (upBox).

So, I would like to know how I can get to apply a force value to compression the material using:

1 – A surface which was created by O.bodies.append([leftBox,lowBox,rightBox,upBox,behindBox,inFrontBox])

2- A geometry which was imported by rod1 = O.bodies.append(ymport.stl(mesh1+'.stl',wire=True,material='caixasup'))

Thanks for any comments.

Best Regards,

Felipe

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Jan Stránský
Solved:
Last query:
Last reply:
Revision history for this message
Jan Stránský (honzik) said :
#1

Hi Felipe,

I had found some issues

next time please be more specific, this information gives no help.. Does
the body disappear? Yuo prescribe force and it does not move?....

apply a force value on the surface that is moving at constant velocity

Either you apply force and the result is positions/velocity, or you
prescribe velocity and the result is force. It is not possible to prescribe
both force and velocity...

1 – A surface which was created by O.bodies.append([leftBox,
> lowBox,rightBox,upBox,behindBox,inFrontBox])

to prescribe force you have two options:
#############################################
O.forces.addF(upBox.id) # [1] for just one iteration
O.forces.setPermF(upBox.id,someForceVector) # [2] sets permanent force
# probably you will also have to set mass and dynamic flag to the body:
upBox.dynamic = True # [4]
upBox.state.mass = someMassValue
upBox.state.inertia = someVector # you can check what is the value of mass
and inertia, it might be 0 or NaN causing the bodies "disappear"
# upBox.state.blockedDOFs = ??? # to block some DOFs like rotations etc.
#############################################

to prescribe velocity:
#############################################
upBox.state.blockedDOFs = 'xyzXYZ' # [3]
upBox.state.vel = someVelocityVector
#############################################

2- A geometry which was imported by rod1 = O.bodies.append(ymport.stl(
> mesh1+'.stl',wire=True,material='caixasup'))

the same approach as above, just you will have to identify the bodies you
want to adjust:
#############################################
upBox = O.bodies[someID]
#############################################

cheers
Jan

[1]
https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.ForceContainer.addF
[2]
https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.ForceContainer.setPermF
[3]
https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.State.blockedDOFs
[4] https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.Body.dynamic

Revision history for this message
Felipe (felipetthadeu) said :
#2

Hello Jan,

thanks for all comments that you provided me.

By the way, i did not get to apply your solution on my program. Maybe, I am putting some incorrect values. Due to this information, i would like to ask to you how can i define the values to:

upBox = O.bodies[540]

O.forces.addF(upBox.id)
O.forces.setPermF(upBox.id,(0,10,0))
upBox.dynamic = True # [4]
upBox.state.mass = 10
upBox.state.inertia =(0,1,0)

is it correct?

#---- Def of the Imported Bodies ----#
rod1 = O.bodies.append(ymport.stl(mesh1+'.stl',wire=True,material='caixasup'))
rod2 = O.bodies.append(ymport.stl(mesh2+'.stl',wire=False,material='caixainf'))

#---- Def of the Plan ----#
upBox = box( center=(0,255,-25), extents=(50,1,50) ,fixed=True,wire=False)

O.bodies.append([upBox])

#---- Def of the Particles ----#
sp=pack.SpherePack()
sp.makeCloud((-35,-45,-35),(35,250,35),rMean=5,periodic=False,porosity=0.8,distributeMass=False,seed=0)
sp.toSimulation()

#---- Def of the Engines ----#
O.engines=[
 ForceResetter(),
 InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb(),Bo1_Box_Aabb()]),
 InteractionLoop(
  [Ig2_Sphere_Sphere_ScGeom6D(),Ig2_Box_Sphere_ScGeom6D(),Ig2_Facet_Sphere_ScGeom6D()],
  [Ip2_FrictMat_FrictMat_FrictPhys()],
  [Law2_ScGeom_FrictPhys_CundallStrack()]
 ),
 NewtonIntegrator(damping=0.7, gravity=[0,-9.81,0]),
 GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8),
 ]

#---- Def of the Force ----#
upBox = O.bodies[540]

O.forces.addF(upBox.id)
O.forces.setPermF(upBox.id,(0,10,0))
upBox.dynamic = True # [4]
upBox.state.mass = 10
upBox.state.inertia =(0,1,0)

#---- Def of the Plots ----#
from yade import plot
qt.Controller()

O.run(3000,True)
qt.View()
O.run(3000)

Revision history for this message
Best Jan Stránský (honzik) said :
#3

Hi Felipe

upBox = O.bodies[540]
> O.forces.addF(upBox.id)
> O.forces.setPermF(upBox.id,(0,10,0))
> upBox.dynamic = True # [4]
> upBox.state.mass = 10
> upBox.state.inertia =(0,1,0)
>
> is it correct?

sorry, I did a typo in te first answer, addF amd setParmF has the same
arguments (id,forceVector). Choose only one of them (depending on if you
want to change the value often, then choode addF, if you want to have
constant value, setPermF is preferable).

I guess state.inertia should not have any zero (not tested)

otherwise I think it could work..

cheers
Jan

Revision history for this message
Felipe (felipetthadeu) said :
#4

Thanks Jan Stránský, that solved my question.