The numerical simulation of three-dimensional flow through or around hydraulic structures