Carbonization of biomass in constant-volume reactors