← Back to team overview

yade-dev team mailing list archive

[svn] r1532 - in trunk/pkg/dem: Engine/DeusExMachina Engine/EngineUnit PreProcessor

 

Author: eudoxos
Date: 2008-09-30 12:29:52 +0200 (Tue, 30 Sep 2008)
New Revision: 1532

Modified:
   trunk/pkg/dem/Engine/DeusExMachina/TriaxialCompressionEngine.cpp
   trunk/pkg/dem/Engine/DeusExMachina/TriaxialCompressionEngine.hpp
   trunk/pkg/dem/Engine/EngineUnit/InteractingFacet2InteractingSphere4SpheresContactGeometry.cpp
   trunk/pkg/dem/PreProcessor/TriaxialTest.cpp
   trunk/pkg/dem/PreProcessor/TriaxialTest.hpp
Log:
A few fixes in TriaxialTest:
1. radiusStdDev is a registered attribute parameter
2. skip unloading phase if sigmaLateralConfinement==sigmaIsoCompaction
3. new bool autoUnload, that controls automaticity of going from compaction to unloading; autocompressionActivation controls from unloading to loading.
Note: IFacet2IS4SCG is broken, but not yet fixed. 



Modified: trunk/pkg/dem/Engine/DeusExMachina/TriaxialCompressionEngine.cpp
===================================================================
--- trunk/pkg/dem/Engine/DeusExMachina/TriaxialCompressionEngine.cpp	2008-09-29 06:37:41 UTC (rev 1531)
+++ trunk/pkg/dem/Engine/DeusExMachina/TriaxialCompressionEngine.cpp	2008-09-30 10:29:52 UTC (rev 1532)
@@ -38,8 +38,10 @@
 	FinalIterationPhase1 = 0;
 	Iteration = 0;
 	testEquilibriumInterval = 20;
-	//compressionActivated=false;
+
+	autoUnload=true;
 	autoCompressionActivation=true;
+
 	UnbalancedForce = 1;
 	saveSimulation = false;
 	firstRun=true;
@@ -147,12 +149,16 @@
 
 		if ( UnbalancedForce<=StabilityCriterion && abs ( ( meanStress-sigma_iso ) /sigma_iso ) <0.005 )
 		{
-			if ( currentState==STATE_ISO_COMPACTION && autoCompressionActivation )
-			{
-				doStateTransition (ncb, STATE_ISO_UNLOADING ); /*update stress and strain here*/ computeStressStrain ( ncb );
+			// only go to UNLOADING if it is needed (hard float comparison... :-| )
+			if ( currentState==STATE_ISO_COMPACTION && autoUnload && sigmaLateralConfinement!=sigmaIsoCompaction ) {
+				doStateTransition (ncb, STATE_ISO_UNLOADING );
+				computeStressStrain ( ncb ); // update stress and strain
 			}
-			else if ( currentState==STATE_ISO_UNLOADING && autoCompressionActivation )
-			{
+			else if(currentState==STATE_ISO_COMPACTION && autoCompressionActivation){
+				doStateTransition (ncb, STATE_TRIAX_LOADING );
+				computeStressStrain ( ncb ); // update stress and strain
+			}
+			else if ( currentState==STATE_ISO_UNLOADING && autoCompressionActivation ) {
 				doStateTransition (ncb, STATE_TRIAX_LOADING ); computeStressStrain ( ncb );
 			}
 			// huh?! this will never happen, because of the first condition...

Modified: trunk/pkg/dem/Engine/DeusExMachina/TriaxialCompressionEngine.hpp
===================================================================
--- trunk/pkg/dem/Engine/DeusExMachina/TriaxialCompressionEngine.hpp	2008-09-29 06:37:41 UTC (rev 1531)
+++ trunk/pkg/dem/Engine/DeusExMachina/TriaxialCompressionEngine.hpp	2008-09-30 10:29:52 UTC (rev 1532)
@@ -24,20 +24,26 @@
 
 /** \brief Class for controlling optional initial isotropic compaction and subsequent triaxial test with constant lateral stress and constant axial strain rate.
  *
- * The engine is a state machine with the following states (and automatic transitions):
+ * The engine is a state machine with the following states; transitions my be automatic, see below.
  *
  * 1. STATE_ISO_COMPACTION: isotropic compaction (compression) until
  *    the prescribed mean pressue sigmaIsoCompaction is reached and the packing is stable.
  *    The compaction happens either by straining the walls (!internalCompaction)
- *    or by growing size of grains (internalCompaction)
+ *    or by growing size of grains (internalCompaction).
  * 2. STATE_ISO_UNLOADING: isotropic unloading from the previously reached state, until
- *    the mean pressure sigmaLateralConfinement is reached (and stabilizes)
+ *    the mean pressure sigmaLateralConfinement is reached (and stabilizes).
+ *    NOTE: this state will be skipped if sigmaLateralConfinement == sigmaIsoCompaction.
  * 3. STATE_TRIAX_LOADING: confined uniaxial compression:
  *		constant sigmaLateralConfinement is kept at lateral walls (left, right, front, back), while
  * 	top and bottom walls load the packing in their axis (by straining), until the value of epsilonMax
  * 	(deformation along the loading axis) is reached. At this point, the simulation is stopped.
  * 4. STATE_TRIAX_LIMBO: currently unused, since simulation is hard-stopped in the previous state.
  *
+ * Transition from COMPACTION to UNLOADING is done automatically if autoUnload==true;
+ * Transition from (UNLOADING to LOADING) or from (COMPACTION to LOADING: if UNLOADING is skipped) is
+ *   done automatically if autoCompressionActivation=true;
+ * Both autoUnload and autoCompressionActivation are true by default.
+ *
  */
 
 class TriaxialCompressionEngine : public TriaxialStressController
@@ -92,8 +98,11 @@
 		std::string Key;//A code that is appended to file names to help distinguish between different simulations
 		// //! Is uniaxial compression currently activated?
 		// bool compressionActivated;
-		//! Auto-switch between isotropic and uniaxial compression?
+		//! Auto-switch from isotropic compaction or unloading state (if sigmaLateralConfinement<sigmaIsoCompaction)
+		// to uniaxial compression
 		bool autoCompressionActivation;
+		//! Auto-switch from isotropic compaction to unloading
+		bool autoUnload;
 				
 		virtual void applyCondition(MetaBody * ncb);
 		void updateParameters(MetaBody * ncb);

Modified: trunk/pkg/dem/Engine/EngineUnit/InteractingFacet2InteractingSphere4SpheresContactGeometry.cpp
===================================================================
--- trunk/pkg/dem/Engine/EngineUnit/InteractingFacet2InteractingSphere4SpheresContactGeometry.cpp	2008-09-29 06:37:41 UTC (rev 1531)
+++ trunk/pkg/dem/Engine/EngineUnit/InteractingFacet2InteractingSphere4SpheresContactGeometry.cpp	2008-09-30 10:29:52 UTC (rev 1532)
@@ -122,6 +122,7 @@
 				scm->cp2rel.Align(Vector3r::UNIT_X,se32.orientation.Conjugate()*(-normal));
 				scm->cp1rel.Normalize(); scm->cp2rel.Normalize();
 			}
+			cerr<<"[n"<<scm->displacementN()<<" t"<<scm->displacementT()<<"]";
 		}
 
 		return true;

Modified: trunk/pkg/dem/PreProcessor/TriaxialTest.cpp
===================================================================
--- trunk/pkg/dem/PreProcessor/TriaxialTest.cpp	2008-09-29 06:37:41 UTC (rev 1531)
+++ trunk/pkg/dem/PreProcessor/TriaxialTest.cpp	2008-09-30 10:29:52 UTC (rev 1532)
@@ -138,6 +138,7 @@
 	maxWallVelocity=10;
 	StabilityCriterion = 0.01;
 	autoCompressionActivation = true;
+	autoUnload = true;
 	maxMultiplier = 1.01;
 	finalMaxMultiplier = 1.001;
 	
@@ -158,6 +159,8 @@
 	wallOversizeFactor=1.3;
 
 	biaxial2dTest=false;
+
+	radiusStdDev=0.3;
 	
 //	wall_top_id =0;
 // 	wall_bottom_id =0;
@@ -188,6 +191,7 @@
 	REGISTER_ATTRIBUTE(biaxial2dTest);
 	REGISTER_ATTRIBUTE(maxMultiplier);
 	REGISTER_ATTRIBUTE(finalMaxMultiplier);
+	REGISTER_ATTRIBUTE(radiusStdDev);
 
 	REGISTER_ATTRIBUTE(sphereYoungModulus);
 	REGISTER_ATTRIBUTE(spherePoissonRatio);
@@ -211,6 +215,7 @@
 	REGISTER_ATTRIBUTE(maxWallVelocity);
 	REGISTER_ATTRIBUTE(StabilityCriterion);
 	REGISTER_ATTRIBUTE(autoCompressionActivation);
+	REGISTER_ATTRIBUTE(autoUnload);
 //	REGISTER_ATTRIBUTE(wall_top);
 //	REGISTER_ATTRIBUTE(wall_bottom);
 //	REGISTER_ATTRIBUTE(wall_1);
@@ -381,7 +386,7 @@
 	
 	vector<BasicSphere> sphere_list;
 	if(importFilename!="") sphere_list=Shop::loadSpheresFromFile(importFilename,lowerCorner,upperCorner);
-	else message+=GenerateCloud(sphere_list, lowerCorner, upperCorner, numberOfGrains, 0.3, 0.75);
+	else message+=GenerateCloud(sphere_list, lowerCorner, upperCorner, numberOfGrains, radiusStdDev, 0.75);
 	
 	vector<BasicSphere>::iterator it = sphere_list.begin();
 	vector<BasicSphere>::iterator it_end = sphere_list.end();
@@ -594,6 +599,7 @@
 	triaxialcompressionEngine->strainRate = strainRate;
 	triaxialcompressionEngine->StabilityCriterion = StabilityCriterion;
 	triaxialcompressionEngine->autoCompressionActivation = autoCompressionActivation;
+	triaxialcompressionEngine->autoUnload = autoUnload;
 	triaxialcompressionEngine->internalCompaction = internalCompaction;
 	triaxialcompressionEngine->maxMultiplier = maxMultiplier;
 	triaxialcompressionEngine->finalMaxMultiplier = finalMaxMultiplier;

Modified: trunk/pkg/dem/PreProcessor/TriaxialTest.hpp
===================================================================
--- trunk/pkg/dem/PreProcessor/TriaxialTest.hpp	2008-09-29 06:37:41 UTC (rev 1531)
+++ trunk/pkg/dem/PreProcessor/TriaxialTest.hpp	2008-09-30 10:29:52 UTC (rev 1532)
@@ -73,7 +73,8 @@
 				StabilityCriterion,
 				maxMultiplier, ///max multiplier of diameters during internal compaction
 				finalMaxMultiplier,
-				wallOversizeFactor; // make walls bigger (/smaller) than necessary by this factor
+				wallOversizeFactor,
+				radiusStdDev; // make walls bigger (/smaller) than necessary by this factor
 
 		bool		 wall_top
 				,wall_bottom
@@ -89,6 +90,8 @@
 				,wall_4_wire
 				//! do we just want to generate a stable packing under isotropic pressure (false) or do we want the triaxial loading to start automatically right after compaction stage (true)?
 				,autoCompressionActivation
+				//! see docs for TriaxialCompressionEngine and TriaxialCompressionEngine::autoUnload
+				,autoUnload
 			
 				,rotationBlocked
 				,spheresRandomColor