save the evolution of the average kinetic energy of the grains and their average distance
hello, i wrote a code python of periodic inclined channel and i want to save the evolution of the average kinetic energy of the grains and their average distance every 500 period. when i open the file i found that kineticenergy=2 ( maximum value )during all simulation. this is my code:
#!/usr/bin/python
#Import libraries
from yade import qt ,plot
# load the initial congiguration
O.load(
#Inclination angle of the channel slope
slope=35
#Evolution of the kinetic energies of the flow over the average distance traveled by the grains.
n=7200 # number of spheres
# interactions
O.engines=
PyRunner(
PyRunner(
]
""" open file"""
fil=open(
fil.write('#Ec\t x \n')
def AddData():
x_g=0
for b in O.bodies:
if isinstance(
fil.write('%d %.3f\n' % (e,x_g/n))
#saving simulation
def Data():
O.save(
#Timestep
O.dt=.1e-2
O.run(23707)
qt.View()
#utils.
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Jan Stránský
- Solved:
- Last query:
- Last reply: