The influence of local fluid flow and the microstructure on elastic and anelastic rock properties