Skip to content

Reply To: Incorrect geometry creation – forward-facing 2D step

OpenLB – Open Source Lattice Boltzmann Code Forums on OpenLB Bug Reports Incorrect geometry creation – forward-facing 2D step Reply To: Incorrect geometry creation – forward-facing 2D step


Thanks for your detailed report!

We are aware of this problem and it will be fixed in our next release.
See the following patch for a solution:

Date: Fri, 5 Jun 2020 16:54:38 +0200
Subject: [PATCH] Fix bstep2d material number setup

_Implicit_ geometry modelling by approximating the step shape using the
cuboids themselves only works if we have enought cuboids to start with.

The material numbers were set correctly in e.g. olb 1.2. It probably got
lost somewhere along the introduction of managed functor arithmetic.

examples/laminar/bstep2d/bstep2d.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff –git a/examples/laminar/bstep2d/bstep2d.cpp b/examples/laminar/bstep2d/bstep2d.cpp
index f6359164e..83faa3093 100644
— a/examples/laminar/bstep2d/bstep2d.cpp
+++ b/examples/laminar/bstep2d/bstep2d.cpp
@@ -85,7 +85,7 @@ SuperGeometry2D<T> prepareGeometry( UnitConverter<T,DESCRIPTOR> const& converter
SuperGeometry2D<T> superGeometry( *cuboidGeometry, *loadBalancer, 2 );

// material numbers from zero to 2 inside geometry defined by indicator
– superGeometry.rename( 0,2 );
+ superGeometry.rename( 0,2, *(channel-step) );
superGeometry.rename( 2,1,1,1 );

Vector<T,2> extendBC( 0,ly0 );


It works for larger cuboid numbers as the block decomposition can then approximate the step geometry as the unification of multiple cuboids. For single cuboid setups we have to use material numbers.