Produced water and flowback water recycling