TEA. Using the system boundary described in Figure , costs for the construction, operation, and maintenance (O&M) of unit operations were calculated using equations detailed in Section S2. Calculated costs and revenue were leveraged in a discounted cash flow analysis with QSDsan's TEA class. To enable inter-system comparison, the levelized cost of COD removal (LC; defined as negative of annualized net present value divided by annual COD removal, in USD•tonne -1 COD removed) was calculated assuming a constant 5% discount rate and a 30-year project lifetime for all configurations. All monetary values were adjusted to 2021 US dollars.