← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-pkg/yade/git-trunk] Rev 3575: HydroForceEngine: small modifications in the averaging function.

 

------------------------------------------------------------
revno: 3575
committer: Raphael Maurin <raph_maurin@xxxxxxxxxxx>
timestamp: Fri 2015-02-06 19:27:58 +0100
message:
  HydroForceEngine: small modifications in the averaging function.
  Perform the averaging also on the y and z component of the particle velocity, instead of only x before.
modified:
  pkg/common/ForceEngine.cpp
  pkg/common/ForceEngine.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/common/ForceEngine.cpp'
--- pkg/common/ForceEngine.cpp	2015-01-27 15:52:46 +0000
+++ pkg/common/ForceEngine.cpp	2015-02-06 18:27:58 +0000
@@ -179,7 +179,9 @@
 	Vector3r fDrag  = Vector3r::Zero();
 
 	int nMax = 2*nCell;
-	vector<Real> velAverage(nMax,0.0);
+	vector<Real> velAverageX(nMax,0.0);
+        vector<Real> velAverageY(nMax,0.0);
+        vector<Real> velAverageZ(nMax,0.0);
 	vector<Real> phiAverage(nMax,0.0);
 	vector<Real> dragAverage(nMax,0.0);
 
@@ -214,7 +216,9 @@
 				volPart = Mathr::PI*pow(s->radius,2)*(zSup - zInf +(pow(zInf,3)-pow(zSup,3))/(3*pow(s->radius,2)));
 
 				phiAverage[numLayer]+=volPart;
-				velAverage[numLayer]+=volPart*b->state->vel[0];
+				velAverageX[numLayer]+=volPart*b->state->vel[0];
+                                velAverageY[numLayer]+=volPart*b->state->vel[1];
+                                velAverageZ[numLayer]+=volPart*b->state->vel[2];
 				dragAverage[numLayer]+=volPart*fDrag[0];
 			}
 			numLayer+=1;
@@ -223,19 +227,25 @@
 	//Normalized the weighted velocity by the volume of particles contained inside the cell
 	for(int n=0;n<nMax;n++){
 		if (phiAverage[n]!=0){
-			velAverage[n]/=phiAverage[n];
+			velAverageX[n]/=phiAverage[n];
+                        velAverageY[n]/=phiAverage[n];
+                        velAverageZ[n]/=phiAverage[n];
 			dragAverage[n]/=phiAverage[n];
 			//Normalize the concentration after
 			phiAverage[n]/=vCell;
 		}
 		else {
-			velAverage[n] = 0.0;
+			velAverageX[n] = 0.0;
+                        velAverageY[n] = 0.0;
+                        velAverageZ[n] = 0.0;
 			dragAverage[n] = 0.0;
 		}
 	}
 	//Assign the results to the global/public variables of HydroForceEngine
 	phiPart = phiAverage;
-	vxPart = velAverage;
+	vxPart = velAverageX;
+	vyPart = velAverageY;
+        vzPart = velAverageZ;
 	averageDrag = dragAverage;
 
 	//desactivate the average to avoid calculating at each step, only when asked by the user

=== modified file 'pkg/common/ForceEngine.hpp'
--- pkg/common/ForceEngine.hpp	2015-01-27 15:52:46 +0000
+++ pkg/common/ForceEngine.hpp	2015-02-06 18:27:58 +0000
@@ -88,7 +88,9 @@
                 ((Vector3r,gravity,Vector3r(0,0,-9.81),,"Gravity vector (may depend on the slope)."))
 		((vector<Real>,vxFluid,,,"Discretized streamwise fluid velocity depth profile"))
 		((vector<Real>,phiPart,,,"Discretized solid volume fraction depth profile"))
-		((vector<Real>,vxPart,,,"Discretized solid velocity depth profile"))
+		((vector<Real>,vxPart,,,"Discretized streamwise solid velocity depth profile"))
+                ((vector<Real>,vyPart,,,"Discretized spanwise solid velocity depth profile"))
+                ((vector<Real>,vzPart,,,"Discretized normal solid velocity depth profile"))
 		((vector<Real>,averageDrag,,,"Discretized drag depth profile"))
 		((bool,activateAverage,false,,"If true, activate the calculation of the average depth profiles of drag, solid volume fraction, and solid velocity for the application of the force (phiPart in hindrance function) and to use in python for the coupling with the fluid."))
 		((bool,velFluct,false,,"If true, activate the determination of turbulent fluid velocity fluctuation for the next time step only at the position of each particle, using a simple discrete random walk model based on the Reynolds stresses :yref:`turbStress<HydroForceEngine.squaredAverageTurbfluct>`"))