yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #10606
Re: [Question #258679]: Non conservation of energy when, simulation is loaded after saving
-
To:
ipemath <question258679@xxxxxxxxxxxxxxxxxxxxx>
-
From:
Janek Kozicki <janek_listy@xxxxx>
-
Date:
Fri, 5 Dec 2014 19:42:38 +0100
-
Cc:
yade-users@xxxxxxxxxxxxxxxxxxx
-
Face:
iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAALVBMVEUBAQEtLS1KSkpRUVFXV1dYWFhjY2Nzc3N3d3eHh4eKioqdnZ24uLjLy8vc3NxVIagyAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH2AIVEzgS1fgQtQAAAjRJREFUOMtt1DFv00AUAOAzFQNbjigSyoQaRaBMhKgLUyKXpVNNeUpk9vyDqFJhQ1kiBuaqAwJCqvPtSLY7RlTn5+5IdnYkkt/AOyfxXVLe5vf53Z1875kd34tOEax8djmj6GyjhB5bxz50GdsVZr9fqRjZwAtKOJw5Wqs2MMZ16ALHsaDncF7xAHix1oEFHAB8f+pRjcO4gfZDykcYzbiucRolOLUJ6kjA0xtVt+A6TySlM0RajIpK6DzwKZ/nOYbF/gclHMo1ZOHYY/+Ha+AWuM+3oMS4eeqYzZ8FiCltgUqI8cd2wwAVpJk+8LWYjBtnJdQpHQqJMd4Oxt4bU9ESiFGc5hkqaH74asAX4iabP5I5gZ+qjgGlJCqZa3h3lxhoeVcSE1qLQC4sqKOK9MGW9E3izFqqHokoztLFEgXg31sbZEKnWi2T74A4NxfVQqlkjKtcAWD+zcArFEES01dR0E/nnV0IgugmDd/2L84sOAouRBBHEc7gtc8teDkRlE0iNQPo2w3Xhh/D4TCIQ4LRLoTvgwjj6RRgavdurxYGMaIuGOyAW/PpNlCcU9/93AHenAWYjPoAwa+G3e3to/MgFNTAEKvKDjzuCzHTnY3qqdXtx24VijzQfZ0yewZ5cwRFQaa+mIYr1uI0I76+3W4xhlvoVRwOA0Fdl64HlJnxP6T8YpX/Lga4Wv4A3ErrU5oTfN7Mu/llXMl8RXEPji/lQkN3H7qXqgC2By47EXeU/7PJ/wPxRKMnuZwIeAAAAABJRU5ErkJggg==
-
In-reply-to:
<20141205180652.31795.88519.launchpad@loganberry.canonical.com>
1. do you check energy at the end of first iteration, or at the beginning of first iteration?
2. do you have correct energy in 2nd iteration?
ipemath said: (by the date of Fri, 05 Dec 2014 18:06:52 -0000)
> Question #258679 on Yade changed:
> https://answers.launchpad.net/yade/+question/258679
>
> Description changed to:
> Hai everyone,
>
> This is my first post in this forum. I am also a relatively new
> user. I am presently trying to understand yade by solving a problem
> of projectile impingement on a particle bed. Because of the
> restriction in SuperComuputer usage time, I have to save and reload
> the interval after certain fixed number of iterations. Hence I am
> using multiple python scripts. The first one sets the problem, runs
> the problem for a fixed no of iterations and saves it. Then the
> second script reopens the saved simulation and runs it futher for
> some more steps. In the course of simulation I am monitoring
> kinematic variables and total energy of the system. In the case of
> the strategy mentioned above(multiple scripts), the energy is not
> conserved. There is a sharp drop in energy when the second script
> is run. But if I used a single python script to run the simulation
> for the same number of steps, the energy is conserved. Below I
> would like to give below the important points of my scripts in the
> form of a pseudocode.
> **********************************************************************************************************
> First Script.
>
> #Create the spheres(Uniform sized ones for the bed, a bigger on
> with an initial velocity as projectile) #Create the enclosing walls
> for the bed O.engine[
> ForceResetter(),
> .........................................
> InteractionLoop(
> .........................................
> ........................................
> [Law2_ScGeom_MindlinPhys_Mindlin(label='Mindlin')]
> ),
> PyRunner(initRun=True,iterPeriod=50,command='myFunction()'),
> PyRunner(initRun=True,iterPeriod=50,command='stopCond()'),
> ]
> -------------------------
> Mindlin.calcEnergy=True
> fet=open('egtotal.dat','w')
> ------------------------------
> def myFunction():
> pe_normal = Mindlin.normElastEnergy() # normal PE
> pe_shear = Mindlin.shearEnergy # shear PE
> norm_damp_dissip = Mindlin.normDampDissip # normal diss
> shear_damp_dissip = Mindlin.shearDampDissip # shear diss
> fric_dissip = Mindlin.frictionDissipation # loss due to
> friction E_tracker = dict(O.energy.items())
> E_kin_trans = E_tracker['kinTrans']
> E_kin_rotation = E_tracker['kinRot']
> etotal = pe_normal + pe_shear + E_kin_trans +
> E_kin_rotation + fric_dissip + norm_damp_dissip + shear_damp_dissip
> # total energy fet.write('%g\n'%(etotal))
>
> def stopCond():
> if O.iter>10000
> O.pause
> fet.close()
> O.save("1.xml.bz2")
> O.exitNoBacktrace()
>
> O.run()
> #######################################################
> Second Script:
> O.load("1.xml.bz2")
> ----------------------------
> Mindlin.calcEnergy=True
> fet=open('egtotal.dat','a') #Append to the existing values
> -------------------------------
> def myFunction():
> pe_normal = Mindlin.normElastEnergy() # normal PE
> pe_shear = Mindlin.shearEnergy # shear PE
> norm_damp_dissip = Mindlin.normDampDissip # normal diss
> shear_damp_dissip = Mindlin.shearDampDissip # shear diss
> fric_dissip = Mindlin.frictionDissipation # loss due to
> friction E_tracker = dict(O.energy.items())
> E_kin_trans = E_tracker['kinTrans']
> E_kin_rotation = E_tracker['kinRot']
> etotal = pe_normal + pe_shear + E_kin_trans +
> E_kin_rotation + fric_dissip + norm_damp_dissip + shear_damp_dissip
> # total energy fet.write('%g\n'%(etotal)) def stopCond():
> if O.iter>20000
> O.pause
> fet.close()
> O.save("1.xml.bz2")
> O.exitNoBacktrace()
>
> O.run()
> ****************************************************************************************
> The above given are excerpts from the script I am using and this
> strategy doesnt conserve the energy. It dips sharply when the
> second script starts running.
>
> I request the help of the yade experts in finding a solution to this
> problem.
>
> --
> You received this question notification because you are a member of
> yade-users, which is an answer contact for Yade.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-users
> Post to : yade-users@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~yade-users
> More help : https://help.launchpad.net/ListHelp
>
--
Janek Kozicki http://janek.kozicki.pl/ |
Follow ups
References