← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-pkg/yade/git-trunk] Rev 3722: add MatchMaker for friction angle

 

------------------------------------------------------------
revno: 3722
committer: Klaus Thoeni <klaus.thoeni@xxxxxxxxx>
timestamp: Sun 2013-09-08 05:40:12 +1000
message:
  add MatchMaker for friction angle
modified:
  pkg/dem/HertzMindlin.cpp
  pkg/dem/HertzMindlin.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 'pkg/dem/HertzMindlin.cpp'
--- pkg/dem/HertzMindlin.cpp	2012-02-16 16:05:15 +0000
+++ pkg/dem/HertzMindlin.cpp	2013-09-07 19:40:12 +0000
@@ -31,8 +31,8 @@
 
 void Ip2_FrictMat_FrictMat_MindlinPhys::go(const shared_ptr<Material>& b1,const shared_ptr<Material>& b2, const shared_ptr<Interaction>& interaction){
 	if(interaction->phys) return; // no updates of an already existing contact necessary
-	shared_ptr<MindlinPhys> mindlinPhys(new MindlinPhys());
-	interaction->phys = mindlinPhys;
+	shared_ptr<MindlinPhys> contactPhysics(new MindlinPhys());
+	interaction->phys = contactPhysics;
 	FrictMat* mat1 = YADE_CAST<FrictMat*>(b1.get());
 	FrictMat* mat2 = YADE_CAST<FrictMat*>(b2.get());
 	
@@ -64,20 +64,20 @@
 	Real Rmean = (Da+Db)/2.; // mean radius
 	Real Kno = 4./3.*E*sqrt(R); // coefficient for normal stiffness
 	Real Kso = 2*sqrt(4*R)*G/(2-V); // coefficient for shear stiffness
-	Real frictionAngle = std::min(fa,fb);
+	Real frictionAngle = (!frictAngle) ? std::min(fa,fb) : (*frictAngle)(mat1->id,mat2->id,mat1->frictionAngle,mat2->frictionAngle);
 
 	Real Adhesion = 4.*Mathr::PI*R*gamma; // calculate adhesion force as predicted by DMT theory
 
 	/* pass values calculated from above to MindlinPhys */
-	mindlinPhys->tangensOfFrictionAngle = std::tan(frictionAngle); 
-	//mindlinPhys->prevNormal = scg->normal; // used to compute relative rotation
-	mindlinPhys->kno = Kno; // this is just a coeff
-	mindlinPhys->kso = Kso; // this is just a coeff
-	mindlinPhys->adhesionForce = Adhesion;
+	contactPhysics->tangensOfFrictionAngle = std::tan(frictionAngle); 
+	//contactPhysics->prevNormal = scg->normal; // used to compute relative rotation
+	contactPhysics->kno = Kno; // this is just a coeff
+	contactPhysics->kso = Kso; // this is just a coeff
+	contactPhysics->adhesionForce = Adhesion;
 	
-	mindlinPhys->kr = krot;
-	mindlinPhys->ktw = ktwist;
-	mindlinPhys->maxBendPl = eta*Rmean; // does this make sense? why do we take Rmean?
+	contactPhysics->kr = krot;
+	contactPhysics->ktw = ktwist;
+	contactPhysics->maxBendPl = eta*Rmean; // does this make sense? why do we take Rmean?
 
 	/* compute viscous coefficients */
 	if(en && betan) throw std::invalid_argument("Ip2_FrictMat_FrictMat_MindlinPhys: only one of en, betan can be specified.");
@@ -86,13 +86,13 @@
 	// en or es specified, just compute alpha, otherwise alpha remains 0
 	if(en || es){
 		Real logE = log((*en)(mat1->id,mat2->id));
-		mindlinPhys->alpha = -sqrt(5/6.)*2*logE/sqrt(pow(logE,2)+pow(Mathr::PI,2))*sqrt(2*E*sqrt(R)); // (see Tsuji, 1992)
+		contactPhysics->alpha = -sqrt(5/6.)*2*logE/sqrt(pow(logE,2)+pow(Mathr::PI,2))*sqrt(2*E*sqrt(R)); // (see Tsuji, 1992)
 	}
 	
 	// betan specified, use that value directly; otherwise give zero
 	else{	
-		mindlinPhys->betan=betan ? (*betan)(mat1->id,mat2->id) : 0; 
-		mindlinPhys->betas=betas ? (*betas)(mat1->id,mat2->id) : mindlinPhys->betan;
+		contactPhysics->betan=betan ? (*betan)(mat1->id,mat2->id) : 0; 
+		contactPhysics->betas=betas ? (*betas)(mat1->id,mat2->id) : contactPhysics->betan;
 	}
 }
 

=== modified file 'pkg/dem/HertzMindlin.hpp'
--- pkg/dem/HertzMindlin.hpp	2013-05-29 11:54:22 +0000
+++ pkg/dem/HertzMindlin.hpp	2013-09-07 19:40:12 +0000
@@ -86,6 +86,7 @@
 			((shared_ptr<MatchMaker>,es,,,"Shear coefficient of restitution $e_s$."))
 			((shared_ptr<MatchMaker>,betan,,,"Normal viscous damping coefficient $\\beta_n$."))
 			((shared_ptr<MatchMaker>,betas,,,"Shear viscous damping coefficient $\\beta_s$."))
+			((shared_ptr<MatchMaker>,frictAngle,,,"Instance of :yref:`MatchMaker` determining how to compute the friction angle of an interaction. If ``None``, minimum value is used."))
 	);
 	DECLARE_LOGGER;
 };