All perfect fluid spacetimes with a purely electric Weyl tensor are shown to have an alignment between the fluid 4-velocity and a canonical null tetrad determined by the Weyl tensor. If, in addition, it is assumed that the flow is irrotational, the eigenframes of the shear and Weyl tensors coincide. In all but two rather special cases, it is proved that the vectors of this eigenframe are hypersurface orthogonal and consequently that a coordinate system exists in which the metric, shear and Eab (the electric part of the Weyl tensor) are all diagonal. Geodesic Petrov type D spacetimes are shown to be either Bianchi type 1 or to belong to the class of solutions considered by Szekeres (1975) and Szafron (1977). The Allnutt solutions (1982) are shown to be the only purely electric type D fields in which the shear is non-degenerate and in which the acceleration vector lies in the plane spanned by the principal null vectors. The field equations are partially integrated in two classes where no solutions are yet known.