← Back to team overview

yade-users team mailing list archive

Re: [Question #665379]: penetrationDepth calculation

 

Question #665379 on Yade changed:
https://answers.launchpad.net/yade/+question/665379

    Status: Answered => Open

Andrea Puglisi is still having a problem:
Thanks Jan and Bruno. From Jan'answer I understand that the variable
shift2 should not be a problem in my example (I have no periodicity, it
is just a collision between two spheres). From Bruno's answer I learn
that there is something wrong in my script where I measure both the
quantity overlap=2*r-(x2-x1)  (I have x2>x1) and the quantity
interaction.geom.penetrationDepth and they do not coincide.

My script is the following. The graph of the two quantity  penetrationDepth vs. overlap can be found at this shared link
https://drive.google.com/file/d/1r6YWwbg56jIN3EGB4RzoBRGHgHyHAhir/view?usp=sharing

#!/usr/bin/python
# -*- coding: utf-8 -*-

from yade import pack,ymport,export,geom,bodiesHandling,qt,plot
import math

rad = 0.00774

f=open("forces.dat" , "w")
def forces():
	x1 = O.bodies[0].state.pos[0]
	v1 = O.bodies[0].state.vel[0]
	v2 = O.bodies[1].state.vel[0]
	x2 = O.bodies[1].state.pos[0]
        ov = 2*rad-(x2-x1)
        intrs = O.bodies[0].intrs()
        if (len(intrs)):
	        nfx = intrs[0].phys.normalForce[0]
	        nfy = intrs[0].phys.normalForce[1]
		nfz = intrs[0].phys.normalForce[2]
		sfx = intrs[0].phys.shearForce[0]
                sfy = intrs[0].phys.shearForce[1]
		sfz = intrs[0].phys.normalForce[2]
                dep = intrs[0].geom.penetrationDepth

        else:
                nfx = nfy = nfz = sfx = sfy = sfz = dep = 0
	f.write ("%6d %12.8f %12.8f %12.8f %12.8f %9.6f %9.6f %9.6f %9.6f %9.6f %9.6f %12.8f\n" %   (O.iter,O.time,ov,v1,v2,nfx,nfy,nfz,sfx,sfy,sfz,dep))
        f.flush()

O.materials.append(FrictMat(young=0.1e9,poisson=.22,frictionAngle=0,density=2300,label='glass'))
Sph_1 = O.bodies.append([sphere([0,0,0], radius=rad, material = "glass")])
Sph_2 = O.bodies.append([sphere([0.1,0,0], radius=rad, material = "glass")])
O.bodies[1].state.vel = Vector3(-0.3,0,0)
O.bodies[0].state.vel = Vector3(0.3,0,0)

O.engines=[
	ForceResetter(),
	InsertionSortCollider([Bo1_Sphere_Aabb(),  
        ],label='collider'),
	InteractionLoop(
		[Ig2_Sphere_Sphere_ScGeom()],
		[Ip2_FrictMat_FrictMat_MindlinPhys()],  
		[Law2_ScGeom_MindlinPhys_Mindlin()],
	),
	NewtonIntegrator(damping=0.0,exactAsphericalRot=True,gravity=(0,0,0)),
	PyRunner(command='forces()', iterPeriod=1),
]


O.dt=PWaveTimeStep()  
try:
	from yade import qt
	qt.Controller()
	qt.View()
except ImportError: pass
O.saveTmp()
O.timingEnabled=True

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.