← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-pkg/yade/git-trunk] Rev 3984: further improvement of the cluster labeling in multiphase model

 

------------------------------------------------------------
revno: 3984
committer: bchareyre <bruno.chareyre@xxxxxxxxxxxxxxx>
timestamp: Mon 2016-12-19 17:47:50 +0100
message:
  further improvement of the cluster labeling in multiphase model
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	2016-11-25 17:09:35 +0000
+++ pkg/pfv/TwoPhaseFlowEngine.cpp	2016-12-19 16:47:50 +0000
@@ -634,7 +634,10 @@
 
 void TwoPhaseFlowEngine::clusterGetFacet(PhaseCluster* cluster, CellHandle cell, int facet) {
 	cell->info().hasInterface = true;
-	cluster->interfacialArea += std::abs(cell->info().poreThroatRadius[facet]);//FIXME: define area correctly
+	double interfArea = sqrt((cell->info().facetSurfaces[facet]*cell->info().facetFluidSurfacesRatio[facet]).squared_length());
+	cluster->interfaces.push_back(std::pair<std::pair<unsigned int,unsigned int>,double>(
+		std::pair<unsigned int,unsigned int>(cell->info().id,cell->neighbor(facet)->info().id),interfArea));
+	cluster->interfacialArea += interfArea;
 	if (cluster->entryRadius < cell->info().poreThroatRadius[facet]){
 		cluster->entryRadius = cell->info().poreThroatRadius[facet];
 		cluster->entryPore = cell->info().id;}

=== modified file 'pkg/pfv/TwoPhaseFlowEngine.hpp'
--- pkg/pfv/TwoPhaseFlowEngine.hpp	2016-11-25 17:09:35 +0000
+++ pkg/pfv/TwoPhaseFlowEngine.hpp	2016-12-19 16:47:50 +0000
@@ -66,12 +66,20 @@
 	public :
 		virtual ~PhaseCluster();
 		vector<TwoPhaseFlowEngineT::CellHandle> pores;
+		vector<std::pair<std::pair<unsigned int,unsigned int>,double> > interfaces;
 		TwoPhaseFlowEngineT::RTriangulation* tri;
-		void reset() {label=entryPore=-1;volume=entryRadius=interfacialArea=0; pores.clear();}
+		void reset() {label=entryPore=-1;volume=entryRadius=interfacialArea=0; pores.clear(); interfaces.clear();}
 		vector<int> getPores() { vector<int> res;
 			for (vector<TwoPhaseFlowEngineT::CellHandle>::iterator it =  pores.begin(); it!=pores.end(); it++) res.push_back((*it)->info().id);
 			return res;}
-		
+			
+		boost::python::list getInterfaces(unsigned int clusterId){
+			boost::python::list ints;
+			for (vector<std::pair<std::pair<unsigned int,unsigned int>,double> >::iterator it =  interfaces.begin(); it!=interfaces.end(); it++)
+				ints.append(boost::python::make_tuple(it->first.first,it->first.second,it->second));
+			return ints;
+		}
+
 		YADE_CLASS_BASE_DOC_ATTRS_INIT_CTOR_PY(PhaseCluster,Serializable,"Preliminary.",
 		((int,label,-1,,"Unique label of this cluster, should be reflected in pores of this cluster."))
 		((double,volume,0,,"cumulated volume of all pores."))
@@ -80,6 +88,7 @@
 		((double,interfacialArea,0,,"interfacial area of the cluster"))
 		,,,
 		.def("getPores",&PhaseCluster::getPores,"get the list of pores by index")
+		.def("getInterfaces",&PhaseCluster::getInterfaces,"get the list of interfacial pore-throats associated to a cluster, listed as [id1,id2,area] where id2 is the neighbor pore outside the cluster.")
 		)
 };
 REGISTER_SERIALIZABLE(PhaseCluster);