Clump angular momentum not conserved
Hello all,
I have a simulation consisting of two spheres (S1, S2) and a clump made of two spheres (C1, C2). The two spheres, S1 and S2, are given the same initial speed but in the opposite directions along the horizontal. The clump is aligned along the vertical and the two spheres, S1 and S2, are made to hit the spheres in the clump at the same time. Could this be a bug in my code or the NewtonIntegrator?
I expect the angular momentum to be conserved in the interactions, but it is not. I have a similar problem with clumps of pfacet [1]. It was reported in a bug report related to pfacet [2]. I am posting again because this appears to be an error related to clumps in general. I have put the code below.
I am using Yadedaily.
Kind regards,
Rohit K. John
[1] https:/
[2] https:/
# script
# -------
from yade.gridpfacet import *
from yade import *
from yade import geom, utils
from yade import plot
import sys, os
# -------
# -------
sphere_young = 50e9
sphere_poisson = 0.3
sphere_friction = radians(30)
sphere_offset = 0.3
sphere_radius = 5e-2
sphere_init_vel = 1
sphere_mass = 0.5
sphere_density = sphere_mass / (4/3*pi*
# -------
sphere_mat = 'sphere_mat'
O.materials.append(
FrictMat(
young = sphere_young,
poisson = sphere_poisson,
density = sphere_density,
label = sphere_mat,
)
)
# -------
O.engines = [
]),
)
]
# -------
# -------
clump_sph_1 = sphere([0, sphere_offset, 0], sphere_radius, material = sphere_mat)
clump_sph_2 = sphere(
clump_sph_1_ID = O.bodies.
clump_sph_2_ID = O.bodies.
clump_clump_ID = O.bodies.
clump_mmoi = O.bodies[
# -------
sp1 = sphere([ 4*sphere_radius, sphere_offset, 0], sphere_radius, material = sphere_mat)
sp2 = sphere(
sp1_ID = O.bodies.
sp2_ID = O.bodies.
O.bodies[
O.bodies[
# -------
O.engines += [
NewtonInteg
gravity = [0,0,0],
damping = 0
),
PyRunner(
command = 'graph()',
iterPeriod = 1000
),
]
# -------
m = sphere_mass
v0 = sphere_init_vel
l = sphere_offset
iz = clump_mmoi[2]
calculated_
calculated_
calculated_
calculated_
print("clump: ", calculated_
print("sphere: ", calculated_
print("total: ", calculated_
# -------
plot.plots = {'t':('clump_Lz', 'calculated_
def graph():
L_sp1 = get_AngMom(sp1_ID)
L_sp2 = get_AngMom(sp2_ID)
angMom_clump = O.bodies[
L_tot = angMom_clump + L_sp1 + L_sp2
plot.addData(
t = O.time, t1 = O.time,
Lx = L_tot[0], Ly = L_tot[1], Lz = L_tot[2],
clump_Lz = angMom_clump[2],
calculated = calculated_
)
def get_AngMom(id):
pos_sp1 = O.bodies[
vel_sp1 = O.bodies[
angMom_sp1 = O.bodies[
mass_sp1 = O.bodies[
return angMom_sp1 + mass_sp1 * pos_sp1.
# -------
O.dt = 2e-7#utils.
O.saveTmp()
plot.plot()
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Rohit John for more information if necessary.