Abstract
A new numerical calculation method has been developed based on the nonlinear analysis characteristics of articial neural
network (ANN). This method is a novel algorithm for computational uid dynamics (CFD) using the concept of the articial
intelligence. It is completely different from prior traditional numerical methods. It does not generate mesh in the calculation domain
except for some random points, even does not solve the algebraic equations. This method has been applied to compute the
vaporwater two-phase ows in a tube with uniform and nonuniform heating. Through the comparison of the calculated results
between this method and theoretical analysis (the nite difference method), the validity of this meshfree method based on the ANN
is conrmed.
r 2005 Elsevier Ltd. All rights reserved.
Keywords: Articial neural network; Articial intelligence CFD (AICFD); Vaporwater two-phase ow; Meshfree method
0952-1976/$ - see front matter r 2005 Elsevier Ltd. All rights reserved.
doi:10.1016/j.engappai.2005.01.007
ARTICLE IN PRESS
664 Z. Shang / Engineering Applications of Artificial Intelligence 18 (2005) 663671
x1 output y
W1i
Wni
W1i-1 W1i
W1i+1
xn
input x
1999; Walid and Shyam, 1998; He et al., 2000): Fig. 2. Boundary network.
!
Xn
yi f wji xj w0i , (8)
output y
j1
Start
Randomly set the weight of the Solve the mass conservation equation using Solve the energy conservation equation Solve the mass conservation equation using
boundary network and positions the function network using the function network the function network
inside the calculation domain
1.keep the position inside the calculation 1.keep the position inside the calculation 1.keep the position inside the calculation
domain and compute the right side of the domain and compute the right side of the domain and compute the right side of the
Solve the boundary network using mass conservation equation at these conservation equation at these position as momentum conservation equation at these
the inlet position and pressure as position as the training samples the training samples position as the training samples
the training sample 2.copy the trained weights from the bound 2.copy the trained weights from the bound 2.copy the trained weights from the energy
-ary file as the weights of the function -ary file as the weights of the function file as the weights of the function
network network network
Train the function network using BP algorithm Train the function network using BP algorithm Train the function network using BP algorithm
no
Convergent?
no no no
Convergent? Convergent? Convergent?
yes
yes yes yes
Save the weights of the boundary
network to the boundary file Save the weights of the function Save the weights of the function
Save the weights of the function
network to the mass file network to the mass file
network to the energy file
yes
End
neural network (Hecht, 1989; Johansson et al. 1992). where k 0; 1; 2: Adopting an iterative gradient-des-
Supposing the input data of a neural network are cend procedure to Eq. (10) we get the weights with the
fxjxk ; k 1; 2; . . . ; ng (the input of learning examples), following mathematical equation (Johansson et al.,
output data are fyjyl ; l 1; 2; . . . ; mg and the objective 1992):
data are fsjsl ; l 1; 2; . . . ; mg; the training process will
be performed with the following mathematical compu- p p1 qey; s
wki wki l (11)
tational procedure. qwki wki wp1
ki
The errors between the output data and the
objective data can be calculated by the following in which l is the step-size, superscript p indicates the
equation: order number of iteration.
In this paper, the boundary network is mainly to deal
1X m
with boundary conditions. This means that the bound-
ey; s y sl 2 , (9)
m l1 l ary conditions will be adopted as the learning data to
train the boundary network. However, differential
where m is delegated as the numbers of output data, equations as the learning examples will train the
yl is the output set of the boundary or function net- function network. The solving procedure will be
work and sl is set of the objective data (the output performed as the following steps:
of learning examples). Applying the least mean
squares (LMS) (Shang et al., 2002) algorithm into
Eq. (9) gives 1. Randomly choose the initial weights between 0 and 1
for the boundary network.
qey; s 2. The boundary conditions are treated as the learn-
0, (10)
qwki ing examples to train the boundary network.
Fig. 6. Enthalpy changing curve and convergent curve of neural networks: (a) curve of enthalpy along the tube, (b) convergent curve of enthalpy of
boundary network and (c) convergent curve of enthalpy of function network.
ARTICLE IN PRESS
668 Z. Shang / Engineering Applications of Artificial Intelligence 18 (2005) 663671
Through the mathematical computational pro- input the boundary network, which has become the nal
cedure in Eq. (9)(11), the nal correct weights are working network, in fact, the numerical result of the
gotten. differential equation at this point x can be gotten.
3. Use the weights gotten by the boundary network as
the weights of the function network and use the
differential equations describing the vaporwater
two-phase ow as the learning examples to train the
function network.
4. Use the weights revised by the function network as
the new weights of the boundary network.
5. Repeat from step 2 to step 4 until the con-
vergent precision or the iterative times will be
reached.
At the third step, when the function network is
trained, the effects of boundary condition will be intro-
duced into inner solving domain directly and quickly,
because the weights of the function network are of the
boundary network. This virtue that the boundary situ-
ation can directly affect the inner domain will not be
performed by the traditional numerical methods. When
the solving process is nished, any point x is chosen to Fig. 8. Curve of temperature of vaporwater two-phase ow.
Fig. 7. Pressure changing curve and convergent curve of neural networks: (a) curve of pressure along tube, (b) convergent curve of pressure of
boundary network and (c) convergent curve of pressure of function network.
ARTICLE IN PRESS
Z. Shang / Engineering Applications of Artificial Intelligence 18 (2005) 663671 669
Fig. 10. Enthalpy changing curve and convergent curve of neural networks; (a) curve of enthalpy along the tube, (b) convergent curve of enthalpy of
boundary network and (c) convergent curve of enthalpy of function network.
ARTICLE IN PRESS
670 Z. Shang / Engineering Applications of Artificial Intelligence 18 (2005) 663671
The function network has the same structure as the with the analysis results. The errors of results between
boundary network. In this paper, we chose 12 random the neural networks and the nite difference method are
points, in which 10 points (from 0 to 1) are selected quite small. The computational precision of a neural
inside the tube size and two points (0 and 1) are the network is able to satisfy the requirement of practical
boundary points at the two ports of the tube, engineering, although the results are gotten without
respectively, as the input data for function network. solving any algebraic equation. Figures (b) and (c) in
The diagram for solving the ow situation is shown in Figs. 6 and 7 show the convergent curves of boundary
Fig. 5. network and function network, respectively. The con-
When the whole solving process is nished, the vergent speed of boundary network is faster than the
other 20 stochastic points in the solving domain, function network, even at the beginning of the solving
which are different from the prior learning exam- process; the boundary network has reached the con-
ples, are chosen to input the working network for vergence. Therefore, the whole calculation time will be
getting the nal numerical results. If the boundary (inlet spent at the function network.
and outlet) points are added, the total points are 22. Using the pressure gotten from neural networks, we
The computational results are shown in Figs. 6(a) can observe the temperature changing along the tube
and 7(a). In these gures, macula is delegated as the and judge if the ow has already reached the two-phase
numerical result by the neural network. The solid line ow. Generally, under the heating condition, the
gives the result by the nite difference method, which temperature of a single-phase liquid will move up along
can be considered as the analysis results. From the the tube, and the boiling of liquid happens at the
gures, we can see that the results of numerical temperature of the liquid which is the saturated
calculation by neural networks are very well congruent temperature (Shang, 2000). From this point, Fig. 8
Fig. 11. Pressure changing curve and convergent curve of neural networks: (a) curve of pressure along the tube, (b) convergent curve of pressure of
boundary network and (c) convergent curve of pressure of function network.
ARTICLE IN PRESS
Z. Shang / Engineering Applications of Artificial Intelligence 18 (2005) 663671 671