LBM for modeling cavities with curved and moving boundaries