A solver for massively parallel direct numerical simulation of three-dimensional multiphase flows