Skip to content

Reply To: IndicatorCuboid2D : Need extra Explanation


Dear at8i,

in case you are not yet familiar with the C++ syntax standardly used in OpenLB, please have a look at introductory books/tutorials for C++ programming and our User Guide.
Then start with compiling, and running the most simplified examples (e.g. laminar, single-phase flows in simple geometries) offered in the latest OpenLB release.

The Example section in the current User Guide should help you with understanding the purpose of each sample code (e.g.: geometry primitives, which are necessary for your code snippet above).
You could then identify the example which is most suitable as a basis for extension towards your own application and have a detailed look on that.

Please note, that we unfortunately cannot debug your code within this forum, but we can however assist you in doing that by yourself.

In that sense, I’ll provide hints and try to answer your questions below.

– The .rename function is simply “renaming” the material numbers assigned to the voxels in your geometry, under (if any are specified) certain indicator constraints. These material numbers are then used as specifiers to be assigned with e.g. different boundary or initial conditions.
– Please use the doxygen documentation to double-check the arguments for renaming and indicator functions.
– First part (origin): Let me explain that via perceiving the 2D cuboid as a planar rectangle. The origin vector comprises the location of the lower left corner of the cuboid. The extend in turn is then the vector which is added to the origin to obtain the upper right corner of the cuboid. The center of the rectangle is then subsequently defined as “origin + 1/2 * extend”, and the angle theta is the rotation (counter-clockwise) which can addtionally be specified.
– Circular boundary: (1) Yes, please have a look at an example with a circular geometry. An incremental search in the olb folder for indicatorCircle2D / 3D should lead you to the specific sections. Copy or code along the syntax of your geometry and boundary conditions from that application after you made sure that it does what you want. (2) That should work, yes, however make sure to hit the nodes correctly with your indicator function (i.e. maybe you should consider a larger distance between the circles than one lattice unit or add a buffer distance e.g. half a lattice unit). (3) You can add multiphysics models in OpenLB in the same manner as the dynamics which are currently implemented. This of course requires knowledge in: C++, LBM for the actual model, and OpenLB in terms of code structure. From my point of view (I am not an expert in Fortran) realizing the same LB algorithm from scratch in Fortran should take you way longer than implementing it in OpenLB.

Hopefully, I could help you a bit.
In case you have further questions, please let me know.