Discrete conformal variations and scalar curvature on piecewise flat two and three dimensional manifolds