airBubbleCoalescence3d example: adding BounceBack BCs
OpenLB – Open Source Lattice Boltzmann Code › Forums › on OpenLB › General Topics › airBubbleCoalescence3d example: adding BounceBack BCs
- This topic has 2 replies, 2 voices, and was last updated 5 months, 3 weeks ago by luizeducze.
-
AuthorPosts
-
September 15, 2024 at 1:06 pm #9239mehrdadvasheghanifarahaniParticipant
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 FarahaniSeptember 30, 2024 at 2:16 pm #9311luizeduczeParticipantDear 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,
LuizSeptember 30, 2024 at 2:19 pm #9312luizeduczeParticipantAnother 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 -
AuthorPosts
- You must be logged in to reply to this topic.