yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #12929
[Branch ~yade-pkg/yade/git-trunk] Rev 3972: (FlowEngine) optionaly include/skip bounding cells when calculating the average pore pressure
------------------------------------------------------------
revno: 3972
committer: bchareyre <bruno.chareyre@xxxxxxxxxxxxxxx>
timestamp: Wed 2016-11-16 18:38:08 +0100
message:
(FlowEngine) optionaly include/skip bounding cells when calculating the average pore pressure
modified:
lib/triangulation/FlowBoundingSphere.hpp
lib/triangulation/FlowBoundingSphere.ipp
lib/triangulation/RegularTriangulation.h
pkg/pfv/FlowEngine.hpp.in
--
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 'lib/triangulation/FlowBoundingSphere.hpp'
--- lib/triangulation/FlowBoundingSphere.hpp 2016-10-24 11:17:04 +0000
+++ lib/triangulation/FlowBoundingSphere.hpp 2016-11-16 17:38:08 +0000
@@ -156,7 +156,7 @@
double getPorePressure (double X, double Y, double Z);
void measurePressureProfile(double WallUpy, double WallDowny);
double averageSlicePressure(double Y);
- double averagePressure();
+ double averagePressure(bool includeBoundaries);
int getCell (double X,double Y,double Z);
double boundaryFlux(unsigned int boundaryId);
void setBlocked(CellHandle& cell);
=== modified file 'lib/triangulation/FlowBoundingSphere.ipp'
--- lib/triangulation/FlowBoundingSphere.ipp 2016-11-16 09:53:52 +0000
+++ lib/triangulation/FlowBoundingSphere.ipp 2016-11-16 17:38:08 +0000
@@ -272,17 +272,17 @@
return P_ave;
}
template <class Tesselation>
-double FlowBoundingSphere<Tesselation>::averagePressure()
+double FlowBoundingSphere<Tesselation>::averagePressure(bool includeBoundaries)
{
RTriangulation& Tri = T[currentTes].Triangulation();
double P = 0.f, Ppond=0.f, Vpond=0.f;
int n = 0;
for (FiniteCellsIterator cell = Tri.finite_cells_begin(); cell != Tri.finite_cells_end(); cell++) {
- P+=cell->info().p();
- n++;
- Ppond+=cell->info().p()*cell->info().volume();
- Vpond+=cell->info().volume();
- }
+ if (includeBoundaries || cell->info().isReal()){
+ P+=cell->info().p();
+ n++;
+ Ppond+=cell->info().p()*cell->info().volume();
+ Vpond+=cell->info().volume();}}
P/=n;
Ppond/=Vpond;
return Ppond;
=== modified file 'lib/triangulation/RegularTriangulation.h'
--- lib/triangulation/RegularTriangulation.h 2016-11-16 09:53:52 +0000
+++ lib/triangulation/RegularTriangulation.h 2016-11-16 17:38:08 +0000
@@ -56,7 +56,7 @@
// Care to initialize it if you need it, there is no magic numbering to rely on
unsigned int id;
Real s;
- bool isFictious;
+ bool isFictious;//true if the cell has at least one fictious bounding sphere as a vertex
SimpleCellInfo (void) {isFictious=false; s=0;}
SimpleCellInfo& setPoint(const Point &p) { Point::operator= (p); return *this; }
SimpleCellInfo& setScalar(const Real &scalar) { s=scalar; return *this; }
=== modified file 'pkg/pfv/FlowEngine.hpp.in'
--- pkg/pfv/FlowEngine.hpp.in 2016-11-16 09:53:52 +0000
+++ pkg/pfv/FlowEngine.hpp.in 2016-11-16 17:38:08 +0000
@@ -204,7 +204,7 @@
if (index<0 || index>5) LOG_ERROR("index out of range (0-5)"); normal[max(0,min(5,index))]=v;}
double averageSlicePressure(double posY){return solver->averageSlicePressure(posY);}
- double averagePressure(){return solver->averagePressure();}
+ double averagePressure(bool includeBoundaries){return solver->averagePressure(includeBoundaries);}
void emulateAction(){
scene = Omega::instance().getScene().get();
@@ -342,7 +342,7 @@
.def("pressureProfile",&TemplateFlowEngine_@TEMPLATE_FLOW_NAME@::pressureProfile,(boost::python::arg("wallUpY"),boost::python::arg("wallDownY")),"Measure pore pressure in 6 equally-spaced points along the height of the sample")
.def("getPorePressure",&TemplateFlowEngine_@TEMPLATE_FLOW_NAME@::getPorePressure,(boost::python::arg("pos")),"Measure pore pressure in position pos[0],pos[1],pos[2]")
.def("averageSlicePressure",&TemplateFlowEngine_@TEMPLATE_FLOW_NAME@::averageSlicePressure,(boost::python::arg("posY")),"Measure slice-averaged pore pressure at height posY")
- .def("averagePressure",&TemplateFlowEngine_@TEMPLATE_FLOW_NAME@::averagePressure,"Measure averaged pore pressure in the entire volume")
+ .def("averagePressure",&TemplateFlowEngine_@TEMPLATE_FLOW_NAME@::averagePressure,(boost::python::arg("includeBoundaries")=true),"Measure averaged pore pressure in the entire volume, the cells adjacent to the boundaries are ignored if includeBoundaries=False")
.def("updateBCs",&TemplateFlowEngine_@TEMPLATE_FLOW_NAME@::updateBCs,"tells the engine to update it's boundary conditions before running (especially useful when changing boundary pressure - should not be needed for point-wise imposed pressure)")
.def("emulateAction",&TemplateFlowEngine_@TEMPLATE_FLOW_NAME@::emulateAction,"get scene and run action (may be used to manipulate an engine outside the timestepping loop).")
.def("getCell",&TemplateFlowEngine_@TEMPLATE_FLOW_NAME@::getCell,(boost::python::arg("pos")),"get id of the cell containing (X,Y,Z).")