← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-pkg/yade/git-trunk] Rev 3439: -fix getWindowsSaturations.

 

------------------------------------------------------------
revno: 3439
committer: Chao Yuan <chaoyuan2012@xxxxxxxxx>
timestamp: Fri 2014-06-27 17:09:33 +0200
message:
  -fix getWindowsSaturations.
modified:
  pkg/pfv/UnsaturatedEngine.cpp


--
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/pfv/UnsaturatedEngine.cpp'
--- pkg/pfv/UnsaturatedEngine.cpp	2014-06-26 16:45:50 +0000
+++ pkg/pfv/UnsaturatedEngine.cpp	2014-06-27 15:09:33 +0000
@@ -97,9 +97,9 @@
 		void savePhaseVtk(const char* folder);
 		//temp functions
 		void initializeCellWindowsID();
-		double getWindowsSaturation(int windowsID);
-		double getWindowsSaturation1(int i);
-		double getWindowsSaturation2(int i);
+		double getWindowsSaturation(int i);
+// 		double getWindowsSaturation1(int i);
+// 		double getWindowsSaturation2(int i);
 		double getRadiusMin(CellHandle cell, int j);
 		void debugTemp();
 		bool checknoCache() {return solver->noCache;}
@@ -332,7 +332,7 @@
                 invadeSingleCell(nCell, pressure);}}}
 }
 
-///invade mode 1. update phase reservoir before invasion. Consider no viscous effects, and invade gradually.
+///invade mode 1: withTrap
 void UnsaturatedEngine::invade1()
 {
     ///update Pw, Pn according to reservoirInfo.
@@ -420,7 +420,7 @@
     }
 }
 
-///invade mode 2. Consider no trapped phase.
+///invade mode 2: withoutTrap
 void UnsaturatedEngine::invade2()
 {
     ///update Pw, Pn according to reservoirInfo.
@@ -918,73 +918,27 @@
     }
 }
 
-double UnsaturatedEngine::getWindowsSaturation(int windowsID)
-{
-    RTriangulation& tri = solver->T[solver->currentTes].Triangulation();
-    FiniteCellsIterator cellEnd = tri.finite_cells_end();
-    for ( FiniteCellsIterator cell = tri.finite_cells_begin(); cell != cellEnd; cell++ ) {
-      if (cell->info().windowsID==0) {cerr<<"Please initialize windowsID"<<endl;break;}
-    }
-    if (isPhaseTrapped) {
-        return getWindowsSaturation1(windowsID);
-    }
-    else {
-        return getWindowsSaturation2(windowsID);
-    }
-}
-double UnsaturatedEngine::getWindowsSaturation1(int i)
-{
-    RTriangulation& tri = solver->T[solver->currentTes].Triangulation();
+double UnsaturatedEngine::getWindowsSaturation(int i)
+{
     double capillaryVolume = 0.0; //total capillary volume
     double airVolume = 0.0; 	//air volume
+    RTriangulation& tri = solver->T[solver->currentTes].Triangulation();
     FiniteCellsIterator cellEnd = tri.finite_cells_end();
 
-    if (isInvadeBoundary==true) {
-        for ( FiniteCellsIterator cell = tri.finite_cells_begin(); cell != cellEnd; cell++ ) {
-            if (tri.is_infinite(cell)) continue;
-            if (cell->info().Pcondition) continue;//NOTE:reservoirs cells should not be included in saturation
-	    if (cell->info().windowsID != i) continue;
-            capillaryVolume = capillaryVolume + cell->info().capillaryCellVolume;
-            if (cell->info().isAirReservoir==true) {
-                airVolume = airVolume + cell->info().capillaryCellVolume;}}}
-    else {
-        for ( FiniteCellsIterator cell = tri.finite_cells_begin(); cell != cellEnd; cell++ ) {
-            if (tri.is_infinite(cell)) continue;
-            if (cell->info().Pcondition) continue;
-            if (cell->info().isFictious) continue;
-	    if (cell->info().windowsID != i) continue;
-            capillaryVolume = capillaryVolume + cell->info().capillaryCellVolume;
-            if (cell->info().isAirReservoir==true) {
-                airVolume = airVolume + cell->info().capillaryCellVolume;}}}
+    for ( FiniteCellsIterator cell = tri.finite_cells_begin(); cell != cellEnd; cell++ ) {
+        if (tri.is_infinite(cell)) continue;
+        if (cell->info().Pcondition) continue;
+        if ( (cell->info().isFictious) && (!isInvadeBoundary) ) continue;
+        if (cell->info().windowsID != i) continue;
+        capillaryVolume = capillaryVolume + cell->info().capillaryCellVolume;
+        if (cell->info().p()==bndCondValue[3]) {
+            airVolume = airVolume + cell->info().capillaryCellVolume;
+        }
+    }
     double saturation = 1 - airVolume/capillaryVolume;
     return saturation;
 }
-double UnsaturatedEngine::getWindowsSaturation2(int i)
-{
-    RTriangulation& tri = solver->T[solver->currentTes].Triangulation();
-    double capillaryVolume = 0.0;
-    double waterVolume = 0.0;
-    FiniteCellsIterator cellEnd = tri.finite_cells_end();
-    if (isInvadeBoundary==true) {
-        for ( FiniteCellsIterator cell = tri.finite_cells_begin(); cell != cellEnd; cell++ ) {
-            if (tri.is_infinite(cell)) continue;
-            if (cell->info().Pcondition) continue;
-	    if (cell->info().windowsID != i) continue;
-            capillaryVolume = capillaryVolume + cell->info().capillaryCellVolume;
-            if (cell->info().p()==0) {
-                waterVolume = waterVolume + cell->info().capillaryCellVolume;}}}
-    else {
-        for ( FiniteCellsIterator cell = tri.finite_cells_begin(); cell != cellEnd; cell++ ) {
-            if (tri.is_infinite(cell)) continue;
-            if (cell->info().Pcondition) continue;
-            if (cell->info().isFictious) continue;
-	    if (cell->info().windowsID != i) continue;
-            capillaryVolume = capillaryVolume + cell->info().capillaryCellVolume;
-            if (cell->info().p()==0) {
-                waterVolume = waterVolume + cell->info().capillaryCellVolume;}}}
-    double saturation = waterVolume/capillaryVolume;
-    return saturation;
-}//----------end temp functions for comparison with experiment-------------------
+//--------------end of comparison with experiment----------------------------
 
 ///compute forces
 void UnsaturatedEngine::computeSolidLine()