Simualtion of droplet motion

I want to write bounce back condition for channel in 3d in which fluid flows in z direction from top (+z)to bottom (-z)

can any body help me in writing code for D3Q19 lattice model for bounce back condition …