Energy tracking of a two-sphere contact
I am trying to follow the internal energy of a simple two-sphere contact and compare it with the external work. However for the case of a combination between normal and shear stress, there seems to be a discrepancy between the internal energy and external work. One sphere is fixed, while the other one is displacement-
1.) An overestimation of the bond braking energy: Since following the bond-breaking energy is not possible, I wrote my own code in order to monitor it. The code is based on simply following the elastic energy difference before and after the bond breakage. It seems to work fine in most scenarios, but in this particular kinematics of two spheres, it seems to overestimate the bond breaking energy. Or perhaps the error is somewhere else? What I find particularly strange is the shear dissipation energy jump at bond breaking. Since the simulation is displacement controlled, that is not what I would have expected.
2.) A slowly growing discrepancy between the internal energy and external work: This issue is independent of the cohesion - it appears even if the cohesive bond in not created (if the lines 133-138 are commented). It also seems to appear with other contact laws - I have reproduced it with a combination of FrictMat and CundallStrack contact law. I know, that the imposed kinematics are somewhat unnatural, due to being displacement controlled and produce big shear displacements, but I suppose i should still be able to follow the contact energy?
I deliberately chose a very simple scenario in order to demonstrate the issue I'm experiencing. If there is an error in my code, I will be very glad if you point it out to me. I'm attaching my code to this message:
''' Two-sphere contact '''
import numpy as np
import sys, os, os.path
import time
import operator
import timeit
import matplotlib.pyplot as plt
import yade
from yade import plot, export
#######
density = 9700
damping = 0
velocity = -1e-2
frictionAngle = 0.2
cohesion = 1e6
young = 1e7 *10
####Material######
Cohesion_material = yade.CohFrictMa
yade.O.
data, energys, bond_energy = [], [], []
broken_
external_work = 0
up,Fp = [0,0,0],[0,0,0]
def plot_energy(
#displacement and forces on the top sphere
u =(yade.
F = yade.O.
du = u-up
#energy tracking
try:
Ek = O.energy['kinetic']
except KeyError:
Ek = 0
if damping == 0:
Edamp = 0
else:
Edamp = yade.O.
Een = myLaw2s[
Ees = myLaw2s[
Eplast = myLaw2s[
Etot = yade.O.
#calculate the energy of a particular cohesive bond
normEnergy, shearEnergy = {},{}
for i in cohesive_
if i.phys:
else:
broken_bonds = 0
broken_
for i in cohesive_
try:
if i.phys.
else:
except AttributeError:
for i in cohesive_
if broken_
previous_
previous_
previous_
#data to plot
external_work = external_work + Fp[0]*du[0]
internal_energy = Ek + Een + Ees + Eplast + Edamp + broken_
ux,uy,uz = u
plot.
#export energy parameters into the next iteration
up=u
Fp=F
return previous_
#Defining interaction geometry, physics and law
myIgeoms = [yade.Ig2_
myIphyss = [yade.Ip2_
myLaw2s = [yade.Law2_
yade.O.engines=[
]
#sphere construction
b1 = yade.utils.
b2 = yade.utils.
id_top_clump = yade.O.
id_bottom_clump = yade.O.
#cohesive interactions
intr = yade.utils.
intr.phys.unp = -(yade.
intr.phys.
intr.phys.
intr.phys.
cohesive_
for i in yade.O.
cohesive_
previous_
for i in cohesive_
previous_
previous_
previous_
#kinematic constraints
yade.O.
yade.O.
yade.O.
yade.O.trackEnergy = True
myLaw2s[
yade.utils.
plot.plots=
plot.plot()
yade.O.
O.run()
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Bruno Chareyre
- Solved:
- Last query:
- Last reply: