Spheres interactions in a clump

Asked by Clémence

I want to study cohesive interactions between clumps during a cone penetration test. I have a code creating clumps from several spheres. At the creation of clumps (initial state), there is no interaction between the spheres for a given clump. But as soon as the simulation is running, interactions between spheres of a same clump are created. Therefore my simulations are taking longer time than it should.

I have tried 2 technics for the clump creation but it does not change the behaviour:
1- yade.O.bodies.appendClumped([list of sphere([x,y,z],radius,material)])
2- yade.O.bodies.append(sphere((x,y,z),radius,material))
     yade.O.bodies.clump([list of sphere])

My material is defined as following:
    material = yade.CohFrictMat(young=1e8,
                                poisson=0.3,
                                density=917,
                                frictionAngle=0.2,
                                normalCohesion=1e6,
                                shearCohesion=1e6,
                                momentRotationLaw=True,
                                etaRoll=-1,
                                alphaKr=2,
                                alphaKtw=2,
                                label='cohesive')

    yade.O.materials.append(material)

My engines are defined as following:
    Igeom_s = [yade.Ig2_Sphere_Sphere_ScGeom6D(), yade.Ig2_Facet_Sphere_ScGeom6D()]
    Iphys_s = [yade.Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=False)]
    Law2_s = [yade.Law2_ScGeom6D_CohFrictPhys_CohesionMoment(useIncrementalForm=True, always_use_moment_law=False)]

    yade.O.engines = [yade.ForceResetter(),
                      yade.InsertionSortCollider([yade.Bo1_Sphere_Aabb(), yade.Bo1_Facet_Aabb()]),
                      yade.InteractionLoop(Igeom_s, Iphys_s, Law2_s),
                      yade.NewtonIntegrator(damping=damping, gravity=yade.Vector3(0, 0, -9.81 / mass_factor), label='Newton')
                      ]

I first define my material, then engines and then I create clumps.

I am very confused with this issue as from what I have read/been told, yade is not computing sphere-sphere interactions within clump. Do you have any idea of what is causing this? I don't know if it matters but I am using yade 2018.02b.

Thanks for your help
Clémence

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Clémence
Solved:
Last query:
Last reply:
Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#1

Hi, please post the script, not parts of it.
https://yade-dem.org/wiki/Howtoask

Bruno

Revision history for this message
Clémence (hernyc) said :
#2

Hi Bruno, thanks for your fast reply. You can find below a version of the code in which I have created a single clump of 3 spheres. As the simulation start running, interactions (not cohesives) are created between spheres.

###
import sys
import os
sys.path.append(os.getcwd())
import yade
import numpy as np

#create material
material = yade.CohFrictMat(young=1.e8,
                            poisson=0.3,
                            density=917,
                            frictionAngle=0.2,
                            normalCohesion=1.0e6,
                            shearCohesion=1.0e6,
                            momentRotationLaw=True,
                            etaRoll=-1,
                            alphaKr=2,
                            alphaKtw=2,
                            label='cohesive')

yade.O.materials.append(material)

#define engines
Igeom_s = [yade.Ig2_Sphere_Sphere_ScGeom6D(), yade.Ig2_Facet_Sphere_ScGeom6D()]
Iphys_s = [yade.Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=False)]
Law2_s = [yade.Law2_ScGeom6D_CohFrictPhys_CohesionMoment(useIncrementalForm=True, always_use_moment_law=False)]

yade.O.engines = [yade.ForceResetter(),
                  yade.InsertionSortCollider([yade.Bo1_Sphere_Aabb(), yade.Bo1_Facet_Aabb()]),
                  yade.InteractionLoop(Igeom_s, Iphys_s, Law2_s),
                  yade.NewtonIntegrator(damping=0.1, gravity=yade.Vector3(0, 0, -9.81), label='Newton') # always last
                  ]

#create spheres and clump
mass_tot = 0

clump_id,sphere_ids=yade.O.bodies.appendClumped([\
sphere([2.5e-3,2.5e-3,2.5e-3],material=material, radius=5e-4),\
sphere([2.0e-3,2.0e-3,2.0e-3],material=material, radius=5e-4),\
sphere([3.0e-3,3.0e-3,3.0e-3],material=material, radius=5e-4)
])

clump=yade.O.bodies[clump_id]
for i in clump.shape.members:
    yade.O.bodies[i].shape.color=(255,0,0)
    radii = yade.O.bodies[i].shape.radius
    mass = yade.O.bodies[i].state.mass
    mass_tot += mass

nb_clump = len(np.unique(clump_id))
nb_sphere = len(np.unique(sphere_ids))
print('Number of clump: ', nb_clump, 'Number of spheres: ', nb_sphere)
print('Total of initial sphere-sphere interaction: ',len(yade.O.interactions))
print('')

#print data
clump_export = yade.PyRunner(command='clump_data(clump_id)', iterPeriod=1)

def clump_data(clump_id):

    couple_sphere = 0
    n_sphere_sphere_total = []
    n_sphere_sphere_cohesive = []

    clump=yade.O.bodies[clump_id]
    for i in clump.shape.members:
        for inter in yade.O.interactions:
                if inter.isReal and inter.isActive:
                    couple_sphere = min(inter.id1, inter.id2) * (len(clump.shape.members) + 1) + max(inter.id1, inter.id2)
                    if couple_sphere not in n_sphere_sphere_total:
                        n_sphere_sphere_total.append(couple_sphere)
                        if inter.phys.cohesionBroken == False:
                            n_sphere_sphere_cohesive.append(couple_sphere)

    print('iteration: ', yade.O.iter, 'sphere-sphere interaction: ', len(n_sphere_sphere_total),'sphere-sphere cohesive interaction: ', len(n_sphere_sphere_cohesive))

#run simulation
yade.O.dt=1.0e-5
yade.O.engines = [clump_export] + yade.O.engines
yade.O.run(10)
###

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

What version of Yade do you use?

> I don't know if it matters but I am using yade 2018.02b.

yes, it does :-)

I got non-zero output for 2018.02b, but zero (ezpected) output for newer from-source version (2020-06-23.git-f03a37c) as well as yadedaily (20210401-5232~58c0c6e~bionic1)

Cheers
Jan

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

Note that, generally speaking (not the case here, I think), O.interactions.countReal() might be better than len(O.interactions) (if one wants to disregard non-real interactions)

Revision history for this message
Clémence (hernyc) said :
#5

Thany you for your reply, indeed it was the yade version that was causing the issue. I used yadedaily (20210419-5278~ad7924d~bionic1). Prevously I was using the yade version downloaded by default with the command "sudo apt-get install yade".

Regards
Clémence

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

> the yade version downloaded by default with the command "sudo apt-get install yade"

Which depends itself upon your Ubuntu version, for your information. With a more recent Ubuntu that would have been e.g. Yade 2020.*