← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-pkg/yade/git-trunk] Rev 3989: Add particleconserve parameter to LiqControl.

 

------------------------------------------------------------
revno: 3989
committer: Anton Gladky <gladky.anton@xxxxxxxxx>
timestamp: Tue 2014-05-27 13:24:16 +0200
message:
  Add particleconserve parameter to LiqControl.
modified:
  pkg/dem/ViscoelasticCapillarPM.cpp
  pkg/dem/ViscoelasticCapillarPM.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/ViscoelasticCapillarPM.cpp'
--- pkg/dem/ViscoelasticCapillarPM.cpp	2014-05-08 05:57:04 +0000
+++ pkg/dem/ViscoelasticCapillarPM.cpp	2014-05-27 11:24:16 +0000
@@ -118,8 +118,12 @@
         NLiqBridg -= 1;
       }
       #ifdef YADE_LIQMIGRATION
-        const intReal B1={id1, phys.Vb/2.0};
-        const intReal B2={id2, phys.Vb/2.0};
+        if (phys.Vb > 0.0 and ((phys.Vf1+phys.Vf2) == 0.0)) {
+          phys.Vf1 = phys.Vb/2.0;
+          phys.Vf2 = phys.Vb/2.0;
+        }
+        const intReal B1={id1, phys.Vf1};
+        const intReal B2={id2, phys.Vf2};
         scene->delIntrs.push_back(B1);
         scene->delIntrs.push_back(B2);
       #endif
@@ -411,6 +415,13 @@
     addBodyMapReal(bodyUpdateLiquid, id2, -Vf2);
     
     Vb->Vb = Vrup;
+    if (particleconserve) {
+      Vb->Vf1 = Vf1;
+      Vb->Vf2 = Vf2;
+    } else {
+      Vb->Vf1 = Vrup/2.0;
+      Vb->Vf2 = Vrup/2.0;
+    }
   }
   
   scene->addIntrs.clear();
@@ -462,8 +473,19 @@
         if(!((*it).second) or !(((*it).second)->isReal()))  continue;
         ViscElCapPhys* physT=dynamic_cast<ViscElCapPhys*>(((*it).second)->phys.get());
         if (physT->Vb<physT->Vmax) {
-          liqVolShr += (physT->Vmax - physT->Vb)*FillLevel;
-          physT->Vb += (physT->Vmax - physT->Vb)*FillLevel;
+          const Real addVolLiq =  (physT->Vmax - physT->Vb)*FillLevel;
+          liqVolShr += addVolLiq;
+          physT->Vb += addVolLiq;
+          if (particleconserve) {
+            if (((*it).second)->getId1() == (*it).first) {
+              physT->Vf1+=addVolLiq;
+            } else if (((*it).second)->getId2() == (*it).first) {
+              physT->Vf2+=addVolLiq;
+            }
+          } else {
+            physT->Vf1+=addVolLiq/2.0;
+            physT->Vf2+=addVolLiq/2.0;
+          }
         }
       }
       return;

=== modified file 'pkg/dem/ViscoelasticCapillarPM.hpp'
--- pkg/dem/ViscoelasticCapillarPM.hpp	2014-05-23 13:20:43 +0000
+++ pkg/dem/ViscoelasticCapillarPM.hpp	2014-05-27 11:24:16 +0000
@@ -35,6 +35,8 @@
 		((CapType,CapillarType,None_Capillar,,"Different types of capillar interaction: Willett_numeric, Willett_analytic, Weigert, Rabinovich, Lambert, Soulie"))
 #ifdef YADE_LIQMIGRATION
 		((Real,Vmax,0.0,,"Maximal liquid bridge volume [m^3]"))
+		((Real,Vf1,0.0,, "Liquid which will be returned to the 1st body after rupture [m^3]"))
+		((Real,Vf2,0.0,, "Liquid which will be returned to the 2nd body after rupture [m^3]"))
 #endif
 		,
 		createIndex();
@@ -95,6 +97,7 @@
 		((Real,liqVolRup,0.,, "Liquid volume (integral value), which has been freed after rupture occured, [m^3]."))
 		((Real,liqVolShr,0.,, "Liquid volume (integral value), which has been shared among of contacts, [m^3]."))
 		((Real,vMaxCoef,0.03,, "Coefficient for vMax, [-]."))
+		((bool,particleconserve,false,, "If True, the particle will have the same liquid volume during simulation e.g. liquid will not migrate [false]."))
 		,/* ctor */
 		,/* py */
 		.def("totalLiq",&LiqControl::totalLiqVol,(boost::python::arg("mask")=0),"Return total volume of water in simulation.")