Skip to content

Compilation error

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
  • #7483

    Dear OpenLB community,

    My simulation is about fluid past a sphere in the channel,and the geometry is acquired from a.stl file.The compilation error as follow:
    sphere3d: ../../../src/functors/analytical/indicator/indicatorF3D.hh:615: olb::IndicatorCuboid3D<T>::IndicatorCuboid3D(olb::Vector<T, 3>, olb::Vector<T, 3>) [with S = double]: Assertion `_xLength>0 && _yLength>0 && _zLength>0′ failed. Aborted (core dumped).
    what should I do?



    This assertion error (the compilation worked, this is a runtime problem) is most likely caused by either a too large deltaX (s.t. not even a single cell width is required to cover one of the axes of the STL) or, more likely, that the scaling of the STL is not set correctly. To fix this you should 1) check what the base unit of your STL is and 2) set the T stlSize parameter of the STLreader constructor accordingly (in SI meters). I hope this helps!


    Dear Adrian,

    Thankyou for your reply.



    Dear Adrian,

    The characteristic length ( the radius of sphere) D= 0.02m, resolution N=20, so the deltaX=0.001m,the size of Computational domain is 15D*8D*8D. The basic unit of my STL is mm,so I set stlsize=0.001.I think there is no problem .
    Then I checked indicatorF3D.hh,from line 621 to line 624:
    621IndicatorCuboid3D<S>::IndicatorCuboid3D(Vector<S,3> extend, Vector<S,3> origin)
    622 : _center(origin+.5*extend),_xLength(extend[0]), _yLength(extend[1]), _zLength(extend[2])
    624 assert(_xLength>0 && _yLength>0 && _zLength>0);
    As _xLength= extend[0], _yLength= extend[1], _zLength= extend[2],the assertion error may caused by the component coordinates of the vector extend, at least one of them is zero or negative value.
    So I replaced the original cylinder3d.stl file in the example cylinder3d with the exact same model created by the modeling software CROE, and the same assertion error occurred.
    It looks like that the source of the error seems to be caused by offset of coordinate systems between OpenLB and CROE, so what should I do?



    So you are basing this on the examples/laminar/cylinder3d example case? If so, have you compared the STL placement between the original file and your geometry (e.g. open both in ParaView at the same time). At a glance, the code is written in a offset agnostic style so for further support I’d need to see the full code and the STL.

    Ali Fauze

    Hello Adrian,

    I have the same problem, but I verified my STL file using blender, and also in my output, the MinPhysR is equal to my min node, and the same for the MaxPhysR, and y PhysDeltaX=0.00125 m. And I tried to define my vectors manually, and then getting the statistics from the simulation. Then I tried also both definition of the IndicatorCuboid3D (olb::IndicatorCuboid3D< S >::IndicatorCuboid3D ( Vector< S, 3 > extend,Vector< S, 3 > origin ) and this one
    olb::IndicatorCuboid3D< S >::IndicatorCuboid3D ( S xlength, S ylength, S zlength, Vector< S, 3 > center )) and always I have the same error.
    Do you have any suggestion to fixe the problem?

    Best Regards

    Ali Fauze

    Following is my PrepareGeometry function

    void prepareGeometry(SuperGeometry<T,3>& superGeometry, ThermalUnitConverter<T, NSDESCRIPTOR, TDESCRIPTOR> &converter, IndicatorF3D <T> &indicator, STLreader <T> &stlReader)
    OstreamManager clout (cout, “prepareGeometry”);
    clout << “Prepare Geometrry ..” << endl;

    superGeometry.rename (0, 1, indicator);
    superGeometry.rename (1, 2, stlReader);

    superGeometry.clean ();
    Vector<T, 3> origini = superGeometry.getStatistics().getMinPhysR(1);
    //origin[1] += converter.getConversionFactorLength() / 2.;
    //origin[2] += converter.getConversionFactorLength() / 2.;

    Vector<T, 3> extendi = superGeometry.getStatistics().getMaxPhysR(1);
    //extend[1] = extend[1] – origin[1] – converter.getConversionFactorLength()/2.;
    //extend[2] = extend[2] – origin[2] – converter.getConversionFactorLength()/2.;
    //IndicatorCuboid3D<T> inlet({-0.1, -0.1, 0.0}, {0.1,0.1,0.0});
    extendi[0] = superGeometry.getStatistics().getMaxPhysR(1)[0];
    extendi[1] = superGeometry.getStatistics().getMaxPhysR(1)[1];
    extendi[2] = superGeometry.getStatistics().getMinPhysR(1)[2];

    //IndicatorCuboid3D<T> outlet({-0.1, -0.1, 10.0}, {0.1, 0.1, 10.0});
    Vector<T, 3> origino = superGeometry.getStatistics().getMinPhysR(1);
    origino[2] = superGeometry.getStatistics().getMaxPhysR(1)[2];
    Vector<T, 3> extendo = superGeometry.getStatistics().getMaxPhysR(1);

    //IndicatorCuboid3D<T> heated_face({-0.1, -0.1, 0.0}, {-0.10, 0.1, 10.0});
    Vector<T, 3> originh = superGeometry.getStatistics().getMinPhysR(1);
    Vector<T, 3> extendh = superGeometry.getStatistics().getMaxPhysR(1);
    extendh[0] = superGeometry.getStatistics().getMinPhysR(1)[0];

    clout << “inlet origin ” << origini << “inlet extend” << extendi
    << “outlet origin” << origino << “outlet extend” << extendo
    << “heated face origin” << originh << “heated face extend” << extendh
    << endl;
    IndicatorCuboid3D<T> inlet(extendi, origini);
    superGeometry.rename(2, 3, 1, inlet);
    IndicatorCuboid3D<T> outlet(extendo, origino);
    superGeometry.rename(2, 4, 1, outlet);
    IndicatorCuboid3D<T> heated_face(extendh, originh);
    superGeometry.rename(2, 5, 1, heated_face);

    superGeometry.clean ();
    superGeometry.innerClean ();
    superGeometry.checkForErrors ();

    superGeometry.print ();
    clout << “Prepare Geometry … OK” << endl;
    I would like also to put a part of my output but i’am blocked.

    Ali Fauze

    Dear community,

    I resolved the problem using the functor IndicatorCircle3D.


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