  Pressure (density) and velocity boundary conditions inside a flow domain are
studied for 2-D and 3-D lattice Boltzmann BGK models (LBGK) and a new method to
specify these conditions are proposed. These conditions are constructed in
consistency of the wall boundary condition based on an idea of bounceback of
non-equilibrium distribution. When these conditions are used together with the
improved incompressible LBGK model by Zou et al., the simulation results
recover the analytical solution of the plane Poiseuille flow driven by pressure
(density) difference with machine accuracy. Since the half-way wall bounceback
boundary condition is very easy to implement and was shown theoretically to
give second-order accuracy for the 2-D Poiseuille flow with forcing, it is used
with pressure (density) inlet/outlet conditions proposed in this paper and in
Chen et al. to study the 2-D Poiseuille flow and the 3-D square duct flow. The
numerical results are approximately second-order accurate. The magnitude of the
error of the half-way wall bounceback is comparable with that using some other
published boundary conditions. Besides, the bounceback condition has a much
better stability behavior than that of other boundary conditions.
