A device for optimizing the anaerobic digestion of biomass and/or animal manure, and possibly to recover biogas for energy production. Digester types include batch, complete mix, continuous flow (horizontal or plug-flow, multiple-tank, and vertical tank), ...