A mathematical technique for the design of near-zero-effluent batch processes

Wastewater minimisation in chemical processes has always been the privilege of continuous rather than batch plants. However, this situation is steadily changing, since batch plants have a tendency to generate much more toxic effluent compared to their continuous counterparts which are usually encountered in bulk manufacturing. Past methodologies for wastewater minimisation in batch processes have focused on operations based on mass transfer. They do not take into consideration the reuse of wastewater as part of product formulation. Reusing wastewater in product formulation has the major advantage of negating much of the effluent produced, thereby enabling a process to operate in an almost zero-effluent manner. Presented in this paper is a mathematical technique for the simultaneous design and scheduling of batch operations operating in a near-zero-effluent manner. The technique determines the number and size of the processing vessels, while ensuring maximum water reuse in product. The technique was applied to an illustrative example, and an 80% savings in wastewater was achieved, with a corresponding plant design that achieves the required production.


Introduction
As freshwater sources are becoming scarcer and environmental legislation becomes more stringent on the quality of effluent discharged by industry, the need for effective techniques for the minimisation of freshwater usage and effluent generation becomes greater.Traditional end-of-pipe treatment methods are not always economical at achieving the required effluent targets.Furthermore, these methods are heavily dependent on the effluent volumes.Process integration techniques, therefore, provide a cost-effective means of reducing the overall volume of effluent water generated and reduce freshwater requirements.The essence of process integration techniques is the reduction of water usage at source.
In the past, research in wastewater minimisation has been focused on continuous processes (Wang and Smith, 1994;Alva-Argáez et al., 1998;Hallale, 2002).However, in the past few years the focus has slowly shifted to include batch processes.Whilst it is true that the volume of wastewater generated from batch processes is generally less than that produced from continuous processes, the concentration and toxicity of contaminants in the wastewater generated from batch processes are generally higher.It is therefore important that wastewater minimisation is also dealt with in batch processes.
Past methodologies for wastewater minimisation in batch processes can roughly be divided into two groups, namely, graphical techniques (Wang and Smith, 1995;Foo et al., 2005;Majozi et al., 2006) and mathematical techniques (Grau et al., 1996;Almató et al., 1997;Kim and Smith, 2004;Majozi, 2005a;b).Graphical techniques have their roots in water pinch analysis as applied in continuous processes and mathematical techniques have their roots in mathematical programming.Graphical techniques have the advantage of being able to give the process designer insights into the interaction between the various processes in the plant.Wastewater reuse bottle-necks are easily identifiable.The disadvantages of graphical techniques are that they are more suited to single contaminant problems and they are based on the optimal schedule being known a priori.Mathematical techniques can, however, deal with multiple contaminant situations and can also determine the schedule and wastewater target at the same time.They do have the disadvantage of being a black-box type approach in which case it is difficult to identify the operations restricting wastewater reuse.
Both graphical and mathematical techniques mentioned above are all mass transfer-based techniques, where the recycle/ reuse of wastewater is determined through the availability of the wastewater and concentration considerations.These methodologies do not take into consideration instances where wastewater can be reused as part of product formulation.The type of operation where this is possible often has a vessel washing step and the products produced contain relatively large quantities of water.The reuse of wastewater in product is beneficial, since this type of reuse has the possibility of generating near-zero effluent production.Furthermore, valuable product residue present in the wastewater is reclaimed, with potentially large financial gains.This reuse concept was used by Jewell et al. (2004) to reduce the amount of effluent produced from a paint-manufacturing facility.The opportunity was, however, restricted to the specific facility studied by Jewell et al. (2004) and no formal methodology was derived to apply this type of water reuse to any other facilities.
Gouws and Majozi (2007) derived a technique for the scheduling of operations where wastewater is reused in product formulation, i.e. in a zero-effluent mode of operation.Presented in this paper is an extension of the technique, where the design of plants operating in the zero-effluent mode of operation is taken into consideration.The technique determines the number and size of processing vessels required to produce a certain amount of product, while ensuring that the minimum amount of wastewater is generated from the process through maximum reuse.The technique is derived for two scenarios.The first is where the contaminants present in the wastewater are negligible and the second where the contaminant mass is not negligible.

Problem statement
The problem addressed in this paper can be formally stated as follows: Given: • required production over a given time horizon; • product recipe and production times; • maximum number of processing vessels; and • maximum and minimum capacity of processing vessels: determine the plant design that will minimise overall cost, i.e. the design with the optimal number and size of processing vessels as well as minimum effluent generation.

Mathematical formulation
Given below are the sets, variables and parameters used in the mathematical formulation.The mathematical formulation can be broken into three main sections.The 1 st section deals with the mass balance constraints, the 2 nd section deals with the scheduling constraints and the final section deals with the objective function and the design constraints.

Mass balance constraints
The mass balance constraints comprise two main parts, namely, production mass balances and washout mass balances.The production mass balances include a raw material balance, which ensures that the correct ratio of water to other raw materials is kept, and an overall product mass balance.In the case where the contaminant mass in the washout water is not negligible, the raw material balance has to take into account the contaminant mass added from the wastewater.Capacity constraints ensure that the amount of raw material processed is not more than the capacity of the processing vessel.The washout mass balances include an inlet water balance and an outlet water balance.The inlet water balance is given in Eq. (1).It is assumed that the amount of water used for a washout is a linear function of the size of the processing vessel.Since the size of the processing vessel is a design variable, the amount of water used for a washout is not fixed.Eq. ( 1) contains a nonlinear term, namely a continuous variable multiplied by a binary variable.This type of nonlinearity can be linearised exactly using a Glover transformation (1975).Apart from the water mass balances, a contaminant mass balance also has to be done when the contaminant mass in the washout water is not negligible.It is assumed that the inlet amount of water is equal to the outlet amount of water. (1) It is important to note that in the case where the contaminant mass is not negligible the model is no longer linear, since the outlet concentration of the washout water is not fixed, but rather variable.This is apparent in Eq. ( 2), which is a contaminant mass balance over the inlet of a processing vessel.Equation (2) states that the contaminant mass entering a vessel is the sum of the contaminant mass in washout water reused from other vessels.

293
(2) As with any operation product integrity is of great importance.To ensure that product integrity is not compromised only compatible wastewater is reused in a product.
Apart from the mass balances, scheduling constraints have to be included to capture the discontinuity of batch processes.

Scheduling constraints
The first scheduling constraints considered are the constraints associated with the operation of a processing vessel.Constraints are formulated to ensure that a processing vessel can only start processing a new batch of raw materials once the vessel has been washed, that the starting time of a later batch occurs at a later time in the time horizon and that a washout starts once product has been removed.
Two duration constraints are also formulated, given in Constraints (3) and (4).Constraint (3) is a product duration constraint and Constraint ( 4) is a washout duration constraint.Each of these constraints merely states that the difference between starting and ending times constitutes the duration of the process.In Constraint (3) the processing time is dependent on the product being produced and in Constraint (4) the duration of a washout is fixed and independent of product or processing vessel.
(3) (4) The other scheduling constraints deal with the reuse of washout water.In this instance washout water is directly reused, at the end of a washout, to a subsequent batch of a compatible product.Constraints ensure that the time at which washout water is reused coincides with the time at which the washout water is produced, at the end of a washout, and coincides with the starting time of the receiving batch.
The constraints presented above complete the mass balance and scheduling parts of the overall model.The remaining parts of the overall model are the design constraints and the objective function, which are presented below.

Design constraints and objective function
The design constraints comprise two constraints.The 1 st constraint, given in Eq. ( 5), is an existence constraint.This constraint states that if a processing vessel processes any raw material in the time horizon then the processing vessel must exist.The 2 nd constraint, given in Eq. ( 6), defines the upper and lower limits of a processing vessel's capacity.
(5) (6) Finally, the objective function is the minimisation of overall cost and is given in Eq. ( 7).The cost arises from the cost of the processing vessels and the treatment cost of the effluent water.It is assumed, in Eq. ( 7), that the cost of a processing vessel is a linear function of its capacity.However, this assumption can be relaxed without major impact on the overall model.( 7)

Illustrative example
The illustrative example involves the design of a small mixing operation.Three products are produced in the operation and the number and size of mixers needed are to be determined.The maximum number of mixers that can be used is 4. The mixers have a maximum capacity of 4 t and a minimum capacity of 1 t.The composition of each of the three products, the required production in a 24 h period and the production time of each product are given in Table 1.It is important to note that the ratio of water and other raw materials for each product is constant, irrespective of the size of the batch.The duration of a washout is 30 min, and is constant.The α proc value is 400 cost units (c.u.) and the value of β proc is 0.8 c.u./t.The treatment cost of wastewater is 5 c.u./kg wastewater.The costing values given are arbitrary.The exact treatment cost of the wastewater is dependent on the nature of the contaminants and actual costing data for mixers can be found in literature.To ensure product integrity, a product can only receive wastewater if the wastewater was contaminated with residue of the same product.The illustrative example was solved for both cases, i.e. a case with negligible contaminant and a case with significant contaminant in wastewater.
The illustrative example was first solved assuming the contaminant mass was negligible.The problem was solved in GAMS using the CPLEX solver.The solution was found in 2 714 CPU s using a Pentium 4, 3.2 GHz processor.The optimum solution required 8 time points.The resulting solution had 4 mixing vessels.Mixers 1 to 3 are each 1 t vessels and Mixer 4 is a 3 t vessel.The value of the objective function was 9 400 c.u.The resulting Gantt chart depicting the production is given in Fig. 1 -the striped boxes represent product processing and the grey boxes represent a washout taking place.The letter 'P' in the striped boxes stands for product and the number following represents the product number.Dashed lines show water reused between the various mixers and the numbers next to the dashed lines depict the amount of water reused in kilograms.Important to note from the figure is that, at the end of the time horizon, only 600kg of wastewater was produced from the operation.At the end of the time horizon there is no further opportunity for the reuse of the washout water in product, since there are no more batches being produced.Therefore, the washout water at the end of the time horizon is discarded.It must be noted, that had reuse of wastewater not taken place the total effluent would have been 3 000 kg for the same operation.The reuse of wastewater

294
in product therefore results in an 80% reduction in the amount of wastewater generated.
As can be seen from Fig. 1, Mixer 3 is dedicated to the production of Product 1 while Mixers 1, 2 and 4 mix all three the products.All the batches produced from Mixers 1, 2 and 3 are 1 t batches and all the batches produced from Mixer 4 are 3 t batches.Important to note is that the required production output within the time horizon is met.
The solution given above can be seen as the global optimum, since the model is a mixed integer linear program (MILP), for which global optimality can be proven.
The illustrative example was also solved for the case where the contaminant mass was not negligible.In this case it was assumed that the amount of residue in a mixer was dependent on the product and the size of the batch being produced.For Product 1, 10 kg of residue would remain per ton of product.For Product 2, 20 kg of residue would remain per ton of product and for Product 3, 30 kg of residue would remain per ton of product.The problem was once again formulated and solved using GAMS/DICOPT.The choice of GAMS/DICOPT instead of just CPLEX was mandated by the structure of the mathematical model for this case.The model exhibits a mixed integer nonlinear programming (MINLP) structure for which global optimality cannot be guaranteed.The resulting design was exactly the same as the previous case, namely, 4 mixers with Mixers 1 to 3 having a capacity of 1 t and Mixer 4 having a capacity of 3 t.The objective function had a value of 9 400 c.u., the same value as the objective function in the previous case.Once again only 600 kg of effluent water was produced.
The main differences in the solutions of the two cases were the amount of product produced and the solution times.The solution time for the 2 nd case was 1 806 CPU s, using the same processor as before, which is almost 1 000 CPU s faster than the solution time for the 1 st case.
The amount of each product produced, in the 2 nd case, was not the exact amount required.Only 3.96 t of Product 1 was produced, 5.88 t of Product 2 was produced and only 4.85 t of Product 3 was produced.This was due to the loss of product in the form of residue left inside the mixer.However, it must be noted that the residue was not all discarded, but rather reused as product formulation.Overall, the amount of residue recovered of Product 1 was 30 kg, of Product 2 was 100 kg and Product 3 was 120 kg.
The solution found in the 2 nd case can be seen as being globally optimal, since the value of the objective function for the 2 nd case was the same as that for the first.

Conclusions
A mathematical technique has been presented for the design of a class of operations where the wastewater generated is reused in product formulation, thereby producing near-zero effluents.The technique determines the number and size of processing vessels that are needed to achieve the required production, while maximising the reuse of wastewater in product.The technique is derived for two distinct cases.The 1 st case where the contaminant mass in the wastewater is negligible and the 2 nd case where the contaminant mass is not negligible.In the 1 st case the formulation takes on the form of a MILP and for the 2 nd case an MINLP.
The technique was applied to an illustrative example.The illustrative example involved the design of a small mixing operation where three products are produced.The example was solved for both cases.The resulting design for both cases was the same and had 4 mixing vessels, where three of the mixing vessels had a capacity of 1 t and the other remaining mixing vessel had a capacity of 3 t.The operation only produced 600 kg of effluent water in both scenarios, which is an 80% reduction in the total amount of effluent produced when compared to exactly the same operation without wastewater reuse.
Future work will be focused on including wastewater storage in the formulation.The formulation presented is limited in that it can only effectively deal with operations where there is no intermediate storage.

S
in,j = {s in,j | s in,j = input state into processing vessel j} S out,j = {s out,j | s out,j = output state from processing vessel j} J = {j | j = processing vessel} U = {u | u = storage vessel} P = {p | p = time point} Variables Mass of water used for product in vessel j Mass of water directly reused from vessel j′ and vessel j Inlet concentration of water into vessel j Outlet concentration of the washout water from vessel j Mass of water used for a washout in vessel j at time point p Effluent water from processing vessel j at time point p Time at which product is produced from vessel j at time point p Time at which raw material us used in vessel j at time point p Time at which a washout ends in vessel j at time point p Time at which a washout begins in vessel j at time point p Capacity of processing vessel j Existence binary variable for processing vessel j Binary variable showing usage of state s in,j at time point p Parameters Factor relating the size of a processing vessel to the amount of washout water Processing time of raw material s in Washout duration Minimum capacity of a processing vessel Maximum capacity of a processing vessel Constant cost term for a processing vessel Cost coefficient for a processing vessel based on size Treatment cost of the effluent water Available on website http://www.wrc.org.zaISSN 0378-4738 = Water SA Vol.34 No. 3 July 2008 ISSN 1816-7950 = Water SA (on-line)