summaryrefslogtreecommitdiff
path: root/apps/adrian/poiseuille2d
diff options
context:
space:
mode:
authorAdrian Kummerlaender2019-01-16 15:06:20 +0100
committerAdrian Kummerlaender2019-06-24 15:17:09 +0200
commit3d447eb5e493c112682e69e5fcd5c91807fcc7fc (patch)
treec81f701b17b16a56e275f3a874932d8e04457583 /apps/adrian/poiseuille2d
parent08e0d597bbf9c6f4c43df071410b69812ac9a8e2 (diff)
downloadgrid_refinement_openlb-3d447eb5e493c112682e69e5fcd5c91807fcc7fc.tar
grid_refinement_openlb-3d447eb5e493c112682e69e5fcd5c91807fcc7fc.tar.gz
grid_refinement_openlb-3d447eb5e493c112682e69e5fcd5c91807fcc7fc.tar.bz2
grid_refinement_openlb-3d447eb5e493c112682e69e5fcd5c91807fcc7fc.tar.lz
grid_refinement_openlb-3d447eb5e493c112682e69e5fcd5c91807fcc7fc.tar.xz
grid_refinement_openlb-3d447eb5e493c112682e69e5fcd5c91807fcc7fc.tar.zst
grid_refinement_openlb-3d447eb5e493c112682e69e5fcd5c91807fcc7fc.zip
Rename example to match its content, extract poiseuille2d
Diffstat (limited to 'apps/adrian/poiseuille2d')
-rw-r--r--apps/adrian/poiseuille2d/poiseuille2d.cpp48
1 files changed, 8 insertions, 40 deletions
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<T,DESCRIPTOR>& grid)
sGeometry.rename(1,4,outflow);
}
- // Set material number for vertically centered obstacle
- {
- const Vector<T,2> origin {1.25, ly/2};
- IndicatorCircle2D<T> 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<T,DESCRIPTOR> coarseGrid(coarseCuboid, N, baseTau, Re);
prepareGeometry(coarseGrid);
- const Vector<T,2> fineExtend {3.0, 1.5};
- const Vector<T,2> fineOrigin {0.8, (ly-fineExtend[1])/2};
+ const Vector<T,2> fineExtend {2.0, 0.5};
+ const Vector<T,2> 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<T, DESCRIPTOR> fineSBoundaryCondition(fineGrid.getSuperLattice());
createLocalBoundaryCondition2D<T, DESCRIPTOR>(fineSBoundaryCondition);
- const Vector<T,2> fineExtend2 {0.6, 0.4};
- const Vector<T,2> 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<T, DESCRIPTOR> fineBulkDynamics2(
- fineGrid2.getConverter().getLatticeRelaxationFrequency(),
- instances::getBulkMomenta<T, DESCRIPTOR>());
-
- sOnLatticeBoundaryCondition2D<T, DESCRIPTOR> fineSBoundaryCondition2(fineGrid2.getSuperLattice());
- createLocalBoundaryCondition2D<T, DESCRIPTOR>(fineSBoundaryCondition2);
-
- prepareLattice(fineGrid2, fineBulkDynamics2, fineSBoundaryCondition2);
-
clout << "starting simulation..." << endl;
Timer<T> timer(
coarseGrid.getConverter().getLatticeTime(maxPhysT),
coarseGrid.getSuperGeometry().getStatistics().getNvoxel());
util::ValueTracer<T> 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();