Improved modelling of Boundary Conditions
The development and implementation of new boundary conditions is often times complicated in lbmpy. This issue should document problems that people face with implementing boundary conditions and should therefore function as a blueprint to improve this situation. As a first part, information that is often needed (but hard to extract in lbmpy) should be listed.
- Equilibrium: For many boundary conditions (UBB, Pressure, InterpolationBB) the equilibrium near to the wall needs to be computed. This is not trivial, because usually the equilibrium is given direction-wise in lbmpy thus a simple, and ugly solution is to use a large if cascade over with the direction index.
- Shear stress, drag etc: Wall models often need to take the shear drag. This goes into the same direction as the first point. Basically, it is important to be able to easily obtain the PDF values next to the wall to implement equations calculating this information.
- Wall distance: For wall models and interpolation boundary conditions, the distance to the wall needs to be known
- Normal direction: It should be easy, to obtain the normal direction to the wall (see: FreeSlip BC etc)
- Second neighbour: For more complex BC, more fluid cells needs to be taken into account (see: NoSlipLinearBouzidi). This might lead to complications for refinement algorithms etc.
- Information from previous timesteps: Some interpolation BC, need PDFs from precious timesteps (see: ExtrapolationOutflow)
-
Optimisation methods: Especially wall models, often rely on Newton steps to fit a certain velocity profile. Without
While
loops these can only be implemented by unrolling a fixed number of iterations
Furthermore, as stated in the book by Tim Krüger: "Despite the large number of methods available, all LB boundary conditions for straight boundaries belong to one of two groups: link-wise and wet-node". At the moment, all boundaries are formulated link-wise. While wet-node BC might not be superior they still make some problems easier to formulate and providing a good interface to support both would be easier for users who are more familiar with one or the other.