← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-pkg/yade/git-trunk] Rev 3621: Add an opportunity to set frictAngl through MatchMaker in ViscEl

 

------------------------------------------------------------
revno: 3621
committer: Anton Gladky <gladky.anton@xxxxxxxxx>
timestamp: Mon 2015-03-16 11:41:06 +0100
message:
  Add an opportunity to set frictAngl through MatchMaker in ViscEl
  
  See https://answers.launchpad.net/yade/+question/263634
modified:
  examples/ViscElMatchMaker.py
  pkg/dem/ViscoelasticPM.cpp
  pkg/dem/ViscoelasticPM.hpp


--
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 'examples/ViscElMatchMaker.py'
--- examples/ViscElMatchMaker.py	2014-04-02 15:33:41 +0000
+++ examples/ViscElMatchMaker.py	2015-03-16 10:41:06 +0000
@@ -18,13 +18,13 @@
 
 
 id11 = O.bodies.append(sphere(center=[0,0,0],radius=r1,material=mat1,fixed=True,color=[0,0,1]))
-id12 = O.bodies.append(sphere(center=[0,0,(r1+r2+0.005*r2)],radius=r2,material=mat2,fixed=False,color=[0,0,1]))
+id12 = O.bodies.append(sphere(center=[0,0,(r1+r2)],radius=r2,material=mat2,fixed=False,color=[0,0,1]))
 
 id21 = O.bodies.append(sphere(center=[3*r1,0,0],radius=r1,material=mat1,fixed=True,color=[0,1,0]))
-id22 = O.bodies.append(sphere(center=[3*r1,0,(r1+r2+0.005*r2)],radius=r2,material=mat3,fixed=False,color=[0,1,0]))
+id22 = O.bodies.append(sphere(center=[3*r1,0,(r1+r2)],radius=r2,material=mat3,fixed=False,color=[0,1,0]))
 
 id31 = O.bodies.append(sphere(center=[6*r1,0,0],radius=r1,material=mat2,fixed=True,color=[1,0,0]))
-id32 = O.bodies.append(sphere(center=[6*r1,0,(r1+r2+0.005*r2)],radius=r2,material=mat3,fixed=False,color=[1,0,0]))
+id32 = O.bodies.append(sphere(center=[6*r1,0,(r1+r2)],radius=r2,material=mat3,fixed=False,color=[1,0,0]))
 
 o.engines = [
   ForceResetter(),
@@ -33,7 +33,8 @@
     [Ig2_Sphere_Sphere_ScGeom()],
     [Ip2_ViscElMat_ViscElMat_ViscElPhys( 
       en=MatchMaker(matches=((mat1,mat2,.9),(mat1,mat3,.5),(mat2,mat3,.1))),          # Set parameters
-      et=MatchMaker(matches=((mat1,mat2,.9),(mat1,mat3,.5),(mat2,mat3,.1)))
+      et=MatchMaker(matches=((mat1,mat2,.9),(mat1,mat3,.5),(mat2,mat3,.1))),
+      frictAngle=MatchMaker(matches=((mat1,mat2,.1),(mat1,mat3,.2),(mat2,mat3,.3)))
       )],
     [Law2_ScGeom_ViscElPhys_Basic()],
   ),
@@ -60,5 +61,9 @@
 from yade import qt
 qt.View()
 
-#O.run(100000, True)
+print "Friction coefficient for id11 and id12 is %g"%(math.atan(O.interactions[id11,id12].phys.tangensOfFrictionAngle))
+print "Friction coefficient for id21 and id22 is %g"%(math.atan(O.interactions[id21,id22].phys.tangensOfFrictionAngle))
+print "Friction coefficient for id31 and id32 is %g"%(math.atan(O.interactions[id31,id32].phys.tangensOfFrictionAngle))
+
+O.run(100000, True)
 #plot.saveGnuplot('sim-data_')

=== modified file 'pkg/dem/ViscoelasticPM.cpp'
--- pkg/dem/ViscoelasticPM.cpp	2014-10-20 13:42:59 +0000
+++ pkg/dem/ViscoelasticPM.cpp	2015-03-16 10:41:06 +0000
@@ -244,7 +244,11 @@
 		phys->mR = 0;
 	}
 
-	phys->tangensOfFrictionAngle = std::tan(std::min(mat1->frictionAngle, mat2->frictionAngle)); 
+	if (frictAngle) {
+		phys->tangensOfFrictionAngle = std::tan((*frictAngle)(mat1->id,mat2->id));
+	} else {
+		phys->tangensOfFrictionAngle = std::tan(std::min(mat1->frictionAngle, mat2->frictionAngle));
+	}
 	phys->shearForce = Vector3r(0,0,0);
 	
 	if ((mRtype1 != mRtype2) or (mRtype1>2) or (mRtype2>2) or (mRtype1<1) or (mRtype2<1) ) {

=== modified file 'pkg/dem/ViscoelasticPM.hpp'
--- pkg/dem/ViscoelasticPM.hpp	2014-10-20 13:42:59 +0000
+++ pkg/dem/ViscoelasticPM.hpp	2015-03-16 10:41:06 +0000
@@ -81,7 +81,9 @@
 	YADE_CLASS_BASE_DOC_ATTRS(Ip2_ViscElMat_ViscElMat_ViscElPhys,IPhysFunctor,"Convert 2 instances of :yref:`ViscElMat` to :yref:`ViscElPhys` using the rule of consecutive connection.",
  		((shared_ptr<MatchMaker>,tc,,,"Instance of :yref:`MatchMaker` determining contact time"))
 		((shared_ptr<MatchMaker>,en,,,"Instance of :yref:`MatchMaker` determining restitution coefficient in normal direction"))
-		((shared_ptr<MatchMaker>,et,,,"Instance of :yref:`MatchMaker` determining restitution coefficient in tangential direction")));
+		((shared_ptr<MatchMaker>,et,,,"Instance of :yref:`MatchMaker` determining restitution coefficient in tangential direction"))
+		((shared_ptr<MatchMaker>,frictAngle,,,"Instance of :yref:`MatchMaker` determining how to compute interaction's friction angle. If ``None``, minimum value is used."))
+		);
 	virtual void Calculate_ViscElMat_ViscElMat_ViscElPhys(const shared_ptr<Material>& b1, const shared_ptr<Material>& b2, const shared_ptr<Interaction>& interaction, shared_ptr<ViscElPhys> phys);
 	FUNCTOR2D(ViscElMat,ViscElMat);
 };