Skip to content

Usage of ParticleDynamics2D::checkAndRemoveEscaped() in dkt2d.cpp

OpenLB – Open Source Lattice Boltzmann Code Forums on OpenLB General Topics Usage of ParticleDynamics2D::checkAndRemoveEscaped() in dkt2d.cpp

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #4703
    guojuw
    Participant

    Dear OLB developers:

    I would like to use “ParticleDynamics2D<T, DESCRIPTOR>::checkAndRemoveEscaped()” in the example “dkt2d.cpp”.

    My purpose is to remove the particles when they settle to the bottom:

    1. Change the column bottom boundary condition to be pressure specified, instead of bounce-back type (which is used in the original code).

    2. Change line #230 in “dkt2d.cpp” to be
    ” bool escapeFromDomain = true;
    bool oldWallCollision = false;
    Vector<T, 2> orig0(0,-converter.getPhysDeltaX() *1);
    Vector<T, 2> ext0(lengthX,converter.getPhysDeltaX()*1);
    std::shared_ptr<IndicatorF2D<T>> colBase = std::make_shared<IndicatorCuboid2D<T>>( ext0, orig0 );
    ParticleDynamics2D<T, DESCRIPTOR> particle(sLattice, converter, superGeometry, colBase,escapeFromDomain,oldWallCollision, accExt);”

    However, the particles are not expected to be removed when they settle to the bottom.
    Can you please provide an example and validate the code “ParticleDynamics2D<T, DESCRIPTOR>::checkAndRemoveEscaped()”?

    Regards,
    Junwei Guo

    #4741
    Nicolas
    Participant

    Dear Junwei Guo,

    as forwarded from our developer Davide Dapelo, who implemented the function:

    ParticleDynamics2D::checkAndRemoveEscaped() removes a particle IF the intersection between the particle’s indicator and the domain’s inner layer is non-empty.

    Most likely you misunderstood the function of indicatorF in ParticleDyamics2D’s constructor, since you defined it as the indicator of the domain’s bottom layer (colBase), BUT in fact it should be the whole domain. Following your definition, colBase’s inner layer is just a zero-height layer, and therefore its intersection with any particle indicator is always empty.

    The solution to this problem should simply be to change colBase with a whole domain indicator:
    Vector orig0(0,0);
    Vector ext0(lengthX,lengthY);

    If that does not work (but it should), you should define a tighter indicator.

    Best wishes,

    Nicolas

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