mass balance calculations