← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-pkg/yade/git-trunk] Rev 4148: Fix calculation of massR in ViscoelasticPM

 

------------------------------------------------------------
revno: 4148
committer: Anton Gladky <gladky.anton@xxxxxxxxx>
timestamp: Mon 2014-08-25 17:42:17 +0200
message:
  Fix calculation of massR in ViscoelasticPM
  
  Thanks to Dominik Boemer for pointing this out.
  http://www.mail-archive.com/yade-users@xxxxxxxxxxxxxxxxxxx/msg08741.html
modified:
  pkg/dem/ViscoelasticPM.cpp
  scripts/checks-and-tests/checks/checkViscElEng.py


--
lp:yade
https://code.launchpad.net/~yade-pkg/yade/git-trunk

Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-pkg/yade/git-trunk/+edit-subscription
=== modified file 'pkg/dem/ViscoelasticPM.cpp'
--- pkg/dem/ViscoelasticPM.cpp	2014-07-18 18:18:50 +0000
+++ pkg/dem/ViscoelasticPM.cpp	2014-08-25 15:42:17 +0000
@@ -170,7 +170,8 @@
 		mass2 = mass1;
 	}
 	
-	const Real massR = 2*mass1*mass2/(mass1+mass2);
+	// See [Pournin2001, just below equation (19)]
+	const Real massR = mass1*mass2/(mass1+mass2);
 	
 	GenericSpheresContact* sphCont=YADE_CAST<GenericSpheresContact*>(interaction->geom.get());
 	Real R1=sphCont->refR1>0?sphCont->refR1:sphCont->refR2;

=== modified file 'scripts/checks-and-tests/checks/checkViscElEng.py'
--- scripts/checks-and-tests/checks/checkViscElEng.py	2014-04-02 15:33:41 +0000
+++ scripts/checks-and-tests/checks/checkViscElEng.py	2014-08-25 15:42:17 +0000
@@ -45,13 +45,13 @@
 
   if v0<=0 and v>0:
     en=-v/v0
-    print ("Precalculated en value %f" % 0.736356797441)
-    print ("Obtained en value %f" % en)
+    print ("Precalculated en value %f" % 0.734839832393159)
+    print ("Obtained en value %.15f" % en)
     O.pause()
   v0=v
 
 O.run(1000000)
 O.wait()
 
-if ((abs(0.736356797441-en)/en)>tolerance):
+if ((abs(0.734839832393159-en)/en)>tolerance):
   resultStatus += 1