determine the force applied on the particle

Asked by Yor1

Hello everyone,

I want to calculate the potential energy of the beam and the work performed on the beam in 3-points bending test.
To calculate the energy potential in each particle i use this formula:
'Ub(particle) = m(mass of particle)*g*d(displacement of particle)
and the work performed in each particle on the boundary of the model, i use this formula:
'W(particle)=F(force exerced on the particle)*d(displacement of particle)

My question is how can i determine the force exerced on each particle and the displacement of each particle?

Thanks so much
Jabrane

from yade import ymport, utils, pack, export
from yade import plot
from pylab import *
import math

#---------------- SIMULATIONS DEFINED HERE (assembly, material, boundary conditions)

#### packing (previously constructed)
PACKING='X240Y80Z30_400'
OUT=PACKING+'_flexion_3_points'

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

#### Material microproperties -> Lac du Bonnet granite (cf. A DEM model for soft and hard rock, Scholtes & Donze, JMPS 2013)
intR=1.6684# allows near neighbour interaction and coordination number K=13 (determined with coordinationNumber.py -> to be adjusted for every packing)
DENS=4000 # could be adapted to match material density: dens_DEM=dens_rock*(V_rock/V_particles)=dens_rock*1/(1-poro_DEM) -> poro?
YOUNG=65e9
FRICT=10
ALPHA=0.4
TENS=8e6
COH=160e6
#### material definition
sphereMat = JCFpmMat(type=1,density=DENS,young=YOUNG,poisson = ALPHA,frictionAngle=radians(FRICT),tensileStrength=TENS,cohesion=COH)
wallMat = JCFpmMat(type=0,density=DENS,young=YOUNG,frictionAngle=radians(0))

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

#### preprocessing to get dimensions
O.bodies.append(ymport.text(PACKING+'.spheres',scale=1.,shift=Vector3(0,0,0)))

dim=utils.aabbExtrema()
xinf=dim[0][0]
xsup=dim[1][0]
X=xsup-xinf
yinf=dim[0][1]
ysup=dim[1][1]
Y=ysup-yinf
zinf=dim[0][2]
zsup=dim[1][2]
Z=zsup-zinf

r=X/15.
#### preprocessing to get dimensions
R=0
Rmax=0
numSpheres=0.
for o in O.bodies:
 if isinstance(o.shape,Sphere):
   numSpheres+=1
   R+=o.shape.radius
   if o.shape.radius>Rmax:
     Rmax=o.shape.radius
Rmean=R/numSpheres

O.reset() # all previous lines were for getting dimensions of the packing to create walls at the right positions (below) because walls have to be genrated after spheres for FlowEngine

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

p0=O.bodies[piston[0]].state.pos[1]

### packing
beam=O.bodies.append(ymport.text(PACKING+'.spheres',scale=1.,shift=Vector3(0,0,0),material=sphereMat))

# Definition of the facets for joint's geometry
alpha = 90 #angle of the crack with horizontal (pi/4.)
c = 0.375*Y # length of the crack

# 4 points pour l'entaille
ptA = gts.Vertex( X/2., c, 8./7.*Z)
ptB = gts.Vertex( X/2., 0, 8./7.*Z)
ptApr = gts.Vertex(X/2., c, -1./7.*Z)
ptBpr = gts.Vertex(X/2., 0, -1./7.*Z)

e1 = gts.Edge(ptA,ptB)
e2 = gts.Edge(ptA,ptApr)
e3 = gts.Edge(ptApr,ptB)
f1 = gts.Face(e1,e2,e3)

e4 = gts.Edge(ptB,ptBpr)
e5 = gts.Edge(ptBpr,ptApr)
f2 = gts.Face(e4,e5,e3)

s1 = gts.Surface()
s1.add(f1)
s1.add(f2)
facet = gtsSurface2Facets(s1,wire = False,material=wallMat)
O.bodies.append(facet)

## Determinate the particle in the boundary
limite=[]
limite=range(0, len(beam))

for i in range(0, len(beam)):
 if X/3. <= O.bodies[beam[i]].state.pos[0] <= 2*X/3. or Y/3. <= O.bodies[beam[i]].state.pos[1] <= 2*Y/3. or Z/3. <= O.bodies[beam[i]].state.pos[2] <= 2*Z/3. :
   limite[i] = 0
 else:
   limite[i] = beam[i]

for i in range(0, len(limite)):
 try:
      limite.remove(0)
 except ValueError:
      pass

## Determinate the initial position of the particle on the boundary

poslimx=[]
poslimy=[]
poslimz=[]
poslimx=range(0,len(limite))
poslimy=range(0,len(limite))
poslimz=range(0,len(limite))

for i in range(0,len(limite)):
 poslimx[i]=O.bodies[limite[i]].state.pos[0]

for i in range(0,len(limite)):
 poslimy[i]=O.bodies[limite[i]].state.pos[1]

for i in range(0,len(limite)):
 poslimz[i]=O.bodies[limite[i]].state.pos[2]

### 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 is defined here (DEM loop, interaction law, servo control, recording, etc...)
##### simulation piston's motion

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

##### simulation beam's grains motion
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')]
 ),

        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','bstresses','jcfpm','cracks'],Key=OUT,label='vtk')
]

## Determinate the initial position of all particles of the model
posx=[]
posy=[]
posz=[]
posx=range(0,len(beam))
posy=range(0,len(beam))
posz=range(0,len(beam))

for i in range(0,len(beam)):
 posx[i]=O.bodies[beam[i]].state.pos[0]

for i in range(0,len(beam)):
 posy[i]=O.bodies[beam[i]].state.pos[1]

for i in range(0,len(beam)):
 posz[i]=O.bodies[beam[i]].state.pos[2]

## Calculate the work on the boundary of model
W=[]
W=range(0,len(limite))
## W est le travail effectue sur les billes du limite de modele
#for i in range(0, len(W)):
# W[i]=utils.sumFacetNormalForces(ids=limite[i],axis=0)*abs(O.bodies[limite[i]].state.pos[0]-poslimx[i])+utils.sumFacetNormalForces(ids=limite[i],axis=1)*abs(O.bodies[limite[i]].state.pos[1]-poslimy[i])+utils.sumFacetNormalForces(ids=limite[i],axis=2)*abs(O.bodies[limite[i]].state.pos[2]-poslimz[i])

## gravitational acceleration
g=[0,0,-9.8]

## calculate the potential energy of model
Ub=[]
Ub=range(0,len(beam))
## Ub is the potential energy of the model

for i in range(0, len(Ub)):
 Ub[i]=O.bodies[beam[i]].state.mass*abs(g[2])*abs(O.bodies[beam[i]].state.pos[2]-posz[i])

# if you want to plot during simulation
plot.plots={'i':('f')}
#plot.plot()

#---------------- SIMULATION STARTS HERE

#### manage interaction detection factor during the first timestep and then set default interaction range ((cf. A DEM model for soft and hard rock, Scholtes & Donze, JMPS 2013))
O.step();
### initializes the interaction detection factor
SSgeom.interactionDetectionFactor=-1.
Saabb.aabbEnlargeFactor=-1.

O.run(iterMax)

Question information

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

Hi Jabrane,

> To calculate the energy potential in each particle i use this formula:
> 'Ub(particle) = m(mass of particle)*g*d(displacement of particle)
>

I am not sure about the meaning of this equation, do you have any
reference? It is similar to (but it is not) potential energy in gravity
field.. would you really need it in three point bending? Don't you want
potential energy of elastic deformation instead?

>
> My question is how can i determine the force exerced on each particle

O.forces.f(bodyID) # [1]

> and the displacement of each particle?

b = O.bodies[bodyID]
b.state.displ() # [2]

cheers
Jan

PS: please consider once more the change of your attitude to scripts
attached to your questions (deleting totally unrelated parts of code, do
not mix English and French comments, do not mention FlowEngine in comments
if it is not used at all etc. etc. etc.). [3], point 3

[1] https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.ForceContainer.f
[2] https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.State.displ
[3] https://yade-dem.org/wiki/Howtoask

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

Hello Jan,

Thank you for your response.
In fact i try to calculate the energy balance based on energy calculation in UDEC.
The formulas used were taken from Energy Calculation in UDEC 5 for each gridpoint.

"Don't you want potential energy of elastic deformation instead?"
I think you are right but the question is how can i calculate the potential energy of elastic deformation without the formula of UDEC5's manual ?
There is a tool in Yade with which we can calculate it ?

Jabrane

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

Hi Jabrane,

> In fact i try to calculate the energy balance based on energy calculation
> in UDEC.
> The formulas used were taken from Energy Calculation in UDEC 5 for each
> gridpoint.
>

I don't work with UDEC, but in general you have:
- kinetic energy (easy to compute)
- potential energy (of various forms, e.g. elastic). In your case
NewtonIntegrator has zero gravity and also from physical point of view
gravity potential energy makes no sense
- dissipation, a tricky part - dissipation by friction, by contact law
damping, by NewtonIntegrator damping, by contact law dissipation (e.g.
contact breakage)...........
- adding new energy to the system if you have interacting body with
prescribed velocity (the piston in your case)

some of the energies might be negligible (like kinetic energy in
quasi-static simulation), you can try purely elastic simulation comparing
added energy by piston and elastic energy. If they equal in elastic case,
then probably you could compute dissipation as the difference between added
and elastic energy.

>
> "Don't you want potential energy of elastic deformation instead?"
> I think you are right but the question is how can i calculate the
> potential energy of elastic deformation without the formula of UDEC5's
> manual ?
> There is a tool in Yade with which we can calculate it ?
>

there are more options:
1) calculate it manually:
   E_interaction = 0.5*stiffness*displacement^2 = 0.5*force^2/stiffness #
force = stiffness*displacement
   E_total = sum(E_interaction for all interactions)
2) some laws implements elasticEnergy() function, e.g. [1]

cheers
Jan

[1]
https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.Law2_ScGeom_FrictPhys_CundallStrack.elasticEnergy

Can you help with this problem?

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

To post a message you must log in.