From 9248f0c5bff6ba04a838ebe94a4a4e925d38530e Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Fri, 1 Feb 2019 14:31:01 +0100 Subject: Report pressure drop and lift of refined cylinder --- apps/adrian/cylinder2d/cylinder2d.cpp | 37 +++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'apps/adrian/cylinder2d') 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& grid) +{ + OstreamManager clout(std::cout,"measurement"); + + auto& sLattice = grid.getSuperLattice(); + auto& sGeometry = grid.getSuperGeometry(); + auto& converter = grid.getConverter(); + + SuperLatticePhysPressure2D pressure(sLattice, converter); + AnalyticalFfromSuperF2D intpolatePressure(pressure, true); + SuperLatticePhysDrag2D 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); } } -- cgit v1.2.3