avoid undesired negative forces for high particle velocities in granular models

This commit is contained in:
Axel Kohlmeyer 2017-05-30 21:54:16 -04:00
parent 167a51538e
commit 066123007c
3 changed files with 6 additions and 0 deletions

View File

@ -183,6 +183,7 @@ void PairGranHertzHistory::compute(int eflag, int vflag)
ccel = kn*(radsum-r)*rinv - damp;
polyhertz = sqrt((radsum-r)*radi*radj / radsum);
ccel *= polyhertz;
if (ccel < 0.0) ccel = 0.0;
// relative velocities
@ -390,6 +391,7 @@ double PairGranHertzHistory::single(int i, int j, int itype, int jtype,
ccel = kn*(radsum-r)*rinv - damp;
polyhertz = sqrt((radsum-r)*radi*radj / radsum);
ccel *= polyhertz;
if (ccel < 0.0) ccel = 0.0;
// relative velocities

View File

@ -161,6 +161,7 @@ void PairGranHooke::compute(int eflag, int vflag)
damp = meff*gamman*vnnr*rsqinv;
ccel = kn*(radsum-r)*rinv - damp;
if (ccel < 0.0) ccel = 0.0;
// relative velocities
@ -302,6 +303,7 @@ double PairGranHooke::single(int i, int j, int itype, int jtype, double rsq,
damp = meff*gamman*vnnr*rsqinv;
ccel = kn*(radsum-r)*rinv - damp;
if (ccel < 0.0) ccel = 0.0;
// relative velocities

View File

@ -223,6 +223,7 @@ void PairGranHookeHistory::compute(int eflag, int vflag)
damp = meff*gamman*vnnr*rsqinv;
ccel = kn*(radsum-r)*rinv - damp;
if (ccel < 0.0) ccel = 0.0;
// relative velocities
@ -687,6 +688,7 @@ double PairGranHookeHistory::single(int i, int j, int itype, int jtype,
damp = meff*gamman*vnnr*rsqinv;
ccel = kn*(radsum-r)*rinv - damp;
if (ccel < 0.0) ccel = 0.0;
// relative velocities