A COMPUTER EXPERT SYSTEM FOR ANALYSIS AND CONTROL OF WATER HAMMER PROBLEMS

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.


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".

Theoretical Aspects
Befor introducing a brief discription of general equation for water hammer problem, a basic architecture of an expert system is viewed.

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.No.3

Vol.13 Al-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].

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: The boundary conditions and control devices can be found in Refs.[3] and [6]

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.

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.No.3

Vol.13 Al-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.

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.

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

Figure ( 2 )
Figure (2) The Characteristic Grid for a Typical Pipe.

Figure
Figure (4) Some Programmable Steps of the Expert System.

Figure ( 12 )
Figure (12) Window for Analysis of Surge Tank in Network.

Figure ( 14 )
Figure (14) Window for Analysis Surge Valve in Network.

Figure ( 18 )
Figure (18) Window for Analysis Network has Jet at Downstream.