The textbook Environmental Engineering by Gerard Kiely is a widely recognized resource that integrates engineering principles with ecological concepts. While it is a commercial publication, there are legitimate ways to access it digitally or find physical copies at a low cost. Amazon.com Legitimate Access and Free Previews Internet Archive
Before diving into pipes and treatment plants, Kiely establishes the scientific bedrock required for the subject.
Gerard Kiely’s text is a comprehensive introduction that bridges engineering and ecology. It is widely used by undergraduate students in civil, chemical, and environmental engineering.