Characterization of wettability in porous media using the lattice boltzmann method