← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-pkg/yade/git-trunk] Rev 3434: -update with PFV

 

------------------------------------------------------------
revno: 3434
committer: Chao Yuan <chaoyuan2012@xxxxxxxxx>
timestamp: Tue 2014-06-24 15:22:21 +0200
message:
  -update with PFV
modified:
  CMakeLists.txt
  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 'CMakeLists.txt'
--- CMakeLists.txt	2014-06-23 16:21:06 +0000
+++ CMakeLists.txt	2014-06-24 13:22:21 +0000
@@ -502,7 +502,7 @@
 # Create header files for PFV from FlowEngine.hpp.in-template.
 # All @TEMPLATE_FLOW_NAME@ are replacing by a given names
 
-SET (TEMPLATE_FLOW_NAMES DFNFlowEngineT DummyFlowEngineT FlowEngineT FlowEngine_PeriodicInfo SoluteFlowEngineT)
+SET (TEMPLATE_FLOW_NAMES DFNFlowEngineT DummyFlowEngineT FlowEngineT FlowEngine_PeriodicInfo SoluteFlowEngineT UnsaturatedEngineT)
 FOREACH(TF ${TEMPLATE_FLOW_NAMES})
   SET (TEMPLATE_FLOW_NAME ${TF})
   CONFIGURE_FILE(pkg/pfv/FlowEngine.hpp.in "${CMAKE_BINARY_DIR}/pkg/pfv/FlowEngine_${TF}.hpp" @ONLY)

=== modified file 'pkg/pfv/UnsaturatedEngine.cpp'
--- pkg/pfv/UnsaturatedEngine.cpp	2014-06-16 12:28:34 +0000
+++ pkg/pfv/UnsaturatedEngine.cpp	2014-06-24 13:22:21 +0000
@@ -12,11 +12,11 @@
 //when you want it compiled, you can pass -DDFNFLOW to cmake, or just uncomment the following line
 #define UNSATURATED_FLOW
 #ifdef UNSATURATED_FLOW
-#define TEMPLATE_FLOW_NAME UnsaturatedEngineT
-#include <yade/pkg/pfv/FlowEngine.hpp>
+
+#include "FlowEngine_UnsaturatedEngineT.hpp"
 
 /// We can add data to the Info types by inheritance
-class UnsatCellInfo : public FlowCellInfo {
+class UnsatCellInfo : public FlowCellInfo_UnsaturatedEngineT {
   	public:
   	bool isWaterReservoir;
 	bool isAirReservoir;
@@ -35,13 +35,13 @@
 	}
 };
 
-class UnsatVertexInfo : public FlowVertexInfo {
+class UnsatVertexInfo : public FlowVertexInfo_UnsaturatedEngineT {
 //	add later;  
 public:
 // 	UnsatVertexInfo (void)
 };
 
-typedef TemplateFlowEngine<UnsatCellInfo,UnsatVertexInfo> UnsaturatedEngineT;
+typedef TemplateFlowEngine_UnsaturatedEngineT<UnsatCellInfo,UnsatVertexInfo> UnsaturatedEngineT;
 REGISTER_SERIALIZABLE(UnsaturatedEngineT);
 YADE_PLUGIN((UnsaturatedEngineT));
 
@@ -120,7 +120,7 @@
 					((double,surfaceTension,0.0728,,"Water Surface Tension in contact with air at 20 Degrees Celsius is: 0.0728(N/m)"))
 
 					((bool, computeForceActivated, true,,"Activate capillary force computation. WARNING: turning off means capillary force is not computed at all, but the drainage can still work."))
-					((bool, invadeBoundary, false,,"Invade from boundaries."))
+					((bool, isInvadeBoundary, false,,"Invade from boundaries."))
 					((int, windowsNo, 10,, "Number of genrated windows(or zoomed samples)."))
 					,,,
 					.def("saveVtk",&UnsaturatedEngine::saveVtk,(boost::python::arg("folder")="./VTK"),"Save pressure field in vtk format. Specify a folder name for output.")
@@ -162,7 +162,7 @@
 		buildTriangulation(pZero,*solver);//create a triangulation and initialize pressure in the elements, everything will be contained in "solver"
 		initializeCellIndex();//initialize cell index
 		updatePoreRadius();//save all pore radii before invade
-		updateTotalCellVolume();//save total volume of porous medium, considering different invading boundaries condition (invadeBoundary==True or False), aiming to calculate specific interfacial area.
+		updateTotalCellVolume();//save total volume of porous medium, considering different invading boundaries condition (isInvadeBoundary==True or False), aiming to calculate specific interfacial area.
 		updateVolumeCapillaryCell();//save capillary volume of all cells, for fast calculating saturation
 		computeSolidLine();//save cell->info().solidLine[j][y]
 	}
@@ -175,7 +175,7 @@
 		buildTriangulation(pZero,*solver);//create a triangulation and initialize pressure in the elements, everything will be contained in "solver"
 		initializeCellIndex();//initialize cell index
 		updatePoreRadius();//save all pore radii before invade
-		updateTotalCellVolume();//save total volume of porous medium, considering different invading boundaries condition (invadeBoundary==True or False), aiming to calculate specific interfacial area.
+		updateTotalCellVolume();//save total volume of porous medium, considering different invading boundaries condition (isInvadeBoundary==True or False), aiming to calculate specific interfacial area.
 		updateVolumeCapillaryCell();//save capillary volume of all cells, for fast calculating saturation
 		computeSolidLine();//save cell->info().solidLine[j][y]
 		solver->noCache = true;
@@ -183,6 +183,8 @@
 
 void UnsaturatedEngine::action()
 {
+/*
+  //the drainage is in quasi-static regime, so it can work outside Omega.  
     if ( !isActivated ) return;
     RTriangulation& tri = solver->T[solver->currentTes].Triangulation();
     if ( (tri.number_of_vertices()==0) || (updateTriangulation) ) {
@@ -192,7 +194,7 @@
         buildTriangulation(pZero,*solver);//create a triangulation and initialize pressure in the elements, everything will be contained in "solver"
         initializeCellIndex();//initialize cell index
         updatePoreRadius();//save all pore radii before invade
-        updateTotalCellVolume();//save total volume of porous medium, considering different invading boundaries condition (invadeBoundary==True or False), aiming to calculate specific interfacial area.
+        updateTotalCellVolume();//save total volume of porous medium, considering different invading boundaries condition (isInvadeBoundary==True or False), aiming to calculate specific interfacial area.
         updateVolumeCapillaryCell();//save capillary volume of all cells, for calculating saturation
         computeSolidLine();//save cell->info().solidLine[j][y]
         solver->noCache = true;
@@ -208,7 +210,7 @@
     for ( FiniteVerticesIterator V_it = solver->T[solver->currentTes].Triangulation().finite_vertices_begin(); V_it !=  vertices_end; V_it++ ) {
         force = pressureForce ? Vector3r ( V_it->info().forces[0],V_it->info().forces[1],V_it->info().forces[2] ): Vector3r(0,0,0);
         scene->forces.addForce ( V_it->info().id(), force); }}
-}
+*/}
 
 void UnsaturatedEngine::initializeCellIndex()
 {
@@ -243,7 +245,7 @@
     FiniteCellsIterator cellEnd = tri.finite_cells_end();
     totalCellVolume=0;
     
-    if(invadeBoundary==true) {
+    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 totalCellVolume
@@ -294,7 +296,7 @@
 ///invade mode 1. update phase reservoir before invasion. Consider no viscous effects, and invade gradually.
 void UnsaturatedEngine::invadeSingleCell1(CellHandle cell, double pressure)
 {
-    if (invadeBoundary==true) {
+    if (isInvadeBoundary==true) {
         for (int facet = 0; facet < 4; facet ++) {
             if (solver->T[solver->currentTes].Triangulation().is_infinite(cell->neighbor(facet))) continue;
             if (cell->neighbor(facet)->info().Pcondition) continue;
@@ -356,7 +358,7 @@
     updatePressureReservoir();
     double nextEntry = 1e50;
     RTriangulation& tri = solver->T[solver->currentTes].Triangulation();
-    if (invadeBoundary==true) {
+    if (isInvadeBoundary==true) {
         FiniteCellsIterator cellEnd = tri.finite_cells_end();
         for ( FiniteCellsIterator cell = tri.finite_cells_begin(); cell != cellEnd; cell++ ) {
             if (cell->info().isAirReservoir == true) {
@@ -500,7 +502,7 @@
     double airVolume = 0.0; 	//air volume
     FiniteCellsIterator cellEnd = tri.finite_cells_end();
 
-    if (invadeBoundary==true) {
+    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
@@ -526,7 +528,7 @@
     FiniteCellsIterator cellEnd = tri.finite_cells_end();
     double interfacialArea=0;
 
-    if (invadeBoundary==true) {
+    if (isInvadeBoundary==true) {
         for ( FiniteCellsIterator cell = tri.finite_cells_begin(); cell != cellEnd; cell++ ) {
             if (cell->info().Pcondition==true) continue;//NOTE:reservoirs cells interfacialArea should not be included.
             if (cell->info().isAirReservoir==true) {
@@ -553,7 +555,7 @@
 ///invade mode 2. Consider no trapped phase.
 void UnsaturatedEngine::invadeSingleCell2(CellHandle cell, double pressure)
 {
-    if (invadeBoundary==true) {
+    if (isInvadeBoundary==true) {
         for (int facet = 0; facet < 4; facet ++) {
             if (solver->T[solver->currentTes].Triangulation().is_infinite(cell->neighbor(facet))) continue;
             if (cell->neighbor(facet)->info().Pcondition) continue;
@@ -606,7 +608,7 @@
     RTriangulation& tri = solver->T[solver->currentTes].Triangulation();
     FiniteCellsIterator cellEnd = tri.finite_cells_end();
 
-    if (invadeBoundary==true) {
+    if (isInvadeBoundary==true) {
         for ( FiniteCellsIterator cell = tri.finite_cells_begin(); cell != cellEnd; cell++ ) {
             if (cell->info().p()!=0) {
                 for (int facet=0; facet<4; facet ++) {
@@ -641,7 +643,7 @@
     double waterVolume = 0.0;
     FiniteCellsIterator cellEnd = tri.finite_cells_end();
 
-    if (invadeBoundary==true) {
+    if (isInvadeBoundary==true) {
         for ( FiniteCellsIterator cell = tri.finite_cells_begin(); cell != cellEnd; cell++ ) {
             if (tri.is_infinite(cell)) continue;
             if (cell->info().Pcondition) continue;
@@ -666,7 +668,7 @@
     FiniteCellsIterator cellEnd = tri.finite_cells_end();
     double interfacialArea=0;
 
-    if (invadeBoundary==true) {
+    if (isInvadeBoundary==true) {
         for ( FiniteCellsIterator cell = tri.finite_cells_begin(); cell != cellEnd; cell++ ) {
             if (cell->info().Pcondition==true) continue;//NOTE:reservoirs cells interfacialArea should not be included.
             if (cell->info().p()!=0) {
@@ -1162,7 +1164,7 @@
     double airVolume = 0.0; 	//air volume
     FiniteCellsIterator cellEnd = tri.finite_cells_end();
 
-    if (invadeBoundary==true) {
+    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
@@ -1188,7 +1190,7 @@
     double capillaryVolume = 0.0;
     double waterVolume = 0.0;
     FiniteCellsIterator cellEnd = tri.finite_cells_end();
-    if (invadeBoundary==true) {
+    if (isInvadeBoundary==true) {
         for ( FiniteCellsIterator cell = tri.finite_cells_begin(); cell != cellEnd; cell++ ) {
             if (tri.is_infinite(cell)) continue;
             if (cell->info().Pcondition) continue;