← Back to team overview

yade-users team mailing list archive

Re: [Question #695558]: Dynamics of pfacet object does not appear to be correct

 

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

    Status: Answered => Open

Rohit John is still having a problem:
Dear Bruno,

Thanks for you swift reply.
> Best method is to download the sources with git [1], then you update with "cd trunk; git pull".
- I shall try this and get back to you. In [2] it is mentioned that Ubuntu18.04 has YADE 2018. Will there be any errors when I use the latest version compiled in my computer?

> It looks a bit like a ball-on-a-tip problem. This triangular object has to fall one way or the other since it is in very unstable equilibrium, so I'm not surprised that it rotates (which doesn't mean there is no problem, maybe you have more insight?).
- If you do not clump the pfacets, triangular object remains on the bristles. I expected the simulation with the clump and one without the clump to have similar dynamics. 

> Note: there is a display problem which makes it look as if the clumped objects were splitting appart. 
- Thanks for your advice. It is not just this. 

In the following I have put a code simulating two collisions (sphere-
sphere and sphere-pfacet). I have made it so that the sphere contacts
the pfacet at its centroid (centre of mass) and the pfacet body and
spheres have the same mass. I expect the pfacet to move without any
rotation, but it does. I have two observations.

1) The mass of the pfacet is not equally distributed to the node - this
is causing an unexpected rotation. This can be solved if the pfacet is
an equilateral triangle (remove the '2*' in the line
Vector3([2*pfacet_circum_rad * cos(node_angle[0]),   pfacet_circum_rad *
sin(node_angle[0]),   0]),).

2) If you clump the pfacet together, then the collision dynamics appears
to be different. But if they are not clumped together, the motion of the
pfacet and sphere after collision are the same (as expected)

Kind regards,
Rohit K. John

[2] https://yade-dem.org/doc/installation.html

from yade import utils
from yade.gridpfacet import *

# ------------------------------------------------------------------- Data
sphere_young    = 1e9
sphere_poisson  = 0.3
sphere_friction = 30

sphere_radius   = 0.1
sphere_1_position = [0, 0,                 3 * sphere_radius]
sphere_2_position = [0, 5 * sphere_radius, 0]
sphere_3_position = [0, 5 * sphere_radius, 3 * sphere_radius]


pfacet_side       = 0.5
pfacet_circum_rad = pfacet_side/sqrt(3) 
pfacet_grid_rad   = sphere_radius
node_angle        = [radians(0), radians(120), radians(240)]
pfacet_nodes      = [
    Vector3([2*pfacet_circum_rad * cos(node_angle[0]),   pfacet_circum_rad * sin(node_angle[0]),   0]),
    Vector3([pfacet_circum_rad * cos(node_angle[1]),   pfacet_circum_rad * sin(node_angle[1]),   0]),
    Vector3([pfacet_circum_rad * cos(node_angle[2]),   pfacet_circum_rad * sin(node_angle[2]),   0]),
]

pfacet_centroid = (pfacet_nodes[0] + pfacet_nodes[1] + pfacet_nodes[2])/3
pfacet_nodes    = [
    pfacet_nodes[0] - pfacet_centroid,
    pfacet_nodes[1] - pfacet_centroid, 
    pfacet_nodes[2] - pfacet_centroid
    ]


pfacet_young    = sphere_young
pfacet_poisson  = sphere_poisson
pfacet_density  = 1000
pfacet_friction = sphere_friction
# ------------------------------------------------------------------- Material
pfacet_int_mat  = "pfacet_int_mat"
pfacet_ext_mat  = "pfacet_ext_mat"

O.materials.append(
    FrictMat(
        young = pfacet_young,
        poisson = pfacet_poisson,
        density = pfacet_density,
        label = 'pfacet_ext_mat',
        frictionAngle = radians(pfacet_friction),
    )
)

O.materials.append(
    CohFrictMat(
        young = pfacet_young,
        poisson = pfacet_poisson,
        density = pfacet_density,
        label = 'pfacet_int_mat',

        frictionAngle = radians(pfacet_friction),
        momentRotationLaw = True,
        normalCohesion = 1e40,
        shearCohesion = 1e40,
    )
)
# ------------------------------------------------------------------- Engines
O.engines = [
	ForceResetter(),
	InsertionSortCollider([
        Bo1_Sphere_Aabb(),
		Bo1_GridConnection_Aabb(),
		Bo1_PFacet_Aabb(), 
	]),
	InteractionLoop([
		Ig2_GridNode_GridNode_GridNodeGeom6D(),
		Ig2_GridConnection_GridConnection_GridCoGridCoGeom(),	# cylinder-cylinder interaction
		Ig2_Sphere_PFacet_ScGridCoGeom(),	# needed for GridNode-pFacet interaction (why is this not included in Ig2_GridConnection_PFacet_ScGeom???)
		Ig2_GridConnection_PFacet_ScGeom(),	# Cylinder-pFcet interaction
        Ig2_Sphere_Sphere_ScGeom(),
	],
	[
		Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=True,setCohesionOnNewContacts=False),
		Ip2_FrictMat_FrictMat_FrictPhys()
	],
	[
		Law2_ScGeom6D_CohFrictPhys_CohesionMoment(),	# contact law for "internal" cylider forces
		Law2_ScGridCoGeom_FrictPhys_CundallStrack(),	# contact law for Cylinder-pFacet interaction
		Law2_GridCoGridCoGeom_FrictPhys_CundallStrack(),	# contact law for cylinder-cylinder interaction
		Law2_ScGeom_FrictPhys_CundallStrack(),
	]
	),
	NewtonIntegrator(gravity=(0.,0,-0),damping=0.0,label='newton'),
    PyRunner(command = 'graph()', iterPeriod = 100)
]

# ------------------------------------------------------------------- Body
# ------------------ pfacet
pnode  = []
pcyl   = []
pfacet = []
pfacetCreator1(
    pfacet_nodes,
    pfacet_grid_rad,
    nodesIds = pnode,
    cylIds   = pcyl,
    pfIds    = pfacet,
    wire     = False,
    fixed = False,
    color = [0.5,0.5,0.5],
    materialNodes = pfacet_int_mat,
    material      = pfacet_ext_mat,
    )

target_ids  = pnode + pcyl + pfacet
mass_node   = O.bodies[pnode[0]].state.mass
volume_node = 4.0/3.0 * pi * pfacet_grid_rad**3
print('mass of node 0', O.bodies[pnode[0]].state.mass)
print('mass of node 1', O.bodies[pnode[1]].state.mass)
print('mass of node 2', O.bodies[pnode[2]].state.mass)
# target_clump_id = O.bodies.clump(target_ids)

# ------------------ sphere
sphere_density  = 3.0 * mass_node / volume_node
sphere_mat      = "sph_mat"

O.materials.append(
    FrictMat(
        young   = sphere_young,
        poisson = sphere_poisson,
        density = sphere_density,
        label   = sphere_mat,
        frictionAngle = radians(sphere_friction),
    )
)

sph_1 = sphere(sphere_1_position, sphere_radius, material = sphere_mat)
sph_2 = sphere(sphere_2_position, sphere_radius, material = sphere_mat)
sph_3 = sphere(sphere_3_position, sphere_radius, material = sphere_mat)

sph_1_ID = O.bodies.append(sph_1)
sph_2_ID = O.bodies.append(sph_2)
sph_3_ID = O.bodies.append(sph_3)
O.bodies[sph_1_ID].state.vel = [0,0,-15]
O.bodies[sph_3_ID].state.vel = [0,0,-15]
# ------------------------------------------------------------------- Other stuff
print('pfacet mass: ', O.bodies[pnode[0]].state.mass)
print('sphere mass: ', O.bodies[sph_1_ID].state.mass)
# ---------------------------------------------- plotting
from yade import plot
plot.plots = {
    't':('fz_sph', 'fz_pfacet')
}

def graph():
    t         = O.time
    fz_pfacet = Vector3([0,0,0])
    for id in pnode: 
        fz_pfacet = fz_pfacet + O.forces.f(id)

    fz_sph = O.forces.f(sph_2_ID)
    plot.addData(
        t = t,
        fz_sph = fz_sph[2], fz_pfacet = fz_pfacet[2]
    )

plot.plot()

# ---------------------------------------------- simulations
O.dt = 2.5e-08 # utils.PWaveTimeStep()
O.saveTmp()

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