yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #27588
Re: [Question #701438]: Why particle velocity varies with time step
Question #701438 on Yade changed:
https://answers.launchpad.net/yade/+question/701438
Aoxi Zhang gave more information on the question:
Hi Jan,
Thanks for your comments.
>> it is not small enough to neglect the effect of its value.
I further tested on other smaller dt values, e.g. 1e-10, but it has the
same problem.
>> You are examining a few "random" particle's velocities in a
simulation with "many" particles. Such DEM simulation is "chaotic".
That is a good point. I updated phase2.py (attached below) by monitoring
a layer of sands, thereby more sands are monitored. But I still got this
problem.
#### updated phase2.py in which more sands are monitored###
from __future__ import division
from yade import pack, plot
import math
import numpy as np
import random
import pickle
from yade import ymport,export
utils.readParamsFromTable(dt=1e-7)
from yade.params import table
finalFricDegree=19
O.load('sample_generatedFromPhase1_afterRelax.yade.gz')
RunTimeLength=3e-4 # how long for the time of data recording
Odt=table.dt
O.dt=Odt
O.engines[3].dead=True## turn of GlobalStiffnessTimeStepper
# TimeStepper.dead=True## Note, use label cannot successfully close time stepper
StopRelaxation.dead=True## turn of StopRelaxation in previous phase
NewtonIntegrator.damping=0.0
# monitoredSand=[1000,2001,3002,4003,5004]
monitoredSand=[]
def getMonitoredSand():
halfHeigh=aabbDim()[1]/2
for i in O.bodies:
if isinstance(i.shape, Sphere):
if halfHeigh<i.state.pos[1]<halfHeigh+0.0015:
i.shape.color=[1,0,0]
monitoredSand.append(i.id)
else:
i.shape.color=[1,1,1]
print ("number of monitoredSand is",len(monitoredSand))
getMonitoredSand()
def avgVel(idList):
vel=0.0
avg=0.0
for i in idList:
vel+=O.bodies[i].state.vel[1]
avg=vel/len(idList)
return avg
print("O.dt=",O.dt)
O.engines=O.engines+[PyRunner(command='outputData()', iterPeriod=1,label="outputData")]
O.engines=O.engines+[PyRunner(command='stopSimulation()', iterPeriod=1,label="stopSimu")]
# print("O.dt=",O.dt)
# NewtonIntegrator.damping=0
def stopSimulation():
print ('Running, O.time,',O.time)
if O.time > RunTimeLength:
O.pause()
print ('Running finished, O.realtime,',O.realtime)
# plot.saveDataTxt('historyData_calmdownVel{}.txt'.format(calmDownVel)) # should revise the monitored data at history
def outputData():
f = open("ResultsOfPhase2_dt{}.txt".format(Odt), "a+")
f.write('{} {} {}\n'.format(O.time,O.dt,avgVel(monitoredSand)))
f.close()
O.resetTime()
O.run()
utils.waitIfBatch()
#####
Do you have any ideas about this?
Thanks!
Aoxi
--
You received this question notification because your team yade-users is
an answer contact for Yade.