A function to compute flux-sum in COBRA