← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-pkg/yade/git-trunk] Rev 3526: delta t for dynamic two-phase flow

 

------------------------------------------------------------
revno: 3526
committer: T Sweijen <thomasje100@xxxxxxxxxxx>
timestamp: Fri 2014-11-07 11:56:38 +0100
message:
  delta t for dynamic two-phase flow
modified:
  pkg/pfv/TwoPhaseFlowEngine.cpp
  pkg/pfv/TwoPhaseFlowEngine.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/pfv/TwoPhaseFlowEngine.cpp'
--- pkg/pfv/TwoPhaseFlowEngine.cpp	2014-11-04 09:40:01 +0000
+++ pkg/pfv/TwoPhaseFlowEngine.cpp	2014-11-07 10:56:38 +0000
@@ -49,17 +49,25 @@
     for (FiniteCellsIterator cell = tri.finite_cells_begin(); cell != cellEnd; cell++) {
       if(cell->info().id == ID){
     
-    double qout = 0.0, Vw = 0.0;
+    double qout = 0.0, Vw = 0.0, dt = 0.0;
     
     for(unsigned int ngb = 0; ngb < 4; ngb++)
     {
       //find out/influx of water
-       if(cell->neighbor(ngb)->info().isWRes){
+       if((cell->neighbor(ngb)->info().isWRes) && (cell->neighbor(ngb)->info().isFictious == 0)){
 	qout= qout + std::abs(cell->info().kNorm() [ngb])*(cell->info().p()-cell->neighbor ( ngb )->info().p()); 
        }
     }
    
-    Vw = (cell->info().saturation * cell->info().poreBodyVolume) - (qout * scene->dt);  
+    Vw = (cell->info().saturation * cell->info().poreBodyVolume) - (qout * scene->dt); 
+    
+    //Functionality to calculate the smallest time step
+    if((1e-16 < Vw) && (Vw < 1e16)){
+      if((1e-16 < qout) && (qout < 1e16)){
+	dt = (Vw / qout);
+	if(dt!=0.0){dtDynTPF = std::min(dt,dtDynTPF);}
+      }
+    }
     cell->info().saturation = Vw / cell->info().poreBodyVolume;
    
    
@@ -77,6 +85,7 @@
 }
 }
 
+
 void TwoPhaseFlowEngine:: computePoreCapillaryPressure(CellHandle cell)
 {
   //This formula relates the pore-saturation to the capillary-pressure, and the water-pressure

=== modified file 'pkg/pfv/TwoPhaseFlowEngine.hpp'
--- pkg/pfv/TwoPhaseFlowEngine.hpp	2014-11-04 09:55:54 +0000
+++ pkg/pfv/TwoPhaseFlowEngine.hpp	2014-11-07 10:56:38 +0000
@@ -119,7 +119,7 @@
 	((bool,initialWetting,true,,"Initial wetting saturated (=true) or non-wetting saturated (=false)"))
 	((bool, isPhaseTrapped,true,,"If True, both phases can be entrapped by the other, which would correspond to snap-off. If false, both phases are always connected to their reservoirs, thus no snap-off."))
 	((bool, drainageFirst, true,,"If true, activate drainage first (initial saturated), then imbibition; if false, activate imbibition first (initial unsaturated), then drainage."))
-
+	((double,dtDynTPF,0.0,,"Parameter which stores the smallest time step, based on the residence time"))
 
 	,/*TwoPhaseFlowEngineT()*/,
 	,