II RESPONSE Lee and CHANNEL

advertisement
TRANSIENT RESPONSE OF A SINGLE HEATED CHANNEL
by
Min Lee and M. S. Kazimi
II
r~lin
NUCLFA" EkA7i
EEING
READG
RuM~r
- JT.
MITNE-271
Department of Nuclear Engineering
Massachusetts Institute of Technology
Cambridge,
Massachusetts
July 25,
02139
1984
TRANSIENT RESPONSE OF A SINGLE HEATED CHANNEL
by
Min Lee and M. S. Kazimi
ABSTRACT
The adequacy of four approaches to description of the transients in
a heated channel are investigated.
The four approaches are:
sectionalized compressible flow model,
the
the momentum integral model,
single velocity model and the channel integral model.
the
The transients
investigated represent flow reduction and power increase under
conditions representative of PWR and BWR pressure and flow rate
conditions.
While the first approach is the most rigorous one, it requires much
longer computational times.
The constraints implied by the other
models, and hence the class of transients they should not be used for
are outlined.
Nomenclature
A
flow area
c
velocity of sound
De
equivalent hydraulic diameter
f
friction factor
g
gravitational acceleration
G
mass flux
H
enthalpy
q'
axial power input per unit length
p
pressure
t
time
u
fluid velocity
z
axial distance
2
p
two phase friction multiplication factor
density
Subscripts
j
cell designation for finite difference in mean value
within the area
Superscript
i
time step designation
-iii-
Table of Contents
Page
Abstract ........................................................
i
Nomenclature ....................................................
ii
Table of Contents ............................................... iii
List of Figures .................................................
v
List of Tables ..................................................
vi
1.
Introduction ................................................
1
2.
Sectionalized Compressible Flow Model .......................
3
2.1
Differential Equation ..................................
3
2.2
Finite Difference Equation .............................
5
2.3
Results ................................................
6
Momentum Integral Model .....................................
7
3.1
Differential Equation ..................................
7
3.2
Finite Difference Equation .............................
9
3.3
Results
3.
................................................
10
Single Mass Velocity Model ..................................
11
4.1
Differential Equations .................................
12
4.2
Finite Difference Equations ............................
13
4.3
Results ................................................
13
Channel Integral Model ......................................
14
5.1
Differential Equations .................................
14
5.2
Finie Difference Equations .............................
15
5.3
Results ................................................
17
6.
Conclusion ..................................................
17
7.
References ..................................................
20
4.
5.
-
iv-
Table of Contents (continued)
General Information and Input Manual of
Computer Codes...............................
...
36
Appendix I.B
Input Manual ................................
...
37
Appendix II.
Computer Codes for Transient Response of a
Single Heated Channel .......................
39
Appendix II.A
Sectionalized Compressible Flow Model .......
40
Appendix II.B
Momentum Integral Model .....................
59
Appendix II.C
Single Velocity Model .......................
77
Appendix II.D
Channel Integral Model ......................
92
Appendix I.A
List of Figures
Figures
1
Sectionalized Compressible Flow Model Calculation Cell .....
21
2
Sectionalized Compressible Flow Model (PWR pressure drop
decrease transient) ........................................
22
Sectionalized Compressible Flow Model (BWR pressure drop
decrease transient) .................. .....................................
23
Sectionalized Compressible Flow Model (PWR heat flux
increase transient) ................. .....................................
24
3
4
5
Sectionalized Compressible Flow Model (PWR pressure drop
decrease transient - long term) ...... ...................... 25
6
Momentum Integral Model (PWR pressure drop decrease
transient) .......................... .....................................
26
Momentum Integral Model (BWR pressure drop decrease
transient) .......................... .....................................
27
8
Momentum Integral Model (PWR
heat flux increase transient) .
28
9
Momentum Integral Model (BWR heat flux increase transient) .
29
10
Momentum Integral Model (PWR pressure drop decrease
transient - long term) .....................................
30
Comparison between Single Mass Velocity Models and Others
(PWR pressure drop decrease transient ......................
31
12
Channel Integral (PWR pressure drop decrease transient) ....
32
13
Channel Integral Model (BWR
drop decrease transient)
33
14
Channel Integral Model (PWR
heat flux increase transient)
15
Channel Integral Model (PWR pressure drop decrease
transient-long term) ....................................... 35
7
11
.......
34
-vi-
List of Tables
Table No.
1
Cases Analyzed
8
1.
INTRODUCTION
By neglecting the lateral variation of fluid properties and
velocity, the conservation equations of mass, momentum and energy for a
single heated channel can be written in the following form:
39
3G
acm
-t +
3G
5t
P
2
--
-(C
-
3z
o(f
m m
z
2De
aH
m
m)GmI(2)
-(p)
/p )p=.
3H
pm
(1)
0
Gm
G
=P
+
+
m
$(f/P)/ I GmG
[D,
m]
(3)
Under the assumption that the liquid and vapor can be considered as a
homogeneous mixture, the above equations are applicable for two phase
flow as well as for single phase flow.
In order to understand the transient response of a single heated
channel, the solution for Gm(z,a), P(z,t), and Hm(z,t) is
desired for the above equations under appropriate boundary conditions.
The difficulty in solving the general transient equations arises from
the coupling between the solution of the momentum and the energy
equations.
However, several different levels of approximations, or
models [1],
can be used to decouple the momentum and energy equations.
Those models are:
(1)
Sectionalized Compressible Model
This model is
the most direct and detailed representation of
channel behavior.
It is based on a direct numerical solution of
multiple point (or sectionalized) difference equation
approximations to the conservation equations (Eqs. (1 to 3)).
-2-
(2)
Momentum Integral Model
It
is
assumed that the density can be evaluated as a function of
enthalpy and a reference pressure where the latter is
a constant.
considered as
This is equivalent to assuming that the fluid is
incompressible.
is
It
clear that, under this assumption, the local
pressure gradient will not influence the mass flux of the fluid
Thus, the momentum equation is only useful in
along the channel.
determining the spatially averaged mass velocity.
(1) and (3)
Combining Eqs.
and with the help of the equation of state, we can use
a difference approximation to find the variation of the local mass
In this model, the sonic
velocity about the average mass velocity.
effects are neglected.
The effects of thermal expansion and
enthalpy transport are preserved.
(3)
Single Mass Velocity Model
Further computational simplification can be obtained if the effect
of thermal expansion is neglected in handling the mass velocity
profile.
That is
the mass velocity is
considered to be constant
throughout the channel and is a function of time only.
This model
preserves the effect of enthalpy transport.
(4)
Channel Integral-Model
Channel Integral model solves all three conservation equations in
an integrated manner.
and energy equation,
This is
In order to perform the integration of mass
an axial profile of the enthalpy is
assumed to be the same as that in
steady state condition.
Hence, in this model, the effect of enthalpy transport is
The effect of thermal expansion is
required.
preserved.
neglect.
-3-
we need to specify the boundary
solving these equations,
In
These are:
conditions.
(1)
The inlet and outlet pressures or the inlet velocity and the
pressure value at one of the ends.
(2)
The linear heat generation is given and is uniformly
distributed.
(3)
The inlet enthalpy is specified.
In this study, a computer code based on finite difference forms
The following sections summarize the finite
was written for each model.
difference equations and numerical schemes.
Examples for the results
using each of the models are also presented.
SECTIONALIZED COMPRESSIBLE FLOW MODEL
2.
2.1
Differential Equation
Assume that a differential equation of state is
pm
available:
pm(HmP)
then
ap m
ap m
Hm
a
ap
+
( PH
m
1
m
aH
=
Rh at
+ R
p at
(5)
From the mass conservation equation (Eq. (1))
3H
R
h at
DG
+ R
+
m
z6
0
(6)
Then Eqs. (3) and (6) may be combined to yield one equation only with
ap/at and a second only with
Hm/3t as a time derivative.
-4-
~mP
T2at
azPM
+(
+
c
3H
2 t
!z
3H
+ (R Gm)
m
+
M
]
(8)
2p- De
A
p
(7)
m
I-
R
=
-
2pmDe
Rp G
G
z
(RhGm
a
)
hm
(f/p)|jG
+
R [
h A
p
R+
PmaGm
m
where c, the isentropic sonic velocity, is given
c = 1/(R
+
R /pm)0.5
(9)
The equations we are interested in are Eqs. (2),
in terms of p, Hm, Gm.
(7) and (8)
which are
By the relation Um = Gm/ 9
we can change all three equations into the following form:
$
aU
aU
PM
+ Um
) ~z
z
p
2(
+U)
=
c
p
3
3H
+ Um
2
a
m
-
U
z-
(f/p)p2 U2
2De
~4g
,
ma
+ R
2De m
+
3U
m
$ .04(f/ p) p 2 U 3
,
hA
(a- +
pA
(10)
2 (f/
'2
(12)
p) p2U3
WDe m m)
(12)
-5-
2.2
Finite Difference Equation
Using staggered mesh (Fig.
i+1
(U
(U j+1/2
(p )
m j+1/2
P
(Um)+J+112]
j+1/2
~2
1
(P)MJ1
m j-1/2
(C)j-1/2
~
o
+ (U
)i+1
m j-1/2
m)i+1
j-1/2
(U
(P )
m j-1/2
(c 2
i
P.
/2
m j+1/2g
(13)
i
P
AzTJJ
(U )1+1
(f/p)]1+l (2)1_
1/2 m J12
- (R ) i
-12
h
3U)1+1
m-112
2De
(H
J
~
Az
m j-1/2
2
)(Urn
m +12
2De
i+1
P.
-P.
.(p )i1
i
(Urn) J111
Az
(f/P) j+1[(p
-P.
Az
[
+ -o
(U)J
/[(U m)1
m J+1/2
j+112-
At
J+1
=
1) and an explicit method [2], we have:
+1/
)V 1
A
I
(14)
i+1
1I
i+1
+
(Urm )j-1/2
2 -
i+1
(Um j-1/2
At
(Hm
m
Az
m) -1
I
j-1/12
iU+1
m j-1/2
20(
+
(Um f-1/
A 1/2
Az
21
2De
+ (R
3)
(U
1+1
m
rj-112]
p
i
j -1/2
Ij-1/2 A
(15)
-6-
In the above difference equation, the parameters (Rh)j-1/2, (R )j-1/2'
(c)j-1/2 are evaluated by the following equations:
(R)M((Hm)
h j - 11 2
j
~(H
j-1/2
mJ
p ((Hm ) j-12
p j-1/
2
P
= ((c) . + (c)
(c).
j-1/2
pm((Hm ) j-12'
-
=
Jj-1
j-1/2)
~ Pm (Hm)j-1'
- ( Hm -
-
1
P
)12.
Where (c). is evaluated by Eq. (9) with the values evaluated as the
local derivative of density with respect to enthalpy and pressure.
Equation (13)
can be solved explicitly.
With the value of (Um)
at
the new time step, Equations (14) and (15) can also be solved
explicitly.
If the inlet velocity is specified in the calculation, the
inlet pressure can be calculated by Eq. (14) at the first half cell,
i.e., the equation is written in terms of P1/2.
For pressure
boundary conditions the inlet velocity can be calculated by Eq. (13)
written in terms of (Um) 1/4
A half cell equation is also needed for
calculating the outlet velocity.
2.3
Results
Several cases were analyzed (Table 1).
Those are PWR heat flux
increase transient (by 10%, step function), and PWR, BWR pressure drop
decrease transient (by 1/2,
equal to 0.025 sec- 1).
Fig. 5.
exponential function with time constant
The results are shown in Fig. 2 through
From Fig. 2 the effect of the sonic wave can easily by
identified.
-7-
Table 1
Cases-Analyzed
BWR
PWR
Condition
Operating
Oneratino Condition
Channel Length (m)
3.66
3.05
Rod Diameter (m)
9.70 x 10-3
1.27 x 10-2 m
Pitch (m)
1.28 x 10-2
1.595 x 10-2 m
q' Linear Heat (kW/m)
17.52
16.4
Mass Velocity (kg/m2 sec)
4124.90
2302.4
P inlet (MPa)
15.5
6.9579
H inlet (kJ/kg)
1337.2
1225.5
Transients
(i)
Pressure Drop Decrease Transient
P inlet (t)
= (P inlet (0)
+
(ii)
+ P outlet (0))12.
P inlet (0) - P outlet (0)
2
Heat Flux Increase Transient
q'(t) = q'(0) * 1.1.
x exp (-400 t)
-8-
The sonic velocity for the PWR operating condition is approximately 900
m/sec.
The results for the BWR are slightly different, (Fig. 3), the
sonic wave propagates faster in the single phase region and slows down
considerably in the two-phase region.
is approximately only 100 m/sec.
flux transient
(Fig.
4)
is
The sonic velocity in this region
The flow oscillation in the PWR heat
also induced by the sonic wave.
The effect
of thermal expansion on the distribution of mass flux can be seen in
Fig. 5.
It can be justified that the boiling begins around 1.1 sec.
after the start of the transient.
Numerical stability of the difference solution requires that the
time step size be less than the order of the time interval for sonic
wave propagation between two points, i.e.,
At
< Az/(C+ UI)
(16)
in a problem in which the fluid has a high-sonic velocity,
Therefore,
the time step becomes prohibitively small from a computer time
standpoint.
Another difficulty for this model arises from the choice of
the correct sonic velocity in finite difference equation.
The sonic
velocity decreases suddenly by more than one order of magnitude as the
boiling begins.
This imposes some extra problems on the stability of
the numerical scheme.
3.
Momentum Integral Model
3.1
It
Differential Equations [3]
is
Pm
assumed that
Pm(Hm'P*)
where P* is a reference pressure.
(17)
From the mass equation (1) we have
-93C
3 p
(
-
H
(18)
(
m
Integrate the momentum equation (2)
over the channel and define Gave
as the average mass velocity we have:
ave
( p - F)
at
AP= - J
where
dz = p
az
inlet
0
L
Gave
0
-
Poutlet
m
()outlet
T) inlet +
m
m
G|G
*2 (f/p)
L
G2
G2
F =
(19)
f0
2e
L
dz + f
m
2De
0
pmgdz
By neglecting the pressure and friction terms in the energy equation
(3) we get:
Gm az m
Pm t m
(20
(0
A
The equations we need to solve are Eqs. (18),
3.2
Finite Difference Equations
Using a staggered mesh where (Gmj
(Hm
(19), and (20).
-1/2 and (pm
is defined at the cell boundary,
-1 2 are defined at the center of cell.
Then, from
Eq. (20) we have:
At
i+1 =+
i
+
(Hm)
(H)
m j+112
m j+1/2
(G)
Li
m
-
(H)
(H)
i
m j+312
j+1
-
m j+112
2
m j-1/2A
+ (G )i
mj
(H )
- (H )
m j+1/2
m j-1/2) +
2
(21)
j+1/2 At/A (p m)j-112
q')1
Combining Eqs. (18) and (20) and rearranging, we have
(1 +
dp(
dHm HmG)a m
_
1
dPm
A
GmHm
az
(22)
-10-
Convert the above equation into a finite difference form,
m j+1
Hm dpm
1 +(p
dH
m
m
Gm j
(H)
M
(H)
).
(G )G
-
)
(H).
+()
m j+1/2 + Hm J-112
m- 3
2
m j+1_
-
A
1 dpm
p dH )
m m
Az
j+1/12
we have
2
Az
By rearranging the last equation we get:
(G ).
mj-3+1
= (a.(G ).
+ S.)
mj
3
(23)
J
where
+
(H ) .
1
dp
p
dHm j+1/2
2
2
(Hm)j+1/2 - (Hm j+312
dpm
Pm dHm j+1/2
2
-z
(1 dm)
p m dH n j+1/2
1+
(1
pm
dp
dH
- (H )d1/2
A
(Hm)j+1/2 - (H)
j+112
j+3/2
2
All the above values are referred to new time step, i.e., i+1.
Equation
(19) can be changed into:
(Gave) i+1 = (Gave)
+
L
(Api- F )
(24)
From the initial conditions, the enthalpy distribution (Hm)f+1
new time step can always be calculated with Eq. (21).
at a
For a flow
transient, (Gm) 1 is specified, and the mass flux distribution can be
known from Eq. (23).
For a pressure transient, Gave at new time step
can be obtained from Eq. (24) and by following the relation we can find
(Gm) 1'
-11-
i+1
_1
(G )i
ml1
(25)
i+1 _^+
A-+ (Gave -6
(25
i+1av
Y
where
+1
1
1+1
i+1
j=1
^+
_ 2N
2N
.
(6+1 + 61+)
J
j-1
and
i+1 i+1
i+1
y.
= a.
y. 1 , y= 1
-1
J
J
61+1
a
J
+1
J
3.3
6 j+1
J-1
o
+ S.,
J
6
= 0
0
Results
The same cases as those of the sectionalized compressible flow
model were analyzed.
was analyzed.
it
Besides that, a BWR heat flux increase transient
The results are shown in Fig. 6 through 10.
From Fig. 6,
can be seen that the flow oscillation predicted by the previous model
was not observed in
transient,
the BWR,
this model.
For the PWR pressure drop decrease
the mass velocity distribution is
relatively uniform.
For
the outlet mass velocity decreases at a slower rate compared
with that of the inlet mass velocity (Fig.
7).
This is due to the fact
that the thermal expansion has larger effect in a boiling channel.
Figure 8 shows the results of a PWR heat flux increase transient.
mass velocity at the outlet is
thermal expansion effect.
The
larger than that at the inlet due to the
Again we did not see the flow oscillation
phenomenon predicted by previous models.
For the BWR heat flux increase transient, the variation of mass
velocity is
larger due to the more severe thermal expansion.
Figure 10
-12-
shows the variations of mass velocity after boiling begins.
Compare
this figure with Fig. 5; it can be seen that both models can predict
thermal expansion,
however,
the results from the sectionalized
compressible flow model are more pronounced.
As expected, the main advantage of the momentum integral method is
that the numerical limitation of Eq. (16) is now replaced by the less
stringent requirement, i.e.,
At < AZ/lU
(26)
In Eq. (23), the parameter (dp m/dHm ) j+12 is evaluated by the following
equation.
dPm
_
dHm j+1
2
m
(Hmj
j-1
1 -
m
j
(27)
(Hm j
The primary reason for doing so is
to avoid the drastic change of the
derivative as boiling begins.
4.
SINGLE MASS VELOCITY MODEL
4.1
Differential Equations
It is assumed that the density change due to the fluid expansion is
neglected.
The mass equation Eq. (1) simplifies to
3G
m
(28)
0
Integrate the momentum equation over the channel length.
3G
We have
1
(9
9t = L (Ap - F)
(29)
where
L
F =f
$2
G2
(f/p)GmIG
L
2De
m
dz + f Pmgdz + (
out
0~
0
M
G2
m in
m
-13-
We also neglect the friction and pressure terms in the energy equation
DH
pma-t
4.2
m
aH
m
G
+m
az
(30)
AL
(
Finite Difference Equations
From Eq. (30)
i+1
i
m j-1/2
(H).
m j
-(H)
(H )i+1
I
m j
2At
+1i+1ii
-
(H ).
i+1
j-1
-(H)
+ (H )
-
2Az
m j-1
(H
)
m j-1 _'
mj
m j-1
mj
+ G
m
+ (H)
m
A
Rearrange it.
(H ).
m j
=
(H )
m j-1
-
a
1+a
[(H )i+1
m j-1
-
(H )]
mj
+
(
q'/A - 2At
(31)
1
m j-l1/2 ('+a)
where
G At
a-A
(rpmn
j-1/2 Az
From Eq. (29)
Gi+1 = G
(p i+- F )
(32)
We can either use Eq. (32) to calculate the new mass velocity for a
pressure transient or use it to calculate the pressure drop for a flow
transient.
After we know the mass velocity, we can use Eq. (31)
calculate the enthalpy and density distribution.
F
to
Then determine the
accordingly.
4.3
Results
The results from this model and those from the momentum integral
model for a PWR pressure drop decrease transient are compared in Fig.
11.
In
the momentum integral model,
after boiling takes place,
the
fluid being expelled from the channel causes the exit mass velocity to
-14-
be considerably greater than that at the inlet.
The single mass
velocity model follows the behavior of the momentum integral model up to
Afterwards, however, the single mass velocity
the point of boiling.
remains within the limit of the other two velocities of the momentum
integral model for only a short time and deviates considerably from both
during the later stages of the transient.
The numerical scheme is stable for reasonable time step size.
It
is still unclear what is the numerical stability limitation.
5. CHANNEL INTEGRAL MODEL
Differential Equations [4]
5.1
The basis of this model is
an integration of the laws of
conservation of mass, momentum and energy over the length of the
During this integration, the shape of the enthalpy profile is
channel.
considered known and invariant during the course of the transient.
Those integrated balance operations are:
dl- = G - G
=
FE
(33)
n
0
dt
1 (Ap - F)
(34)
G
(5
-
d- = Q - G AH
n
dt
(35)
where
L
M = f pmdz
0
L
E =
f
Pm((Hm)
0
L
G
f
0
Gdz
-
Hin)dz
-15-
The shape of enthalpy profile in the integration is
Hm(z,t) = H
+ B(z)(H(t) - H i)
where
1L
A
H(t)
f
=
Hm(z,t)dz
0
andL
af L(z )dz = 1 , 6
0
=
0
It can be shown that [5], the mass velocity distribution can be
expressed as
Gm(z,t)
=
G0 (t) + Y(z,H) [G(t)
G0 (t)]
-
(36)
where
L
r
f Y(z,H)dz = 1, Y
0
0
=
Define
C
C = dE
1
(37)
A
At
dH
dH
Then from Eq. (33) and (34)
C
= Yn (Gin - G)
(38)
From Eq. (35) and (36)
A
C2
dH
G6H) + (yn-1)(G n-
Solve Eqs. (38) and (39) for
1
dH
A
A
-
H and G
dt
o
G)AH
,
(39)
that is
A
(40)
[Q - GAHI
C3
A
G
C1
A
= G +
[Q - GAH]
3
n
(41)
-16-
where
_
C3
Yn C 2
1AH
n
-
nL
-Y
Finite Difference Equations
5.2
In the channel integral model we solve Eqs. (34) and (40) in finite
That is
differencd form.
Q
H +
H+
ave
C3L
At
Ai
^i+1
+-
G
G
(43
(43)
i
[p
Aui+
From the calculated H
(42)
AH']
G-G
- F]
1+1
G
,
, we can find the enthalpy and mass
velocity distributions with the following relations:
i+1
A i+1 -H(4
-H.]
= H. + S(z) [(H)
in
m
in
mj
(44)
(H ).+
= G.
(G )
mj
in
j
(45)
i+1 - Gi+1]
+ Y (z,^ i+1
in
m
From the initial operating condition, we first calculate C1 , C2 and C3 ,
then with those values and the enthalpy and density distributions we can
evaluate Yj.
By Eq. (45), we can calculate the mass velocity
distribution at a new time step.
there is
In determining C1 , C2 , C 3 and y (H),
some iteration over H (Eq.
40).
That is,
(40)
using Eq.
A
i+1
the C1 , C2 , C 3 , y.(H) of the previous time step to estimate H
use this new H
1
to calculate C 1 , C 2 , C 3 and y (H).
^i+1
procedure until two successive H
Repeat this
get close enough.
The numerical limitations of the channel integral model are
unclear.
.
It is only known that the time step can not be too
and
Then
-17-
small (on the order of ms).
Otherwise, the situation of dividing by
zero will happen in the iteration stated above.
5.3
Results
The same cases as those of Section 2 were analyzed and the results
are shown in Fig.
12 to Fig. 15.
From Fig. 12 and Fig. 3,
it
can be
seen that owing to the neglect of the enthalpy transport effect (by
assuming the enthalpy profile) we tend to overpredict the outlet mass
velocity especially as the transient time is small.
worse for the BWR.
The situation is
For PWR heat flux increase transient, we see
approximately the same trends in the channel integral model as those of
the momentum integral model.
However,
two are not exactly the same (Fig.
the mass velocity profiles of the
13 and Fig.
8).
Figure 15 shows the
mass velocity profile after boilng begins in a PWR pressure drop
decrease transient.
The mass velocity profile keeps the same shape even
after the boiling begins which is different from the prediction of
the sectionalized compressible model and momentum integral model.
Again,
this is
believed to be the effect of enthalpy transport.
6. CONCLUSION
The transient response of a single heated channel have been
calculated by several different models.
levels of assumptions.
Those models involve different
Among those, the sectionalized compressible flow
model represents the most detailed approach.
performing this kind of detailed calculation.
very long.
However,
one pays for
The computer time is
The numerical scheme for sectionalized compressible model
used in this analysis is not good enough.
It is quite sensitive to
which value of the sonic velocity is used in the finite difference
-18-
equations.
Sometimes, the numerical scheme does not work for a certain
kind of transient, e.g., for a BWR heat flux increase transient.
The
sudden change of sonic velocity at the boiling boundary causes a lot of
problems and give unreasonable results.
The time step size of the momentum integral model is
less
restrictive, order of magnitudes different, compared with that of
sectionalized compressible flow model.
The results of momentum integral
model are only significantly different from those of sectionalized
compressible flow model in the first few tenths of milliseconds.
If we
want to calculate the long term response of a transient, the momentum
integral model seems good enough.
The momentum integral model preserves
the thermal expansion effect.
The single velocity is the simplest method we can use to solve the
transient responses of a single heated channel.
effect and thermal expansion effect,
transport effect.
It neglects the sonic
but preserves the enthalpy
Therefore, we can expect the single velocity will
give reasonable results as long as thermal expansion of the coolant is
not very large, i.e., it remains as a single phase.
In the channel integral model,
used throughout the transient.
from the true solution.
a preassumed enthalpy profile is
This will cause the results to deviate
It is believed that the situation will be even
worse for a nonuniform heat flux distribution or a transient heat flux
that changes its profile.
channel integral model is
Another interesting phenomenon observed in
that there are some oscillations in
the outlet
mass velocity in a PWR pressure drop decrease transient (Fig. 11).
is still unclear to the authors where these oscillations come from.
It
-19-
In all the calculations above, it has been assumed that the two
phase flow can be treated as a homogeneous flow with no slip.
interesting to know what is the impact of this assumption.
so,
we need only to modify the definition of densities in
It is
For doing
the momentum
and energy conservation equations and implement those new definitions
into a computer code.
-20-
7.
Reference
(1)
J. E. Meyer, "Hydrodynamic Models for the Treatment of Reactor
Thermal Transients," Nucl. Sci. and Eng. 19, 269-277 (1961).
(2)
R. D. Richtmyer, "Difference Methods for Initial-Value Problems,"
Interscience, New York, 1957.
(3)
J. E. Meyer, J. S. Williams, Jr., "A Momentum Integral Model for
the Treatment of Transient Fluid Flow," WAPD BT-25 (1962).
(4)
J. E. Meyer,
W. D. Long,
"A Channel Integral Model for the
Treatment of Transient Fluid Flow," WAPD-BT-23 (1961).
-21-
J+1
3
J-1
XX
X
(Um)
j-1
(Hm) _
Fig. 1.
(Um)
Pj
(Hm).
-,'
Pj+ 1
(Hm)j+1
Sectionalized Compressible Flow Model Calculation Cell.
SECTIONALIZED COMP. FLOW MODEL
PWR Pressure Drop Decrease Tran
MASS FLUX RATIO
1.22
4.88
7.32
11.59
'1.000
.995
-...............
.990
--
40
ra
.985
I
me
. 980
14.64
me
.975
15.25
me
. 970
.965 1
0. 0
'I
.1
'I
.2
'I
.3
'I
.4
iI
iI
.6
.7
RELATIVE AXIAL POSITION
.5
II
.9
.91.0
Fig. 2. Sectionalized Compressible Flow Model (PWR Pressure Drop Decrease
Transient)
SECTIONALIZED COMP. FLOW MODEL
BWR Pressure Drop Deorease Tran
1.22
1.00
MASS FLUX RATIO
me
.99
2.44
-
.98
.97
4.88
me
-
.96
1.0
-
7.32
.95
-
.94
me
.93
-
.92
.91
/
-
.90
I
0.0
.1
.2
.3
.7
.6
.5
.4
RELATIVE AXIAL POSITION
Fig. 3. Sectionalized Compressible Flow Model (BWR Pressure Drop Decrease Transient)
I
.9
1.0
SECTIONALIZED COMP.a FLOW MODEL
PWR Heat Flux Increase Trans.
MASS FLUX RATIO
1.0
1.010
M0
1.008
2.0
rae
1.006
4.0
1.004
me
1.002
a,
8.0
ran
20.
-998
me
.996
.994
.992
.9m0 0.0
.1
.2
.3
.7
.5
.6
.4
RELATIVE AXIAL POSITION
.8
Fig. 4. Sectionalized Compressible Flow Model (PWR Heat Flux Increase Transient)
.9
1.0
SECTIONALIZED COMP. FLOW MODEL
PWR Pressure Drop Decrease Tran
1.100
.53
MASS FLUX RATIO
Sec.
1.125
.52
Sec.
1.150
.51
Sec.
U,
1.175
Sec.
.49
1.200
Sec.
.48
.47
.46 L0.0
.3
.7POSI
.6
A.2I.4 .5
RELATIVE AXIAL POSITION
Fig. 5. Sectionalized Compressible Flow Model (PWR Pressure Drop Decrease Transient--Long Term)
MOMENTUM INTEGRAL MODEL
PRW
Pressure Drop Decrease Trans
MASS FLUX RATIO
1.22
1.000
me
2.44
.995
me
4.88
.990
r!o
7.32
me
. 985
11.59
me
.980
.975
.970
-
0.0
.1
.2
.3
.7
.6
.5
.4
RELATIVE AXIAL POSITION
.8
Fig. 6. Momentum Integral Model (PWR Pressure Drop Decrease Transient)
.9
1.0
MOMENTUM INTEGRAL MODEL
BWR Pressure Drop Deorease Tran
1.22
1.00
MASS FLUX RATIO
MR
2.44
-
.99
-
-
-
-
-
.~ .-
.-
-
-''
--
4.88
.98
7z
7.32
-
-
-
0~~~~~~
.97
11.59
Ma
.96 F
.95
.94 1
0.0
I
.1
I
.2
I
.3
I
.6
.7
.4
.5
RELATIVE AXIAL POSITION
I
.8
Fig. 7. Momentum Integral Model (BWR Pressure Drop Decrease Transient)
.9
1.0
MOMENTUM INTEGRAL MODEL
PWR Heat Flux Increase Trans.
MASS FLUX RATIO
1.0
1.006
2.0
1.004
4.0
1.002
me
ra
00
I
8.0
tAB
1.000
20.
ma
.998
.996
.994 L0.0
.1
.2
.3
.7
.6
.5
.4
RELATIVE AXIAL POSITION
Fig. 8. Momentum Integral Model (PWR Heat Flux Increase Transient)
.8
.9
1.0
MOMENTUM INTEGRAL MODEL
BWR Heat Flux Increase Tran.
0.1
MASS FLUX RATIO
1.05 1
Sec
0.5
Sao
0.9
Seo
r!o
.95
1.5
Seo
2.0
Sea
3.0
Seo
.85
0.0
.1
.2
.3
.4
.5
.6
.7
RELATIVE AXIAL POSITION
Fig. 9. Momentum Integral Model (BWP Heat Flux Increase Transient)
.8
.9
1.0
MOMENTUM INTEGRAL MODEL
PWR Pressure Drop Decrease Tran
MASS FLUX RATIO
Sec.
1.125
Sec.
/
--
1.100
.49
1.150
Sec.
.48
C
1.175
Sec.
1.200
.47
Sec.
0'o
-.-
-
.
.
.
.
.46
.
.
.
.
.....-.
.45
0. 0
I
.1
Fig. 10 .
.2
.3
I
.7
.6
.5
.4
RELATIVE AXIAL POSITION
.8
.9
1.0
Momentum Integral Model (PWR Pressure Drop Decrease Transient - Long Term)
SING-VEL. CHANL-INTE.
MOMEN-INTE
PWR Pressure Drop Decrease Tran.
SINGLE
VELOCITY
.70,
MASS FLUX RATIO
i
MOMEN-INTE.
INLET
.65
HOMEN-INTE
OUTLET
.60
CA)
I~a
CHANL-INTE
INLET
.55
CHANL-INTE
OUTLET
.50
.45
.40
1 2
0
Fig. 11.
3
4 5 6
7
8
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Second
Comparison between Single Mass Velocity Models and Others (PWR
Pressure Drop Decrease Transient)
CHANNEL INTEGRAL MODEL
PWR Pressure Drop Decrease Tran
MASS FLUX RATIO
1.22
1.005
me
2.44
1.000
me
4.88
.995
me
7.32
L)
.990
me
.985
11.59
me
.980
.975
.970 10.0
.1
Fig. 12.
.2
.3
.7
.6
.5
.4
RELATIVE AXIAL POSITION
.8
Channel Integral (PWR Pressure Drop Decrease Transient)
.9
CHANNEL INTEGRAL MODEL
BWR Pressure Drop Decrease Tran
6.00
1.10
MASS FLUX RATIO
ma
12.0
1.05
ma
18.0
me
1.00
(A)
(A)
24.0
.95
34.0
MO
.85
.80
0
Fig. 13.
1
2
3
7
6
5
4
RELATIVE AXIAL POSITION
8
Channel Integral Model (BWR Pressure Drop Decrease Transient)
9
CHANNEL INTEGRAL MODEL
PWR Heat Flux Increase Trans.
1.0
1.008
MASS FLUX RATIO
ma
2.0
4.0
me
C,-)
8.0
1.002
20.
ma
.998
.996
L0.0g
.1
Fig. 14.
.2
.3
.7
.5
.6
.4
RELATIVE AXIAL POSITION
.8
Channel Integral Model (PWR Heat Flux Increase Transient)
.9
1.0
CHANEL INTEGRAL MODEL
PWR Pressure Drop Decrease Tran
1.100
MASS FLUX RATIO
.50
Sec.
1.150
.49
Sec.
1.200
Seo.
.48
LJ-
U,
.47
.46
.45 '0.0
Fig. 15.
.1
.2
.3
.7
.6
.5
.4
RELATIVE AXIAL POSITION
.8
Channel Integral Model (PWR Pressure Drop Decrease Transient--Long Term)
.9
1.0
-36-
Appendix I.A:
General Information
A separate code was written for each of the following methods:
(1)
Sectionalized Compressible Flow Model
(2)
Momentum Integral Model
(3)
Single Mass Velocity Model
(4)
Channel Integral Model.
(1)
McAdames correlation was used to calculate the friction factor.
(2)
The Equation (5.209) p. 230 in Lahey and Moody was used to
calculate the two phase multiplier.
(3)
The Equations of State are the same as those of THERMIT [5].
However, the routine has been rewritten.
(4)
Subroutine INIT was used to calculate the pressure distribution
The
The inlet mass velocity must be given.
across the channel.
condition can also be input by the user.
initial
(5)
For different kinds of transient, the corresponding routines must
be modified. These are pilt, polt, power and gilt. The transient
in current coding is for a pressure drop decrease transient.
-37-
Appendix I.B:
Input Manual
Problem Title
Card 1
80 characters string
Card 2 (1)
chani (elO.5) Channel Length (m)
)
(2)
area (elO.5) Channel Flow Area (m
(3)
equd (310.5) Channel Equivalent Diameter (m)
Card 3 (1)
is (I5)
1: initial condition calculated by code
Others: initial condition supplied by user
(2)
isb
(I5)
1: Given mass flux for initial condition calculation
Others: Specified pressure drop for initial condition
calculation (only 1 can be input)
(3)
i$ (I5)
Others: Flow rate are specified for B.C.
(4)
NPP (I5)
Output will be given for each NPP time steps
Card 4 (1)
Time (e1O. 6) Total Transient Time (sec)
(2)
nots (i5) No. of Time Steps
(3)
nosn (i5) No. of Spatial Nodes
Card 5 (1)
giltO (elO.5) inlet enthalpy (3/kg)
(2)
hilto (elO.5) inlet enthalpy (3/kg)
(3)
pilto (elO.5) initial inlet pressure (Pa)
(4)
polto (elO.5) initial outlet pressure (Pa)
(* this value is unimportant for is=1)
(5)
poweo (elO.5) initial linear power (w/m)
-38-
Card 6
only need if is * 1
(1)
po(i)
pressure for ith node (Pa)
(2)
go(i)
mass velocity for ith node (kg/m 2 sec)
(3)
ho(i)
enthalpy for ith node (3/kg)
Totally NOSN cards are needed.
Files:
5:
input
6:
output
0:
terminal display
-39-
Appendix II:
Computer Codes for Transient
Response of a -Single Heated Channel
A.
Sectionalized Compressible Flow Model
B.
Momentum Integral Model
C.
Single Velocity Model
D.
Channel Integral Model
-40-
A.
Sectionalized Compressible Flow Model
I
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
c
c
c
c
c
c
solutions of transient balance equations for single heated channel
**
SECTIONALIZED COMPRESSIBLE FLOW MODEL
June
**
1983
dimension title(20)
common /param/hn(21),ho(21),gn(21),go(21),dn(21),do(21),pn(21),
1 po(21),x(21),un(21),uo(21),uin,uio,din,dio
common /sonvel/ csq(21)
common /datal/
chanl,areaequd,nosn,nots.dz,dt
read (5,1000)(title(i),i=1,20)
1000 format (20a4)
read (5,1010)chanl,area,equd
read(5,1050)is,isb,io,npp
read(5,1030)time,nots,nosn
1050 format(415)
1010 format(3e10.5)
read(5.1020)giltO,hiltO,piltO.poltO.poweO
1020 format(5e10.5)
1030 format(elO.6,2i5)
dz=chanl/(nosn-1)
dt=time/nots
if(is.eq.1)go to 130
do 10 i=inosn
read (5,1040)po(i),go(i),ho(i)
10 continue
1040 format(3e10.5)
go to 140
c
c
c
c
c
c
c
calculate the steady state density distribution
the initial condition is calculated by sub. init
130 call init(isb,giltO,hiltO,piltO,poltO,poweO,
1
poho,dogo,x)
140 continue
nosn1=nosn-I
do 90 i=1,nosni
ha=(ho(i)+ho(i+1))/2
pa=(po(i)+po(i+1))/2.
call densi(pa,ha,do(i),x(i))
uo(i)=go(i)/do(i)
90 continue
call densi(po(nosn),ho(nosn),do(nosn),x(nosn))
call densi(po(1),ho(1),dio,xa)
uio=giltO/dio
uo(nosn)=go(nosn)/do(nosn)
write(6,2000)
2000 format (//," transient solutions of single heated channel by",
1 " sectionalized compressible fluid model ")
write(6,2010)(title(i),i=1,20)
2010 format (/,20a4)
write(6,2020)
2020 format(/," channel geometry ")
write (6,2030)chanl,area,equd
2030 format( ix," channel length=",f6.3," m",
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
11
112
113
114
115
116
117
118
119
1/,"
flow area = ",e13.6, " m**2",
1
/,"
equi
diame = ",f6.3," m")
write(6,2040)
2040 format(/," operating condition ")
hiltw=hiltO/1000
piltw=piltO/1.e6
poltw=poltO/1.e6
powew=poweO/1000
write (6,2050)giltO,hiltw,piltw,poltw,powew
2050 format(ix," inlet mass flux =",f8.3," kg/m**2.sec",
1
/,"
inlet enthalpy = ",f8.3," kj/kg",
1
/,"
inlet pressure = ",f7.4," Mpa",
1
/,"
outlet pressure = ",f7.4." Mpa",
1
/"
power =
",f7.4," kw/m")
write(6,2300)time,dt
2300 format(/," total transient time =",e13.6,
1 /,"
time step size ",e13.6)
write(6,2110)
write(6,2070)
do 150 i=1,nosn
pw=po(i)/1.e6
hw=ho(i)/1000
write(6,3080)i,pwgo(i),hw,do(i),uo(i),x(i)
150 continue
initial conditions for transient calculation .")
2110 format(/."
c
np=O
do 30 i=1,nots
9000 format(1x," the time step ",16)
np=np+1
ttime=dt*i
timel=ttime-dt
tpolt=polt(polto,ttime)
qipt=power(poweO,timei)
hilt=hiltO
call calc(tpolthilt,qiptieror)
if(ieror.eq.1) go to 71
dtdz=dt/dz
c
c
c
determine the inlet velocity or inlet pressure
if(io.eq.1) go to 40
c
c
c
determine the inlet pressure for a flow reduced transient
tgilt=gilt(giltOttime)
call densi(po(1),hn(1),din,xa)
hal=(3*ho(1)+ho(2))/4
pa=(3*po(1)+po(2))/4
call densi(pa,hal,da,xal)
call rph(pa,hai,da,xai.rpi.rhai)
csqa1=l/(rp1+rhal/da)
if(csqa1.le.O.0)write(0,8888)csqa1
csqal",1x,e13.6)
8888 format(ix,"
uin=tgilt/din
uan=(uin+un(1))/2.
gai=da*uan
call frici(xa,pa,gai,da,foda,ieror)
if(ieror.eq.1) go to 71
pa=(3*po(2)+po(1))/4.
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
ha2=(3*ho(2)+ho(1))/4;
call densi(pa,ha2,daa,xaa)
call rph(pa,ha2,daa.xaa,rpa2.rha2)
csqa2=1./(rpa2+rha2/daa)
csq1=((csqal**.5+csqa2**.5)/2.)**2.
pa=(po(1)+po(2))/2.
call densi(pahal,dal.xal)
call densi(pa,ha2,da2,xa2)
rhi=(da2-dai)/(ha2-hai)
daaa=(daa+da)/2.
c1=(daaa*csql)*(un(1)+un(2)-2*uin)*dtdz/2.
c2=rhi/(daaa/csq1)*(qipt/area+foda*da**2*uan**3/(
1
2*equd))*dt
c3=(uin+un(1))*(po(2)-po(1))/2.*dtdz
pn(1)=po(2)+po(i)-pn(2)-2*(c1+c2+c3)
go to 60
c
c
c
determine the inlet velocity for pressure transient
40 pn(1)=pilt(piltO,poltO,ttime)
call densi(pn(1),hn(1),dinxa)
hal=(3*ho(1)+ho(2))/4
pa=(3*po(1)+po(2))/4
ua=(uio+uo(1))/2
call densi(pa,haldaxa)
call rph(pa,hal,da,xa,rpal,rhai)
csqal=1./(rpal+rhal/da)
ga=ua*da
call fricl(xa,pa,ga,da,foda,ieror)
if(ieror.eq.1)go to 71
pa=(3*po(2)+po(1))/4.
ha2=(3*ho(2)+ho(1))/4.
call densi(pa,ha2,daa,xaa)
call rph(pa,ha2,daaxaa.rpa2,rha2)
csqa2=1./(rpa2+rha2/daa)
if(csqa2.le.0.0) write(0,8887)csqa2
8887 format(1x," csqa=",e13.6)
csqa=((csqa1**.5+csqa2**.5)/2.)**2.
pa=(po(2)+po(1))/2.
call densi(pa,hal,dai,xal)
call densi(pa,ha2,da2,xa2)
rha=(da2-dai)/(ha2-hai)
daaa=(da+daa)/2.
cl=(foda*da*ua**2/(2*equd)+9.8)*dt*2
c2=(po(2)-po(1))/da*dtdz*2.
c3=(uo(1)+uio)*(uo(1)-uio)*dtdz*2
uin=uo(1)+uio-un(I)-ci-c2-c3
udif=0.1
int=O
itest=0
iti=O
d1=0.
uloi=uin
uini=uin
61 int=int+1
if(itest.eq.0)uin=uini
c
iteration over the pressure boundary
c
c
uan=(uin+un(1))/2.
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
c1=(daaa*csqa)*(un(1)+un(2)-2*uin)*dtdz/2.
181
c2=rha/(daaa/csqa)*(qipt/area+foda*da**2.*uan**3./(2*equd))*dt
182
c3=(uin+un(1))*(po(2)-po(1))/2.*dtdz
183
pnl=po(2)+po(1)-pn(2)-2*(c1+c2+c3)
184
d2=pni-pn(1)
185
if(abs(d2).le.1.0)go to 62
186
if(itest.eq.1)go to 66
187
if(d1.eq.O.0)go to 63
188
if((d1*d2).le.O.0)go to 64
189
63 ulol=uini
190
if(iti.eq.1)go to 67
191
if(d2.gt.O.0)uinl=uinl-udif
192
if(d2.lt.O.0)uinI=uinI+udif
193
if(di.eq.O.0)go to 65
194
if(abs(d2).le.abs(di))go to 65
195
itI=I
196
67 if(d2.gt.O.0)uinl=uinl+udif
197
if(d2.lt.O.0)uin1=uinI-udif
198
go to 65
199
64 itest=1
200
if(di.gt.O.0)go to 68
201
uh=uini
202
ul=uiol
203
dh=abs(d2)
204
d1=abs(di)
205
go to 69
206
68 uh=uio1
207
ul=uini
208
dh=abs(di)
209
dl=abs(d2)
210
69 uin=(ul*dh+uh*dl)/(dl+dh)
211
go to 65
212
66 if(d2.gt.O.0)go to 59
213
ul=uin
214
dl=abs(d2)
215
go to 69
216
59 uh=uin
217
dh=abs(d2)
218
go to 69
219
65 if(int.gt.50)go to 70
220
dl=d2
221
go to 61
222
62 continue
223
tgilt=uin*din
224
60 predi=pn(1)-pn(nosn)
225 c
226
do 260 l1=1,nosnl
227
ha=(hn(ii)+hn(i1+1))/2
228
pa=(pn(ii)+pn(iI+1))/2.
229
call densi(pa,ha,dn(iI),x(iI))
230
gn(ii)=dn(i1)*un(ii)
231
260 continue
232
call densi(pn(nosn),hn(nosn),dn(nosn),x(nosn))
233
gn(nosn)=un(nosn)*dn(nosn)
234
do 110 ii=1,nosn
235
po(ii)=pn(iI)
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
ho(iI)=hn(ii)
236
237
238
239
go(11)=gn(ii)
do(ii)=dn(ii)
uo(ii)=un(ii)
237
238
239
110 continue
240
uio=uin
241
dio=din
242
243
if(i.eq.20000)npp=100
244
if(i.eq.20000)np=O
245
if(np.ne.npp)go to 31
71 continue
246
247 c
write(0,9000)i
248
np=0
249
predw=predi/1000
250
qiptw=qipt/1000
251
write (6,2060)ttime,predw,qiptwuin,tgilt
write(6,2070)
252
253
do 120 i=l,nosn
pw=pn(ii)/i.e6
254
255
hw=hn(ii)/1000
256
gr=gn(11)/giltO
257
sonic=csq(ii)**0.5
write(6,2080)ii,pw,gn(ii),hwdn(ii),un(ii),x(ii),gr,sonic
258
259
120 continue
260
if(ieror.eq.1) go to 160
261
2060 format(//," transient time=",e13.6," sec ",
pressure drop = ",f8.4," kpa",
/,"
1
262
=
",f8.4, " kw/m",
power
/,"
1
263
inlet velocity = ",f7.4, " m/sec",
/,"
1
264
kg/m**2.sec")
inlet mass fux = ",f8.3,"
"
/,
1
265
",
pressure
2070 format(/"
266
density",
enthalpy
flux
"mass
1
267
quality ",
velocity
"
1
268
m/s ec.
kg/m**3
kj/kg
kg/m**2.sec
/,7x, " Mpa
I
269
270
2080 format(1x,12,3xf7.4,6x,f7.2,3x,f8.3,3x,
f7.3,3x,f7.4,4x,f6.3,3x,f7.4,4x,f7.2)
I
271
272
3080 format(1x,12,3x,f7.4,6x.f7.2,3x,f8.3,3x,
I f7.3,3x,f7.4,4x,f6.3)
273
31 continue
274
30 continue
275
go to 160
276
277 c
70 write(6,2100)ttime
278
279
2100 format (1x," iteration not converge at time eq. ",e13.6)
160 continue
280
281 c
end
282
")
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
U,
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
subroutine init(isi,giltO,hiltO,piltO,poltO.poweO,
1
p,h,d,gx)
dimension h(21),d(21),p(21),g(21),x(21)
common /datal/ chan1,area,equd,nosn,nots,dz,dt
call densi(piltO,hiltO,d(1),x(1))
h(1)=hiltO
p(1)=piltO
g(1)=giltO
i=1
n1=1
90 do 10 i=2,nosn
h1=h(i-1)+poweO*dz/(area*giltO)
pl=p(i-1)
call densi(pI,hi,d(i),x(i))
60 ha=(hl+h(i-1))/2.
pa=(p2+p(1-1))/2.
call densi(pa,ha,da,x1)
call frici (xi,pa,giltOda,fod.ieror)
p2=p(1-i)-fod*giltO**2.*dz/(2*equd)
1 -da*9.80*dz-giltO**2.*(1/d(i)-1/d(1-1))
call densi(p2,hi,d(i),x(I))
pa=(p2+p(i-1))/2.
call densi(pa,ha.da,xl)
call fric1(xi,p2,giltO,da,fod,ieror)
31 hi=h(1-1)+poweO*dz/(area*giltO)+(p2-p(1-1)+
1
(fod*giltO**2*dz)/(2*equd))/da
if(abs((p2-pl)/p2).le.i.Oe-8)go to 40
n=n+1
if(n.gt.50)goto 50
pl=p2
goto 60
40 p(i)=p2
h(i)=hl
g(i)=gilto
10 continue
if(isi.eq.1)poltO=p(nosn)
if(abs((p(nosn)-polto)/polto).le.1.Oe-4)return
if(n1.gt.50) go to 80
nl=nl+1
giltO=giltO*((p(nosn)-p(1))/(poltO-piltO))**0.5
goto 90
80 write(6,2110)
2110 format(1x," iteration not converge for pressure b.c.")
return
50 write(6,2090)i
2090 format(1x,"iteration not converge for spatial node ",12)
return
end
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
03
331
332
333
334
function power(poweO,timel)
power=poweO
return
end
1
2
3
4
335
336
337
338
function polt(poltO,timel)
polt=poltO
return
end
1
2
3
4
00
339
340
341
342
function gilt(giltO,timel)
gilt=giltO
return
end
2
3
4
343
344
345
346
347 c
348
349
350
351 c
352 c
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
subroutine fric1(xi,p,g,d,fod.ieror)
common /datal/ chan1,area,equdnosn,nots,dz,dt
data convi,conv2,vics/737.4643,1.4504e-4,91.7e-6/
data vics1/19.73e-6/
ieror=O
if(g.lt.O.O)ieror=i
if(g.lt.O.0)go to 60
use McAdames correlation to calculate the friction factor
thm=1.0
dpc=d
if(x1.eq.-1.0)go to 10
if(x1.eq.1.)go to 20
call satt(p,hls,hvs)
call Iden(p.hlsrol)
call vden(p,hvs,rov)
gtest=g*conv1/1.Oe6
if(gtest.le.0.7)cl=1.36+0.0005*p*conv2+0.1*gtest
1
-0.000714*p*conv2*gtest
if(gtest.gt.0.7)cl=1.26-0.0004*p*conv2+0.119/gtest
1+0.00028*p/gtest*conv2
thm=cl*(1.2*(rol/rov-1)*x1**0.824)+1.0
dpc=rol
10 fric=0.184*(g*equd/vics)**(-0.2)
go to 21
20 fric=O.184*(g*equd/vicsl)**(-0.2)
21 fod=thm*fric/dpc
60 continue
return
end
I
2
3
4
5
6
7
8
9
10
II
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
C
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
subroutine calc(tpolt,hilt,qipt,ieror)
common /sonvel/csq(21)
common /param/ hn(21),ho(21),gn(21),go(21),dn(21),do(21),pn(21)
1
,po(21),x(21),un(21),uo(21),uin,uio,din,dio
common /datal/ chan1,area.equd,nosn,nots,dz,dt
dimension fod(21),rp(21),rh(21)
nosni=nosn-1
nosn2=nosn-2
pa=po(1)/2.+po(2)/2.
do 10 i=1,nosni
ha=(ho(i)+ho(i+1))/2
pa=(po(i)+po(i+1))/2.
call rph(paha,do(i),x(i),rp(i),rh(i))
csq(i)=i/(rp(i)+rh(i)/do(i))
if(csq(i).le.O.0)write(0,9999)i,csq(i)
9999 format(1x, i=", 14,"csq(i)=".e13.6)
call fric1(x(i),po(i),go(i),do(i),fod(i),ieror)
if(ieror.eq.1)goto 100
10 continue
do 11 i=1,nosn2
hal=(ho(i)+ho(i+1))/2.
ha2=(ho(i+1)+ho(i+2))/2.
pal=(po(i)+po(i+1))/2.
pa2=(po(1+1)+po(i+2))/2.
call densi(po(I+1),hai,dai,xai)
call densi(po(i+i),ha2,da2.xa2)
call densi(pai,ho(i+1),da3,xa3)
call densi(pa2,ho(i+1),da4,xa4)
rp(i)=(da3-da4)/(pai-pa2)
rh(i)=(da2-dai)/(ha2-hai)
11 continue
pa=(3*po(nosn)+po(nosni))/4.
hal=(ho(nosni)+ho(nosn))/2.
call densi(pa,hal,dai,xal)
call densi(pa,ho(nosn),da2,xa2)
rh(nosni)=(da2-da1)/(ho(nosn)-hal)
ha=(3*ho(nosn)+ho(nosni))/4.
pal=(po(nosni)+po(nosn))/2.
call densi(pal,ha,da3,xa3)
call densi(po(nosn),ha,da4,xa4)
rp(nosni)=(da4-da3)/(po(nosn)-pai)
hn(1)=hilt
dtdz=dt/dz
ci=uo(1)*(uo(1)-uio)*2*dtdz
c2=(po(2)-po(1))/do(1)*dtdz
c3=fod(1)*do(1)*uo(1)**2.*dt/(2*equd)+9.8*dt
un(1)=uo(1)-c1-c2-c3
do 40 i=2,nosni
c1=uo(i)*(uo(i)-uo(I-1))*dtdz
c2=(po(i+1)-po(i))/do(i)*dtdz
c3=fod(i)*do(i)*uo(i)**2.*dt/(2*equd)+9.8*dt
un(i)=uo(i)-c1-c2-c3
gol=un(i)*do(i)
call frici(x(i),po(i),gol,do(i),fod(i),ieror)
If(ieror.eq.1) go to 100
40 continue
do 50 i=2,nosni
da=(do(i-1)+do(i))/2.
csqa=((csq(i-I)**.5+csq(i)**.5)/2.)**2.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
rha=rh(i-1)
c1=un(i-1)*(po(i)-po(i-1))*dtdz
c2=(da*csqa)*(un(i)-un(1-1))*dtdz
c3=rha/(da/csqa)*(qipt/area+fod(i-1)*
1
do(1-1)**2.*un(I-1)**3./(2*equd))*dt
pn(i)=po(i)-ci-c2-c3
50 continue
pn(nosn)=tpolt
ua=un(nosn1)
call rph(po(nosn),ho(nosn),do(nosn),x(nosn),rp(nosn),rh(nosn))
csq(nosn)=1./(rp(nosn)+rh(nosn)/do(nosn))
if(csq(nosn).le.O.0)write(0,8886)csq(nosn)
8886 format(1x," csqa11 ",e13.6)
uan=un(nosni)
csqa=((csq(nosnl)**.5+csq(nosn)**.5)/2.)**2.
rha=rh(nosnl)
daa=(do(nosni)+do(nosn))/2.
cl=(3*pn(nosn)+pn(nosn1)-3*po(nosn)-po(nosni))/(8*dtdz)
c2=un(nosnl)*(po(nosn)-po(nosni))
c3=(c1+c2)/(daa*csqa)
c4=rha*dz/daa**2.*(qipt/area+fod(nosnl)*do(nosnli)**2.
1 *un(nosni)**3./(2*equd))/2.
un(nosn)=un(nosni)-c3-c4
do 130 i=2,nosni
csqa=((csq(1-1)**.5+csq(i)**.5)/2.)**2.
da=(do(i-i)+do(i))/2.
rpa=rp(1-1)
cl=un(1-1)*(ho(i)-ho(1-i))*dtdz
c2=csqa*(un(i)-un(i-1))*dtdz
c3=rpa/(da/csqa)*(qipt/area+fod(i-1)
1 *do(i-1)**2.*un(i-1)**3./(2*equd))*dt
hn(i)=ho(i)+c3-ci-c2
130 continue
csqa=((csq(nosn)**.5+csq(nosnl)**.5)/2.)**2.
rpa=rp(nosni)
daa=(do(nosni)+do(nosn))/2.
cl=un(nosnl)*(ho(nosn)-ho(nosni))*dtdz
c2=csqa*(un(nosn)-un(nosni))
1
*2*dtdz
c3=rpa/(daa/csqa)*(qipt/area+fod(nosni)
1
*do(nosnl)**2.*un(nosni)**3./(2*equd))*dt
hn(nosn)=ho(nosn)+c3-ci-c2
100 continue
return
end
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
N)
478
479 c
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
subroutine densi(p,h,d,x)
call satt(p,hls,hvs)
if(h.le.hls) go to 10
if (h.gt.hvs) go to 20
call lden(p,hls,rol)
call vden(p.hvs,rov)
x=(h-hls)/(hvs-hls)
svl=1./rol
svv=1./rov
sv=svl*(1-x)+svv*x
d=1./sv
return
10 x=-1.
call lden(p,hrol)
d=rol
return
20 x=1.
call vden(p,hrov)
d=rov
return
end
1
2
3
4
5
6
7
8
9
10
II
12
13
14
15
16
17
18
19
20
21
22
500
501
502
503
504 c
505
506.
507
508 c
509
510
511
512
513
514
515
516
517
518
519
520
subroutine lden(p,h,rol)
data f1l,f12/999.65,4.9737e-7/
data f21,f22/-2.5847e-1O,6.1767e-19/
data f31,f32/1.2696e-22,-4.9223e-31/
data f41,f42/1488.64,1.3389e-6/
data f51,f52/1.4695e9,8.85736/
data f61,f62/3.20372e6,1.20483e-2/
if(h.gt.6.513e5) go to 10
f1=f11+f12*p
f2=f21+f22*p
f3=f31+f32*p
rol=fl+h*h*(f2+f3*h*h)
go to 20
10 f4=f41+f42*p
f5=f51+f52*p
f6=f61+f62*p
rol=f4+f5/(h-f6)
20 return
end
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
L,
521
522 c
523
524
525 c
526
527
528
529
530
subroutine vden(p,h,rov)
data gOO,gOl,gO2,g1O.g1lg12/-5.1026e-5,1.1208e-10,
-4.4506e5,-1.6893e-10,-3.3980e-17,2.3058e-1/
1
gOp=gOO+gOl*p+gO2/p
glp=giO+gii*p+g12/p
rov=l./(gOp+gip*h)
return
end
1
2
3
4
5
6
7
8
9
10
un
I,
531
532
533
534 c
535
536
537
538
539 c
subroutine satt(p,hls,hvs)
data tscl,tsc2, tsexp /9.0395, 255.2, 0.223/
/9.5875e2, .00132334, -0.8566/
data cpsl,cps2, cpsexp
for his and hvs
hlO,hll,h12,h13,h14,h15/5.7474718e5,2.0920624e-1,
data
1
-2.8051070e-8,2.3809828e-15,-1.0042660e-22,1.6586960e-30/
data hvO,hvi,hv2.hv3,hv4/2.7396234e6,3.758844e-2,
-7.1639909e-9,4.2002319e-16,-9.8507521e-24 /
1
= hvO + p*(hvl
+ p*(hv2 + p*(hv3 + p*hv4)))
540
hvs
541
542
543
his = WO + p*(hli + p*(h12 + p*(h13 + p*(hl4 + p*h15))))
return
end
1
2
3
4
5
6
7
8
9
10
11
12
13
Ul
C-'
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
subroutine rph(p,h,d,x,rp.rh)
c
data hll,hl22,h133,h144,h155/2.0920624e-1,-5.610214e-8.
1 7.142948e-15,-4.0170640e-22,8.293480e-30/
c
data hv11,hv22,hv33,hv44/3.758844e-2,-14.33279818e-9,
12.6006957e-16,-39.4030084e-24/
1
c
data f1i,f12/999.65,4.9737e-7/
data f21,f22/-2.5847e-10,6.1767e-19/
data f31,f32/1.2696e-22,-4.9223e-31/
c
data f41,f42/1488.64,1.3389e-6/
data f51,f52/1.4695e9,8.85736/
data f61,f62/3.20372e6,1.20483e-2/
c
data gOO,gOl,gO2,g1O,g1l.g12/-5.1026e-5,1.1208e-10,
-4.4506e5,-1.6893e-10,-3.3980e-17,2.3058e-1/
1
c
20
30
10
40
50
if(x.eq.-i.)go to 10
call satt(p,hls,hvs)
call Iden(p,hls,rol)
call vden(phvs,rov)
dhldp=hll+p*(h122+p*(hl33+p*(hl44+p*h155)))
dhvdp=hv1+p*(hv22+p*(hv33+p*hv44))
dvvdp=(gO1-gO2/p**2.)+(gl1-g12/p**2.)*hvs
if(hls.gt.6.513e5) go to 20
f2=f21+f22*p
f3=f31+f32*p
dvldp=-(f12+hls*hls*(f22+f32*hls*hls))/rol**2.
go to 30
f5=f51+f52*p
f6=f61+f62*p
dvldp=-(f42+f52/(hls-f6)+f5*f62/(hls-f6)**2.)/rol**2.
continue
dxdp=-dhldp/(hvs-hls)-(dhvdp-dhldp)*(h-hls)/(hvs-hls)**2.
dvdp=(1-x)*dvldp+x*dvvdp+(1./rov-1./rol)*dxdp
dvdh=(1./rov-1./rol)/(hvs-hls)
rp=-d**2.*dvdp
rh=-d**2.*dvdh
return
if(h.gt.6.513e5)go to 40
f2=f21+f22*p
f3=f31+f32*p
rp=(f12+h*h*(f22+f32*h*h))
rh=(2*h*f2+4*h*h*h*f3)
go to 50
f5=f51+f52*p
f6=f61+f62*p
rh=-f5/(h-f6)**2.
rp=(f42+f52/(h-f6)+f5*f62/(hrf6)**2.)
continue
return
end
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
s3
598
599
600
601
602
603
604
605
606
function pilt(pilto,poltO,timel)
cn=400.*timel
if(cn.gt.79.99)go to 10
pilt=(piltO+poltO)/2.+(piltO-poltO)/2.*(exp(-400*timei))
go to 20
10 p1lt=(piltO+poltO)/2.
20 continue
return
end
1
2
3
4
5
6
7
8
9
L,
071
CI
B.
Momentum Integral Model
I
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
c
c
c
c
c
c
solution of transient balance equations for single heated channel
***
MOMEMTUM INTEGRAL MODEL
June
***
1983
dimension hn(21),ho(21),gn(21),go(21),dn(21),do(21),
title(20),ddh(21)
x(21),
1
chan1,area,equd,nosn,nots,dz,dt
common /datal/
read (5,1000)(title(i),i=1,20)
1000 format (20a4)
read (5,1010)chanl,area,equd
read(5,1050)is,isb,io,npp
read(5,1030)time,nots,nosn
1050 format(415)
nosnl=nosn-1
nosn2=nosn-2
1010 format(3e10.5)
read(5,1020)giltO,hiltO,pilto,poltO,poweO
1020 format(5e10.5)
1030 format(elO.6,2i5)
dz=chanl/(nosn-1)
dt=time/nots
if(is.eq.1)go to 130
do 10 i=1,nosn
read (5,1040)go(i),ho(i)
10 continue
1040 format(2e10.5)
c
c
c
c
calculate the steady state density distribution
p=(piltO+poltO)/2
go to 140
c
c
c
the initial condition is calculated by sub. init
130 call init(isb,giltO,hiltO,piltO,poltO,poweO,
p,ho,do,go,x)
1
c
140 write(6.2000)
c
call densi(p,hiltO,din,xin)
do 141 i=1,nosn1
hn(i)=(ho(i)+ho(i+1))/2.
141 continue
hn(nosn)=ho(nosn)
do 142 i=1,nosn
ho(i)=hn(i)
call densi(p,ho(i),do(i),x(i))
142 continue
calculate the average of the initial mass flux
c
c
sum=O
do 30 i=2,nosn
sum=sum+(go(i-1)+go(i))/2.
30 continue
gavo=sum/(nosn-1)
dz=chanl/(nosn-1)
1
2
3
4
5
6
7
8
9
1O
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
C
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
dt=time/nots
c
c
c
calculate the friction term of the integral momemtum equation
call intrgl(pgohodo,din,x,fric)
transient solutions of single heated channel by
2000 format (//,"
i"momentumum integral model")
write(6,2010)(title(i),i=1,20)
2010 format (/,20a4)
write(6,2020)
2020 format(/," channel geometry ")
write (6.2030)chanl,area.equd
2030 format(1x, " chanlnel length=",f6.3," M",
1/,"
flow area = ",e13.6," m**2" ,
1
/,"
equi
diame = ",f6.3," m")
write(6,2040)
2040 format(/," operating condition ")
hiltw=hiltO/1000
piltw=piltO/1.e6
poltw=poltO/1.e6
powew=poweO/1000
write (6,2050)giltO,hiltw,piltw,poltw,powew
2050 format(lx," inlet mass flux =",f8.3," kg/m**2.sec".
/,"
inlet enthalpy = ",f9.4," kj/kg",
1
/,"
inlet pressure = ",f8.4," Mpa",
1
1
/,"
outlet pressure = ",f8.4," Mpa",
= ",f8.4," kw/m")
1
/,"
power
write(6.3000)time.dt
3000 format(/," total transient time = ",e13.6," sec",
time step size = ",e13.6," sec")
1
/,"
write(6,3010)
initial condition for transient calculation ")
3010 format(/,"
write(6,2070)
do 240 i=i,nosn
hw=ho(i)/1000
write(6,2080)i,go(i),hw,do(i),x(i)
240 continue
c
np=O
do 40 i=1,nots
np=np+1
time step ",15)
9000 format(1x,"
ttime=dt*i
timel=ttime-dt
qipt=power(poweO,timet)
c
the power should be evaluate at time=i
c
c
i+1
c calculate the enthalpy of the new time stop i.e.
c
hin=hiltO
cl=dt/(dz*do(1))
c2=(ho(2)-ho(1))/2.*go(2)-(hin-ho(i))*go(i)
c3=qipt*dt/(area*do(1))
hn(1)=ho(1)-c1*c2+c3
do 50 ii=2,nosn2
c1=dt/(dz*do(ii))
c2=(ho(ii+1)-ho(ii))/2.*go(i+1)-(ho(i1- )-ho(ii))/2.*go(ii)
c3=qipt*dt/(area*do(ii))
hn(ii)=ho(ii)-ci*c2+c3
"
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
50 continue
cl=dt/(dz*do(nosn1))
c2=(ho(nosn)-ho(nosn1))*go(nosn)-(ho(nosn2)-ho(nosni))/2.
1 *go(nosnt)
c3=qipt*dt/(area*do(nosnl))
hn(nosnl)=ho(nosni)-cl*c2+c3
hoh=(ho(nosn)+ho(nosn1))/2.
call densi(phoh,da,xa)
c1=2*dt/(da*dz)
c2=ho(nosn)*go(nosn)-ho(nosni)*(go(nosn)+go(nosni))/2.
-hoh*(go(nosn)-go(nosn1))/2.
1
c3=qipt*dt/(area*da)
hn(nosn)=-hn(nosni)+2*hoh-2*c1*c2+2*c3
c
c
calculate the new density distribution from the equation of the state
call densi(p,hin,din,xin)
c
do 60 ii=1,nosn
call densi(p,hn(ii),dn(iI),x(ii))
60 continue
c
c
c
c
c
c
c
c
the mass flux distribution at new time step
if(io.eq.1)goto 70
flow reduced transient
io.eq.2
tgilt=gilt(giltO,ttime)
tpilt=piltO
ddh(1)=(dn(1)-din)/(hn(1)-hin)
do 62 ii=2,nosn
ddh(ii)=(dn(ii)-dn(i1-1))/(hn(ii)-hn(ii-1))
62 continue
call masscal(pqipt,dnhn,hin,ddh,tgilt,gn)
calculate the average of the mass flux
sum=0
do 80 11=2,nosn
sum=sum+(gn(ii-1)+gn(ii))/2.
80 continue
gavn=sum/(nosn-1)
predi=(gavn-gavo)/dt+fric
tpolt=tpilt+predi
goto 90
pressure transient
io.eq.1
70 continue
tpilt=pilt(piltO,poltO,time1)
tpolt=polt(poltO,timel)
predi=tpilt-tpolt
gavn=gavo+dt/chanl*(predi-fric)
c
calculate the inlet mass flux
c
ddh(1)=(dn(1)-din)/(hn(1)-hin)
do 71 11=2,nosn
ddh(ii)=(dn(ii)-dn(ii-1))/(hn(ii)-hn(ii-1))
71 continue
sum1=O
sum2=0
qipt=power(poweO,ttime)
gammO=1
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
NJ
180
deltO=O
181
c1=ddh(1)/dn(1)
alpha=(1+(hn(1)-hin)*cl)/(1+(hn(1)-hn(2))/2.*ci)
182
183
belta=-dz*cl*qipt/(area*(1+(hn(i)-hn(2))/2.*cl))
gamml=gammO*alpha
184
185
delti=deltO*alpha+belta
186
sum1=suml+(gamml+gammO)/2.
187
sum2=sum2+(deltO+deltl)/2.
188
gammO=gamml
189
deltO=delti
190
do 100 i1=3,nosni
191
c1=ddh(11-1)/(dn(ii-1)*2)
192
alpha=(1+(hn(11-1)-hn(ii-2))*cl)/(1+(hn(ii-1)-hn(ii))*c1)
193
belta=-2*dz*cl*qipt/(area*(1+(hn(il-1)-hn(ii))*cl))
194
gammi=alpha*gammO
deltl=alpha*deltO+belta
195
suml=suml+(gamml+gammO)/2.
196
197
sum2=sum2+(delti+deltO)/2.
198
gammO=gammi
199
deltO=delti
200
100 continue
201
c1=ddh(nosnl)/dn(nosn1)
alpha=(1+(hn(nosni)-hn(nosn2))/2.*cl)/(1+(hn(nosn1)-hn(nosn)
202
203
1 )*cI)
204
belta=-dz*c1*qipt/(area*(1+(hn(nosn1)-hn(nosn))*cl))
205
gammi=alpha*gammO
deltl=deltO*alpha+belta
206
sum1=sum1+(gammi+gammO)/2.
207
208
sum2=sum2+(deltO+delti)/2.
209
avel=suml/(nosn-1)
ave2=sum2/(nosn-1)
210
211
tgilt =(gavn-ave2)/avel
212 9900 format(lx,"gavn,ave2,avel".3(2x,elO.5),2x,15)
call masscal(p,qipt,dn,hnhinddh,tgiltgn)
213
214 c
215 c
calculate the friction term of the integral momemtum equation
216 c
217
90 continue
do 91 11=1,nosn
218
if(gn(ii).lt.O.O)go to 45
219
91 continue
220
call intrgl(p,gn,hn,dn,din,x,fric)
221
do 110 i1=1,nosn
222
223
ho(il)=hn(ii)
224
go(il)=gn(11)
do(ii)=dn(ii)
225
226
110 continue
p=(tpilt+tpolt)/2.
227
gavo=gavn
228
229
if(np.ne.npp)go to 41
230
if(gn(1).lt.O.0)write(0,9999)gn(1)
231
9999 format(1x," something wrong gn(1)=",e13.6)
write(0.9000)i
232
233
np=O
predw=predi/1000
234
qiptw=qipt/1000
235
write (6,2060)ttimepredw,qiptwgavn
236
write(6,2070)
237
do 120 i1=1,nosn
238
239
hw=hn(ii)/1000
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
gr=gn(ii)/giltO
write(6,2080)ii,gn(ii),hw,dn(ii),x(ii),gr
120 continue
transient time=",e13.6, sec
2060 format(//,"
pressure drop = ",f8.4," kpa",
/,"
1
/,"
power
=
",f8.4, " kw/m",
average mass flux =",f9.4.' kg/m**2.sec")
/,"
density quality",
enthalpy
mass flux
2070 format(/,"
(kg/m**3)")
(kj/kg)
(kg/m**2.sec)
/,"
1I
2080 format(lx,i3,2x,f8.3,6x,f8.3,4x,f8.3,2x,f6.3,3x,f7.4)
41 continue
40 continue
go to 46
45 write(0,5000)i,ii,gn(i i)
write(6,5000)i,iign(i 1)
50 00 format(1x, " flow rate is negative at time step no"
gn=" ,e13.6)
14,"
1 ,lx,15,/," at node
46 continue
stop
end
c
c
c
c
c
c
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
subroutine intrgl(p,g,h,ddin,xa,fric)
dimension h(21),g(21),d(21),xa(21)
chani,area,equd,nosn,nots,dz,dt
common /datal/
data convl,conv2,vics,gl/737.4643,1.4504e-4,91.7e-6,9.8/
data vicsi/19.73e-6/
267
268
269
270
271
6
272 c
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
fric=O
nosnl=nosn-1
acceleration pressure drop
c
c
fric=g(nosn)**2/d(nosn)-g(1)**2/din
c
c
c
thm:
two phase pressure drop multiplier
thm=1
c
c
c
get the saturation liquid and vapor density rol,rov
do 10 i=1,nosni
ga=(g(i+1)+g(i))/2.
c
c
c
elavation pressure drop
fric=fric+d(i)*g1*dz
dpc=d(i)
c
c
c
c
if x>O calculate the two phase multiplier
eq(5.209) p.230 Lahey and Moody was used
if(xa(i).eq.-1.) goto 20
if(xa(i).eq.1.) go to 30
call satt(p,hlshvs)
call lden(p,hls,rol)
call vden(p,hvs,rov)
dpc=rol
gtestoga*convl/1.Oe6
if(gtest.le.0.7)c1=1.36+0.0005*p*conv2+0.1*gtest
-0.000714*p*conv2*gtest
1
if(gtest.ge.O.7)cl=1.26-0.0004*p*conv2+0.119/gtest
+0.00028*p/gtest*conv2
1
thm=cl*(1.2*(rol/rov-l)*xa(i)**0.824)+1.0
c
c
c
use Blasius for friction factor
20 fact=0.184*(ga*equd/vics)**(-0.20)
go to 40
30 fact=0.184*(ga*equd/vicsl)**-.20
40 fric=fric+thm*fact*ga**2/(2*equd*dpc)*dz
10 cont'inue
return
end
c
c
c
1
2
3
4
5
*
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
Cn
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
subroutine init(isl,giltO,hiltO,piltO,poltO,poweO,
1
pi,hd,g,x)
dimension h(21),d(21),p(21),g(21),x(21)
common /datal/ chan1,area,equd,nosn,nots,dz,dt
call densi(piltO,hiltO,d(1),x(I))
h(1)=hiltO
p(I)=piltO
g(i)=gilto
i=1
n1=1
90 do 10 i=2,nosn
hl=h(i-1)+poweO*dz/(area*giltO)
pl=p(i-1)
call densi(pi,hi,d(i),x(i))
60 ha=(hi+h(i-1))/2.
call densi(pi,hada,xl)
call frici (x1,pi,giltO,da,fod)
p2=p(i-1)-fod*giltO**2.*dz/(2*equd)
1 -da*9.80*dz-giltO**2.*(1/d(i)-1/d(i-1))
call densi(p2,hi,d(i),x(i))
call densi(p2,hada,xi)
call fric1(x1,p2,giltO,da,fod)
31 hi=h(i-1)+poweO*dz/(area*giltO)+(p2-p(i-1)+
1
(fod*giltO**2*dz)/(2*equd))/da
if(abs((p2-pl)/p2).le.1.Oe-8)go to 40
n=n+1
if(n.gt.50)goto 50
pl=p2
goto 60
40 p(i)=p2
h(i)=hi
g(i)=gilto
10 continue
if(is1.eq.1)poltO=p(nosn)
if(abs((p(nosn)-poltO)/poltO).le.i.Oe-4)go to 160
if(ni.gt.50) go to 80
nl=n1+1
giltO=giltO*((p(nosn)-p(i))/(poltO-piltO))**0.5
goto 90
80 write(6,2110)
2110 format(1x," iteration not converge for pressure b.c.")
stop
50 write(6,2090)i
2090 format(lx,"iteration not converge for spatial node ",12)
stop
160 p1=(poltO+piltO)/2.
return
end
1
2
3
4
5
6
7
8
9
10
II
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
ch
369
370
371
372
373 c
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
subroutine fricl(xi,p,g,d,fod)
common /datal/ chani,area.equd,nosn,nots,dz,dt
data convi,conv2,vics/737.4643,1.4504e-4,91.7e-6/
use McAdames correlation to calculate the friction factor
fric=0.184*(g*equd/vics)**(-0.2)
if(x1.eq.-1.0)go to 10
call satt(p,hls,hvs)
call 1den(phls,rol)
call vden(p,hvs,rov)
gtest=g*convl/1.Oe6
if(gtest.le.0.7)cl=1.36+0.0005*p*conv2+0.1*gtest
1
-0.000714*p*conv2*gtest
if(gtest.gt.0.7)c1=1.26-0.0004*p*conv2+0.119/gtest
1+0.00028*p/gtest*conv2
thm=cl*(1.2*(rol/rov-1)*xl**0.824)+i.0
fod=thm*fric/rol
go to 21
10 fod=fric/d
21 continue
return
end
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
392
393
394
395
function power(poweO,timel)
power=poweO
return
end
2
3
4
00)
396
397
398
399
400
401
402
403
404
function pilt(piltO,poltO,timel)
cn=400.*timei
if(cn.gt.79.99)go to 10
pilt=(piltO+poltO)/2.+(piltO-poltO)/2.*(exp(-400*timel))
go to 20
10 pilt=(piltO+poltO)/2.
20 continue
return
end
1
2
3
4
5
6
7
8
9
405
406
407
408
function polt(poltO.timel)
polt=polto
return
end
1
2
3
4
CD
Adwa~
409
410
411
412
413 c
function gilt(giltO,timel)
gilt=giltO
return
end
2
3
4
5
414
415 c
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
subroutine densi(ph,d,x)
call satt(p,hls,hvs)
if(h.le.hls) go to 10
if(h.gt.hvs) go to 20
call Iden(p,hls,rol)
call vden(p,hvs,rov)
x=(h-hls)/(hvs-hls)
svl=1./rol
svv=l./rov
sv=svl*(1-x)+svv*x
d=1./sv
return
10 x=-1.
call lden(p,h.rol)
d=rol
return
20 x=1.0
call vden(p,hvsrov)
d=rov
return
end
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
436
437
438
439
440 c
441
442
443
444 c
445
446
447
448
449
450
451
452
453
454
455
456
subroutine Iden(p,h,rol)
data fil,fi2/999.65,4.9737e-7/
data f21,f22/-2.5847e-iO,6.1767e-19/
data f31,f32/1.2696e-22,-4.9223e-31/
data f41,f42/1488.64,1.3389e-6/
data f51,f52/1.4695e9,8.85736/
data f61,f62/3.20372e6,1.20483e-2/
if(h.gt.6.513e5) go to 10
fl=f11+f12*p
f2=f21+f22*p
f3=f31+f32*p
rol=f1+h*h*(f2+f3*h*h)
go to 20
10 f4=f41+f42*p
f5=f51+f52*p
f6=f6i+f62*p
rol=f4+f5/(h-f6)
20 return
end
.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
457
458 c
459
460
461 c
462
463
464
465
466
subroutine vden(p,h,rov)
data gOO,gOl,gO2,glO,g1l,g12/-5.1026e-5,1.1208e-10,
1
-4.4506e5,-1.6893e-10,-3.3980e-17,2.3058e-1/
gOp=gOO+gOl*p+gO2/p
glp=glO+gll*p+g12/p
rov=1./(gOp+glp*h)
return
end
1
2
3
4
5
6
7
8
9
10
467
468
469
470 c
471 c
472
473
474
475
476 c
477
478
479
480
481
482
483
484
subroutine satt(p,hls,hvs)
data tscl.tsc2, tsexp /9.0395, 255.2, 0.223/
data cpsi,cps2, cpsexp /9.5875e2, .00132334, -0.8566/
cps2 = -cpsexp * tcrinv
for his and hvs
data
hlO,hl1,h12,h13,h14,h15/5.7474718e5.2.0920624e-1,
1
-2.8051070e-8,2.3809828e-15,-1.0042660e-22,1.6586960e-30/
data hv0,hvi,hv2,hv3,hv4/2.7396234e6,3.758844e-2,
1
-7.1639909e-9,4.2002319e-16,-9.8507521e-24 /
tsat = tscl* p**tsexp
hvs = hvO + p*(hvi + p*(hv2 + p*(hv3 + p*hv4)))
his = hlO + p*(hl1 + p*(hl2 + p*(h13 + p*(hl4 + p*h15))))
pinv = 1./ p
dtsdp = tsat*tsexp*pinv
tsat = tsat + tsc2
return
end
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
subroutine masscal(p,qiptdnhn,hin,ddh,tgilt,gn)
dimension dn(21),hn(21),gn(21),ddh(21)
common /datal/
chani,area.equdnosn,nots,dz,dt
nosnl=nosn-i
nosn2=nosn-2
gn(1)=tgilt
ci=ddh(1)/dn(i)
belta=-dz*cl*qipt/(area*(1+(hn(1)-hn(2))/2.*cl))
alpha=(1+(hn(i)-hin)*c1)/(1+(hn(1)-hn(2))/2.*c1)
gn(2)=gn(i)*alpha+belta
do 100 11=3,nosni
cl=ddh(Il-1)/(dn(ii-1)*2)
alpha=(1+(hn(1l-1)-hn(11-2))*ci)/(1+(hn(ii-1)-hn(ii))*cl)
belta=-2*dz*ci*qipt/(area*(1+(hn(il-1)-hn(ii))*cl))
gn(I1)=gn(ii-1)*alpha+belta
100 continue
c1=ddh(nosn1)/dn(nosni)
alpha=(1+(hn(nosni)-hn(nosn2))/2.*cl)/(1+(hn(nosni)-hn(nosn)
1 )*ci)
belta=-dz*c1*qipt/(area*(1+(hn(nosni)-hn(nosn))*cl))
gn(nosn)=alpha*gn(nosnl)+belta
return
end
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
C.
Single Velocity Model
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
c
c
c
c
c
c
solution of transient balance equations for single heated channel
SINGLE VELOCITY MODEL
***
june
3
***
1983
dimension hn(21),ho(21), dn(21),do(21),
title(20)
x(21),xa(21),da(21),
1
chanlareaequd,nosn,nots,dz,dt
common /datal/
read (5,1000)(title(i),i=1,20)
1000 format (20a4)
read (5,1010)chanl,area.equd
read(5,1050)is.isb,io,npp
read(5,1030)time,notsnosn
1050 format(415)
1010 format(3eiO.5)
read(5,1020)giltO,hiltO,piltOpoltO.poweO
1020 format(SelO.5)
1030 format(elO.6,2i5)
dz=chanl/(nosn-1)
dt=time/nots
if(is.eq.l)go to 130
do 10 i=1,nosn
read (5,1040)ho(i)
10 continue
1040 format(elO.5)
c
c
c
p=(piltO+poltO)/2
go to 140
c
c
c
the initial condition is calculated by sub. init
130 call
1
init(isbgiltO,hiltO,piltO,poltO,poweO,
p,ho,do,x)
c
140 write(6,2000)
c
c
c
calculate the steady state density distribution
do 20 i=1,nosn
call densi(pho(i),do(i),x(i))
20 continue
c
do 141 i=2,nosn
hoh=(ho(i)+ho(i-1))/2.
call densi(p,hoh,da(i),xa(i))
141 continue
go=giltO
call intrgl(p,go,ho,do,da,xafric)
2000 format (ihi," transient solutions of single heated channel
,"
by single velocity model ")
1
write(6.2010)(title(i),i=1,20)
2010 format (/,20a4)
write(6,2020)
2020 format(/," channel geometry ")
write (6.2030)chanl,area,equd
2030 format(lx," channel length=".f6.3," M",
1
2
"
4.
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
00
= ",e13.6," m**2",
flow area
1/,"
60
equi
diame = ".f6.3," M")
/,"
1
61
write(6,2040)
62
63 2040 format(/," operating condition ")
hiltw=hiltO/1000
64
piltw=pilto/1000000
65
poltw=poltO/1.e6
66
powew=poweO/1000
67
write (6,2050)giltO,hiltw,piltw,poltwpowew
68
inlet mass flux = ",f9.3," kg/m**2.sec",
69 2050 format(lx,"
inlet enthalpy = ",f9.3," kj/kg",
/,"
1
70
inlet pressure = ",f8.4," Mpa",
/,"
1
71
/," outlet pressure = ",f8.4," Mpa",
1
72
power = ",f8.4," kw/m")
/,"
1
73
write(6,3200)time,dt
74
75
76 3200 format(/," total transient= ",e13.6,1" sec",
/" time step size = ",e13.6," sec")
1
77
write(6,3000)
78
initial condition for transient calculation ")
79 3000 format(/,"
write(6,2070)
80
do 200 i=1,nosn
81
hw=ho(i)/1000
82
write(6,2080)i.hwdo(i),x(i)
83
84
200 continue
85 c
np=O
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
do 40
11
,nots
time step "1.5)
6000 format(1x,"
np=np+1
ttime=dt*i
timel=ttime-dt
qipt=power(poweO,timel)
c
c
the power should be evaluate at time=i
c
1+1
c calculate the enthalpy of the new time step i.e.
c
hn(1)=hiltO
do 50 il=2,nosn
alpha=go*dt/(da(ii)*dz)
belta=(2*dt*qipt/area)/(da(ii)*(1+alpha))
hn(il)=ho(ii-1)-(hn(ii-1)-ho(ii))*((1-alpha)/(1+alpha))+belta
50 continue
c
calculate the new density distribution from the equation of the state
c
c
do 60 ii=i,nosn
call densi(p,hn(i1),dn(ii),x(ii))
60 continue
do 61 il=2,nosn
hnh=(hn(ii)+hn(i1-I))/2.
call densi(p,hnh,da(ii),xa(ii))
61 continue
c
the mass flux distribution at new time step
c
c
if(io.eq.1)goto 70
flow reduced transient
io.eq.2
c
gn=gilt(giltO,ttime)
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
c
c
c
c
tpilt=piltO
predi=(gn-go)/dt+fric
tpolt=tpilt+predi
goto 90
io.eq.1
pressure transient
70 continue
tpilt=pilt(pilto,polto,timel)
tpolt=polt(poltO,timel)
predi=tpilt-tpolt
gn=go+dt/chanl*(predi-fric)
calculate the friction term of the integral momemtum equation
90 continue
call intrgl(p,gn,hn,dn,da,xafric)
do 110 ii=1,nosn
ho(il)=hn(ii)
do(ii)=dn(iI)
110 continue
go=gn
if(np.ne.npp)go to 40
c
write(0,6000)i
np=O
predw=predi/1000
qiptw=qipt/1000
gnr=gn/giltO
write (6,2060)ttime,predw,qiptw,gn,gnr
write(6,2070)
do 120 il=1,nosn
hw=hn(il)/1000
write(6,2080)iI.hwdn(ii),x(ii)
120 continue
2060 format(//," transient time=",f8.4," sec ",
pressure drop = ",f8.4," kpa",
1
/,"
1
/,"
power
=
",f8.4, " kw/m",
kg/m**2.sec",3x,f8.4)
1
/,"
mass flux = ",f9.3,"
",
enthalpy
density
2070 format(/,"
,
(kj/kg)
(kg/m**3)
1
/
2080 format(lx,12,2x,f9.3,5x,f8.4,4x,f6.3)
41 continue
40 continue
end
quality
")
",
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
C3
-aOAN,
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
subroutine intrgl(p,g,h,d,da,xa,fric)
dimension h(21),d(21),xa(21),da(21)
common /datal/
chani,area,equd,nosn,nots,dz.dt
data conv1,conv2,vics,g1/737.4643,1.4504e-4,91.7e-6,9.8/
data vicsi/19.73e-6/
c
c
c
fric=O
acceleration pressure drop
fric=g**2/d(nosn)-g**2/d(1)
c
c
c
thm:
two phase pressure drop multiplier
thm=1
c
c
c
get the saturation liquid and vapor density rol,rov
call satt(p,hls,hvs)
call lden(p,hls,rol)
call vden(phvs,rov)
do 10 i=2,nosn
c
c
c
elavation pressure drop
fric=fric+da(i)*g1*dz
dpc=da(i)
c
c
c
c
if x>O calculate the two phase multiplier
eq(5.209) p.230 Lahey and Moody was used
if(xa(i).eq.-1) goto 20
if(xa(i).eq.1.0) go to 30
dpc=rol
gtest=g*convi/1.Oe6
if(gtest.le.0.7)c1=1.36+0.0005*p*conv2+0.1*gtest
1
-0.000714*p*conv2*gtest
if(gtest.ge.0.7)cI=1.26-0.0004*p*conv2+0.119/gtest
1
+0.00028*p/gtest*conv2
thm=cI*(1.2*(rol/rov-1)*xa(21)**0.824)+I.0
c
c
20 fact=0.184*(g*equd/vics)**(-0.20)
go to 40
30 fact=0.184*(g*equd/vicsl)**(-0.20)
40 fric=fric+thm*fact*g**2/(2*equd*dpc)*dz
10 continue
return
end
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
subroutine init(isi,giltO,hiltO,piltO,poltO,poweO,
pi,h,d,x)
1
dimension h(21),d(21),p(21),g(21),x(21)
common /datai/ chan1,area,equdnosn.nots,dz,dt
tsub=600
call densi(piltO,hiltOd(1),x(i))
h(1)=hiltO
p(1)=piltO
g(1)=giltO
i=1
n1=1
90 do 10 i=2,nosn
hi=h(1-1)+poweO*dz/(area*giltO)
pl=p(1-1)
call densi(pi,hi.d(i),x(i))
60 ha=(hi+h(1-1))/2.
call densi(pi.hada,x1)
call fric1 (xI,p1,giltO,da,fod)
p2=p(1-l)-fod*giltO**2.*dz/(2*equd)
1 -da*9.80*dz-giltO**2.*(1/d(i)-1/d(I-1))
call densi(p2,hi,d(i),x(i))
call densi(p2,ha-,da,x1)
call frici(xi,p2,giltO,da,fod)
31 hl=h(1-1)+poweO*dz/(area*giltO)+(p2-p(1-I)+
(fod*giltO**2*dz)/(2*equd))/da
1
if(abs((p2-p1)/p2).le.1.Oe-8)go to 40
n=n+1
if(n.gt.50)goto 50
p1=p2
goto 60
40 p(i)=p2
h(i)=hi
g(i)=gilto
10 continue
if(isi.eq.1)poltO=p(nosn)
if(abs((p(nosn)-poltO)/poltO).le.1.Oe-4)go to 160
if(ni.gt.50) go to 80
nl=n1+1
gil tO=gi l tO*( (p(nosn)-p( 1) )/(pol tO-piltO) )**0.5
goto 90
80 write(6,2110)
2110 format(Ix," iteration not converge for pressure b.c.")
stop
50 write(6,2090)i
2090 format(lx,"iteration not converge for spatial node ",12)
stop
160 pl=(poltO+piltO)/2.
return
end
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
0o
260
261
262
263
264 c
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
subroutine fric1(xl,p,gd,fod)
common /datal/ chanl.areaequd,nosn,notsdz,dt
data conviconv2,vics/737.4643eO,1.4504e-4,91.7e-6/
use McAdames correlation to calculate the friction factor
fric=0.184*(g*equd/vics)**(-0.2)
if(x1.eq.-i.0)go to 10
call satt(p,hls,hvs)
call lden(p,hls,rol)
call vden(p,hvs,rov)
gtest=g*convi/1.Oe6
if(gtest.le.0.7)ci=1.36+0.0005*p*conv2+0.i*gtest
-0.000714*p*conv2*gtest
1
if(gtest.gt.0.7)c1=1.26-0.0004*p*conv2+0.119/gtest
1+0.00028*p/gtest*conv2
thm=c1*(1.2*(rol/rov-1)*xl**0.824)+1.0
fod=thm*fric/rol
go to 21
10 fod=fric/d
21 continue
return
end
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
283
284
285
286
function power(poweO,timel)
power=poweO
return
end
1
2
3
4
287
288
289
function polt(poltO.timel)
polt=poltO
return
1
2
3
290
end
4
co
291
292
293
294
295 c
function gilt(giltO,timel)
gilt=giltO
return
end
2
3
4
5
80
296
297 c
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
subroutine densi(p,h,d,x)
call satt(p,hls,hvs)
if(h.le.hls) go to 10
if(h.gt.hvs) go to 20
call Iden(p,hls,rol)
call vden(p,hvs,rov)
x=(h-hls)/(hvs-hls)
svl=1./rol
svv=1./rov
sv=svl*(1-x)+svv*x
d=1./sv
return
10 x=-1.
call 1den(p,h,rol)
d=rol
return
20 x=1.0
call vden(p.hvs,rov)
d=rov
return
end
I
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
o
318
319
320
321
322 c
323
324
325
326 c
327
328
329
330
331
332
333
334
335
336
337
338
subroutine 1den(p,h.rol)
data fil.fi2/999.65,4.9737e-7/
data f21,f22/-2.5847e-1O,6.1767e-i9/
data f31,f32/1.2696e-22,-4.9223e-31/
data f41,f42/1488.64,1.3389e-6/
data f51,f52/1.4695e9,8.85736/
data f61,f62/3.20372e6,1.20483e-2/
if(h.gt.6.513e5) go to 10
fl=fll+f12*p
f2=f21+f22*p
f3=f31+f32*p
rol=fi+h*h*(f2+f3*h*h)
go to 20
10 f4=f41+f42*p
f5=f51+f52*p
f6=f61+f62*p
rol=f4+f5/(h-f6)
20 return
end
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
339
340 c
341
342
343 c
344
345
346
347
348
subroutine vden(p,h,rov)
data gOO,gOl,gO2,glO,gl1,g12/-5.1026e-5,1.1208e-10,
-4.4506e5,-1.6893e-10,-3.3980e-17,2.3058e-1/
1
gOp=gOO+gOl*p+gO2/p
glp=glO+gll*p+g12/p
rov=i./(gOp+glp*h)
return
end
1
2
3
4
5
6
7
8
9
10
0
349
350
351
352 c
353 c
354
355
356
357
358 c
359
360
361
362
363
364
365
366
subroutine satt(p,hls,hvs)
data tscltsc2, tsexp /9.0395, 255.2, 0.223/
data cpsl,cps2, cpsexp /9.5875e2, .00132334, -0.8566/
cps2 = -cpsexp * tcrinv
for hIs and hvs
data hlO,hll,h12,h13,h14,hl5/5.7474718e5,2.0920624e-1,
1
-2.8051070e-8,2.3809828e-15,-1.0042660e-22,1.6586960e-30/
data hvO,hvi,hv2,hv3,hv4/2.7396234e6,3.758844e-2,
-7.1639909e-9,4.2002319e-16,-9.8507521e-24 /
1
tsat = tscl* p**tsexp
hvs = hvO + p*(hvi + p*(hv2 + p*(hv3 + p*hv4)))
his = hlO + p*(hll + p*(h12 + p*(h13 + p*(h14 + p*hl5))))
pinv = 1./ p
dtsdp = tsat*tsexp*pinv
tsat = tsat + tsc2
return
end
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
C)
I
367
368
369
370
371
372
373
374
375
function pilt(piltO,poltO,timel)
cn=400.*timel
if(cn.gt.79.99)go to 10
pilt=(piltO+poltO)/2.+(piltO-poltO)/2.*(exp(-400*timel))
go to 20
10 pilt=(piltO+poltO)/2.
20 continue
return
end
1
2
3
4
5
6
7
8
9
D.
Channel Integral Model
1 c
2 c
solution of transient balance equations for single neated cnannel
3 C
***
CHANNEL INTEGRAL MODEL
1
2
***3
4 c
1983
june
5 c
6 c
dimension hn(21).ho(21),gn(21),go(21),dn(21),do(21),
7
xn(21 ),xo(21),hnl(21),dnl(21 ),gamma(21 ),beta(21 ),title(20)
1
8
chanl,area,equdnosn,nots,dz,dt
common /datal/
9
read (5,1000)(title(i),i=1,20)
10
1000 format (20a4)
i
read (5,1010)chanl,area,equd
12
read(5,1050)is,isbio,npp
13
read(5,1030)time,nots,nosn
14
1050 format(415)
15
1010 format(3ei0.5)
16
read(5,1020)giltO,hiltO,piltOpoltOpoweO
17
1020 format(5e10.5)
18
1030 format(elO.6,2i5)
19
dz=chanl/(nosn-1)
20
dt=time/nots
21
if(is.eq.1)go to 130
22
do 10 i=1,nosn
23
read (5,1040)go(i),ho(i)
24
10 continue
25
1040 format(2eI0.5)
26
27 c
28 c
p=(piltO+poltO)/2.
29
go to 140
30
31 c
the initial condition is calculated by sub. init
32 c
33 c
130 call init(isb.giltO,hiltO.piltOpoltOpoweO,
34
p,hodo,go,xo)
1
35
36 c
37 c
38 c
calculate the steady state density distribution
39 c
40 c
p=(pilto+poltO)/2.
41
do 20 i=1,nosn
42
call densi(p,ho(i),do(i),xo(i))
43
20 continue
44
45 c
140 write(6,2000)
46
47 c
calculate the average of the initial mass flux
48 c
49 c
sum=0
50
do 30 i=2,nosn
51
sum=sum+(go(i-l)+go(i))/2.
52
30 continue
53
gavo=sum/(nosn-1)
54
nosnl=nosn-1
55
sum=ho(1)/2.
56
do 40 j=2,nosni
57
sum=sum+ho(j)
58
40 continue
59
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
sum=sum+ho(nosn)/2
61
havo=sum/nosni
62
deltho=ho(nosn)-hiltO
63
do 50 j=1,nosn
64
beta(j)=(ho(j)-hiltO)/(havo-hiltO)
65
50 continue
66
dz=chan1/(nosn-1)
67
dt=time/nots
68 c
69 c
70 2000 format (//,"
transient solutions of single heated channel by ",
71
1"channel integral model")
72
write(6,2010)(title(i),i=1,20)
73 2010 format (/,20a4)
74
write(6,2020)
75 2020 format(/," channel geometry ")
76
write (6,2030)chan1,area,equd
77 2030 format(1x," chanlnel length=",f6.3," M",
78
1/, " flow area = ",e13.6," m**2",
79
1
/,"
equi
diame = ",f6.3," M")
80
write(6,2040)
81
2040 format(/," operating condition ")
82
hiltw=hiltO/1000
83
piltw=piltO/1.e6
84
poltw=poltO/I.e6
85
powew=poweO/1000
86
write (6,2050)giltO,hiltw.piltw,poltw,powew
87 2050 format(1x," inlet mass flux =".f8.3," kg/m**2.sec",
88
1
/,"
inlet enthalpy = ",f9.4," kj/kg",
89
1
/,"
inlet pressure = ",f8.4," Mpa",
90
1
/,"
outlet pressure = ",e13.6," Mpa",
91
1
/,"
power
= ",f8.4," kw/m")
92
write(6,3000)time,dt
93
3000 format(/," total transient time = ",e13.6," sec",
94
1
/,"
time step size = ",e13.6," sec")
95
write(6,3010)
96
3010 format(/."
initial condition for transient calculation ")
97
write(6,3200)
98
do 240 i=1,nosn
99
hw=ho(i)/1000
100
write(6,3300)i ,go( i ) ,hw,do( i) ,xo( i)
101
240 continue
102
havn= havo*1.0001
103
havn=havo+1.
104
do 60 J=1,nosn
105
hn(j)=hiltO+beta(j)*(havn-hiltO)
106
call densi(p,hn(j),dn(j).xn(j))
107
60 continue
108
call cst(havo,ho,do,havn,hn,dn,deltho,gamma,hiltO,csti
109
1,cst2,cst3)
110 c
111
np=0
112
do 70 i=1,nots
113
n=1
114
np=np+1
115
ttime=dt*i
116
timel=ttime-dt
117
qipt=power(poweO,timel)
118
thilt=hiltO
119
if(io.eq.l)go to 80
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
c
c
c
flow reduce transient
tgilt=gilt(giltOtimei)
const=csti/(cst3*gamma(nosn)*chanl)
gavo=(tgilt-const*qipt*chan1/area)/(1-const*deltho)
80 havn=havo+dt/(cst3*chanl)*(qipt*chan1/area-gavo*deltho)
do 110 j=1,nosn
hn(j)=thilt+beta(j)*(havn-thilt)
call densi(phn(j),dn(j),xn(j))
110 continue
180 continue
call cst(havo,hodo,havn,hn,dn,deltho,
gammathilt,cstl,cst2,cst3)
1
if(io.eq.1)go to 81
const=cstl/(cst3*gamma(nosn)*chan1)
gavo=(tgilt-const*qipt*chanl/area)/(1-const*deltho)
81 havn1=havo+dt/(cst3*chanl)*(qipt*chan1/area-gavo*deltho)
if(abs((havn-havn1)/havn1).le.i.0e-7) go to 90
n=n+1
if(n.gt.100)go to 100
do 112 j=1,nosn
hn1(j)=thilt+beta(j)*(havni-thilt)
call densi(p,hni(j),dni(j),xn(j))
112 continue
havn=havnl
do 120 j=i,nosn
dn(j)=dni(j)
hn(j)=hn1(j)
120 continue
go to 180
90 tgilt=gavo+cst1/(cst3*gamma(nosn)*chanl)*(qipt*chanll/area
1
-gavo*deltho)
gn(1)=tgilt
do 190 j=2,nosn
gn(j)=gn(1)+gamma(j)*(gavo-gn(1))
190 continue
if(lo.eq.1)go to 150
c
c
c
c
c
c
c
flow reduce transient
for this transient the calculated pressure drop
is corresponding to ttime-2dt hence there is no meaning
to calculate it for first time step
191
151
150
192
if(i.eq.1)go to 151
time2=timei-dt
tpolt=polt(poltO,time2)
do 191 ii=1,nosn
if(go(ii).lt.O.0)go to 73
continue
call intrgl(p,go,ho,do,xo,fric)
predi=(gavo-gavoo)*chanl/dt+fric
tpilt=tpolt+predi
p=(tpilt+tpolt)/2.
gavoo=gavo
go to 160
do 192 il=1,nosn
if(gn(ii).lt.O.0)go to 73
continue
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
Cn
call intrgl(p,gn,hn.dn,xn,fric)
180
tpolt=polt(poltO.timel)
181
tpilt=pilt(piltO,poltO.timel)
182
predi=tpilt-tpolt
183
p=(tpolt+tpilt)/2.
184
gavn=gavo+dt/chanl*(predi-fric)
185
160 gavo=gavn
186
deltho=hn(nosn)-thilt
187
do 170 j=i,nosn
188
do(j)=dn(j)
189
ho(j)=hn(j)
190
xo(j)=xn(j)
191
192
170 continue
havo=havn
193
if(i.gt.1000)npp=10
194
if(np.ne.npp)go to 71
195
np=O
196
write(0,9000)i
197 c
198
9000 format(ix." timme steps ",15)
write(6,3600)ttime
199
200 3600 format(//," transient time = ",e13.6," sec")
havw=havn/1000
201
qiptw=qipt/1000
202
predw=predi/1000
203
write(6,3100)gavn,havwpredw,qiptw
204
average mass flux = ",f8.3," kg/m**2.sec",
205
3100 format(/."
"
average enthalpy = ",f8.3," kj/kg".
/,
1
206
kpa",
pressure drop = ",f8.3,"
/,
1
207
"
linear power = ",f8.3," kw/m")
1
/,
208
write(6,3200)
209
density quality ",
enthalpy
mass flux
210 3200 format(/,"
")
kg/m**3
kj/kg
kg/m**2.sec
/,"
1
211
do 200 j=1,nosn
212
gr=gn(j)/giltO
213
hw=hn(j)/1000
214
write(6,3300)j,gn(j),hw,dn(j),xn(j),gr
215
3300 format(lx,13,2x,f8.3,3x,f8.3,3x,f8.4,2x,f7.4,3x,f7.4)
216
200 continue
217
71 continue
218
70 continue
219
go to 72
220
73 write(0,3500)i,il
221
write(6,3500)i,11
222
223
3500 format(1x," flow rate Is negative at time step ",15,/,
1
" for node ",14)
224
go to 72
225
100 write(6,3400)i
226
3400 format(1x," iteration not converenge for time step",2x,12)
227
72 continue
228
end
229
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
subroutine intrgl(p,g,h,d,x,fric)
dimension h(21),g(21),d(21),x(21)
chaniareaequd,nosn,nots,dz,dt
common /datal/
fric=O
data convi,conv2,vics,gI/737.4643,1.4504e-4,91.7e-6,9.8/
data vicsi/19.73e-6/
c
c
c
acceleration pressure drop
fric=g(nosn)**2/d(nosn)-g(1)**2/d(1)
c
c
c
thm:
two phase pressure drop multiplier
thm=1
c
c
c
get the saturation liquid and vapor density rol,rov
call satt(p,hls,hvs)
call lden(p,hls,rol)
call vden(p,hvsrov)
do 10 i=2,nosn
ha=(h(i-1)+h(i))/2.
call densi(p,ha,daxa)
ga=(g(i-1)+g(i))/2.
c
c
c
elavation pressure drop
fric=fric+da*g1*dz
c
c
c
c
if x>O calculate the two phase multiplier
eq(5.209) p.230 Lahey and Moody was used
if(xa.eq.-1) goto 20
if(xa.eq.1.) go to 30
da=rol
gtest=ga*convi/1.Oe6
if(gtest.le.0.7)c1=1.36+0.0005*p*conv2+0.1*gtest
1
-0.000714*p*conv2*gtest
if(gtest.ge.0.7)c1=i.26-0.0004*p*conv2+0.119/gtest
1
+0.00028*p/gtest*conv2
thm=ci*(1.2*(rol/rov-1)*xa**0.824)+1.0
c
c
c
use Blasius for friction factor
20 fact=0.184*(ga*equd/vics)**(-0.20)
go to 40
30 fact=0.184*(ga*equd/vicsl)**(-0.2)
40 fric=fric+thm*fact*ga**2/(2*equd*da)*dz
10 continue
return
end
c
c
c
**********************************************
1
2
3
4
5
6
7
8
9
10
i
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
subroutine init(isi,giltO,hiltO,piltO,poltO,poweO,
1
pl,h,d,g,x)
dimension h(21),d(21),p(21),g(21),x(21)
common /datal/ chan1,area,equd,nosn,nots,dz,dt
call densi(piltO,hiltOd(i),x(1))
h(i)=hiltO
p(1)=pilto
g(1)=giltO
i=1
n1=1
90 do 10 i=2,nosn
hl=h(i-i)+poweO*dz/(area*giltO)
pl=p(i-1)
call densi(pi,hid(i),x(i))
60 ha=(hi+h(i-1))/2.
call densi(pi,hada,xi)
call frici (xi,pi,giltO,da,fod)
p2=p(i-1)-fod*giltO**2.*dz/(2*equd)
1 -da*9.80*dz-giltO**2.*(1/d(i)-1/d(i-1))
call densi(p2.hi,d(i),x(i))
call densi(p2,ha,da,xi)
call fric1(xi,p2,giltO,da,fod)
31 hI=h(i-1)+poweO*dz/(area*giltO)+(p2-p(1-1)+
(fod*giltO**2*dz)/(2*equd))/da
1
if(abs((p2-p1)/p2).le.1.Oe-8)go to 40
n=n+i
if(n.gt.50)goto 50
pi=p2
goto 60
40 p(i)=p2
h(i)=hi
g(i)=giltO
10 continue
if(isi.eq.1)poltO=p(nosn)
if(abs((p(nosn)-polto)/polto).le.1.Oe-4)go to 160
if(ni.gt.50) go to 80
n1=n1+i
gitO=giltO*((p(nosn)-p(1))/(poltO-piltO))**0.5
goto 90
80 write(6,2110)
2110 format(1x." iteration not converge for pressure b.c.")
stop
50 write(6,2090)i
2090 format(ix,"iteration not converge for spatial node ",i2)
stop
160 p1=(poltO+piltO)/2.
return
end
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
0o
332
333
334
335
336 c
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
subroutine fricl(xl,p,g,dfod)
common /datal/ chan1,areaequd.nosn,nots,dz,dt
data conviconv2,vics/737.4643,1.4504e-4,91.7e-6/
use McAdames correlation to calculate the friction factor
fric=0.184*(g*equd/vics)**(-0.2)
call satt(p,hls,hvs)
call Iden(p,hls,rol)
call vden(p,hvs,rov)
if(x1.eq.-1.0)go to 10
gtest=g*conv1/1.Oe6
if(gtest.le.O.7)cl=1.36+0.0005*p*conv2+0.1*gtest
1
-0.000714*p*conv2*gtest
if(gtest.gt.0.7)ci=1.26-0.0004*p*conv2+0.119/gtest
1+0.00028*p/gtest*conv2
thm=c1*(1.2*(rol/rov-i)*xl**0.824)+1.0
fod=thm*fric/rol
go to 21
10 fod=fric/d
21 continue
return
end
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
subroutine cst(havo,ho,do,havni,hni,dni,deltho,gamma,
355
hiltO,csticst2,cst3)
1
356
dimension ho(21),hnl(21),do(21),dnl(21),b(21),gamma(21)
357
chan1,area,equd,nosnnots,dzdt
common/datal/
358
nosnl=nosn-1
359
smtot=do(1)/2.
360
do 30 j=2,nosni
361
smtot=smtot+do(j)
362
30 continue
363
smtot=smtot+do(nosn)/2.
364
smtot=smtot*chan1/nosni
365
etot=0
366
do 40 j=2,nosn
367
et=1/2.*(do(j-1)+do(j))*((ho(j-1)+ho(j))/2.-hiltO)
368
etot=etot+et
369
370
40 continue
etot=etot*chanl/nosni
371
smttl=1/2.*dni(i)
372
373
do 60 j=2,nosni
smtti=smttl+dn1(j)
374
60 continue
375
smttl=smttl+1/2.*dni(nosn)
376
smttl=smttl*chan1/nosni
377
etoti=0
378
do 70 j=2,nosn
379
et=1/2.*(dnl(j-1)+dni(j))*((hnl(j)+hn1(j-1))/2.-hiltO)
380
etotl=etotl+et
381
70 continue
382
etotl=etot1*chanl/nosni
383
384
cst1=(smttl-smtot)/(havn1-havo)
cst2=(etoti-etot)/(havnl-havo)
385
b(1)=0
386
do 80 J=2,nosn
387
b(j)=dn1(j)-do(j)+dn1(j-1)-do(j-1)+b(j-1)
388
80 continue
389
btot=O
390
btot=1/2.*b(1)
391
do 90 j=2,nosni
392
btot=btot+b(j)
393
90 continue
394
btot=btot+1/2.*b(nosn)
395
bave=btot/nosni
396
do 100 j=1,nosn
397
gamma(j)=b(j)/bave
398
100 continue
399
cst3=(gamma(nosn)*cst2-cstl*(gamma(nosn)-1)*deltho)/
400
i(gamma(nosn)*chan1)
401
return
402
end
403
404 c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
C
405
406 c
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
subroutine densi(p,h,d,x)
call satt(p,hls,hvs)
if(h.le.hls) go to 10
if(h.gt.hvs) go to 20
call 1den(p,hlsrol)
call vden(phvs,rov)
x=(h-hls)/(hvs-hls)
svl=1./rol
svv=1./rov
sv=svl*(1-x)+svv*x
d=1./sv
return
10 x=-1.
call 1den(p,h,rol)
d=rol
return
20 x=1.
call vden(p,h,rov)
d=rov
return
end
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
C)
427
428
429
430
431 c
432
433
434
435 c
436
437
438
439
440
441
442
443
444
445
446
447
subroutine 1den(ph,rol)
data f11,f12/999.65,4.9737e-7/
data f21,f22/-2.5847e-10,6.1767e-19/
data f31,f32/1.2696e-22,-4.9223e-31/
data f41,f42/1488.64,1.3389e-6/
data f51,f52/1.4695e9,8.85736/
data f61,f62/3.20372e6,1.20483e-2/
if(h.gt.6.513e5) go to 10
f1=f11+f12*p
f2=f21+f22*p
f3=f31+f32*p
rol=fl+h*h*(f2+f3*h*h)
go to 20
10 f4=f41+f42*p
f5=f51+f52*p
f6=f61+f62*p
rol=f4+f5/(h-f6)
20 return
end
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
C)
448
449 c
450
451
452 c
453
454
455
456
457
subroutine vden(p,h.rov)
8
data gOOgOi,gO2,glO gll,g12/-5.1026e-5.1.120 e-10,
-4.4506e5,-1.6893e-10,-3.3980e-17,2.3058e-1/
1
gop=gOO+gOl*p+g02/p
gip=g10+g11*p+g12/p
rov=l ./(gOp+gip*h)
return
end
4
2
3
4
5
6
7
8
9
10
I
CD
'-A
458
459
460
461 c
462 c
463
464
465
466
467 c
468
469
470
471
472
473
474
475
subroutine satt(p,hls,hvs)
data tscltsc2, tsexp /9.0395, 255.2, 0.223/
data cpsi.cps2, cpsexp /9.5875e2. .00132334, -0.8566/
cps2 = -cpsexp * tcrinv
for his and hvs
data h10,hl,h12,h13,h14,h15/5.7474718e5,2.0920624e-1,
-2.8051070e-8,2.3809828e-15,-1.0042660e-22,1.6586960e-30/
1
data hvO,hvi,hv2,hv3,hv4/2.7396234e6,3.758844e-2,
-7.1639909e-9,4.2002319e-16,-9.8507521e-24 /
1
tsat = tscl* p**tsexp
hvs = hvo + p*(hvi + p*(hv2 + p*(hv3 + p*hv4)))
his = hlO + p*(hll + p*(h12 + p*(h13 + p*(hl4 + p*h15))))
pinv = 1./ p
dtsdp = tsat*tsexp*pinv
tsat = tsat + tsc2
return
end
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
C)A
476
477
478.
479
function power(poweO,timel)
power=poweO
return
end
1
2
3
4
480
481
482
483
function polt(poltO,timel)
polt=pol1t0
return
end
1
2
3
4
484
485
486
487
488 c
function gilt(giltO.timel)
gilt=giltO
return
end
1
2
3
4
5
489
490
491
492
493
494
495
496
497
function pilt(piltO,poltO,timel)
cn=100.*time1
if(cn.gt.79.99)go to 10
pilt=(piltO+poltO)/2.+(piltO-poltO)/2.*(exp(-100*timel))
go to 20
10 pilt=(piltO+poltO)/2.
20 continue
return
end
2
3
4
5
6
7
8
9
0
Download