Keeping track of internal energy in the Law2_ScGeom6D_CohFrictPhys_CohesionMoment contact law

Asked by Tijan

I am trying to use the contact law formulation of energy tracking in the Law2_ScGeom6D_CohFrictPhys_CohesionMoment contact law. I define a label for my contact law:

myLaw2s = [yade.Law2_ScGeom6D_CohFrictPhys_CohesionMoment(useIncrementalForm=True,
                                                            always_use_moment_law=False,label='law')]

and then follow the energy by:

internalEnergy=law.elasticEnergy()+law.plasticDissipation()+kineticEnergy()

However, this results in an error. Is this type of energy tracking implemented for the type of contact law I am trying to use?

Thank you in advance for your help.

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Bruno Chareyre
Solved:
Last query:
Last reply:
Revision history for this message
Jan Stránský (honzik) said :
#1

Hello,
according to the docs [1], plasticDissipation or any function like this is
not (yet) implemented for Law2_ScGeom6D_CohFrictPhys_CohesionMoment..
cheers
Jan

PS: next time please put the error message to the question [2]. Here it is
clear where is the problem, but in other situtions it might help and save a
few mails :-)

[1]
https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.Law2_ScGeom6D_CohFrictPhys_CohesionMoment
[2] https://yade-dem.org/wiki/Howtoask

2016-02-15 11:37 GMT+01:00 Tijan <email address hidden>:

> New question #285535 on Yade:
> https://answers.launchpad.net/yade/+question/285535
>
> I am trying to use the contact law formulation of energy tracking in the
> Law2_ScGeom6D_CohFrictPhys_CohesionMoment contact law. I define a label for
> my contact law:
>
> myLaw2s =
> [yade.Law2_ScGeom6D_CohFrictPhys_CohesionMoment(useIncrementalForm=True,
>
> always_use_moment_law=False,label='law')]
>
> and then follow the energy by:
>
> internalEnergy=law.elasticEnergy()+law.plasticDissipation()+kineticEnergy()
>
> However, this results in an error. Is this type of energy tracking
> implemented for the type of contact law I am trying to use?
>
> Thank you in advance for your help.
>
>
>
> --
> You received this question notification because your team yade-users is
> an answer contact for Yade.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-users
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~yade-users
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
Tijan (tijan-mede) said :
#2

Thank you for the quick answer mr. Stransky. However, I'm a bit confused. So if I understand correctly, it is only possible to follow the elastic energy of the contact (normal, shear, bending and twisting) by applying this type of energy tracking? I'm a bit puzzled by the fact that there is a switch in the contact law to turn on shear energy dissipation (traceEnergy=True), but there seems to be no function to record the this shear dissipation in the contact law. I also can't seem to find any function in this contact law to record kinetic energy. Is the O.energy the only way to follow friction dissipation and kinetic energy?

Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#3

Hi Tijan,

Kinetic energy is not specific to any contact law, that is why you don't find it in a contact law:
KE=kineticEnergy(), just as in your question.

I checked the code after our discussion. I see that traceEnergy is there in the class but there is no mechanism to actually trace as there is in Law2_ScGeom_FrictPhys_CundallStrack [1].

I will commit a fix in minutes.

Bruno

[1] https://github.com/yade/trunk/blob/master/pkg/dem/ElasticContactLaw.cpp#L73

Revision history for this message
Jan Stránský (honzik) said :
#4

Hi Tijan,

> So if I understand correctly, it is only possible to follow
> the elastic energy of the contact (normal, shear, bending and twisting)
> by applying this type of energy tracking? I'm a bit puzzled by the fact
> that there is a switch in the contact law to turn on shear energy
> dissipation (traceEnergy=True), but there seems to be no function to
> record the this shear dissipation in the contact law.

To get the dissipation energy, you have to define O.trackEnergy=True. Then,
instead of law.plasticDissipation do O.energy['shearDissip'],
O.energy['bendingDissip'] and O.energy['twistDissip']

These information I got from the source code, maybe the documentation could
be a bit more explanatory..

> I also can't seem
> to find any function in this contact law to record kinetic energy. Is
> the O.energy the only way to follow friction dissipation and kinetic
> energy?
>

kinetic energy is independent on material model, so utils.kineticEnergy()
is used (or just kineticEnergy() as in your example, no
law.kineticEnergy..). Or you can do O.trackEnergy=True and
O.energy['kinetic'], you should get the same results.

cheers
Jan

Revision history for this message
Best Bruno Chareyre (bruno-chareyre) said :
#5

Fix commited [1].
Please confirm if it fixes the problem.

[1] https://github.com/yade/trunk/commit/754f20fc64f41f73d34b96f68d3c00c039f1cd4e

Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#6

@Jan
> "To get the dissipation energy, you have to define O.trackEnergy=True."

It depends on the contact model in fact. Some law functors have their own accumulator (CundallStrack, for years, and now also CohesionMoment).
The reason is that O.trackEnergy=True is extremely slow, hence if all you need is to accumulate plastic dissipation you better use the Law2's counter.

Bruno

Revision history for this message
Tijan (tijan-mede) said :
#7

Thank you for such a swift response. I am now able to track the dissipated energy with the "yade.O.energy['shearDissip']" function. However I am still not able to use the "law.plasticDissipation()" function.

I have switched on the energy tracing by "law.traceEnergy=True" and used the "law.plasticDissipation()" command, but I still get the error:

"AttributeError: 'Law2_ScGeom6D_CohFrictPhys_CohesionMoment' object has no attribute 'plasticDissipation' "

I am using the yadedaily version of the software.

Tijan

Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#8

>I am using the yadedaily version of the software.

It is not synchronized yet I think, but you can compile the source if you want to try the last.

Revision history for this message
Tijan (tijan-mede) said :
#9

Thanks Bruno Chareyre, that solved my question.