changed class to not store fluxes, compute residual on the fly