Energy tracking functions
Good morning,
I'm new to YADE and I'm using it for a part of my master thesis.
I want to model a granular damper. In the case study the phases are the following
1) The spheres are inserted in a parallelepiped box (approx. 2cmx1cmx0.5cm)
2) The vibration of the all system makes the box shear cyclically.
(code at the end)
IMG to schematize the system ---> https:/
The idea is to build before all the objects (box as facets and sphere pack), then to compress the pack of spheres by imposing a motion on the cover and finally to excite the system with HarmonicRotatio
I use Hertz-Mindlin contact law (code below).
I'm facing some "physical" problems:
1) I want to get the total energy given to the system, so I save the Torque aruond z and the rotation to integrate over an half cycle. Is there another way to get this total energy directly from YADE? Am I taking the wrong data or interpreting them bad?
2) From Law2_ScGeom_
3) I want to relate the confinement pressure (F_closing in code) with the dissipation in this system, so I expect that at low pressure friction is not effective and at very high pressure is not effective as well, with a sort of optimum in the middle. What I see is that I can increase the pressure on the pack more and more (up to complete compenetration of the sphere layers) and the dissipation by friction only increases to not physical values? What is the reason of this? Am I missing something in controlling?
4) Are there other ways to achieve the my result? If yes, are there some examples to referr to?
Thank you very much for the helping and for the care you all have in this community. I really hope that you can help me with this problems that make me stuck. I hope as well that I did respect all the rules for making questions on this forum.
Thank you again and regards.
Stefano Simone
-------
The code is the following:
from yade import plot,utils
from yade import pack
import math
import random
import numpy
#parameters
f = 250
period = 1/f
wrad = 2*pi*f
ang_ampl = 0.04
e_n = 0.63
e_s = 0.63
frictionAngle = 0.197
num_per = 1
g = 9.81
F_closing= 15000
#materials
#O.materials.
O.materials.
O.materials.
#bodies
# sphere packing creation
pred = pack.inAlignedB
O.bodies.
# random distribution of radii
Dev = 0.0001
media = 0.00075
val_max = media + Dev
val_min = media - Dev
radii = numpy.linspace(
for b in O.bodies:
if isinstance(
# total volume and number of the spheres
V_spheres = 0
number = 0
for b in O.bodies:
if isinstance(b.shape, Sphere):
V_spheres = V_spheres + 4/3*pi*
number = number + 1
# Container
Down = O.bodies.
Right = O.bodies.
Left = O.bodies.
Bottom = O.bodies.
Upper = O.bodies.
Cover = O.bodies.
#engines
O.engines = [
ForceResett
InsertionSo
Interaction
),
NewtonInteg
Translation
HarmonicRot
HarmonicRot
#HarmonicMo
PyRunner(dead = False, command = 'startPressure()', iterPeriod = 100, label = 'phase'),
PyRunner(dead = False, command = 'plotData()', iterPeriod = 1000, label = 'data')
]
O.dt = PWaveTimeStep()
O.trackEnergy = True
def startPressure():
if O.iter > 250000 and unbalancedForce() < 0.05:
def stopPressure():
top_sphere = max([b.state.pos[2] for b in O.bodies if isinstance(b.shape, Sphere)])
if (O.bodies[
if abs((O.
#if O.bodies[
Ip2.en = 0.63
Ip2.es = 0.63
pres.dead = True
def Rotation_control():
if unbalancedForce() < 0.02 and O.time > 0.4 :
rotR.dead = False
rotL.dead = False
#rotU.dead = False
data.dead = False
def plotData():
plot.addData(
t = O.time,
Edf = Mindlin.
Eds = Mindlin.
Edn = Mindlin.
Etot = Mindlin.
Ed = Mindlin.
v_av = numpy.average(
TorqueR = O.forces.
TorqueL = O.forces.
ForceUP = -O.forces.
v_UP = O.bodies[
Angle = O.bodies[
AngVel = O.bodies[
Pressure = ((O.forces.
Unbalanced = unbalancedForce(),
**O.energy
)
# if O.iter > 1000000:
# plot.saveDataTx
plot.plots = {'t':('
plot.plot()
O.saveTmp()
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Jérôme Duriez
- Solved:
- Last query:
- Last reply: