← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-pkg/yade/git-trunk] Rev 3724: Compute edgesSurfaces if viscousShear is true.

 

------------------------------------------------------------
revno: 3724
committer: Donia <donia.marzougui@xxxxxxxxxxxxxxx>
timestamp: Tue 2013-10-22 16:05:23 +0200
message:
  Compute edgesSurfaces if viscousShear is true.
modified:
  pkg/dem/FlowEngine.cpp
  pkg/dem/FlowEngine.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/FlowEngine.cpp'
--- pkg/dem/FlowEngine.cpp	2013-10-21 13:11:33 +0000
+++ pkg/dem/FlowEngine.cpp	2013-10-22 14:05:23 +0000
@@ -276,7 +276,7 @@
 	
         if ( !first && !multithread && (useSolver==0 || fluidBulkModulus>0)) flow->Interpolate ( flow->T[!flow->currentTes], flow->T[flow->currentTes] );
         if ( WaveAction ) flow->ApplySinusoidalPressure ( flow->T[flow->currentTes].Triangulation(), sineMagnitude, sineAverage, 30 );
-        if (normalLubrication || shearLubrication) flow->computeEdgesSurfaces();
+        if (normalLubrication || shearLubrication || viscousShear) flow->computeEdgesSurfaces();
 }
 
 void FlowEngine::setPositionsBuffer(bool current)
@@ -595,13 +595,13 @@
 		const Tesselation& Tes = flow.T[flow.currentTes];
 		flow.deltaShearVel.clear(); flow.normalV.clear(); flow.deltaNormVel.clear(); flow.surfaceDistance.clear(); 
 
+
 		for ( int i=0; i< ( int ) flow.Edge_ids.size(); i++ ) {
 			const int& id1 = flow.Edge_ids[i].first;
 			const int& id2 = flow.Edge_ids[i].second;
 			
 			int hasFictious= Tes.vertex ( id1 )->info().isFictious +  Tes.vertex ( id2 )->info().isFictious;
 			if (hasFictious>0 or id1==id2) continue;
-			if (hasFictious==2) continue;
 			const shared_ptr<Body>& sph1 = Body::byId ( id1, scene );
 			const shared_ptr<Body>& sph2 = Body::byId ( id2, scene );
 			Sphere* s1=YADE_CAST<Sphere*> ( sph1->shape.get() );
@@ -653,8 +653,7 @@
 			flow.deltaShearVel.push_back(deltaShearV);
 			flow.normalV.push_back(normal);
 			flow.surfaceDistance.push_back(max(surfaceDist, 0.) + eps*meanRad);
-			if (affiche_vitesse) cout << "le vecteur normal entre " << id1 << " et " << id2 << "est " << normal <<" total " << ( int ) flow.Edge_ids.size()<< endl;
-			
+
 			if (shearLubrication)
 				visc_f = flow.computeShearLubricationForce(deltaShearV,surfaceDist,i,eps,O1O2,meanRad);
 			else if (viscousShear) 
@@ -687,8 +686,13 @@
 					flow.lubBodyStress[id1] += lub_f * O1C_vect.transpose()/ (4.0/3.0 *3.14* pow(r1,3));
 					flow.lubBodyStress[id2] += (-lub_f) *O2C_vect.transpose() / (4.0/3.0 *3.14* pow(r2,3));}
 			}
+
+			if (create_file){
+			  std::ofstream velocity_file("result_velocity.txt",ios::app);
+			  velocity_file << i << "\t" << deltaNormV * normal[0] << "\t" << deltaNormV * normal[1] << "\t" << deltaNormV * normal[2] << "\t" << deltaShearV[0] << "\t" << deltaShearV[1] << "\t" << deltaShearV[2] << "\t" << normal[0] << "\t" << normal[1] << "\t" << normal[2] << "\t" << max(surfaceDist, 0.) + eps*meanRad <<  endl;
+			  velocity_file.close(); }
 			  
-			if (affiche_force) cout<<"force tangentielle "<<visc_f<< " force normale "<< lub_f<<endl;
+			if (display_force) cout<<"force tangentielle "<<visc_f<< " force normale "<< lub_f<<endl;
 		}
 	}
 }
@@ -1100,7 +1104,8 @@
 // 	if ( !first && (useSolver==0 || fluidBulkModulus>0)) flow->Interpolate ( flow->T[!flow->currentTes], flow->T[flow->currentTes] );
 	
         if ( WaveAction ) flow->ApplySinusoidalPressure ( Tes.Triangulation(), sineMagnitude, sineAverage, 30 );
-        if (normalLubrication || shearLubrication) flow->computeEdgesSurfaces();
+
+        if (normalLubrication || shearLubrication || viscousShear) flow->computeEdgesSurfaces();
 	if ( Debug ) cout << endl << "end buildTri------" << endl << endl;
 }
 

=== modified file 'pkg/dem/FlowEngine.hpp'
--- pkg/dem/FlowEngine.hpp	2013-10-21 13:11:33 +0000
+++ pkg/dem/FlowEngine.hpp	2013-10-22 14:05:23 +0000
@@ -231,8 +231,7 @@
 					((int, ignoredBody,-1,,"Id of a sphere to exclude from the triangulation.)"))
 					((vector<int>, wallIds,vector<int>(6),,"body ids of the boundaries (default values are ok only if aabbWalls are appended before spheres, i.e. numbered 0,...,5)"))
 					((vector<bool>, boundaryUseMaxMin, vector<bool>(6,true),,"If true (default value) bounding sphere is added as function of max/min sphere coord, if false as function of yade wall position"))
-					((bool, affiche_vitesse, false,,"show the relative velocities between particles"))
-					((bool, affiche_force, false,,"show the lubrication force applied on particles"))
+					((bool, display_force, false,,"display the lubrication force applied on particles"))
 					((bool, create_file, false,,"create file of velocities"))
 					((bool, viscousShear, false,,"Compute viscous shear terms as developped by Donia Marzougui (FIXME: ref.)"))
 					((bool, shearLubrication, false,,"Compute shear lubrication force as developped by Brule (FIXME: ref.) "))