Skip to content

airBubbleCoalescence3d example: adding BounceBack BCs

OpenLB – Open Source Lattice Boltzmann Code Forums on OpenLB General Topics airBubbleCoalescence3d example: adding BounceBack BCs

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #9239

    Dear OpenLB community,

    I am trying to run the airBubbleCoalescence3d example with solid boundaries at the top and bottom by adding bounce-back boundary conditions. Following the approach from the rayleighTaylor3d example, I made the following modifications:

    i) in the prepareGeometry function:

    superGeometry.rename( 0,1 );

    Vector<T,3> origin1( -2. );
    Vector<T,3> origin2( -2., N/2., -2. );
    Vector<T,3> origin3( -2., N-1., -2. );
    Vector<T,3> extend1( N+3., 2., N+3. );
    Vector<T,3> extend2( N+3., N/2+2., N+3. );

    IndicatorCuboid3D<T> bottom( extend1, origin1 );
    IndicatorCuboid3D<T> top( extend1, origin3 );

    superGeometry.rename( 1,3,bottom );
    superGeometry.rename( 1,4,top );

    superGeometry.clean();

    This sets material numbers 3 and 4 for the bottom and top boundaries, respectively, while the bulk fluid remains as material 1.

    ii) in the simulate function:

    // set periodic boundaries to the domain
    cGeometry.setPeriodicity( true, false, true );

    So, I disable the peiodicity in y-direction.

    iii) in prepareLattice function:

    sLattice1.defineDynamics<BulkDynamics>(superGeometry, 3);
    sLattice2.defineDynamics<BulkDynamics>(superGeometry, 3);

    sLattice1.defineDynamics<BulkDynamics>(superGeometry, 4);
    sLattice2.defineDynamics<BulkDynamics>(superGeometry, 4);

    setBounceBackBoundary(sLattice1, superGeometry, 3);
    setBounceBackBoundary(sLattice1, superGeometry, 4);
    setBounceBackBoundary(sLattice2, superGeometry, 3);
    setBounceBackBoundary(sLattice2, superGeometry, 4);

    and also:

    sLatticeOne.defineRho(superGeometry, 3, rhoH2O);
    sLatticeTwo.defineRho(superGeometry, 4, rhoH2O);

    sLatticeOne.defineRho(superGeometry, 4, rhoN2);
    sLatticeTwo.defineRho(superGeometry, 3, rhoN2);

    This ensures that the bounceback nodes have densities required to impose the wettability.

    However, when I run the simulation, I get NaN values. Could you please advise if any further modifications are needed to correctly implement the bounce-back nodes? I believe I’m implementing something incorrectly in step (iii).

    Kind Regards,
    Mehrdad Vasheghani Farahani

    #9311
    luizeducze
    Participant

    Dear Farahani,

    I tried to simulate here the same example with your modifications and it worked. However, I did the simulation using lattice1 for H2O, lattice2 for N2 and lattice3 for O2. Are you trying to simulate just H2O and N2? I will try to disable the O2 phase and see if it breaks.

    Kind regards,
    Luiz

    #9312
    luizeducze
    Participant

    Another thing …

    You dont need those lines:

    sLattice1.defineDynamics<BulkDynamics>(superGeometry, 3);
    sLattice2.defineDynamics<BulkDynamics>(superGeometry, 3);

    sLattice1.defineDynamics<BulkDynamics>(superGeometry, 4);
    sLattice2.defineDynamics<BulkDynamics>(superGeometry, 4);

    When you use the setBounceBack, you are already applying the correct dynamics to the boundary nodes.

    Did you applied BulkDynamics for the material number 1?

    Kind regards,
    Luiz

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