Direct numerical simulation was used to study laminar and turbulent flows in circular pipes with smoothly corrugated walls. The corrugation wavelength was kept constant at 0.419D, where D is the mean diameter of the wavy-wall pipe and the corrugation height was varied from zero to 0.08D. Flow rates were varied in steps between low values that generate laminar flow and higher values where the flow is in the post-transitional turbulent regime. Simulations in the turbulent regime were also carried out at a constant Reynolds number, Re τ = 314, for all corrugation heights. It was found that even in the laminar regime, larger-amplitude corrugations produce flow separation. This leads to the proportion of pressure drop attributable to pressure drag being approximately 50 %, and rising to approximately 85 % in transitional rough-wall flow. The near-wall structure of turbulent flow is seen to be heavily influenced by the effects of flow separation and reattachment. Farther from the wall, the statistical profiles examined exhibit behaviours characteristic of smooth-wall flows or distributed roughness rough-wall flows. These observations support Townsend's wall-similarity hypothesis. The organized nature of the present roughness allows the mean pressure drop to be written as a function of the corrugation height. When this is exploited in an analysis of the mean dynamical equation, the scaling problem is explicitly revealed to result from the combined influences of roughness and Reynolds number. The present results support the recent analysis and observations of Mehdi et al. (J. Fluid Mech., vol. 731, 2013, pp. 682-712), indicating that the length scale given by the distance from the wall at which the mean viscous force loses leading order is important to describing these combined influences, as well as providing a dynamically self-consistent connection to the scaling structure of smooth-wall pipe flow.