summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Kummerlaender2019-02-01 14:31:01 +0100
committerAdrian Kummerlaender2019-06-24 15:17:09 +0200
commit9248f0c5bff6ba04a838ebe94a4a4e925d38530e (patch)
tree4025cc2885d089831d0d126900ea7dfa988d54c4
parent87f0b74b54a67d3838950e78214978ac2472589e (diff)
downloadgrid_refinement_openlb-9248f0c5bff6ba04a838ebe94a4a4e925d38530e.tar
grid_refinement_openlb-9248f0c5bff6ba04a838ebe94a4a4e925d38530e.tar.gz
grid_refinement_openlb-9248f0c5bff6ba04a838ebe94a4a4e925d38530e.tar.bz2
grid_refinement_openlb-9248f0c5bff6ba04a838ebe94a4a4e925d38530e.tar.xz
grid_refinement_openlb-9248f0c5bff6ba04a838ebe94a4a4e925d38530e.zip
Report pressure drop and lift of refined cylinder
-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);
}
}