Skip to content

adding more cylinders in Cylinder3D

OpenLB – Open Source Lattice Boltzmann Code Forums on OpenLB General Topics adding more cylinders in Cylinder3D

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #8879

    Dear OpenLB Team,

    Please provide me some suggestions regarding the changes required in the Cylinder3D code where I can add multiple cylinders in the simulation model. What are the changes needed in the code to add multiple cylinders.

    Thank you


    You neet to adapt the geometry setup to include another cylinder indicator (e.g. using indicator arithmetic for constructive solid geometry to build your domain). The user guide lessons provide a starting point for this.


    Thank you for the suggestion. I am provoding a code snippet below. Is this the way I need to implement it? Is it correct? Please reply,

    void prepareGeometry(UnitConverter<T, DESCRIPTOR> const& converter, IndicatorF3D<T>& indicator,
    STLreader<T>& stlReader, SuperGeometry<T, 3>& superGeometry)
    // … (existing code)

    // Set material number for additional cylinders
    origin[0] = superGeometry.getStatistics().getMinPhysR(2)[0] + 2 * converter.getConversionFactorLength();
    extend[0] = (superGeometry.getStatistics().getMaxPhysR(2)[0] – superGeometry.getStatistics().getMinPhysR(2)[0]) / 2.;

    // Create additional cylinder indicators
    std::shared_ptr<IndicatorF3D<T>> cylinder2 = std::make_shared<IndicatorCuboid3D<T>>(extend, origin);
    superGeometry.rename(2, 6, cylinder2); // Material number 6

    std::shared_ptr<IndicatorF3D<T>> cylinder3 = std::make_shared<IndicatorCuboid3D<T>>(extend, origin);
    superGeometry.rename(2, 7, cylinder3); // Material number 7

    // Removes all not needed boundary voxels outside the surface


    clout << “Prepare Geometry … OK” << std::endl;


    You can test its correctness — for detailed support I reffer to

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.