C-Language Programming for Development of Conventional Water Treatment Plants Decision Support System

Water-Decision Support System (DSS) tools enhance decision-makings towards improved water supply in a given region. The rigours of manual design of the conventional water treatment plants are easily eliminated with the use of softwares as in the case of DSS. Therefore, this paper focuses on the development of a Water-DSS for design of treatment plant in Karkala Town, Udupi District of India. A four-decade population projection was made using the baseline data of 1971 till date. The manual computation for water demand, unit operations and adjoining facilities was carried out and later coded in C-programming language for development of a DSS for easier design and process selection. Data validation was done and results from the two approaches were compared. With the C-programming technique, a decision support tool for design and process selection of drinking water treatment plant using conventional method has been developed and named Water-DSS1. The designed tool is simple, accurate, flexible, efficient and universal, easily adaptable to any similar conventional treatment plant. Water-DSS1 is thus recommended for general use in ultimately alleviating water supply challenges.


Introduction
In a simple form, Decision Support System, DSS is any system supporting decision-making, including executive information systems, executive support systems, geographic information systems and software agents [1].The concept of DSS emerged in the 1970s, as a family of interactive computer-based systems in the field of decision theory and assisting in utilizing data models to solve unstructured problems, especially with great potential in the field of environmental management [2].
C-programming has emerged as one of the most widely used languages for software development and for DSS.C language supports the powerful low level features like pointer, memory allocation, bit manipulations etc.The features of C language make it possible to see the language for system programming like the development of compiler, interpreter, operating system, system utilities etc. [3].C language has become the language of choice of two decades among system programmers and application programmers.It is popular because it is powerful and flexible; it is portable; efficient; programmer-oriented; and can be modularized for step-wise refinement [4].
The overall efficiency of a Water Treatment Plant depends largely on its design and the functionalities of the Unit Processes constituted in it [5].Most of the design procedures for water treatment plant have been developed using manuals or spreadsheet calculations which are time consuming and costly [6].Therefore, a DSS is required to speed up the design process and reduce the design cost.The central aim of this study is to develop and employ a DSS tool in the general design of Conventional Water Treatment Plants.A case study of Karkala town, Udupi District, Karnataka State, India has been selected, and the design based on projected population against the year 2043 using C-programming language in Code-Blocks 10.05.Study also focuses on developing an easier, cheaper and user-friendly DSS to assist in selecting appropriate and essential procedures for water treatment process; and to compare the obtained output values of manual design and C-programming.Thus, a general Water Decision Support System named WATER-DSS1 has been developed to reduce the design time and while maximizing the treatment plant efficiency, using Karkala Treatment Plant as a case study.

Methodology (a) Study Area
The study area is Karkala Taluk which is located at 13.2˚N 74.98˚E (Figure 1).It has an average elevation of 81 metres (265 feet) above the Mean Sea Level.It has a population of 25,824 people (according to 2011 census).It has an area of 23.06 sq•km and the annual rainfall is 4372.2mm.currently the city have 3 MLD of total water supply from the Mundli River.The summer temperature is 38˚C and winter temperature is 24˚C.Suvarna River has been considered as the source to accomplish the future water demand for Karkala town [4].

(b) Development of WATER-DSS
The DSS (Decision Support System) in this study is known as WATER-DSS.The development of WATER-DSS applies methods of conventional computing practices and programming techniques.WATER-DSS was built by integrating the conceptual design of drinking water treatment through conventional method into a computer program, which has capability as a DSS.The structure design of WATER-DSS [6] is shown in Figure 2.

(c) Conventional Water Treatment Plant Units
The units of a typical conventional treatment plant include aeration, plain sedimentation tank, sedimentation aided with coagulation, flocculation, filters, disinfection etc.Note that the length of the tank may be provided in one, two, or three parts depending upon the shape of the area available.
(v) Sedimentation tank aided with coagulants (1) Chemical feeding Using alum as coagulant, the optimum quantity of dose will be determined actually by jar test in the laboratory.
Let the optimum dose be 5 -8 mg/liter.
The average quantity of alum required = Add 0.5 m for storage and 0.5 m for free board, say overall depth = 3 m.Provide rectangular settling tank (6 × 3.3 × 3) m.The bottom of the tank is sloped of 1 in 12 pushing the sludge towards the discharging end, with the help of scrappers from where it will be removed by the sludge outlet under hydrostatic pressure of water filled in the tank.
The water will be collected from settling tank over its discharging end along the weir provided all around the water from this channel shall be taken into the rapid gravity filters in covered channels (0.3 × 0.3) m.
(vii) Rapid Gravity Filter Quantity of water to be treated = 3.85 litres/day.Assume the rate of filtration of rapid gravity filter-2000 litres/m 2 /hour and also assuming that 30 minutes shall be utilized daily in the back-washing of the filter, the total filter area required = Provide 4 units of rapid gravity filters with two numbers of stand-by units.

(viii) Chlorination Plant
The dose of the chlorine to be added will vary from 0.5 to 1.0 ppm depending on the quantity of water and the chlorine demand tests.
Therefore quantity of chlorine required =   and microbiologically.Each parameters of water has its own treatment procedure but often these can be combined.
In validating the developed program, required data was keyed in and run.At the same time, manual computations are done using the conventional method for the designing the different units of the water treatment plant.The output values of the C-program as compared with those of manual design are presented in Table 2.Meanwhile, if the user desires to get the design of any particular unit of the water treatment plant, it is possible to access the desired unit's design using the "switch case" statement.This flexibility further confirms the userfriendliness of C-programming Language.
In comparing the C-program output values and the manually designed values only marginal differences were observed, especially in the decimal places.It is so, because in the c-programming "float" data type is used which gives the accurate values up to six decimal points whereas in manual design the values are rounded off to two decimal points.

Conclusion
In this paper with the C-programming technique, a decision support tool for design and process selection of drinking water treatment plant using conventional method has been developed and named Water-DSS1.The applied C-program is user friendly, saves time and gives more accurate values.The program is much more efficient and reliable than the manual design and can be used repeatedly for different sets of data.It is universal in its approach and easily adaptable to any similar conventional water treatment plant apart from the Karkala one reported in this paper.Water-DSS1 is therefore recommended for general use in alleviating water supply challenges.

Figure 3 So from Table 1 ,
shows the flowchart of conventional water treatment plant.(d) Manual design of the Water Treatment Plant ([7] [8]) (i) Forecasting population The Conventional Water Treatment Plant is being designed for the next 3 decades.Forecasting population of the study area for 3 decades by the Geometric Increase Method: If the present is P and the average percentage growth is I G the population at the end of n decade will be: the Expected Population of Karkala by 2043 is 38,396 people.(ii) Water demand The water requirement per capita demand of Karkala = 100 LPCD (BIS Code).Thus, water requirement of Karkala per day = 38,396 × 100 = 3,839,600 = 3.84 MLD.So, the proposed water treatment plant design is of approximately 3.85 MLD in capacity.(iii) Aeration process Assuming number of steps = 5 and that tread width, t = 250 mm Diameter of the first step, D 1 = 1 m (including the diameter of pipe) Diameter of the second step, Diameter of aeration tank (collector) = D 5 + 2(1) = 3 + 2 = 5 m Further assuming that: Rise of 1 st step = 0.3 m Rise of 2 nd step = 0.4 m Rise of 3 rd step = 0.5 m Rise of 4 th step = 0.6 m Rise of 5 th step = 0.7 m Overall Dimension of Aeration tank of diameter 5 m and total height of Cascade is 2.5 m.

Figure 3 .
Figure 3. Flowchart of conventional water treatment plant.

2 .
iv) Plain sedimentation tank Quantity of water to be treated in 24 hours = 3.85 × 10 6 liters = 3850 m 3 .Quantity of water to be treated by the sedimentation tank during detention period of 6 hours = 3850 6 24 × = 962.5 m 3 .Thus the capacity of the sedimentation tank required = 962.5 m 3 .Assume the velocity of flow = 18 cm per min or 0.003 m/s.Length of the tank required = Velocity of tank (m/s) × Detention period (s) = 0.003 × (6 × 60 × 60) = 64.8 m.Cross section of tank required = Assume the depth of water = 4 m which includes allowable allowance for sludge to be made as 80 cm (or 0.8 m).Required width of tank = 14.85 3.2 = 4.64 m.Providing 0.5 m for free board, overall depth of the tank = 4 + 0.5 = 4.5.Therefore the dimensions of the designed tank are = (64.8× 4.64 × 4.5) m.

1 × 1 ×
.82 to 7.7 kg/day.The maximum requirement in summer will be 1.5 times more = 7.23 to 11.55 kg/day.This quantity of alum shall be first mixed with the water to form a solution of 5 strength and then will be added through solution feed device which is given as = 11.55 × 20 liters/day = 111609 liters/min.Quantity of solution to be fed in 8 hours/day = 0.1604 × 60 × 8 = 76.99 liters.Providing solution tank of capacity = 0.07699 m 3 = 0.077 m 3 .Keeping the depth of solution in the tank as 0.35 m and 0.15 m as free board.The sides of the square tank = 0.077 0.35 = 0.4699 m = 0.5 m.So the designed size of Solution Tank = (0.5 × 0.5 × 0.5) m. 11 m 3 /s.Providing a velocity of 0.4 m/s, the cross sectional area of approach channel = 0.011 0.4 = 0.0275 m 2 .Provide (0.175 × 0.225) m channel with 175 mm water depth and 50 cm free board.(3) Mixing tank Mechanical flash mixers will be used for mixing the coagulant solution with the water.Assuming the detention period of one minute (60 s).Capacity of flash mixer = 0.11 × 60 = 0.66 m 3 .Providing depth of 1m, the sides of the square plan mixing tank = 01) m size of mixing tank with flocculator.(v) Flocculating Tank A flocculating tank with mixing slow moving paddles is provided with variable speed electric motors.Assuming the flocculating time of 30 minutes, the capacity of each flocculating tank = 0.11 × 30 = 19.8m 3 .So, provide a channel of capacity = 19.8m 3 .Providing 1.6 m depth of water and 10 m of length of channel its width = 19.81.6 10 × = 1.2375 m.Therefore, provide channel of size (10 × 1.4 × 1.6) m with water depth of water 1.4 m and 0.2 m as free board in continuation on flash mixer.(vi) Settling Tank Provide a rectangle sedimentation tank with a square tank with surface loading of 2000 litres/hour/m 2 plan of area. in the settling tank at average flow is given as = Perimeter m/day.Providing a detention period of 2.5 hours at a time of maximum flow.Capacity of tank = 962.5 2.5 24 × = 1000.26m 3 .Now quantity of water to be treated in one hour = 962

5 × = 770 m 2 .
08 kg/hour.Therefore liquid chlorinator having capacity 0.1 to 5 kg/hour will be installed.(ix) Underground Reservoir Water Underground clear water reservoir having capacity of about 8 hours will be provided.Quantity of water to be stored = 3.85 × 10 3 m 3 .Providing 5 m depth, area of clear water reservoir = 3.85 10 ^3 So, the dimensions of the designed underground clear water reservoir = (40 × 19.25 × 5) m. (x) Design of Pumps (Centrifugal Pumps) We are adopting two pump stations, one is at source and another is in the middle.Maximum daily water requirement = 1.5 × 3.85 × 1000 m 3 /day = 5.775 × 10 3 m 3 /day.Since Pumping time is 8 hours per day,

Table 1 .
Forecasting of population for 3 decades.

portion of Water-DSS1 C-Program for Karkala Treatment Plant Design
The unit processes manually designed above were coded in C-Language and fed into the in Code-Blocks 10.05 software.A portion of the program, for the population forecast, water demand, aeration unit design and underground clear water reservoir, is as shown below:

Table 2 .
Comparison of the manual and C-program output values.