Optimization of Polyaluminum Chloride-Chitosan Flocculant for Treating Pig Biogas Slurry Using the Box–Behnken Response Surface Method

Flocculation can remove large amounts of nitrogen and phosphorus from wastewater, and the resulting nitrogen- and phosphorus-rich floc can be used to produce organic fertilizer. For biogas slurries containing high levels of nitrogen and phosphorus, ordinary flocculants can no longer meet the flocculation requirements. In this study, to fully utilize the advantages of the two flocculants and achieve efficient removal rates of nitrogen and phosphorus from a biogas slurry, chitosan (CTS) and polyaluminum chloride (PAC) were used as a composite flocculation agent to flocculate pig biogas slurries. The response surface method was used to study the effect of PAC added (PACadded) to the composite flocculant (CF), composite flocculant added (CFadded) to the biogas slurry and the pH on flocculation performance, and optimize these three parameters. In the tests, when the PACadded was 6.79 g·100 mL−1CF, the CFadded was 20.05 mL·L−1 biogas slurry and the pH was 7.50, the flocculation performance was the best, with an absorbance of 0.132 at a wavelength of 420 nm. The total phosphorus (TP) concentration was reduced from 214.10 mg·L−1 to 1.38 mg·L−1 for a removal rate of 99.4%. The total ammonia nitrogen (TAN) concentration was reduced from 1568.25 mg·L−1 to 150.27 mg·L−1 for a removal rate of 90.4%. The results showed that the CF could form larger flocs, and had greater adsorption capacity and more stable flocculation performance than ordinary flocculants. Furthermore, the CF could exhibit better chelation, electrical neutralization and bridge adsorption.


Introduction
There are several methods such as adsorption, precipitation, ultra-filtration, electrodialysis, solvent extraction and ion exchange which can be used for the removal of toxic ions. Among these methods, adsorption is the most preferred method [1,2]. Flocculation is an important water treatment technology [3] and has important applications in solid-liquid separation processes [4]. Flocculation not only removes large amounts of nitrogen and phosphorus from wastewater but also converts heavy metal ions in the wastewater into flocs for removal [5]. Biogas slurry is rich in nitrogen, phosphorus, trace elements, and is a potential high-quality nutrient carrier. However, when biogas slurry is treated by ordinary flocculants, the supernatant still cannot be discharged directly because it typically still contains large amounts of nitrogen and phosphorus [6].
The molecular structure of a material substantially determines its final application performance [7,8]. Chitosan (CTS) is a natural polymer derived from renewable resources [9], and it is an important polymer flocculant for water treatment as a cationic polysaccharide. Compared

Preparation of the CF
CTS (2 g) and acetic acid (2 mL) were completely dissolved in pure water (96 mL) to prepare a CTS-acetic acid solution with a mass fraction of 2%. Then different amount of PAC was added to the CTS-acetic acid solution for adsorption, as shown in Table 2. This mixture was slowly stirred in a constant temperature water bath at 70 • C for1 h, then it was cooled naturally to obtain the CF.

Experimental Design
For the test, 1 L of pig biogas slurry held in a beaker was used. The pH of the biogas slurry was adjusted as given in Table 2 with hydrochloric acid solution and sodium hydroxide solution. The sample was stirred at medium speed (100 r·min −1 ) for 1 min and then stirred rapidly (300 r·min −1 ) as the corresponding amount of CF was added. After 1 min, the sample was stirred slowly (50 r·min −1 ) for 20 min. After the sample was allowed to stand for 45 min, the supernatant was extracted, and its corresponding index was measured.

Analytical Methods
The absorbance of the supernatant at a wavelength of 420 nm was measured with the UV-visible spectrophotometer. Supernatant (1 mL), hydrogen peroxide (1 mL), and concentrated sulfuric acid (5 mL)f were placed in a digestion tube and digested for 45 min at 220 • C in an automatic microwave extractor. TP reacted with antimony potassium tartrate under acidic conditions to form a pale yellow ammonium phosphomolybdate complex, which was then reacted with the reducing agent ascorbic acid to form molybdenum blue. The absorbance was measured at a wavelength of 880 nm, and the absorbance was converted to the TP concentration with the automatic chemical analyzer. Sodium salicylate, ammonium hypochlorite and TAN react to form a blue substance proportional to the TAN concentration, and sodium nitroprusside was added to increase the degree of color development. The absorbance was measured at a wavelength of 660 nm, and the absorbance was converted to the TAN concentration with the automatic chemical analyzer.

Statistical Analysis
The response surface method (RSM) is a tool for developing, improving, and optimizing the statistical and mathematical techniques of a process. The design principles of the Box-Benhnken central combined experimental design was used to develop a three-factor response surface analysis test program. The PAC added , the CF added , and the pH of the solution were the main factors (independent variables) and represented by X 1 , X 2 , and X 3 , respectively. The absorbance at the wavelength of 420 nm, TP concentration, and TAN concentration of the biogas slurry after the test were the test results (dependent variables) and represented by Y 1 , Y 2 , and Y 3 , respectively. A modol was built to fit to a quadratic polynomial equation by the least-squares method: Y = A 0 + ∑A i X i + ∑A ii X i 2 + ∑A ij X i X j . The statistical significance of the model was examined through an analysis of variance (ANOVA) of the polynomial model with a 95% confidence level, and the residual map was used to verify the goodness of the model fit. Finally, the response surface map was analyzed, and the module in the RSM program (Design-Expert.V8.0.6, Stat-Ease, MN, USA) was used to obtain the optimal combination of factor values that met the response requirements. Table 2 lists the statistical combinations of key parameters and the statistics of the test results for the three factors. Table 3 presents the regression coefficients and p-value of the response function. According to the RSM test data in Table 2, the regression model is given by the following equations regarding the significance of the coefficients.   Figure 1 shows the residual and fitted value plots and normal probability plots of the (a) absorbance; (b) TP concentration; and (c) TAN concentration. The normal assumptions for the three test results were relatively satisfactory because the point distributions in the graphs approach a straight line. The residual and predicted graphs were also used to test the fit of the model. In order for the model to be reliable, no outliers should be found. In other words, the points on the graph should be randomly distributed around the zero value on the vertical axis, and there should be no abnormally large or abnormally small residual values. In the figure, the points on the graph are randomly distributed on both sides of the vertical axis, which indicates no problems with the model. Figure 1 shows that the absorbance, TP concentration, and TAN concentration had a good normal probability distribution and residual performance. Thus, the empirical model can be concluded to be fit for describing the effects of the pH and coagulants used in this study on the absorbance, TP concentration, and TAN concentration as a response surface.   Figure 1 shows the residual and fitted value plots and normal probability plots of the (a) absorbance; (b) TP concentration; and (c) TAN concentration. The normal assumptions for the three test results were relatively satisfactory because the point distributions in the graphs approach a straight line. The residual and predicted graphs were also used to test the fit of the model. In order for the model to be reliable, no outliers should be found. In other words, the points on the graph should be randomly distributed around the zero value on the vertical axis, and there should be no abnormally large or abnormally small residual values. In the figure, the points on the graph are randomly distributed on both sides of the vertical axis, which indicates no problems with the model. Figure 1 shows that the absorbance, TP concentration, and TAN concentration had a good normal probability distribution and residual performance. Thus, the empirical model can be concluded to be fit for describing the effects of the pH and coagulants used in this study on the absorbance, TP concentration, and TAN concentration as a response surface.

Absorbance Response Surface Analysis and Parameter Optimization
There is a certain correlation between the absorbance and the chemical oxygen demand (COD) in the water, which can indirectly reflect the degree of organic pollution [22,23]. Rather than the COD, the absorbance is more feasible and practical that can be used to monitor wastewater. The absorbance value can also reflect the degree of clarification of the water and content of the suspended substance (SS).
The optimization module in the RSM program was used to predict the lowest absorbance. When the PACadded was 6.00 g·100 mL −1 CF, the CFadded was 30 mL·L −1 biogas slurry, and the pH was 7.50, the absorbance was 0.102 (the desirability was 1.000). Figure 2 shows the response surface and contour plots for the PACadded, the CFadded and pH to absorbance. Response surface plots based on Equation (1) with one variable kept constant at its optimum level, and varying the other two variables within the experimental range. A relatively flat slope for a response surface indicates that the absorbance is robust against variations in the processing conditions. Conversely, if the slope of a response surface is very steep, the response is very sensitive to variation. The shape of the contour line can reflect the strength of the interaction

Absorbance Response Surface Analysis and Parameter Optimization
There is a certain correlation between the absorbance and the chemical oxygen demand (COD) in the water, which can indirectly reflect the degree of organic pollution [22,23]. Rather than the COD, the absorbance is more feasible and practical that can be used to monitor wastewater. The absorbance value can also reflect the degree of clarification of the water and content of the suspended substance (SS).
The optimization module in the RSM program was used to predict the lowest absorbance. When the PAC added was 6.00 g·100 mL −1 CF , the CF added was 30 mL·L −1 biogas slurry , and the pH was 7.50, the absorbance was 0.102 (the desirability was 1.000). Figure 2 shows the response surface and contour plots for the PAC added , the CF added and pH to absorbance. Response surface plots based on Equation (1) with one variable kept constant at its optimum level, and varying the other two variables within the experimental range. A relatively flat slope for a response surface indicates that the absorbance is robust against variations in the processing conditions. Conversely, if the slope of a response surface is very steep, the response is very sensitive to variation. The shape of the contour line can reflect the strength of the interaction effect. An ellipse indicates that the interaction between two factors is significant, while a circle indicates the opposite.
The interaction among the PAC added , the CF added and pH was not significant (p > 0.05), as shown in Figure 2.
Based on the response surface and contour plots of the absorbance values, the important degree of the three parameters are pH > CF added >PAC added . pH could be concluded to be the main factor that affected the absorbance. As the pH increased, the surface became steeper, and the sensitivity of the biogas slurry absorbance to the pH gradually increased. The CF added also affected the absorbance of the biogas slurry. Adding more flocculant lowered the absorbance and improved the treatment effect. Under the optimal conditions, the absorbance was close to zero, which is close to the clarity of pure water. The activity of the CF increased when the pH was closer to neutral, which resulted in better flocculation performance. ANOVA of the model equation showed that the PAC added during the preparation of the CF was not significant and was a secondary factor affecting the absorbance.
CTS was found to dominate the flocculation effect in terms of reducing the absorbance and polyaluminum chloride did not show good flocculation performance. This reflects the strong complexing ability of CTS [24], which can remove colored matter in biogas slurry well. The colored matter in the biogas slurry is mainly suspended in the liquid in the form of particles, and the CF has bridging adsorption. When these particles come into contact with the CF, they are adsorbed onto its long chain. A suitable pH allows the long chain to be more active, which promotes adsorption. effect. An ellipse indicates that the interaction between two factors is significant, while a circle indicates the opposite. The interaction among the PACadded, the CFadded and pH was not significant (p > 0.05), as shown in Figure 2. Based on the response surface and contour plots of the absorbance values, the important degree of the three parameters are pH > CFadded >PACadded. pH could be concluded to be the main factor that affected the absorbance. As the pH increased, the surface became steeper, and the sensitivity of the biogas slurry absorbance to the pH gradually increased. The CFadded also affected the absorbance of the biogas slurry. Adding more flocculant lowered the absorbance and improved the treatment effect. Under the optimal conditions, the absorbance was close to zero, which is close to the clarity of pure water. The activity of the CF increased when the pH was closer to neutral, which resulted in better flocculation performance. ANOVA of the model equation showed that the PACadded during the preparation of the CF was not significant and was a secondary factor affecting the absorbance.
CTS was found to dominate the flocculation effect in terms of reducing the absorbance and polyaluminum chloride did not show good flocculation performance. This reflects the strong complexing ability of CTS [24], which can remove colored matter in biogas slurry well. The colored matter in the biogas slurry is mainly suspended in the liquid in the form of particles, and the CF has bridging adsorption. When these particles come into contact with the CF, they are adsorbed onto its long chain. A suitable pH allows the long chain to be more active, which promotes adsorption.

Response Surface Analysis and Optimization of the TP Concentration
The TP concentration is an important index to determine whether or not the biogas slurry can be discharged directly. The optimization module in the RSM program was used to predict the lowest TP concentration. Depending on the difference of the CFadded and pH, there was significant variation in the TP concentration after treatment. When the PACadded was 7.8 g·100 mL −1 CF, the CFadded was 21.95 mL·L −1 , and the pH is 7.55, the phosphorus in the biogas slurry was almost completely removed (the desirability was 1.000). Figure 3 shows the response surface and contour plots for the PACadded, the CFadded and pH to the TP concentration. The ANOVA results for the model equation showed that there is no interaction between the three factors, and the PACadded was a secondary factor that affected the removal rate of the TP. But the TP concentration was sensitive to the CFadded and pH. Increasing CFadded and decreasing pH significantly reduced the TP concentration of the treated biogas slurry. The TP concentration was more sensitive with the variation of CFadded and pH when the CFadded was above 15.00 mL·L −1 and the pH was below 8.65, so greater change of TP concentration was observed in this 10

Response Surface Analysis and Optimization of the TP Concentration
The TP concentration is an important index to determine whether or not the biogas slurry can be discharged directly. The optimization module in the RSM program was used to predict the lowest TP concentration. Depending on the difference of the CF added and pH, there was significant variation in the TP concentration after treatment. When the PAC added was 7.8 g·100 mL −1 CF , the CF added was 21.95 mL·L −1 , and the pH is 7.55, the phosphorus in the biogas slurry was almost completely removed (the desirability was 1.000). Figure 3 shows the response surface and contour plots for the PAC added , the CF added and pH to the TP concentration. The ANOVA results for the model equation showed that there is no interaction between the three factors, and the PAC added was a secondary factor that affected the removal rate of the TP. But the TP concentration was sensitive to the CF added and pH. Increasing CF added and decreasing pH significantly reduced the TP concentration of the treated biogas slurry. The TP concentration was more sensitive with the variation of CF added and pH when the CF added was above 15.00 mL·L −1 and the pH was below 8.65, so greater change of TP concentration was observed in this range, as shown in Figure 3. Compared with other ordinary flocculants, CTS has many advantages, the most obvious of which is the larger flocs that are formed [10][11][12][13]. Larger flocs can better adsorb and carry inorganic substances containing phosphorus in biogas slurry.
The CF made of PAC and CTS can adapt to a wider range of pH [25,26] and reflects a better flocculation performance in a certain pH range. This is because the phosphorus-containing material in the biogas slurry mainly has a negative charge, and the CF is a cationic polymer flocculant. When the CF is contacted with a phosphorus-containing substance, the negatively charged ions carried by the substance undergo a neutralization reaction. This reaction lowers the potential of the phosphorus-containing substance and loses stability. The CF wraps the phosphorus-containing material that loses stability and forms floccules to settle. At the same time, a more neutral pH allows the CF to be more active. range, as shown in Figure 3. Compared with other ordinary flocculants, CTS has many advantages, the most obvious of which is the larger flocs that are formed [10][11][12][13]. Larger flocs can better adsorb and carry inorganic substances containing phosphorus in biogas slurry. The CF made of PAC and CTS can adapt to a wider range of pH [25,26] and reflects a better flocculation performance in a certain pH range. This is because the phosphorus-containing material in the biogas slurry mainly has a negative charge, and the CF is a cationic polymer flocculant. When the CF is contacted with a phosphorus-containing substance, the negatively charged ions carried by the substance undergo a neutralization reaction. This reaction lowers the potential of the phosphoruscontaining substance and loses stability. The CF wraps the phosphorus-containing material that loses stability and forms floccules to settle. At the same time, a more neutral pH allows the CF to be more active.

Response Surface Analysis and Optimization of the TAN Concentration
Nitrogen is an abundant component of biogas slurry [27] and an important indicator whether the biogas slurry meets the standards for discharge. The TAN concentration of pig biogas slurry has increased considerably because of changes of pig feed. The unique flocculation characteristics of the CF are reflected in the TAN concentration removal. The optimization module in the RSM program was used to predict the lowest value of the TAN concentration. When the PACadded was 7.13·100 mL −1 CF, the CFadded 12.00 mL·L −1 , and the pH was 7.71, then the TAN concentration was 139.225 mg·L −1 (the desirability was 1.000). From the obtained response surface, it was found that the effect of removal TAN in the biogas slurry using the CF was excellent.
According to the ANOVA results for the model equation, all three test factors had insignificant effect on the TAN concentration. Figure 4 shows the response surface and contour plots for the PACadded, the CFadded and pH to the TAN concentration. The interaction between the PACadded and the CFadded was extremely significant (p < 0.01), and the other two interactions were not significant (p > 0.05). When the PACadded and the CFadded were increased or decreased at the same time, the TAN removal from the biogas slurry was affected.
When PAC is complexed with CTS, there is an intermolecular interaction between Al and CTS [27]. An Al-NH2 bond is present in the composite flocculant [28,29] that is not conducive to the flocculation of nitrogen-containing organic and inorganic substances in the biogas slurry. This situation led to the mutual inhibition of the removal of TAN after the two flocculants were combined.
PACadded didn't affect the removal of TAN significantly, but combination of CTS and PAC was concluded to mutually inhibit TAN removal, which may be due to the characteristics of CTS. A large

Response Surface Analysis and Optimization of the TAN Concentration
Nitrogen is an abundant component of biogas slurry [27] and an important indicator whether the biogas slurry meets the standards for discharge. The TAN concentration of pig biogas slurry has increased considerably because of changes of pig feed. The unique flocculation characteristics of the CF are reflected in the TAN concentration removal. The optimization module in the RSM program was used to predict the lowest value of the TAN concentration. When the PAC added was 7.13·100 mL −1 CF , the CF added 12.00 mL·L −1 , and the pH was 7.71, then the TAN concentration was 139.225 mg·L −1 (the desirability was 1.000). From the obtained response surface, it was found that the effect of removal TAN in the biogas slurry using the CF was excellent.
According to the ANOVA results for the model equation, all three test factors had insignificant effect on the TAN concentration. Figure 4 shows the response surface and contour plots for the PAC added , the CF added and pH to the TAN concentration. The interaction between the PAC added and the CF added was extremely significant (p < 0.01), and the other two interactions were not significant (p > 0.05). When the PAC added and the CF added were increased or decreased at the same time, the TAN removal from the biogas slurry was affected.
When PAC is complexed with CTS, there is an intermolecular interaction between Al and CTS [27]. An Al-NH 2 bond is present in the composite flocculant [28,29] that is not conducive to the flocculation of nitrogen-containing organic and inorganic substances in the biogas slurry. This situation led to the mutual inhibition of the removal of TAN after the two flocculants were combined.
PAC added didn't affect the removal of TAN significantly, but combination of CTS and PAC was concluded to mutually inhibit TAN removal, which may be due to the characteristics of CTS. A large amount of free amino groups are distributed on the CTS molecular chain [30]. CTS also contains a large amount of hydroxyl groups. These hydroxyl groups can form cage-like molecules resembling a network structure by means of hydrogen bonds or salt bonds in the biogas slurry. This molecule chelates with TAN-containing substances in the biogas slurry, so CTS may affect the flocculation of TAN. However, excessive addition of PAC or excessive addition of CTS is not conducive to reducing the concentration of TAN in the biogas slurry. This indicates that the Al-NH 2 bond is stronger than the chelation reaction. amount of free amino groups are distributed on the CTS molecular chain [30]. CTS also contains a large amount of hydroxyl groups. These hydroxyl groups can form cage-like molecules resembling a network structure by means of hydrogen bonds or salt bonds in the biogas slurry. This molecule chelates with TAN-containing substances in the biogas slurry, so CTS may affect the flocculation of TAN. However, excessive addition of PAC or excessive addition of CTS is not conducive to reducing the concentration of TAN in the biogas slurry. This indicates that the Al-NH2 bond is stronger than the chelation reaction.

Optimization of the Flocculation Optimal Conditions
The flocculation test was carried out on pig biogas slurry in order to reduce its absorbance, TP concentration, and TAN concentration. Considered the three measurements as the same weight, the RSM software was used to obtain the minimum absorbance, TP concentration and TAN concentration when Equations (1)-(3) were jointly solved. By consideration three indexes comprehensively, the optimum test conditions were found that the PACadded was 6.79 g·100 mL −1 CF, the CFadded was 20.05 mL·L −1 biosgas slurry and the pH was 7.50. In this case, the biogas slurry absorbance after flocculation treatment was 0.132, the TP concentration was 1.31 mg·L −1 , the TAN concentration was 145.08 mg·L −1 , and the desirability was 0.994.

Data Validation and Flocculation Observation
A verification test was carried out under the optimized condition (as shown in Section 3.4). After flocculation treatment, the biogas slurry absorbance was 0.186, the TP concentration was 1.38 mg·L −1 , the TAN concentration was 150.27 mg·L −1 . Some scholars added PAC to the biogas slurry first and then added CTS. After the flocculation, the TP removal rate was 75.90%, and the TAN removal rate was 65.50% [31]. Some scholars have used a similar flocculant preparation method, m(PAC): m(CTS) = 4:1, heated in a 70 °C water bath for 1 h, pH 4. The resulting flocculant flocculated a cyanobacterial biogas slurry, and the TP removal rate was 84.05% [32]. In this paper, a composite flocculant was prepared using PAC and CTS firstly, which was used to flocculate biogas slurry later. It was found that the TP removal rate was 99.36% and the TAN removal rate was 90.42% in the biogas slurry. Comparing the two methods, it could be found that CF had good flocculation performance. 10

Optimization of the Flocculation Optimal Conditions
The flocculation test was carried out on pig biogas slurry in order to reduce its absorbance, TP concentration, and TAN concentration. Considered the three measurements as the same weight, the RSM software was used to obtain the minimum absorbance, TP concentration and TAN concentration when Equations (1)-(3) were jointly solved. By consideration three indexes comprehensively, the optimum test conditions were found that the PAC added was 6.79 g·100 mL −1 CF , the CF added was 20.05 mL·L −1 biosgas slurry and the pH was 7.50. In this case, the biogas slurry absorbance after flocculation treatment was 0.132, the TP concentration was 1.31 mg·L −1 , the TAN concentration was 145.08 mg·L −1 , and the desirability was 0.994.

Data Validation and Flocculation Observation
A verification test was carried out under the optimized condition (as shown in Section 3.4). After flocculation treatment, the biogas slurry absorbance was 0.186, the TP concentration was 1.38 mg·L −1 , the TAN concentration was 150.27 mg·L −1 . Some scholars added PAC to the biogas slurry first and then added CTS. After the flocculation, the TP removal rate was 75.90%, and the TAN removal rate was 65.50% [31]. Some scholars have used a similar flocculant preparation method, m(PAC): m(CTS) = 4:1, heated in a 70 • C water bath for 1 h, pH 4. The resulting flocculant flocculated a cyanobacterial biogas slurry, and the TP removal rate was 84.05% [32]. In this paper, a composite flocculant was prepared using PAC and CTS firstly, which was used to flocculate biogas slurry later. It was found that the TP removal rate was 99.36% and the TAN removal rate was 90.42% in the biogas slurry. Comparing the two methods, it could be found that CF had good flocculation performance.
The floc was observed by scanning electron microscopy for 100 times magnification, as shown in Figure 5. It was found to be multi-layered and distributed with irregular pores. The contour was obvious and there was no accumulation. This might be because the adhesion had been lost between the flocs after drying. The floc was observed by scanning electron microscopy for 100 times magnification, as shown in Figure 5. It was found to be multi-layered and distributed with irregular pores. The contour was obvious and there was no accumulation. This might be because the adhesion had been lost between the flocs after drying.

Conclusions
In this study, the organic polymer flocculant CTS was modified with acetic acid to form a CTSacetic acid solution and then combined with the PAC to form a composite flocculant (CF). The amount of flocculant added for flocculation could be reduced, and the cost of CTS could be reduced. The test data were analyzed and organized with RSM software to establish a quadratic mathematical model for the flocculation effect with regard to the absorbance, TP concentration, and total nitrogen concentration. The regression equation could fit the test data well and predict the test results. The response surface of the model and its contour lines were used to explore the key factors and their interactions to optimize the process parameters and improve the flocculation effect. Under the best experimental conditions, the absorbance was 0.132 at a wavelength of 420 nm, the TP removal rate was 99.4% and the TAN removal rate was 90.7%. This composite flocculant used in this study showed improved performance in the reduction of biogas slurry absorbance, TP concentration, and TAN concentration because CF can form larger flocs, and has a greater adsorption capacity and more stable flocculation effect than ordinary flocculants. Furthermore, the CF can exhibit better chelation, electrical neutralization and bridge adsorption. However, the manufacture of the CF has more stringent requirements. For improving flocculation effect, further research should be carried out in later studies on the optimization of flocculant types, in order to improve flocculant quality and reduce cost.

Conclusions
In this study, the organic polymer flocculant CTS was modified with acetic acid to form a CTS-acetic acid solution and then combined with the PAC to form a composite flocculant (CF). The amount of flocculant added for flocculation could be reduced, and the cost of CTS could be reduced. The test data were analyzed and organized with RSM software to establish a quadratic mathematical model for the flocculation effect with regard to the absorbance, TP concentration, and total nitrogen concentration. The regression equation could fit the test data well and predict the test results. The response surface of the model and its contour lines were used to explore the key factors and their interactions to optimize the process parameters and improve the flocculation effect. Under the best experimental conditions, the absorbance was 0.132 at a wavelength of 420 nm, the TP removal rate was 99.4% and the TAN removal rate was 90.7%. This composite flocculant used in this study showed improved performance in the reduction of biogas slurry absorbance, TP concentration, and TAN concentration because CF can form larger flocs, and has a greater adsorption capacity and more stable flocculation effect than ordinary flocculants. Furthermore, the CF can exhibit better chelation, electrical neutralization and bridge adsorption. However, the manufacture of the CF has more stringent requirements. For improving flocculation effect, further research should be carried out in later studies on the optimization of flocculant types, in order to improve flocculant quality and reduce cost.