## 2 Materials and Methods
### Analytical Methods  
A MilliGascounter gas meter (RITTER, Bochum, Germany) was used to measure the volume of generated biogas in the experiment on the DF of CW in continuous mode. The gas produced during the experiment with vials in batch mode was collected by water displacement method (volumetric method) [24]. The composition of biogas was determined using a GC-2010 Plus gas chromatograph (Shimadzu, Kyoto, Japan) with a thermal conductivity detector (TCD) on a Restek ShinCarbon ST packed column (2 m long, 1.0 mm ID, 1/16\" OD, 100/120 mesh). The oven temperature was set at 40 \({}^{\circ}\)C for 3 min, then increased to 110 \({}^{\circ}\)C at a rate of 10 \({}^{\circ}\)C/min; injector and TCD temperatures were set at 30 \({}^{\circ}\)C and 200 \({}^{\circ}\)C; carrier gas (nitrogen for hydrogen determination and helium for methane and carbon dioxide determination) flow rate was 13 mL/min, splitless. The GC was calibrated using four calibration gas mixtures of hydrogen in nitrogen and three calibration gas mixtures of carbon dioxide and methane in helium. The volume of the injected sample was 1 mL.  
The content of total carbon (Ctot) and total nitrogen (Ntot) was determined using a Vario EL cube elemental analyzer (Elementar, Langenselbold, Germany). The amount and composition of VFA in the liquid samples were determined with a GCMS-QP2010 Ultra  
\begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline
**Parameter** & **Units** & \multicolumn{5}{c}{**Value**} \\ \hline Stage & - & S-I & S-II & S-III & S-IV & S-V & S-VI \\ Time & D & 1–30 & 31–50 & 51–66 & 67–80 & 81–90 & 91–100 \\ HRT & D & 14.5 & 9.1 & 5.6 & 4.5 & 3.6 & 2 \\ OLR & kg COD/(m\({}^{3}\) d) & 2.07 & 3.31 & 5.37 & 6.61 & 8.26 & 14.88 \\ \hline \hline \end{tabular}
\end{table}
Table 1: AF and AFB operating modes.  
Figure 1: Schematic of a laboratory plant. (**a**)—AFB: 1-1—actor vessel; 2-1—carrier; 3-1—substrate (CW); 4-1—feeding pump; 5-1—sampler; 6-1—recirculation pump; 7-1—effluent pump; 8-1—biogas counter; 9-1—water seal; 10-1—effluent; 11-1—biogas sampler. (**b**)—anaerobic biofiliter (AF): 1-2—carrier; 3-2—substrate (CW); 4-2—feeding pump; 5-2—sampler; 6-2—recirculation pump; 7-2—effluent pump; 8-2—biogas counter; 9-2—water seal; 10-2—effluent; 11-2—biogas sampler.  
chromatography/mass spectrometer (Shimadzu). The liquid samples were centrifuged at 4200 rpm for 5 min and filtered through syringe filters with a pore diameter of 0.45 \(\upmu\)m. The 0.20-\(\upmu\)L sample was introduced into the injector of the GCMS. The analyzed substances were evaporated in the carrier gas (helium 6.0) at a flow of 250 \({}^{\circ}\)C. The sample components were separated in a capillary GC column ZB-FFAP for 19 min. The results of chromatography/mass spectrometry were processed with the Shimadzu software (GCMS Solution ver. 4.11). VFAs were identified with the NIST 11 database. The VFA concentrations in liquid-phase samples were determined by the areas of chromatographic peaks in the mode of monitoring selected ions (ions assigned to the most intense lines in the mass spectra of tested substances) with the internal-size standard protocol [25]. TS content was determined after drying the samples to constant weight at 105 \({}^{\circ}\)C. The ash residue was calculated after burning a dry sample in a muffle furnace (JSC Laboratory Equipment and Instruments, Saint Petersburg, Russia) at 600 \({}^{\circ}\)C. VS content was calculated as the difference between TS and ash residue. COD was determined by the dichromatic method, pH was measured using a portable pH meter WTW pH 3110 SET (WTW, Weilheim in Oberbayern, Germany). The measurements were carried out in duplicate.