Skip to content

Reply To: [Tutorial] – Cylinder 3d – Geometry beginner question

OpenLB – Open Source Lattice Boltzmann Code Forums on OpenLB General Topics [Tutorial] – Cylinder 3d – Geometry beginner question Reply To: [Tutorial] – Cylinder 3d – Geometry beginner question

#6379
Adrian
Keymaster

Yes, the physical simulation domain described by the cuboid geometry is slightly larger than the STL to ensure that the boundaries can be correctly represented as cells.

Specifically lines 336-337


  STLreader<T> stlReader( "cylinder3d.stl", converter.getConversionFactorLength(), 0.001 );
  IndicatorLayer3D<T> extendedDomain( stlReader, converter.getConversionFactorLength() );

extend the STL geometry by a single cell layer. This extended domain is then used as the input for constructing the actual cuboid geometry.

You are on point w.r.t. the reason for shifting the physical locations used for setting up the material geometry to fit physical locations. (First voxel layer as inflow, last as outflow and so on). It can be tricky to set this up in a way so that the material geometry relates to the input STL geometry as expected.

For the outflow the location [2.4925 0.0025 0.0025] is the origin of the outflow subdomain which extends [0.02 0.41 0.41] from there. This way only the last cell layer is changed from material 2 to 4 (line 96).

For the cylinder it is important not to mix up the physical indicator (IndicatorCuboid3d, line 101) used to select a subdomain of the material geometry with the actual cylinder. Notably the indicator cylinder is actually a cuboid here which works as the following rename call (line 102) only changes cells with material 2 to material 5, ignoring any bulk cells. This way the cylinder boundary is changed to material 5 (the entire STL boundary was previously set to material 2 in lines 74-75).

I hope that this helps! When getting started it can be useful to only execute parts of the geometry setup and check out the resulting material numbers in ParaView.