Skip to content

ShanChen multicomponents + outflow boundary

OpenLB – Open Source Lattice Boltzmann Code Forums on OpenLB General Topics ShanChen multicomponents + outflow boundary

  • This topic has 2 replies, 2 voices, and was last updated 1 year ago by Marie.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #7622

    Dear all,

    I discovered LBM 4 months ago for my internship and after trying to implement it by myself, luckily I found OpenLB. I’ve been trying to understand LBM and OpenLB on my own, so maybe I misunderstood something…
    I am trying to simulate two fluids of different viscosity, with an inflow with a set velocity and two passive outflows.
    I use a ShanChen coupling between two lattices, with ForcedBGK dynamics and setLocalVelocity for the inflow: this works, but then the fluid accumulates and the density rises, so I want to add one or two passive outflows. I tried setLocalPressure, setInterpolatedPressure, setZouHePressure, setInterpolatedConvection… Nothing works, I get -nan for the density everywhere. Is what I am trying to do possible? Should I completely switch to the FreeEnergy dynamics, like in the microFluidics example? Should I update by hand the densities in the pressure boundaries at each time steps?

    Thank you!


    Hi Marie!

    The boundary conditions that you used for the outflow should work. When setting boundary conditions while using a multi-component/multi-phase force like Shan-Chen, make sure that your boundary nodes have an appropriate component/fluid density or pseudopotential.
    For example, the default value for a component density on a boundary node is zero which can cause problems in some pseudopotential functions (these you can look up in /src/dynamics/interactionPotential.h).
    This is also the reason, why there are boundary conditions defined specifically for the freeEnergy model.
    Hope, this helps a bit and just ask again in case you got another question.

    Kind regards


    Hi Tim,

    Thank you a lot for your explanations! I do initialize the boundary nodes correctly, I think (I input the densities found at equilibrium, just like for the rest of the setup), but the problem might be in the corners (I put weird densities in the bounceback boundary next to it, to simulate hydrophobicity). I’ll try to investigate it from there.


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