From 3d447eb5e493c112682e69e5fcd5c91807fcc7fc Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Wed, 16 Jan 2019 15:06:20 +0100 Subject: Rename example to match its content, extract poiseuille2d --- apps/adrian/poiseuille2d/poiseuille2d.cpp | 48 ++++++------------------------- 1 file changed, 8 insertions(+), 40 deletions(-) (limited to 'apps/adrian/poiseuille2d') diff --git a/apps/adrian/poiseuille2d/poiseuille2d.cpp b/apps/adrian/poiseuille2d/poiseuille2d.cpp index 7112f58..b6c2f52 100644 --- a/apps/adrian/poiseuille2d/poiseuille2d.cpp +++ b/apps/adrian/poiseuille2d/poiseuille2d.cpp @@ -37,10 +37,10 @@ typedef double T; #define DESCRIPTOR D2Q9Descriptor -const T lx = 8.0; // length of the channel -const T ly = 2.0; // height of the channel +const T lx = 4.0; // length of the channel +const T ly = 1.0; // height of the channel const int N = 50; // resolution of the model -const T Re = 200.; // Reynolds number +const T Re = 100.; // Reynolds number const T baseTau = 0.8; // Relaxation time of coarsest grid const T maxPhysT = 60.; // max. simulation time in s, SI unit const T physInterval = 0.25; // interval for the convergence check in s @@ -83,13 +83,6 @@ void prepareGeometry(Grid2D& grid) sGeometry.rename(1,4,outflow); } - // Set material number for vertically centered obstacle - { - const Vector origin {1.25, ly/2}; - IndicatorCircle2D obstacle(origin, 0.1); - sGeometry.rename(1,2,obstacle); - } - sGeometry.clean(); sGeometry.innerClean(); sGeometry.checkForErrors(); @@ -170,7 +163,7 @@ void getResults(const std::string& prefix, vtmWriter.createMasterFile(); } - if (iT%20==0) { + if (iT%100==0) { vtmWriter.write(iT); } @@ -195,8 +188,8 @@ int main(int argc, char* argv[]) Grid2D coarseGrid(coarseCuboid, N, baseTau, Re); prepareGeometry(coarseGrid); - const Vector fineExtend {3.0, 1.5}; - const Vector fineOrigin {0.8, (ly-fineExtend[1])/2}; + const Vector fineExtend {2.0, 0.5}; + const Vector fineOrigin {1.0, (ly-fineExtend[1])/2}; auto& fineGrid = coarseGrid.refine(fineOrigin, fineExtend); prepareGeometry(fineGrid); @@ -221,33 +214,14 @@ int main(int argc, char* argv[]) sOnLatticeBoundaryCondition2D fineSBoundaryCondition(fineGrid.getSuperLattice()); createLocalBoundaryCondition2D(fineSBoundaryCondition); - const Vector fineExtend2 {0.6, 0.4}; - const Vector fineOrigin2 {1.05, (ly-fineExtend2[1])/2}; - - auto& fineGrid2 = fineGrid.refine(fineOrigin2, fineExtend2); - prepareGeometry(fineGrid2); - - auto refinedOverlap2 = fineGrid2.getRefinedOverlap(); - fineGrid.getSuperGeometry().rename(1,0,*refinedOverlap2); - fineGrid.getSuperGeometry().rename(2,0,*refinedOverlap2); - prepareLattice(fineGrid, fineBulkDynamics, fineSBoundaryCondition); - BGKdynamics fineBulkDynamics2( - fineGrid2.getConverter().getLatticeRelaxationFrequency(), - instances::getBulkMomenta()); - - sOnLatticeBoundaryCondition2D fineSBoundaryCondition2(fineGrid2.getSuperLattice()); - createLocalBoundaryCondition2D(fineSBoundaryCondition2); - - prepareLattice(fineGrid2, fineBulkDynamics2, fineSBoundaryCondition2); - clout << "starting simulation..." << endl; Timer timer( coarseGrid.getConverter().getLatticeTime(maxPhysT), coarseGrid.getSuperGeometry().getStatistics().getNvoxel()); util::ValueTracer converge( - fineGrid2.getConverter().getLatticeTime(physInterval), + fineGrid.getConverter().getLatticeTime(physInterval), residuum); timer.start(); @@ -271,14 +245,8 @@ int main(int argc, char* argv[]) iT, timer, converge.hasConverged()); - getResults( - "fine2_", - fineGrid2, - iT, - timer, - converge.hasConverged()); - converge.takeValue(fineGrid2.getSuperLattice().getStatistics().getAverageEnergy(), true); + converge.takeValue(fineGrid.getSuperLattice().getStatistics().getAverageEnergy(), true); } timer.stop(); -- cgit v1.2.3