← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-dev/yade/trunk] Rev 2916: - fix bug 2) found by chiara (https://answers.launchpad.net/yade/+question/169689)

 

------------------------------------------------------------
revno: 2916
committer: Bruno Chareyre <bruno.chareyre@xxxxxxxxxxx>
branch nick: trunk
timestamp: Thu 2011-09-01 12:21:18 +0200
message:
  - fix bug 2) found by chiara (https://answers.launchpad.net/yade/+question/169689)
modified:
  pkg/dem/NewtonIntegrator.cpp


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

Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-dev/yade/trunk/+edit-subscription
=== modified file 'pkg/dem/NewtonIntegrator.cpp'
--- pkg/dem/NewtonIntegrator.cpp	2011-08-31 17:04:33 +0000
+++ pkg/dem/NewtonIntegrator.cpp	2011-09-01 10:21:18 +0000
@@ -147,6 +147,9 @@
 				// linear acceleration
 				Vector3r linAccel=computeAccel(f,state->mass,state->blockedDOFs);
 				cundallDamp2nd(dt,f,fluctVel,linAccel);
+				//This is the convective term, appearing in the time derivation of Cundall/Thornton expression (dx/dt=velGrad*pos -> d²x/dt²=dvelGrad/dt*pos+velGrad*vel), negligible in many cases but not for high speed large deformations (gaz or turbulent flow).
+				if (homoDeform==Cell::HOMO_VEL_2ND) linAccel+=prevVelGrad*state->vel;
+				//finally update velocity
 				state->vel+=dt*linAccel;
 				// angular acceleration
 				if(!useAspherical){ // uses angular velocity
@@ -189,10 +192,7 @@
 		// update velocity reflecting changes in the macroscopic velocity field, making the problem homothetic.
 		//NOTE : if the velocity is updated before moving the body, it means the current velGrad (i.e. before integration in cell->integrateAndUpdate) will be effective for the current time-step. Is it correct? If not, this velocity update can be moved just after "state->pos += state->vel*dt", meaning the current velocity impulse will be applied at next iteration, after the contact law. (All this assuming the ordering is resetForces->integrateAndUpdate->contactLaw->PeriCompressor->NewtonsLaw. Any other might fool us.)
 		//NOTE : dVel defined without wraping the coordinates means bodies out of the (0,0,0) period can move realy fast. It has to be compensated properly in the definition of relative velocities (see Ig2 functors and contact laws).
-		//This is the convective term, appearing in the time derivation of Cundall/Thornton expression (dx/dt=velGrad*pos -> d²x/dt²=dvelGrad/dt*pos+velGrad*vel), negligible in many cases but not for high speed large deformations (gaz or turbulent flow).
-		if (homoDeform==Cell::HOMO_VEL_2ND) state->vel+=prevVelGrad*state->vel*dt;
-
-		//In all cases, reflect macroscopic (periodic cell) acceleration in the velocity. This is the dominant term in the update in most cases
+		//Reflect mean-field (periodic cell) acceleration in the velocity
 		Vector3r dVel=dVelGrad*state->pos;
 		state->vel+=dVel;
 	} else if (homoDeform==Cell::HOMO_POS){