← Back to team overview

yade-users team mailing list archive

Re: [Question #693852]: energy issues

 

Question #693852 on Yade changed:
https://answers.launchpad.net/yade/+question/693852

    Status: Open => Answered

Jan Stránský proposed the following answer:
Hello,

> (1) how do we calculate the gravity work?
> ... but I do not fully understand it.

see [1]
delta(GravWork) = - gravity.dot(vel) * mass * dt # per time step

this is equivalent to delta(m*g*h) = m*g*delta(h), delta(h) being vel*dt
approximation

> As we all know, the particles should have the maximum gravity work at
the height position ... I get the z position of the particles and use
this equation (m*g*h) to calculate the gravity work...

Yade computes actual work done by gravity in the simulation.
The *potential energy* mgh uses some reference frame (the h term). This frame is arbitrary (consider falling on a flat roof, different h would be w.r.t the roof and w.r.t the ground) and hence the initial value is arbitrary.
If needed, consider the Yade's reference frame such that the initial potential energy is 0.
If you know h in advance, you can add it "manually".

> (2) ...it seems the energy is not conserved. I do not know whether the
energy in YADE is conserved.

Potential energy m*g*h is not included.
You have some initial potential energy and after some run, it is lowered by gravity work, but should be included to energy balance if you are interested in the balance itself.

I suggest to split the problem and investigate simpler scenarios:
- free fall (without any interactions)
- fall on a ground (with prescribed initial velocity, no gravity)
- and after understanding both previous scenarios, go to the combined case

> (3)
> why the plastDissip does not being recorded here?

plastDissip is only recorded when "needed", when the pastic dissipation actually happen, not before (it is inside "if (shearForce.squaredNorm() > maxFs)" branch).
You have it in method 1, because you explicitly add E_plastic (default value is 0) to plod.addData.

> what is the relationship between the plastDissip and the
plasticDissipation[4]?

it is the same value. See [3] for the difference.
For Law2(traceEnergy=True), it is saved only to law.plasticDissipation() and NOT to O.energies. That's why you get 0 for plasticdissip.
It works oppositely for Law2(traceEnergy=False).

cheers
Jan

[1] https://gitlab.com/yade-dev/trunk/-/blob/master/pkg/dem/NewtonIntegrator.cpp#L90
[2] https://gitlab.com/yade-dev/trunk/-/blob/master/pkg/dem/ElasticContactLaw.cpp#L101
[3] https://gitlab.com/yade-dev/trunk/-/blob/master/pkg/dem/ElasticContactLaw.cpp#L98

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.