fix ave/euler

Submitted by Daniel Queteschiner on
ckloss

Hi Daniel,

thanks - you are of course right! Will fix this in the next release,

Cheers
Christoph

Wed, 15 Jul 2015 - 22:43 Permalink
Daniel Queteschiner

Hi Christoph,

I just noticed that there's another bug in fix ave/euler which is typically hidden by dump custom commands in the input script.
modify->addstep_compute_all which is called in the constructor at
https://github.com/CFDEMproject/LIGGGHTS-PUBLIC/blob/master/src/fix_ave…
must be invoked only after the internal ComputeStressAtom has been created
https://github.com/CFDEMproject/LIGGGHTS-PUBLIC/blob/master/src/fix_ave…

I think you can either move the creation of the ComputeStressAtom to the constructor before modify->addstep_compute_all or move modify->addstep_compute_all to the post_create function after https://github.com/CFDEMproject/LIGGGHTS-PUBLIC/blob/master/src/fix_ave…

Mon, 20 Jul 2015 - 10:40 Permalink
Daniel Queteschiner

In reply to by Daniel Queteschiner

Even better then use
compute_stress_->addstep(nfirst);
instead of
modify->addstep_compute_all(nfirst);

Mon, 20 Jul 2015 - 14:48 Permalink
ckloss

Hi Daniel,

thanks a lot! Andreas and I will have a close look for the next release!

Best wishes
Christoph

Mon, 27 Jul 2015 - 12:37 Permalink
Daniel Queteschiner

Unfortunately, I have to come back to this command once again and report another bug:
https://github.com/CFDEMproject/LIGGGHTS-PUBLIC/blob/3.3.1/src/fix_ave_…
else if(j < 14) return stress_[i][j-8];
should be
else if(j < 14) return stress_[i][j-7];
The resulting index (j is in the range 8 to 13) should run from 1 to 6 instead of 0 to 5 because stress_[i][0] is the pressure value (see the preceding code line 662)

Wed, 2 Mar 2016 - 19:54 Permalink
aaigner

In reply to by Daniel Queteschiner

Hello Daniel,
I am so sorry. I did not see your comment.
I fixed it internally. It will be corrected with the next release.

Best wishes
Andreas

Fri, 28 Apr 2017 - 13:17 Permalink

The average velocity gets divided by the number of particles, but it also gets divided by the sum of particle masses. That's too much, hence
https://github.com/CFDEMproject/LIGGGHTS-PUBLIC/blob/master/src/fix_ave…
if(ncount_[icell]) vectorScalarDiv3D(v_av_[icell],static_cast<double>(ncount_[icell])*mass_[icell]);
should read
if(mass_[icell] > 0.) vectorScalarDiv3D(v_av_[icell],mass_[icell]);