← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-pkg/yade/git-trunk] Rev 3919: Store an information about active liquid contacts.

 

------------------------------------------------------------
revno: 3919
committer: Anton Gladky <gladky.anton@xxxxxxxxx>
timestamp: Mon 2014-04-14 16:11:53 +0200
message:
  Store an information about active liquid contacts.
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-04-12 14:12:48 +0000
+++ pkg/dem/ViscoelasticCapillarPM.cpp	2014-04-14 14:11:53 +0000
@@ -82,6 +82,7 @@
    
   if (not(phys.liqBridgeCreated) and phys.Capillar and geom.penetrationDepth>=0) {
     phys.liqBridgeCreated = true;
+    phys.liqBridgeActive = false;
     Sphere* s1=dynamic_cast<Sphere*>(bodies[id1]->shape.get());
     Sphere* s2=dynamic_cast<Sphere*>(bodies[id2]->shape.get());
     if (s1 and s2) {
@@ -97,6 +98,11 @@
   
   if (geom.penetrationDepth<0) {
     if (phys.liqBridgeCreated and -geom.penetrationDepth<phys.sCrit and phys.Capillar) {
+      if (not(phys.liqBridgeActive)) {
+        phys.liqBridgeActive=true;
+        VLiqBridg += phys.Vb;
+        NLiqBridg += 1;
+      }
       phys.normalForce = -phys.CapFunct(geom, phys)*geom.normal;
       if (I->isActive) {
         addForce (id1,-phys.normalForce,scene);
@@ -104,11 +110,21 @@
       };
       return;
     } else {
+      if (phys.liqBridgeActive) {
+        VLiqBridg += -phys.Vb;
+        NLiqBridg += -1;
+      }
       scene->interactions->requestErase(I);
       return;
     };
   };
   
+  if (phys.liqBridgeActive) {
+    phys.liqBridgeActive=false;
+    VLiqBridg += -phys.Vb;
+    NLiqBridg += -1;
+  }
+  
   if (I->isActive) {
     
     Vector3r torque1 = Vector3r::Zero();

=== modified file 'pkg/dem/ViscoelasticCapillarPM.hpp'
--- pkg/dem/ViscoelasticCapillarPM.hpp	2014-04-12 14:12:48 +0000
+++ pkg/dem/ViscoelasticCapillarPM.hpp	2014-04-14 14:11:53 +0000
@@ -26,6 +26,7 @@
 	YADE_CLASS_BASE_DOC_ATTRS_CTOR(ViscElCapPhys,ViscElPhys,"IPhys created from :yref:`ViscElCapMat`, for use with :yref:`Law2_ScGeom_ViscElCapPhys_Basic`.",
 		((bool,Capillar,false,,"True, if capillar forces need to be added."))
 		((bool,liqBridgeCreated,false,,"Whether liquid bridge was created, only after a normal contact of spheres"))
+		((bool,liqBridgeActive,false,, "Whether liquid bridge is active at the moment"))
 		((Real,sCrit,false,,"Critical bridge length [m]"))
 		((Real,Vb,NaN,,"Liquid bridge volume [m^3]"))
 		((Real,gamma,NaN,,"Surface tension [N/m]"))
@@ -61,7 +62,13 @@
 		static Real None_f                (const ScGeom& geom, ViscElCapPhys& phys);
 		Real critDist(const Real& Vb, const Real& R, const Real& Theta);
 	FUNCTOR2D(ScGeom,ViscElCapPhys);
-	YADE_CLASS_BASE_DOC(Law2_ScGeom_ViscElCapPhys_Basic,LawFunctor,"Extended version of Linear viscoelastic model with capillary parameters.");
+	YADE_CLASS_BASE_DOC_ATTRS_CTOR_PY(Law2_ScGeom_ViscElCapPhys_Basic,LawFunctor,"Extended version of Linear viscoelastic model with capillary parameters.",
+		((OpenMPAccumulator<Real>,VLiqBridg,,Attr::noSave,"The total volume of liquid bridges"))
+		((OpenMPAccumulator<int>, NLiqBridg,,Attr::noSave,"The total number of liquid bridges"))
+		,/* ctor */
+		,/* py */
+		;
+	)
 	DECLARE_LOGGER;
 };
 REGISTER_SERIALIZABLE(Law2_ScGeom_ViscElCapPhys_Basic);