summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/adrian/cylinder2d/cylinder2d.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/apps/adrian/cylinder2d/cylinder2d.cpp b/apps/adrian/cylinder2d/cylinder2d.cpp
index b2ed6fc..094e548 100644
--- a/apps/adrian/cylinder2d/cylinder2d.cpp
+++ b/apps/adrian/cylinder2d/cylinder2d.cpp
@@ -206,6 +206,41 @@ void getResults(const std::string& prefix,
}
}
+void takeMeasurements(Grid2D<T,DESCRIPTOR>& grid)
+{
+ OstreamManager clout(std::cout,"measurement");
+
+ auto& sLattice = grid.getSuperLattice();
+ auto& sGeometry = grid.getSuperGeometry();
+ auto& converter = grid.getConverter();
+
+ SuperLatticePhysPressure2D<T,DESCRIPTOR> pressure(sLattice, converter);
+ AnalyticalFfromSuperF2D<T> intpolatePressure(pressure, true);
+ SuperLatticePhysDrag2D<T,DESCRIPTOR> drag(sLattice, sGeometry, 5, converter);
+
+ const T centerCylinderX = 2*cylinderD;
+ const T centerCylinderY = 2*cylinderD;
+ const T radiusCylinder = cylinderD/2;
+
+ const T point1[2] { centerCylinderX - radiusCylinder, centerCylinderY };
+ const T point2[2] { centerCylinderX + radiusCylinder, centerCylinderY };
+
+ T pressureInFrontOfCylinder, pressureBehindCylinder;
+ intpolatePressure(&pressureInFrontOfCylinder, point1);
+ intpolatePressure(&pressureBehindCylinder, point2);
+
+ clout << "pressure1=" << pressureInFrontOfCylinder;
+ clout << "; pressure2=" << pressureBehindCylinder;
+
+ T pressureDrop = pressureInFrontOfCylinder - pressureBehindCylinder;
+ clout << "; pressureDrop=" << pressureDrop;
+
+ const int input[3] {};
+ T _drag[drag.getTargetDim()] {};
+ drag(_drag, input);
+ clout << "; drag=" << _drag[0] << "; lift=" << _drag[1] << endl;
+}
+
int main(int argc, char* argv[])
{
olbInit(&argc, &argv);
@@ -297,6 +332,8 @@ int main(int argc, char* argv[])
timer.printStep();
coarseGrid.getSuperLattice().getStatistics().print(iT, coarseGrid.getConverter().getPhysTime(iT));
+
+ takeMeasurements(fineGrid3);
}
}