<4D6963726F736F667420576F7264202D20E3CCE1C920C7E1D1C7DDCFEDE420C8C7E1DAD1C8ED2E727466> 2005No.3Vol.13Al-Rafidain Engineering Accepted 30 th March2005 Submitted 5 th May 2004 A COMPUTER EXPERT SYSTEM FOR ANALYSIS AND CONTROL OF WATER HAMMER PROBLEMS Dr. Rasul M. Khalaf Prof. Dr. Alaa H. Kadoury College of Engineering College of Engineering University of Tikrit Univerity of Al-Mustansiria Wisam J. Al-Hilo College of Engineering University of Al-Mustansiria Abstract The current system called Expert System for Analysis and Control of Water Hammer Problems “ESACWHP” is developed to help engineers in the design and analysis of water hammer problems using the characteristic method with aid of the programming language called Visual Basic. Results obtained from the developed of “ESACWHP” show good agreement with that solved by traditional lengthy methods, in addition it is capable of handling more variables. The system is recommended to be used for analysis and design. .. . )Characteristic Method ( )Windows ()Visual Basic ( . . 2005No.3Vol.13Al-Rafidain Engineering 1. Introduction Expert systems are computer programs that contain knowledge in a specific domain. The expert system often uses this knowledge to perform tasks a human can do, but with a longer time. Expert system has become commercially important because it provides the way of archiving expertise and making it routinely available where it is needed. Since early eighties, researchers have developed an entirely new kind of tools, a computer that serves as an assistant whose skills include finding reasonable solutions to problems for which there may be no hard and fast “right” answers. The “expert” computer system uses extensive experience-based knowledge of a subject to guess intelligently in the same way as a human expert does. Before computer analysis, the general equations describing water hammer in pipeline system are simplified in some manner to permit solution by arithmetic, graphical… etc. Matching the boundary condition at pumps and turbines is at best, difficult and understood by relatively few engineers. Modern analysis techniques, including numerical methods of solving partial differential equations, are brought within the capability of solving a wide range of water hammer problems. To protect the piping system against the extreme pressure developed during the transient state, it can be designed with a liberal factor of safety to withstand these pressure changes. Such a design will be uneconomical and various devices are employed to control these changes. Two types of devices are available. The first, such as surge tank, air vessels and bypasses, reduces the rate of net change in initial conditions. The second, such as safety valve, pressure regulating valves and air inlet valves, restricts the minimum or maximum pressure developed during the transient state. A brief description of the two types of devices may be found in Ref. [ ]. The designed expert system, which is constructed to control, and analyze water hammer, is called “Expert System for Analysis and Control of Water Hammer Problems” and in abbreviation,can be written as “ESACWHP”. 2. Theoretical Aspects Befor introducing a brief discription of general equation for water hammer problem, a basic architecture of an expert system is viewed. 2.1 The Structure of an Expert System A human expert uses knowledge and reasoning to arrive at conclusions. Similarly, an expert system relies on knowledge and performance reasoning. The reasoning carried out in expert system attempts to mimic human experts in combining pieces of knowledge. Thus, the structure or architecture of an expert system partially resembles how a human expert performs. Thus, there is an analogy between an expert and an expert system. 2005No.3Vol.13Al-Rafidain Engineering The basic architecture of an expert system consists of three parts: the knowledge base, the inference engine (inference mechanism) and the working memory,as shown in Fig.(1) ,[4]. a. The Knowledge Base (KB) The Knowledge base is the medium through which a human expert’s knowledge is made available to the computer. It contains general problem solving knowledge as well as expert knowledge about how to solve problems or how to interact with the user and it is mostly built into the way the inference engine operates. b. The Working Memory It contains information that the system has received about the problem at hand. In addition, any information the expert system derives about the problem is stored in the working memory. c. The Inference Engine (Inference Mechanism) The inference engine combines facts and rules to arrive at conclusions. But if a large number of facts and rules are matched then how can the systems choose the right facts or rules and the wrong choice may set the system on wild goose chase where most of the reasoning is of little assistance in performing the task. Thus, the system needs method of inference that can select which rule can be applied at each step in the reasoning process. In performing inference, the inference engine tries to establish the truth or facility of a statement called a goal. A goal is a fact whose truth-value is to be determined [2]. 2.2 Water Hammer Considerations The characteristic method is utilized a special property of hyperbolic partial differential equations to find their numerical solutions. For a system of hyperbolic partial differential equations, there are two characteristic directions in the s-t plane (See Fig.2) in which the integration of the partial differential equations is reduced to the integration of a system of ordinary differential equations. The advantages of this method are: it is a method of solution which allows the direct inclusion of friction losses, it offers ease in handling the boundary conditions and in the programming of complex systems, it is a general method, i.e. the program once written and it can be used for analyzing different piping systems having the same boundary conditions, and the transient state conditions, obtained by using this method are close to the actual situation. The restrictions in this method are the flow must be one-dimensional, the wave speed is constant during the transient state, and the time increment is chosen accordingly to satisfy the stability conditions [6]. The general equations for water hammer by characteristics method are: 2005No.3Vol.13Al-Rafidain Engineering RRLLRLRLRLP VVVV D tf VVt a g HH a g VVV 2 sin 2 1 ……….(1) RRLLRLRLRLP VVVV D tf g a VVtVV g a HHH 2 sin 2 1 ……....(2) The boundary conditions and control devices can be found in Refs.[3] and [6] 3. Design and Development of ESACWHP The expert system is constructed as a skeleton of expert system and as a base of information about water hammer using a Visual Basic technique.This system is designed to be simple and easy to handle, using two system units (SI & English unit). In order to provide basic information for the user, tables of elasticity, density…etc, for liquids at different temperatures are included in the system. The expert system contains aid instruments and auxillary softwares (wave speed calculations, graphical representation …etc) to expand the information about water hammer. 3.1 ESACWHP Properties The properties of the current expert system are described by the following steps: 1- ESACWHP depends on the information bases that essentially related to the water hammer theory .Its programs are designed initially using Fortran language and changed later to the Basic language in order to be properly interactive with Visual Basic program. 2- ESACWHP displays the questions through out (42) windows or more. Several windows are designed and categorized to fit the most general and partical problems. ESACWHP is written with more than 20000 program steps , as shown in Figs. (3) and (4). 3- The question windows related to the required information are designed to investigate the aims in article (2) above. 4- Conclusion tool of ESACWHP tells the users about the errors that may be committed by mistake in order to overcome them. It gives warnings to avoid the mistakes, as well as it corrects them whensoever happened. 5- The conclusion tool leads the users to achieve the aims followed in articles (2,3) using the bases of information followed in article (1). 6- When all the calculations and operations are achieved throughout the system without mistakes, the required information would display on windows according to their specific locations in the expert system. 2005No.3Vol.13Al-Rafidain Engineering 3.2 ESACWHP Operation When [Vertical Pump] was choosen and clicking [Ok], a related window will be displayed ,as shown in Fig. (11). When Click [Surge Tank], its window will At the start of the ESACWHP, a window is displayed ,as shown in Fig. (5), containing the name of the program, the producer, and its version. There is a clause “Press any key” at the bottom of the window indicating that the program is ready when any key would be pressed. After that, the main window of the system displays ,as shown in Fig. (6), this window contains the menu bar and the boundary conditions of the system, as listed below: Menu Bar: 1- File 2- Wave speed 3- Graph 4- Setting 5- Help Boundary conditions: 1- Pump Station 2- Surge tank 3- Air chamber 4- Surge valve 5- Dead end 6- Network 7- Valve 8- Atmospheric Discharge When Click [Wave Speed] a corresponding window displays, as in Fig. (7), this window is used to calculate wave speed in fluids. When Click [Graph] a related window displays, as in Fig. (8),this window presents a separated software called WHAM linked to ESACWHP to explain the instant variation of H.G.L. and the discharge for a pipe with a valve installed at the downstream and a reservoir at the upstream, this window includes five options for a valve to be selected, as shown in Fig. (8). When Click [Pump Station], its window will be displayed ,as shown in Fig.(9), containing two types of pump: Horizontal Pump Vertical Pump When [Horizontal Pump] was choosen and associating with click [Ok], a specific window will be displayed ,as shown in Fig. (10). be displayed, as shown in Fig.(12). When Click[Air Chamber], its window will be displayed,as shown in Fig. (13). When Click [Surge Valve], its window will be displayed, as shown in Fig. (14). When Click [Dead End] , its window will be displayed in order to analyze the flow from a reservoir in which the downstream pipe contains dead end or closed valve, as shown in Fig. (15). 2005No.3Vol.13Al-Rafidain Engineering When click [Networks], a corresponding window will be displayed in order to analyze the pipe networks (pipes branch) in each position whereas the user selects, as shown in Fig. (16). When Click [valve], its window will be displayed to analyze the flow from a reservoir in which the downstream pipe contains a valve, as shown in Fig.(17). When Click [Atoms. Discharge], its window will be displayed, as shown in Fig.(18). There are many applications for ESACWHP in order to analyze the water hammer problems in hydraulic systems.The results obtained from these applications that can be found in Ref. [1], were verified by traditional lengthy method and the tests show good agreement. 3.3 Capabilities of ESACWHP ESACWHP used in this study, is discribed by the followings: 1- ESACWHP reduces the time and helps the hydraulic engineers to analyze the network. 2- ESACWHP is easy and clear to use by engineers. Besides it warns the user about the faults throughout the input or within the analysis. 3- ESACWHP can save the results in separate file in order to be used later for further analysis. 4- ESACWHP accepts the future development and is capable of further modifications and improvement to solve other problems which are not considered by ESACWHP. 5- ESACWHP contains a branched programs which work as clarification tool for water hammer recycle. 4. Conclusions and Recommendations From this research context and from the development of “ ESACWHP ”, the followings could be concluded: 1- A number of published and solved problems are analyzed using the expert system “ESACWHP”, the obtained results show a good agreement.For more details see Ref.[ 1] . 2- The expert system gives solutions for most of the main problems caused by water hammer phenomenon, such as pumps power failure and sudden closing of valve. 3- ESACHWP is a friendly software and can be handled by an engineer with a medium level of computer knowledge. The following modifications can be recommended for the expert system: 1- The expert system can be modified to include the analysis of a system at the beginning of the pump operation, because of the expected occurrence of changes in the pressure, (before reaching steady state conditions). 2005No.3Vol.13Al-Rafidain Engineering 2- The expert system can be modified to include the analysis of a system in case of partial operation of pumping sets. 3- The software “ Excel ” can be used to support the expert system “ESACWHP”. This makes it able to represent the results in a graphical fashion. References [1]. Al-Hilo ,W. J.“ A Computer System for Analysis and Control of Water Hammer Problems ” M.Sc. Thesis , Depart. of Environmental Engineering, Al- Mustansiria University ,2002. [2]. Beerel, and Annabel, C., “Expert System Strategic Implications and Applications ”, Ellis Horwood Ltd., U.K., 1987. [3]. Chaudhry, M.H., “Applied Hydraulic Transients ”, 1st Edition, Van Nostrand Reinhold company, New York, 1986. [4]. Hart, A., “Knowledge Acquisition for Expert Systems ” Kogan Page Ltd., 2nd Edition, London, 1989. [5]. Tullis, J.P., “Hydraulics of Pipelines, Pumps, Valve, Cavitation, Transients”, 1st Edition, John Wiley & Sons, New York, 1989. [6]. Watters, G.Z., “Analysis and Control of Unsteady Flow in Pipeline”, 2nd Edition, Butter worth, Chicago, California, 1984. 2005No.3Vol.13Al-Rafidain Engineering t S S 1 S 2 S 3 S N S N+1 t t2 P 1 P 2 P 3 P N P N+1 C+ C - Figure (2) The Characteristic Grid for a Typical Pipe. Figure (1) Expert System Architecture. Expert System Program Inference Engine Working Memory User Output Data Input Data Knowledge Engineer 2005No.3Vol.13Al-Rafidain Engineering Figure (3) Windows of the Expert System. Figure (4) Some Programmable Steps of the Expert System. 2005No.3Vol.13Al-Rafidain Engineering Figure (6)Window Contains the Menu Bar and the Boundary Conditions Figure (5) Window Displays When the System Beginning. 2005No.3Vol.13Al-Rafidain Engineering Figure (7) Window Used to Calculate Wave Speed. 2005No.3Vol.13Al-Rafidain Engineering Figure (9) Window to Select Pump Station Type. Figure (10) Window for Analysis Horizontal Pump Power Failure. 2005No.3Vol.13Al-Rafidain Engineering Figure (11) Window for Analysis Vertical Pump Power failure. Figure (12) Window for Analysis of Surge Tank in Network. 2005No.3Vol.13Al-Rafidain Engineering Figure (13) Window for Analysis Air Chamber in Network. Figure (14) Window for Analysis Surge Valve in Network. 2005No.3Vol.13Al-Rafidain Engineering Figure (15) Window for Analysis Dead End in Network. Figure (16) Window for Analysis Networks (Branched Pipes). 2005No.3Vol.13Al-Rafidain Engineering Figure (17) Window for Analysis Network has Valve at Downstream. Figure (18) Window for Analysis Network has Jet at Downstream.