how detect force applied on beam

Asked by Yor1

Hello everybody
I'm trying to realize a 3 bending test. I impose a velocity on the piston but i don't detect any force applied and the beam don't undergo any strain. The piston cross the beam and i think that it is not normal.
This is a part of my code:

#### simulation is defined here (DEM loop, interaction law, servo control, recording, etc...)
##### simulation piston's movement

for i in range(0,len(piston)):
 O.bodies[piston[i]].state.vel[1]=-1

##### simulation of movement of beam's grains
O.engines=[
        ForceResetter(),
        InsertionSortCollider([Bo1_Box_Aabb(),Bo1_Sphere_Aabb(aabbEnlargeFactor=intR,label='Saabb')]),
 InteractionLoop(
  [Ig2_Sphere_Sphere_ScGeom(interactionDetectionFactor=intR,label='SSgeom'),Ig2_Box_Sphere_ScGeom()],
  [Ip2_JCFpmMat_JCFpmMat_JCFpmPhys(cohesiveTresholdIteration=1,label='interactionPhys')],
  [Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM(recordCracks=True,Key=OUT,label='interactionLaw')]
 ),

        GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=10,timestepSafetyCoefficient=0.4, defaultDt=0.1*utils.PWaveTimeStep()),
        NewtonIntegrator(damping=DAMP,label="newton"),
        PyRunner(iterPeriod=int(saveData),initRun=True,command='recorder()',label='data'),
        VTKRecorder(iterPeriod=int(saveVTK),initRun=True,fileName=OUT+'-',recorders=['spheres','jcfpm','cracks'],Key=OUT,label='vtk')
]

tensCks=shearCks=cks=cks0=0
e10=e20=e30=0
def recorder():
    global tensCks, shearCks, e10,e20,e30
    tensCks=0
    shearCks=0
    for o in O.bodies:
 if isinstance(o.shape,Sphere):
  tensCks+=o.state.tensBreak
  shearCks+=o.state.shearBreak
    yade.plot.addData( t=O.time
        ,i=O.iter
        #,e1=triax.strain[0]-e10
        #,e2=triax.strain[1]-e20
        #,e3=triax.strain[2]-e30
        ,f=utils.sumFacetNormalForces(ids=piston,axis=1)
        ,tc=0.5*tensCks,sc=0.5*shearCks,unbF=utils.unbalancedForce()
    )
    yade.plot.saveDataTxt(OUT)

Best regards

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Yor1
Solved:
Last query:
Last reply:
Revision history for this message
Yor1 (jabrane-hamdi) said :
#1

sorry it is 3-point bending test

Revision history for this message
Jérôme Duriez (jduriez) said :
#2

Hi,

When you show us your script, please give it complete and shortened as much as possible: "minimal working". Here:

- it is not shortened as much as possible : all what concerns data recording is useless (recorder() function with corresponding engine, and also the VTKRecorder). Your problem surely still holds without this part

- it is not complete: if someone wants to try it, it will not work: there is nothing for what concerns bodies definition for ex.

By chance, I remember your previous question, and can assume that your piston is made of facets-shaped bodies. That's exactly the problem since your interaction loop only handles interactions between two sphere-shaped bodies, or between one sphere-shaped and one box-shaped. See:
 [Ig2_Sphere_Sphere_ScGeom(interactionDetectionFactor=intR,label='SSgeom'),Ig2_Box_Sphere_ScGeom()]

Then, there is no interaction between the piston and your beam: the piston can cross the beam without seeing it. If necessary, I advice you to browse the examples using facet-shaped bodies to know how to define InteractionLoop in your case

Revision history for this message
Yor1 (jabrane-hamdi) said :
#3

Ok now i understand how to resolve the problem
Thanks Jérôme

Revision history for this message
Yor1 (jabrane-hamdi) said :
#4

Hello,
I integrate in the interaction loop the interaction between the facet (the piston) and the sphere ( the beam).
But i obtain an error message:"Undefined or ambiguous IPhys dispatch for types FrictMat and JCFpmMat".
I define all my objects with JCFpmMat and i don't find the mistake.

PACKING='poutre400_notch'
OUT=PACKING+'_flexion_3_points'

#### Simulation Control
DAMP=0.4 # numerical damping
saveData=100 # data record interval
iterMax=200000 # maximum number of iteration (to be adjusted)
saveVTK=10000 # Vtk files record interval

### Creation de modele ###
X=15
Y=3
Z=2
r=1
xinf=0
yinf=0
zinf=0

xsup=15
ysup=3
zsup=2

#### Material microproperties -> Lac du Bonnet granite (cf. A DEM model for soft and hard rock, Scholtes & Donze, JMPS 2013)
intR=1.5
DENS=4000
YOUNG=65e9
FRICT=10
ALPHA=0.4
TENS=8e6
COH=160e6
#### material definition
def sphereMat(): return JCFpmMat(type=1,density=DENS,young=YOUNG,poisson = ALPHA,frictionAngle=radians(FRICT),tensileStrength=TENS,cohesion=COH)
def wallMat(): return JCFpmMat(type=0,density=DENS,young=YOUNG,frictionAngle=radians(0))
O.bodies.append(ymport.text(PACKING+'.spheres',scale=1.,shift=Vector3(0,0,0)))

O.reset()

O.bodies.append(geom.facetCylinder(center=(xinf+X/5.,yinf-0.9*r,Z/2.),radius=r,height=Z,orientation=Quaternion((1, 0, 0), 0),segmentsNumber=20,wire=False)) # bas gauche
O.bodies.append(geom.facetCylinder(center=(0.8*X,yinf-0.9*r,Z/2.),radius=r,height=Z,orientation=Quaternion((1, 0, 0), 0),segmentsNumber=20,wire=False)) # bas droite
piston=O.bodies.append(geom.facetCylinder(center=(0.5*X,Y+r,Z/2.),radius=r,height=Z,dynamic=False,orientation=Quaternion((1, 0, 0), 0),segmentsNumber=20,wire=False)) # haut

#### now we construct the surrounding walls with right dimensions
### walls
#mn,mx=Vector3(xinf,yinf,zinf),Vector3(xsup,ysup,zsup)
#walls=utils.aabbWalls(oversizeFactor=1.5,extrema=(mn,mx),thickness=min(X,Y,Z)/100.,material=wallMat)
#wallIds=O.bodies.append(walls)
### packing
O.bodies.append(ymport.text(PACKING+'.spheres',scale=1.,shift=Vector3(0,0,0),material=sphereMat))

### set a color to the spheres
for o in O.bodies:
 if isinstance(o.shape,Sphere):
   o.shape.color=(0.7,0.5,0.3)

#---------------- ENGINES DEFINED HERE

##### simulation piston's movement

for i in range(0,len(piston)):
 O.bodies[piston[i]].state.vel[1]=-1

##### simulation of movement of beam's grains
O.engines=[
        ForceResetter(),
        InsertionSortCollider([Bo1_Box_Aabb(),Bo1_Sphere_Aabb(aabbEnlargeFactor=intR,label='Saabb'),Bo1_Facet_Aabb()]),
 InteractionLoop(
  [Ig2_Sphere_Sphere_ScGeom(interactionDetectionFactor=intR,label='SSgeom'),Ig2_Facet_Sphere_ScGeom()],
  [Ip2_JCFpmMat_JCFpmMat_JCFpmPhys(cohesiveTresholdIteration=1,label='interactionPhys')],
  [Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM(recordCracks=True,Key=OUT,label='interactionLaw')]
 ),

 #ForceEngine(ids=wallIds, force=Vector3(0,-100,0)),
        GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=10,timestepSafetyCoefficient=0.4, defaultDt=0.1*utils.PWaveTimeStep()),
        NewtonIntegrator(damping=DAMP,label="newton"),
        PyRunner(iterPeriod=int(saveData),initRun=True,command='recorder()',label='data'),
        VTKRecorder(iterPeriod=int(saveVTK),initRun=True,fileName=OUT+'-',recorders=['spheres','jcfpm','cracks'],Key=OUT,label='vtk')
]

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

Hello,

I define all my objects with JCFpmMat and i don't find the mistake.

This is not true :-) The reasons are:
- you did not put any material to O.materials
- you did not specify material for facetCylinder

if you do not specify material to particles, lastly appended material to
O.materials is used. As there is none in your simulation, default material
(of FrictMat type) is created and used.

a note to the script:

def sphereMat(): return JCFpmMat(type=1,density=DENS,young=YOUNG,poisson =
> ALPHA,frictionAngle=radians(FRICT),tensileStrength=TENS,cohesion=COH)
> def wallMat(): return JCFpmMat(type=0,density=DENS,
> young=YOUNG,frictionAngle=radians(0))
>

this is very bad practise in my opinion, your function returns always new
material instance. Use

sphereMat = JCFpmMat(...)
wallMat = JCFpmMat(...)
for mat in (sphereMat,wallMat):
   O.materials.append(mat) # then wallMat will be used if material is not
specified

> O.bodies.append(ymport.text(PACKING+'.spheres',scale=1.,
> shift=Vector3(0,0,0)))
> O.reset()
> O.bodies.append(geom.facetCylinder(center=(xinf+X/
> 5.,yinf-0.9*r,Z/2.),radius=r,height=Z,orientation=Quaternion((1, 0, 0),
> 0),segmentsNumber=20,wire=False)) # bas gauche
> O.bodies.append(geom.facetCylinder(center=(0.8*X,
> yinf-0.9*r,Z/2.),radius=r,height=Z,orientation=Quaternion((1, 0, 0),
> 0),segmentsNumber=20,wire=False)) # bas droite
> piston=O.bodies.append(geom.facetCylinder(center=(0.5*X,Y+
> r,Z/2.),radius=r,height=Z,dynamic=False,orientation=Quaternion((1, 0, 0),
> 0),segmentsNumber=20,wire=False)) # haut

For the sake of clarity, if you use more materials, I would specify what
material you are using (but it's up to you :-)

O.bodies.append(geom.facetCylinder(...,material=wallMat)) # or any other
JCFpmMat instance

cheers
Jan

2015-07-24 11:41 GMT+02:00 Yor1 <email address hidden>:

> Question #269576 on Yade changed:
> https://answers.launchpad.net/yade/+question/269576
>
> Yor1 posted a new comment:
> Hello,
> I integrate in the interaction loop the interaction between the facet (the
> piston) and the sphere ( the beam).
> But i obtain an error message:"Undefined or ambiguous IPhys dispatch for
> types FrictMat and JCFpmMat".
> I define all my objects with JCFpmMat and i don't find the mistake.
>
> PACKING='poutre400_notch'
> OUT=PACKING+'_flexion_3_points'
>
> #### Simulation Control
> DAMP=0.4 # numerical damping
> saveData=100 # data record interval
> iterMax=200000 # maximum number of iteration (to be adjusted)
> saveVTK=10000 # Vtk files record interval
>
>
> ### Creation de modele ###
> X=15
> Y=3
> Z=2
> r=1
> xinf=0
> yinf=0
> zinf=0
>
> xsup=15
> ysup=3
> zsup=2
>
> #### Material microproperties -> Lac du Bonnet granite (cf. A DEM model
> for soft and hard rock, Scholtes & Donze, JMPS 2013)
> intR=1.5
> DENS=4000
> YOUNG=65e9
> FRICT=10
> ALPHA=0.4
> TENS=8e6
> COH=160e6
> #### material definition
> def sphereMat(): return JCFpmMat(type=1,density=DENS,young=YOUNG,poisson =
> ALPHA,frictionAngle=radians(FRICT),tensileStrength=TENS,cohesion=COH)
> def wallMat(): return
> JCFpmMat(type=0,density=DENS,young=YOUNG,frictionAngle=radians(0))
>
> O.bodies.append(ymport.text(PACKING+'.spheres',scale=1.,shift=Vector3(0,0,0)))
>
> O.reset()
>
> O.bodies.append(geom.facetCylinder(center=(xinf+X/5.,yinf-0.9*r,Z/2.),radius=r,height=Z,orientation=Quaternion((1,
> 0, 0), 0),segmentsNumber=20,wire=False)) # bas gauche
> O.bodies.append(geom.facetCylinder(center=(0.8*X,yinf-0.9*r,Z/2.),radius=r,height=Z,orientation=Quaternion((1,
> 0, 0), 0),segmentsNumber=20,wire=False)) # bas droite
> piston=O.bodies.append(geom.facetCylinder(center=(0.5*X,Y+r,Z/2.),radius=r,height=Z,dynamic=False,orientation=Quaternion((1,
> 0, 0), 0),segmentsNumber=20,wire=False)) # haut
>
> #### now we construct the surrounding walls with right dimensions
> ### walls
> #mn,mx=Vector3(xinf,yinf,zinf),Vector3(xsup,ysup,zsup)
>
> #walls=utils.aabbWalls(oversizeFactor=1.5,extrema=(mn,mx),thickness=min(X,Y,Z)/100.,material=wallMat)
> #wallIds=O.bodies.append(walls)
> ### packing
>
> O.bodies.append(ymport.text(PACKING+'.spheres',scale=1.,shift=Vector3(0,0,0),material=sphereMat))
>
>
> ### set a color to the spheres
> for o in O.bodies:
> if isinstance(o.shape,Sphere):
> o.shape.color=(0.7,0.5,0.3)
>
>
> #---------------- ENGINES DEFINED HERE
>
> ##### simulation piston's movement
>
> for i in range(0,len(piston)):
> O.bodies[piston[i]].state.vel[1]=-1
>
> ##### simulation of movement of beam's grains
> O.engines=[
> ForceResetter(),
>
> InsertionSortCollider([Bo1_Box_Aabb(),Bo1_Sphere_Aabb(aabbEnlargeFactor=intR,label='Saabb'),Bo1_Facet_Aabb()]),
> InteractionLoop(
>
> [Ig2_Sphere_Sphere_ScGeom(interactionDetectionFactor=intR,label='SSgeom'),Ig2_Facet_Sphere_ScGeom()],
>
> [Ip2_JCFpmMat_JCFpmMat_JCFpmPhys(cohesiveTresholdIteration=1,label='interactionPhys')],
>
> [Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM(recordCracks=True,Key=OUT,label='interactionLaw')]
> ),
>
> #ForceEngine(ids=wallIds, force=Vector3(0,-100,0)),
>
> GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=10,timestepSafetyCoefficient=0.4,
> defaultDt=0.1*utils.PWaveTimeStep()),
> NewtonIntegrator(damping=DAMP,label="newton"),
>
> PyRunner(iterPeriod=int(saveData),initRun=True,command='recorder()',label='data'),
>
> VTKRecorder(iterPeriod=int(saveVTK),initRun=True,fileName=OUT+'-',recorders=['spheres','jcfpm','cracks'],Key=OUT,label='vtk')
> ]
>
> --
> You received this question notification because you are a member of
> yade-users, which is an answer contact for Yade.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-users
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~yade-users
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
Yor1 (jabrane-hamdi) said :
#6

Thanks Jan for your answer that resolve my problem.
Cheers :D
Jabrane

Revision history for this message
Yor1 (jabrane-hamdi) said :
#7

Hi,
How can we determine the strain of the beam induced from applying the force?

Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#8

Is your question closed Jabrane?
https://yade-dem.org/wiki/Howtoask

Revision history for this message
Yor1 (jabrane-hamdi) said :
#9

Yes it is closed about the detection of force applied on the beam.
My question about strain is in the same test.
I will ask about how i can determine the strain of the beam in another question like showed in "how to ask"

Thanks Bruno.