We propose the design of a tubular phononic crystal (TPC) for the purpose of sensing the physical properties of a liquid filling the hollow part of the tube. The TPC is constituted by a periodic repetition of washers along a hollow pipe with the advantage of avoiding any perturbation of a flowing fluid by any element inside the tube. Using finite element simulations, we demonstrate the existence of complete as well as polarization dependent bandgaps inside which one can design localized modes associated with defects. The most sensitive cavity to the liquid sound velocity is found to be constituted by a Fabry-Perot (F-P) cavity. The signature of the cavity modes can be detected as peaks or dips in the transmission spectrum as well as at the external surface of the cavity. We study the dramatic effect of the liquid viscosity, more particularly shear viscosity, on these features and discuss the conditions for their practical observation. A TPC test sample made of a polymer is fabricated by means of 3D printing and characterized without the liquid by transmission measurements. The comparison with the simulations showed the necessity of considering the damping of the polymer whose effect on the transmission features is discussed. Our sensor design can find many applications at different scales in several systems transporting a fluid, as microfluidic channels in micro and nanotechnology, syringe in medicine, or pipe lines in civil engineering.