Dynamic Simulation of Petrochemical Wastewater Treatment Using Wastewater Plant Simulation Software

A dynamic simulation model was developed, calibrated and validated for a petrochemical plant in Terengganu, Malaysia. Calibration and validation of the model was conducted based on plant monitoring data spanning 3 years resulting in a model accuracy (RMSD) for effluent chemical oxygen demand (COD), ammoniacal nitrogen (NH3-N) and total suspended solids (TSS) of ±11.7 mg/L, ±0.52 mg/L and ± 3.27 mg/L respectively. The simulation model has since been used for troubleshooting during plant upsets, planning of plant turnarounds and developing upgrade options. A case study is presented where the simulation model was used to assist in troubleshooting and rectification of a plant upset where ingress of a surfactant compound resulted in high effluent TSS and COD. The model was successfully used in the incident troubleshooting activities and provided critical insights that assisted the plant operators to quickly respond and bring back the system to normal, stable condition.


Introduction
Wastewaters from petrochemical plants are complex in nature and their characteristics are specific to the particular petrochemical product being manufactured in the plant.In order to prevent pollution of water bodies and to conform to environmental protection regulations, petrochemical effluents generally require treatment based on physical, chemical and biological processes prior to discharge into the environment.
A number of wastewater treatment plant simulation software packages are commercially available which allow users to develop wastewater plant flow schemes, which mimic the performance of the plant at given operational and influent loading conditions.These simulator software packages incorporate mathematical models that describe the unit processes such as activated sludge system, chemical precipitation, clarification and sludge handling processes.The systems are typically specified graphically using icon-based approach; once the user defines the graphical flow scheme and influent parameters, the simulation can be executed to generate results [1].________________________________ * Corresponding author: idzhamfauzi_mariff@petronas.comMATEC Web of Conferences 203, 03005 (2018) https://doi.org/10.1051/matecconf/201820303005ICCOEE 2018 A petrochemical facility in Terengganu, Malaysia is equipped with an Industrial Effluent Treatment System (IETS) for the treatment of effluents generated from the facility in order to reduce pollutant concentrations to levels meeting the Malaysian effluent discharge standards.This facility has historically experienced plant upsets due to unintended or accidental discharges of toxic or high-strength effluent into the IETS.These events have caused operational disruptions including plant shutdown in the effort to ensure that the final effluent discharge quality does not exceed the legal limits.The IETS has been designed to treat up to 500 m 3 /h of effluent from several plants and consists of the following sub-systems:  Primary Treatment -Equalisation Tank, Diversion Tank  Secondary Treatment -Aeration and Deaeration Basins, Clarifiers  Tertiary Treatment -Lamella Clarifiers  Sludge Management System -Thickener, Sludge Digester, Belt Press, Land Farm  Check Basin and Recycle Basin The facility is also designed with a separate collection header to collect off-spec effluent, which is diverted to the Diversion Tank.
Using a commercially available wastewater treatment plant simulator, a simulation model was developed for the IETS to assist in investigating strategies to handle increased loads, predict IETS performance during abnormal conditions, assist in investigating options to optimise chemicals and energy costs, assist in generating options for improving treatability and as an interactive platform for operator training.The model was calibrated and validated using plant monitoring data spanning 3 years.The model has since been used extensively for the stated purposes.
In this paper, the methodology and results of the development of the wastewater treatment plant simulation model is presented.The results of the model validation indicated that the calibrated model prediction was fairly accurate; for normal operating conditions, the root mean square deviation (RMSD) for effluent chemical oxygen demand (COD), ammoniacal nitrogen (NH3-N) and total suspended solids (TSS) was calculated to be ±11.7 mg/L, ±0.52 mg/L and ± 3.27 mg/L respectively.
A case study is presented on the application of the validated model for the purpose of assisting in troubleshooting of a plant upset incident involving the ingress of surfactant compound.Ingress of surfactant into an activated sludge process is known to cause operational problems.It is reported that the inhibition threshold of surfactants for activated sludge process is in the range of 100-200 mg/L [2].The mechanism of disruption of the activated sluge process is due to the breakup of loosely bound flocs and, as surfactant concentration is increased, tightly-bound flocs, causing poor settling of the sludge blanket and suspended solids carryover.Eventually, at high concentrations, microbial cell lysis occurs [3].In the surfactant ingress incident at the facility, the validated simulation model was used to quickly understand the likelihood of effluent toxicity, estimate the proportion of surfactant remaining in the aeration tank and to predict the likely process behavior in the days following the incident.This information was used by the plant operators to decide on the course of action in order to quickly return the plant to normal operating conditions.

Data gathering and analysis
All the required information pertaining to the IETS design and operation were collected including process flow diagrams (PFDs), piping & instrumentation diagrams (P&IDs), MATEC Web of Conferences 203, 03005 (2018) https://doi.org/10.1051/matecconf/201820303005ICCOEE 2018 design data and calculations, material balance, daily operational monitoring data, previous characterisation reports, process descriptions and operating philosophies.A wastewater characterisation study was also commissioned to obtain data required specifically for activated sludge modelling such as biodegradable and inert portions of COD and nitrogen fractions.A bio-assay test was also conducted to determine the readily biodegradable COD (rbCOD) component in the wastewater.
In some cases, important model input parameters were not measured as part of the regular plant monitoring data.Thus, ratios of these parameters to other available parameters were calculated during times when the data were available (e.g. during characterisation study) and the results generalised to calculate the unknown parameter in other periods.For example, the ratio of COD to organic nitrogen was calculated when total N data was available and then used for calculation of total Kjeldahl nitrogen (TKN).Also, typical values of COD fractions were obtained from literature and used to guide the finalisation of COD fractions data.

Model Layout Construction
After data gathering, a model layout was developed to model the existing facility as closely as possible, mimicking the actual facility in terms of the flow configuration, influent properties and behavior, operational conditions and equipment specifications.Design or operational data were also used to define process stream state variables, composite variables and stoichiometric ratios.PFDs were used to develop the model layout and specify the model flow connections.

Model Calibration and Validation
Plant monitoring data and characterisation data were used to develop the average flow and composition values and mass balance.The model was then calibrated to match the average composition data by repeatedly running the model and adjusting the model parameters.Refer to Figure 1 for the workflow.

Fig. 1. Work Process Methodology for Calibration and Validation
The accuracy of the model was defined as the best match achievable to majority of selected parameters as follows: 1. Average NH3-N at clarifier overflow 2. Average COD at clarifier overflow 3. Average TSS at clarifier overflow 4. Average mixed liquor suspended solids (MLSS) in Aeration Tanks To assist in the calibration work, a sensitivity analysis was conducted using the plant model layout by adjusting model input parameters and analyse the effect on model output parameters (e.g.COD, NH3-N, TSS, nitrite and nitrate nitrogen (NO2-N/NO3-N) and MLSS).The sensitivity analysis was conducted on all biological stoichiometric and kinetic parameters as well as on selected influent characterisation parameters.
Following the sensitivity analysis, average or mean values of collected data were used to develop a steady-state calibration of the model.starting point, the model was then calibrated using a set of dynamic, time-series data.A single set of dynamic/time series data typically contains performance monitoring data spanning a 3-month duration.After recalibration using dynamic data, the model was validated using separate data sets during normal plant operating conditions.To quantify the goodness-of-fit, the absolute RMSD values between model and data were calculated for COD, NH3-N and TSS in the clarifier overflow effluent.

Background of the incident
An incident occurred in September 2013 whereby operators noticed white, billowy foam on the surface of the IETS aeration tanks.At the same time, the water quality results of the effluent from the clarifier overflow showed elevated levels of TSS (exceeding 50 mg/l) and COD (exceeding 250 mg/L).The effluent was also observed to be murky.As a result, plant operators decided to divert the effluent to the Recycle Basin for temporary storage and reduce influent flow to the IETS at half of the overall incoming flowrate i.e. temporarily accumulating the wastewater in the Equalisation tank.In the meantime, plant operators attempted to troubleshoot and rectify the situation.It was suspected that an effluent stream containing high surfactant content had been introduced to the IETS feed.

Investigation methodology
In order to assist in troubleshooting the incident, the IETS model was run with the latest plant monitoring data to determine the following: 1. Whether the chemical ingress was causing inhibition to the process of COD biological oxidation.2. Estimate the likely proportion or concentration of the surfactant still in the system.3. Simulate the likely consequences of intervention actions.4. Simulate likely duration until normalisation after implementing intervention actions.Based on the physical observation of white billowy foam and possible ingress of high concentration of surfactant, it is probable that the high COD was a result of the poor clarification at the secondary clarifiers contributing to an increased in particulate COD.To confirm this, the model was run by adjusting the settling parameters in the IETS model in order to obtain model effluent TSS levels that closely match the actual plant monitoring data.
The clarification factor, which is a relative clarification index (between 0 and 1) that specifies the sedimentation characteristics of the secondary clarifier, was adjusted by trialand-error in the model to obtain the fit to the plant effluent TSS data.When a good fit is obtained for TSS, the model output for COD is compared to the actual effluent COD; if a good fit is obtained, it can be concluded that the elevated COD is due to the increased particulate COD from the poor clarification (i.e.no toxic effects).Conversely, if a good fit is not observed (i.e.actual COD is higher than model prediction), some impairment in COD biological oxidation is indicated.
Measurement of the concentration of surfactant in the system was found to be difficult and not practical.Hence, the wastewater treatment plant simulator was used to estimate the likely proportion of surfactant remaining in the system and duration required to reduce the surfactant content.To achieve this, a model was developed incorporating a simple tank (no reaction) with the same volume and retention time as the aeration tank and clarifier system.A dummy compound was introduced in the influent to represent the surfactant dose into the system.The dummy compound was introduced as a pulse feed to mimic the actual MATEC Web of Conferences 203, 03005 (2018) https://doi.org/10.1051/matecconf/201820303005ICCOEE 2018 operational condition where the offending stream was immediately isolated after the event was observed.The actual surfactant concentration was not measured; in the model, the initial dummy compound concentration in the aeration tank was set at 100 mg/L to represent 100% of the initial surfactant concentration.The actual flow profile of the influent stream obtained from plant distributed control system historian data was used in the simulation and the resultant dummy compound concentration profile was obtained from the model.In addition, a 2-month planned feed flow profile was also input to determine the decline of the surfactant compared to the initial high dose.
The same planned feed flow profile, as well as feed concentration profile (total COD, NH3-N, NO3-N, TKN) was input into the full IETS model and simulated to determine the effluent quality at the clarifier outlet including COD, TSS and NH3-N.

Model calibration and validation results
The results of the sensitivity analysis are shown in Table 1.The sensitivity analysis show that the model stoichiometric parameters only seem to affect the biomass (i.e.MLSS) and do not have any significant impact on the other output parameters.The kinetic parameters affect all effluent parameters except the MLSS.The influent parameters, contributing directly to the mass loading and composition, have the greatest impact to all the output parameter values.1), a satisfactory model was obtained for the steady-state conditions of normal operation.The calibration set was used as a starting point for the subsequent dynamic modelling where the model was further refined.Dynamic calibration for normal operating conditions was done using a data set of daily plant data spanning 4 months.The following model parameters were adjusted in the dynamic calibration to obtain satisfactory fit to the dynamic data set: 1. Heterotrophic yield 2. Heterotrophic endogenous fraction 3. Autotrophic yield 4. Autotrophic endogenous fraction 5. Readily biodegradable substrate half saturation coefficient 6. Anoxic oxygen half saturation coefficient 7. Anoxic growth factor 8. Nitrate half saturation coefficient 9. Ammonia (as nutrient) half saturation coefficient The calibrated model was then validated with separate data sets each spanning 3-4 months.The RMSD results for normal operations is provided in Table 2.The results show that on average the model prediction accuracies for COD, NH3-N and TSS are ± 11.7 mg/L, ±0.52 mg/L and ± 3.27 mg/L respectively.

Case study investigation
The model predicted and actual TSS results at clarifier overflow are shown in Figure 3.By adjusting the clarification factor, a satisfactory fit can be obtained for the TSS at the clarifer overflow.This represents the poor settling characteristics that occurred during the surfactant ingress incident.However, the data also shows that approximately 3 weeks prior to the surfactant ingress, the influent COD has started to increase gradually from 1000 mg/l to 4800 mg/l.
Figure 6 shows the model prediction compared to the actual COD results at the clarifier overflow.It can be clearly seen that the model prediction of COD closely matches the actual results.This indicates that the increased level of COD can be fully explained by the higher TSS at the clarifier effluent (contributing to particulate COD) and also the increased COD in the feed influent and that no toxic event occurred.It can also be seen in Figure 7 that the effluent showed relatively low effluent ammonia levels of less than 8 mg/L despite increased influent TKN levels of approximately 180 mg/l.This indicates that nitrification was effective and inhibition of nitrifiers was not occurring.Ammonia-oxidised bacteria have been reported to be ten times as sensitive to organic chemical toxicity compared to nitrite-oxidised bacteria and heterotrophs [4].In general, compared to non-nitrifying activated sludge, lower pollutant concentrations are able to inhibit nitrifying activated sludge [5].This supports the conclusion that the surfactant ingress did not result in any significant inhibiting effect to both heterotrophic oxidation and autotrophic nitrification processes.Figure 8 shows the surfactant relative concentration during the incident overlaid with the influent feed flowrate.The figure shows that the surfactant levels in the activated sludge plant is expected to gradually reduce and eventually reach <1% of the initial concentration 24 days after the surfactant ingress.At these levels, it was expected that the surfactant levels will have been reduced to levels low enough to not result in elevated TSS at the clarifier overflow.Overall, it can be concluded from the model results that the surfactant ingress caused a disruption in the settleability of the biomass at the clarifier and did not cause any discernible inhibitory impact.It was also concluded that isolating the surfactant and reducing the COD influent load would reduce TSS and COD levels at the effluent.Approximately 2 weeks after the surfactant ingress event, it was observed that the COD and TSS levels have reduced significantly to less than 100 mg/L and 30 mg/L, respectively as shown in Figure 9 and Figure 10.At this time, the surfactant concentration is expected to have been reduced to approximately 15% of the initial value.At this level, the biomass settling has improved significantly although it has yet to return to its optimum condition (where the TSS at the overflow is approximately 5 mg/L).Subsequent communications with https://doi.org/10.1051/matecconf/201820303005ICCOEE 2018 the operations team indicated that the IETS has returned to normal operating conditions after 1 month from the incident.

Conclusions
A model of an IETS treating petrochemical wastewater was developed, calibrated and validated.Sensitivity analysis of the model parameters was conducted and indicated that the model stoichiometric parameters only affect the biomass concentrations and did not have any significant impact on the other output parameters.Conversely, kinetic parameters affected all effluent parameters except the MLSS.The influent parameters have the greatest impact on all the output parameter values.
The model was calibrated and validated with separate data sets each spanning 3-4 months.The results show that the model prediction matched the actual plant monitoring data closely with RMSD for COD, NH3-N and TSS being ± 11.7 mg/L, ±0.52 mg/L and ± 3.27 mg/L, respectively.

TSS mg/L
MATEC Web of Conferences 203, 03005 (2018) https://doi.org/10.1051/matecconf/201820303005ICCOEE 2018 The model was used to assist in the investigation of a surfactant ingress incident which resulted in plant upset as indicated by foaming and high effluent COD and TSS levels.The model simulations show that the surfactant ingress had resulted in reduction of the biomass settling efficiency which caused solids carryover at the clarifier overflow, increasing TSS and particulate COD at the effluent.Concurrently, influent COD levels during the incident was also found to be significantly higher than normal, contributing greatly to the effluent total COD levels.
Based on the model simulation findings, toxic inhibition of the system was not indicated.By isolating the offending stream and reducing the COD influent load, it was predicted the settleability of the biomass will improve leading to lower TSS, particulate COD and soluble COD levels.Consequently, the effluent COD level was expected to be reduced acordingly.Subsequent follow-up with the IETS operations team showed that, as predicted, the TSS and COD levels at the clarifier overflow improved and the system gradually recovered to normal operational ranges.
This study shows that wastewater plant models, when properly developed and calibrated, are extremely useful as a tool in operational troubleshooting.Hence, development of such models are recommended to assist plant operators to ensure discharge compliance and continued operational excellence.

Fig. 3 .
Fig. 3. Model prediction and actual results of TSS at clarifier overflow during surfactant ingress event.

Figures 4
Figures 4 and 5 show the influent flow and influent characteristics during the incident.The surfactant ingress occurred at approximately day 40 in the model.Actual data was used until day 47; after that planned flow and composition data was input into the model.It can be seen in the data that the feed flowrate was greatly reduced after the incident, from about 100 m 3 /h to 20 m 3 /h as part of the operational response to the incident.

Fig. 6 .
Fig. 6.Model prediction and actual results of COD at clarifier overflow during surfactant ingress event.

Fig. 7 .
Fig. 7. Model prediction and actual results of NH3-N at clarifier overflow during surfactant ingress event.

Table 1 .
Results of model sensitivity analysis

Table 2 .
Root Mean Square Difference (RMSD) of model vs actual data, in mg/L