Skip to content

About the distance between the boundary node and stl in “setBouzidiBoundary”

OpenLB – Open Source Lattice Boltzmann Code Forums on OpenLB General Topics About the distance between the boundary node and stl in “setBouzidiBoundary”

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #7977
    Yuji
    Participant

    Hello openLB team,

    I look up the distance the boundary node and stl using in setBouzidiBoundar.
    In the example/cylinder3d, I set “verbose=true” in setBouzidiBoundary.h, charPhysLength =100 and STLreader<T> stlReader( “cylinder3d.stl”, converter.getConversionFactorLength(), 1,2,true ); in main.cpp.
    At the boundary point (552.5, 197.5, 207.5), the variable “dist” in setBouzidiBoundary.h has the even longer distance than the length between stl and the boundary node I cheked using Paraview.

    Why does it occur and are there any advise to fix it?

    Best regardes,
    Yuji

    #7981
    Adrian
    Keymaster

    Such artifacts are most likely caused due to a misalignment of the STL indicator and the cell discretization. How did you mark the interior of the STL file in the material geometry?

    Just to be sure: Did you take into consideration that the Bouzidi boundary distances are computed in lattice units while the distance you see in Paraview is in physical units?

    #7983
    Yuji
    Participant

    Thank you for your reply.

    How did you mark the interior of the STL file in the material geometry?
    >> I did same cpp file in example/cylinder3d because I used it.

    Just to be sure: Did you take into consideration that the Bouzidi boundary distances are computed in lattice units while the distance you see in Paraview is in physical units?
    >> Yes I did.

    #7986
    Adrian
    Keymaster

    Ok, so the main changes are A) the characteristic length and B) the STL file?

    This difference between expected distance and some lattice positions could be caused by the different approaches being used to evaluate the STL for geometry construction: The material geometry only considers whether the cell position is “inside” the STL (evaluated via the underlying Octree in STLreader::operator()) while the distance between a given position and the STL-defined surface along a given direction (which is what the Bouzidi setter uses) is done via a different approach in STLreader::distance (ray tracing and additional handling of boundary cases).

    In general matching STL meshes and LBM lattices is a non-trivial problem. For a quick workaround you can e.g. tweak the discretization width and the shift between mesh and STL origin. We can take a look at your exact setup and figure out a more general solution together.

    #7988
    Yuji
    Participant

    Thank you for your comments.
    I have understood the conncept of stlreader;) I cannot understand this codes in detail though.

    For your questions,
    A) Yes, I changed the characteristic length to 100 from 0.1.
    B) No, I did not changed the stl file. I just replaced the arguments from STLreader<T> stlReader( "cylinder3d.stl", converter.getConversionFactorLength(), 0.001 ); to stlReader( “cylinder3d.stl”, converter.getConversionFactorLength(), 1,2,true )

    Thank you for your supports.

    #7989
    Adrian
    Keymaster

    I was not talking about the concept of the STL reader but the likely reason for the outlier distance you observe and a possible workaround until we have the time to take a look in more detail.

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