Viscosity measurement of non-Newtonian fluids in pressure-driven flows of general geometries based on energy dissipation rate