Flow of materials in ecosystem