NUREG/IA-0253 

 International 

Agreement Report

 

Development of a Computer

Tool for In-Depth Analysis and 

Post Processing of the

RELAP5 Thermal Hydraulic 

Code 

Prepared by:

R. H. Santos, J. M. Izquierdo Rocha

Consejo de Seguridad Nuclear

Justo Dorado, 11 

28040 Madrid, Spain

A. Calvo, NRC Project Manager 

Office of Nuclear Regulatory Research

U.S. Nuclear Regulatory Commission

Washington, DC 20555-0001

April 2011 

 

Prepared as part of

The Agreement on Research Participation and Technical Exchange 

Under the International Code Assessment and Maintenance Program (CAMP) 

 

Published by

U.S. Nuclear Regulatory Commission
AVAILABILITY OF REFERENCE MATERIALS 

IN NRC PUBLICATIONS

NRC Reference Material 

As of November 1999, you may electronically access 

NUREG-series publications and other NRC records at 

NRC=s Public Electronic Reading Room at 

http://www.nrc.gov/reading-rm.html. Publicly released 

records include, to name a few, NUREG-series 

publications; Federal Register notices; applicant, 

licensee, and vendor documents and correspondence; 

NRC correspondence and internal memoranda; 

bulletins and information notices; inspection and 

investigative reports; licensee event reports; and 

Commission papers and their attachments. 

NRC publications in the NUREG series, NRC 

regulations, and Title 10, Energy, in the Code of 

Federal Regulations may also be purchased from one 

of these two sources. 

1. The Superintendent of Documents 

 U.S. Government Printing Office 

 Mail Stop SSOP 

 Washington, DC 20402B0001 

 Internet: bookstore.gpo.gov 

 Telephone: 202-512-1800 

 Fax: 202-512-2250 

2. The National Technical Information Service 

 Springfield, VA 22161B0002 

 www.ntis.gov 

 1B800B553B6847 or, locally, 703B605B6000 

A single copy of each NRC draft report for comment is 

available free, to the extent of supply, upon written 

request as follows: 

Address: Office of the Chief Information Officer, 

 Reproduction and Distribution 

 Services Section 

 U.S. Nuclear Regulatory Commission 

 Washington, DC 20555-0001 

E-mail: DISTRIBUTION@nrc.gov 

Facsimile: 301B415B2289 

Some publications in the NUREG series that are 

posted at NRC=s Web site address 

http://www.nrc.gov/reading-rm/doc-collections/nuregs 

are updated periodically and may differ from the last 

printed version. Although references to material found 

on a Web site bear the date the material was accessed, 

the material available on the date cited may 

subsequently be removed from the site. 

Non-NRC Reference Material

Documents available from public and special technical 

libraries include all open literature items, such as 

books, journal articles, and transactions, Federal 

Register notices, Federal and State legislation, and 

congressional reports. Such documents as theses, 

dissertations, foreign reports and translations, and 

non-NRC conference proceedings may be purchased 

from their sponsoring organization. 

Copies of industry codes and standards used in a 

substantive manner in the NRC regulatory process are 

maintained atC

The NRC Technical Library 

Two White Flint North 

11545 Rockville Pike 

Rockville, MD 20852B2738 

These standards are available in the library for 

reference use by the public. Codes and standards are 

usually copyrighted and may be purchased from the 

originating organization or, if they are American 

National Standards, fromC

American National Standards Institute 

11 West 42nd Street 

New York, NY 10036B8002 

www.ansi.org 

Legally binding regulatory requirements are stated only 

in laws; NRC regulations; licenses, including technical 

specifications; or orders, not in 

NUREG-series publications. The views expressed in 

contractor-prepared publications in this series are not 

necessarily those of the NRC. 

The NUREG series comprises (1) technical and 

administrative reports and books prepared by the staff 

(NUREGBXXXX) or agency contractors 

(NUREG/CRBXXXX), (2) proceedings of conferences 

(NUREG/CPBXXXX), (3) reports resulting from 

international agreements (NUREG/IABXXXX), (4) 

brochures (NUREG/BRBXXXX), and (5) compilations of 

legal decisions and orders of the Commission and 

Atomic and Safety Licensing Boards and of Directors=

decisions under Section 2.206 of NRC=s regulations 

(NUREGB0750). 

212B642B4900 

DISCLAIMER: This report was prepared as an account of work sponsored by an agency of the U.S. Government. 

 Neither the U.S. Government nor any agency thereof, nor any employee, makes any warranty, expressed or 

implied, or assumes any legal liability or responsibility for any third party=s use, or the results of such use, of any 

information, apparatus, product, or process disclosed in this publication, or represents that its use by such third 

party would not infringe privately owned rights. 
NUREG/IA-0253

Development of a Computer Tool for In-Depth 

Analysis and Postprocessing of the RELAP5 

Thermal Hydraulic Code 

Manuscript Completed: April 2003 

Date Published: March 2011 

Prepared by: Roberto Herrero Santos* and José María Izquierdo Rocha* 

*Consejo de Seguridad Nuclear 

Justo Dorado, 11 

28040 Madrid – Spain 

A. Calvo, NRC Project Manager 

Prepared for:

Division of Systems Analysis 

Office of Nuclear Regulatory Research 

U.S. Nuclear Regulatory Commission 

Washington, DC 20555-0001

ABSTRACT

The Spanish Nuclear Safety Council (CSN) has sponsored the development of a computer

tool for the error diagnosis and interpretation of the results obtained with the code RELAP5/MOD3.2.

The report describes the tests used to check the consistency of the results and illustrates

some application examples that point out some defficiencies in the code.

iii
iv
CONTENTS

Page

ABSTRACT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iii

LIST OF FIGURES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . viii

EXECUTIVE SUMMARY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii

1 PROBLEM SETUP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1

1.1 Problems concerning the use of thermal hydraulic codes in Nuclear Safety . . . . 1-1

1.1.1 Analysis of thermal hydraulic codes . . . . . . . . . . . . . . . . . . . . . . . . 1-1

1.1.2 Checking the solutions computed by the TH codes . . . . . . . . . . . . . . . 1-2

1.1.3 Interpretation of results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-4

1.1.4 User effect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-4

1.2 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-5

2 VERIFICATIONS IMPLEMENTED IN THE ANALYSIS TOOL . . . . . 2-1

2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-1

2.2 Mass conservation equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-1

2.2.1 Analytical derivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2

2.2.2 Discretized form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2

2.3 Mixture momentum equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3

2.4 Pressure and volume equations . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-5

2.4.1 Analytical derivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-5

2.4.2 Discretized form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-8

2.5 Non-equilibrium mass equation . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-9

2.5.1 Analytical derivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-9

2.5.2 Discretized form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-11

2.5.3 Uncoupling of the non-equilibrium mass equations . . . . . . . . . . . . . . . . 2-12

2.6 Correspondence of variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-15

v
3 DESCRIPTION OF THE ANALYSIS TOOL . . . . . . . . . . . . . . . . . . 3-1

3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-1

3.2 Description of the programs used in the analysis tool . . . . . . . . . . . . . . . 3-1

3.2.1 The RELAP5 code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-1

3.2.2 The BABIECA simulation language . . . . . . . . . . . . . . . . . . . . . . . 3-1

3.2.3 Parallel Virtual Machine (PVM) . . . . . . . . . . . . . . . . . . . . . . . . . 3-2

3.2.4 The text editor AWK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2

3.2.5 XMGR5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3

3.3 Linkage of the codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3

3.3.1 The BABIECA-RELAP5 coupling . . . . . . . . . . . . . . . . . . . . . . . . 3-3

3.3.2 The role of the AWK editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4

3.3.3 The role of the XMGR5 program . . . . . . . . . . . . . . . . . . . . . . . . . 3-5

3.4 Functioning of the analysis tool . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5

4 APPLICATION EXAMPLES . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1

4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1

4.2 Compression caused by heating in a closed pipe . . . . . . . . . . . . . . . . . . 4-1

4.2.1 Example description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1

4.2.2 Analysis of results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2

4.3 Depressurization in a circuit with liquid and vapor . . . . . . . . . . . . . . . . 4-5

4.3.1 Justification of the example . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-5

4.3.2 Verification of the balance equations . . . . . . . . . . . . . . . . . . . . . . . 4-12

4.3.3 Interpretation of results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-13

4.3.4 Verification of the simplified non-equilibrium model . . . . . . . . . . . . . . . 4-17

4.4 Over specification of boundary conditions . . . . . . . . . . . . . . . . . . . . . 4-18

4.4.1 Motivation and background . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-18

4.4.2 Original case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-21

4.4.3 Zhang’s problem with PV term . . . . . . . . . . . . . . . . . . . . . . . . . . 4-21

4.4.4 Over specification suppression with pressure feedback . . . . . . . . . . . . . . 4-23

4.5 Full plant model. Flow mixing problem . . . . . . . . . . . . . . . . . . . . . . . 4-29

4.5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-29

5 CONCLUSIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-1

vi
6 RECOMMENDATIONS FOR FUTURE DEVELOPMENTS . . . . . . . . 6-1

6.1 Analysis of other codes and models . . . . . . . . . . . . . . . . . . . . . . . . . 6-1

6.2 Identification of lower order models . . . . . . . . . . . . . . . . . . . . . . . . . 6-1

6.3 Development of codes with error control . . . . . . . . . . . . . . . . . . . . . . 6-2

7 REFERENCES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-1

Appendix A. Nomenclature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-1

Appendix B. Partial derivatives of thermodynamic properties . . . . . . . . . . B-1

Appendix C: File babpost.awk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-1

vii
Figures

Page

1 Functioning diagram of the analysis tool. . . . . . . . . . . . . . . . . . . . . . . 3-5

2 Nodalization used in the example. . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1

3 Power introduced in the pipe. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2

4 Verification of the pressure equation. Pipe 402. . . . . . . . . . . . . . . . . . . 4-3

5 Verification of the level equation. Pipe 402. . . . . . . . . . . . . . . . . . . . . 4-3

6 Verification of the vapor mass. Pipe 402. . . . . . . . . . . . . . . . . . . . . . . 4-3

7 Verification of the liquid mass. Pipe 402. . . . . . . . . . . . . . . . . . . . . . . 4-3

8 Non-equilibrium vapor mass. Pipe 402. . . . . . . . . . . . . . . . . . . . . . . . 4-4

9 Non-equilibrium liquid mass. Pipe 402. . . . . . . . . . . . . . . . . . . . . . . . 4-4

10 Terms of the pressure equation. Pipe 402. . . . . . . . . . . . . . . . . . . . . . 4-4

11 Verification of the pressure equation. Pipe 500. . . . . . . . . . . . . . . . . . . 4-6

12 Verification of the level equation. Pipe 500. . . . . . . . . . . . . . . . . . . . . 4-6

13 Verification of the vapor mass. Pipe 500. . . . . . . . . . . . . . . . . . . . . . . 4-6

14 Verification of the liquid mass. Pipe 500. . . . . . . . . . . . . . . . . . . . . . . 4-6

15 Non-equilibrium vapor mass. Pipe 500. . . . . . . . . . . . . . . . . . . . . . . . 4-7

16 Non-equilibrium liquid mass. Pipe 500. . . . . . . . . . . . . . . . . . . . . . . . 4-7

17 Terms of the pressure equation. Pipe 500. . . . . . . . . . . . . . . . . . . . . . 4-7

18 Verification of the pressure equation. Pipe 402. Revised example. . . . . . . . . 4-8

19 Verification of the level equation. Pipe 402. Revised example. . . . . . . . . . . 4-8

20 Verification of the vapor mass. Pipe 402. Revised example. . . . . . . . . . . . . 4-8

21 Verification of the liquid mass. Pipe 402. Revised example. . . . . . . . . . . . . 4-8

22 Non-equilibrium vapor mass. Pipe 402. Revised example. . . . . . . . . . . . . . 4-9

23 Non-equilibrium liquid mass. Pipe 402. Revised example. . . . . . . . . . . . . . 4-9

24 Terms of the pressure eq. Pipe 402. Revised example. . . . . . . . . . . . . . . . 4-9

25 Verification of the pressure equation. Pipe 500. Revised example. . . . . . . . . 4-10

26 Verification of the level equation. Pipe 500. Revised example. . . . . . . . . . . 4-10

27 Verification of the vapor mass. Pipe 500. Revised example. . . . . . . . . . . . . 4-10

28 Verification of the liquid mass. Pipe 500. Revised example. . . . . . . . . . . . . 4-10

29 Non-equilibrium vapor mass. Pipe 500. Revised example. . . . . . . . . . . . . . 4-11

30 Non-equilibrium liquid mass. Pipe 500. Revised example. . . . . . . . . . . . . . 4-11

viii
31 Terms of the pressure eq. Pipe 500. Revised example. . . . . . . . . . . . . . . . 4-11

32 Circuit nodalization. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-12

33 Pressure evolution. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-13

34 Pressure analysis. Break in vapor region. . . . . . . . . . . . . . . . . . . . . . . 4-14

35 Liquid volume analysis. Break in vapor region. . . . . . . . . . . . . . . . . . . . 4-14

36 Vapor mass analysis. Break in vapor region. . . . . . . . . . . . . . . . . . . . . 4-14

37 Liquid mass analysis. Break in vapor region. . . . . . . . . . . . . . . . . . . . . 4-14

38 Pressure analysis. Break in liquid region. . . . . . . . . . . . . . . . . . . . . . . 4-15

39 Level analysis. Break in liquid region. . . . . . . . . . . . . . . . . . . . . . . . . 4-15

40 Vapor mass analysis. Break in liquid region. . . . . . . . . . . . . . . . . . . . . 4-15

41 Liquid mass analysis. Break in liquid region. . . . . . . . . . . . . . . . . . . . . 4-15

42 Energy flow released through the breaks. . . . . . . . . . . . . . . . . . . . . . . 4-16

43 Enthalpy flow released through the breaks. . . . . . . . . . . . . . . . . . . . . . 4-16

44 Terms of pressure eq. Break in vapor region. . . . . . . . . . . . . . . . . . . . . 4-16

45 Terms of pressure eq. Break in liquid region. . . . . . . . . . . . . . . . . . . . . 4-16

46 System compressibility. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-17

47 Neglection of term with Γiin the non-equilibrium eq. Vapor phase. Volume

10001. Break in vapor region. . . . . . . . . . . . . . . . . . . . . . . . . . . 4-19

48 Approximation of the interfacial heat power in the vapor phase. Volume 10001.

Break in vapor region. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-19

49 Neglection of term with Γi

in the non-equilibrium eq. Liquid phase. Volume

20001. Break in vapor region. . . . . . . . . . . . . . . . . . . . . . . . . . . 4-19

50 Approximation of the interfacial heat power in the liquid phase. Volume 20001.

Break in vapor region. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-19

51 Neglection of term with Γiin the non-equilibrium eq. Vapor phase. Volume

10001. Break in liquid region. . . . . . . . . . . . . . . . . . . . . . . . . . . 4-20

52 Approximation of the interfacial heat power in the vapor phase. Volume 10001.

Break in liquid region. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-20

53 Neglection of term with Γiin the non-equilibrium eq. Liquid phase. Volume

20001. Break in liquid region. . . . . . . . . . . . . . . . . . . . . . . . . . . 4-20

54 Approximation of the interfacial heat power in the liquid phase. Volume 20001.

Break in liquid region. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-20

55 Zhang’s problem. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-21

56 Zhang’s problem: pressure postprocessing. . . . . . . . . . . . . . . . . . . . . . 4-22

ix
57 Zhang’s problem: level postprocessing. . . . . . . . . . . . . . . . . . . . . . . . 4-22

58 Zhang’s problem: vapor mass postprocessing. . . . . . . . . . . . . . . . . . . . 4-22

59 Zhang’s problem: non-equilibrium vapor mass postprocessing. . . . . . . . . . . 4-22

60 Zhang’s problem: pressure drop postprocessing. . . . . . . . . . . . . . . . . . . 4-23

61 Zhang’s problem: vapor temperature. . . . . . . . . . . . . . . . . . . . . . . . . 4-24

62 Zhang’s problem: vapor enthalpy. . . . . . . . . . . . . . . . . . . . . . . . . . . 4-24

63 Zhang’s problem: vapor density. . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-24

64 Zhang’s problem: pressure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-24

65 Vapor temperature with PV term. . . . . . . . . . . . . . . . . . . . . . . . . . . 4-25

66 Vapor enthalpy with PV term. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-25

67 Vapor density with PV term. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-25

68 Pressure with PV term. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-25

69 Pressure equation with momentum calculation. . . . . . . . . . . . . . . . . . . 4-30

70 Liquid volume equation with momentum calculation. . . . . . . . . . . . . . . . 4-30

71 Mass equation with momentum calculation. . . . . . . . . . . . . . . . . . . . . 4-30

72 Non-equilibrium mass equation with momentum calculation. . . . . . . . . . . . 4-30

73 Pressure drop equation with momentum calculation. . . . . . . . . . . . . . . . 4-31

74 Vapor temperature with momentum calculation. . . . . . . . . . . . . . . . . . . 4-32

75 Enthalpy with momentum calculation. . . . . . . . . . . . . . . . . . . . . . . . 4-32

76 Vapor density with momentum calculation. . . . . . . . . . . . . . . . . . . . . . 4-32

77 Pressure with momentum calculation. . . . . . . . . . . . . . . . . . . . . . . . . 4-32

78 Volumetric flow in junction 5 of the downcomer. . . . . . . . . . . . . . . . . . . 4-33

79 Analysis of the pressure equation in the downcomer. . . . . . . . . . . . . . . . 4-34

80 Analysis of the liquid volume equation in the downcomer. . . . . . . . . . . . . . 4-34

81 Analysis of the vapor mass equation. . . . . . . . . . . . . . . . . . . . . . . . . 4-34

82 Analysis of the liquid mass equation in the downcomer. . . . . . . . . . . . . . . 4-34

83 Analysis of the non-equilibrium vapor mass equation in the downcomer. . . . . . 4-35

84 Analysis of the non-equilibrium liquid mass equation in the downcomer. . . . . . 4-35

85 Terms of the pressure equation in the downcomer. . . . . . . . . . . . . . . . . . 4-35

86 Analysis of the pressure equation in downcomer subsystem. . . . . . . . . . . . . 4-36

87 Analysis of the level equation in downcomer subsystem. . . . . . . . . . . . . . . 4-36

88 Analysis of the vapor mass equation in downcomer subsystem. . . . . . . . . . . 4-36

x
89 Analysis of the liquid mass equation in downcomer subsystem. . . . . . . . . . . 4-36

90 Analysis of the non-equilibrium vapor mass equation in downcomer subsystem. . 4-37

91 Analysis of the non-equilibrium liquid mass equation in downcomer subsystem. . 4-37

92 Pressure equation terms in downcomer subsystem. . . . . . . . . . . . . . . . . . 4-37

93 One-dimensional flow mixing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-38

94 Vapor mass flows in the downcomer. . . . . . . . . . . . . . . . . . . . . . . . . 4-40

95 Liquid mass flows in the downcomer. . . . . . . . . . . . . . . . . . . . . . . . . 4-40

96 Vapor energy flows in the downcomer. . . . . . . . . . . . . . . . . . . . . . . . 4-40

97 Liquid energy flows in the downcomer. . . . . . . . . . . . . . . . . . . . . . . . 4-40

98 Verification and validation processes. . . . . . . . . . . . . . . . . . . . . . . . . 6-3

99 Collapsed verification and validation processes. . . . . . . . . . . . . . . . . . . 6-3

xi
xii
EXECUTIVE SUMMARY

A computer tool has been developed to assist RELAP5 users in the interpretaiton and

qualification of pressure and level transients.

For that purpose some balance equations have been rigorously derived from the original mass

and energy equations. Those balances include the pressure, level and non-equilibrium mass

equations. The balances are used to check the consistency of the solution and to interpret

the pressure and level evolution in terms of physically meaningful variables.

Verification of the equations is implemented in the tool with the aid of an AWK script and

the general purpose simulation language BABIECA. The AWK script automatically generates the BABIECA input file necessary to check the RELAP5 transient. The execution

of BABIECA with the corresponding input file implies the spawning of the RELAP5 transient. RELAP5 information is transferred to BABIECA through PVM, so that the balance

equations can be verified.

The tool has been applied to some application examples, which have revealed some misconceptions in RELAP5, such as the overspecification of boundary conditions and the flow

mixing problems.

Some guidelines for the development of future codes, with full control of the discretization

errors, are pointed out.

xiii
xiv
1 PROBLEM SETUP

1.1 Problems concerning the use of thermal hydraulic codes in

Nuclear Safety

1.1.1 Analysis of thermal hydraulic codes

Nuclear Safety specialists face very often the need of simulating the transients expected to

occur in nuclear power plants, in order to determine and quantify the associated risks. This

need can be found in a wide variety of activities such as the conception and design of plant

systems, optimization of procedures and set-points, operator training simulators, success

criteria in PSAs, accident analyses, licensing tasks, etc.

The simulation of the operating and accidental transients that may happen in power plants

based on a nuclear fission process requires, as a previous step, the description of the physical

systems involved in the plant by means of mathematical models. A mathematical model

could be defined as a set of, generally partial, differential equations capable of describing

and predicting certain phenomena in a range of applicability. The predictive capability of

the models must be considered as a mandatory requirement, since a set of equations that

can only reproduce some transients by tuning certain parameters must never be regarded as

a model. The predictive capability is inherent to the concept of model.

The solution of the equations involved in the models that describe a nuclear power plant is

a very difficult problem. An analytical solution of the equations can never be achieved in

practice. The most common approach consists in solving a dicretized version of the differential equations by means of a programmable computer algorithm. The resulting program is

usually called a code. The nuclear industry counts on many codes focused on the different

disciplines involved in Nuclear Safety: neutronics, containment building, structural analysis,

etc. thermal hydraulic codes, and specially the RELAP5 code [95], must not be forgotten.

The thermal hydraulic codes simulate the behavior of water and steam circuits used to

transport the energy generated in the reactor. Despite their undeniable advantages, the use

of computer codes implies a numeral of problems which are very frequently understimated or

not taken into account. For instance, the solution of the discretized equations is subject to

errors that make very difficult to ensure how good the solution is. Interpretation of results

is another remarkable problem. Very often the users regard the codes as black boxes that

give an answer to the problems set through the input file, forgetting that they are formed by

mathematical models and that they never substitute the plants perfectly. Other problems

are related to the interaction between the codes and the users: build-up of the input file,

correct interpretation of the data supplied to the code, nodalization, decisions about the

different options available in the code, etc. As a consequence, the code may be told to solve

a problem different from that the user would like to solve. On the other hand, the user may

obtain wrong conclusions because of a misunderstanding of the output information computed

by the code.

1-1
Some of the problems mentioned above are described in a greater detail in the following

sections.

1.1.2 Checking the solutions computed by the TH codes

Disagreement between experimental results and the output data computed by a code is not

unusual at all. The causes of the discrepancies, usually referred to as uncertainties, may be

classified as follows:

1. External sources, originated in the modelling process. Two different types can be

defined in turn:

(a) The discrepancies between the analytical equations of the models and the real

world, which may be originated in deficiencies in the instrumentation used to

obtain the experimental correlations, inapropriate curve fitting, wrong modelling

hypotheses, etc.

(b) Hypersensitivity of the model to certain parameters, initial conditions or boundary

conditions, which cannot be measured with the required precision. As a result,

some output variables may lie within a very broad range as the value of the above

mentioned parameters is changed within the measuring error interval.

2. Internal sources, related to the discretization process of the analytical equations and

the discrete nature of digital computers. Three types can be noticed:

(a) Round-off errors, caused by the finite precision with which floating-point numbers are represented in a digital computer. The representation may be different

depending on the machine and even on the compiler [99, 25]. Round-off errors

are the root cause of the uncertainties attributed to machines and compilers in

references such as [16, 65].

(b) Truncation errors, which arise whenever a Taylor series is used. A discrete numerical method is a good example, since it implies in most cases a Taylor expansion

up to a certain order. Truncation errors also appear when trying to represent in

a digital computer non-rational numbers such as e, π, square roots, trigonometric

functions, exponential functions, or any other trascendental function. Computation of that kind of numbers is always achieved by means of Taylor expansions.

From the theoretical point of view, truncation errors can be as small as desired.

For numerical methods, refinement of the spatio-temporal discretization mesh

should decrease the error. In the case of the computation of non-rational numbers, calculation of higher order terms in the series should yield the same effect.

But in real practice, the refinement of the mesh or the increment of the terms

in the expansion results in more mathematical operations and hence in greater

round-off errors. From a certain point on, round-off errors could even compensate for the decreasing truncation errors. The native floating-point precision with

1-2
fixed finite length used by digital computers is then the main source of errors in

computer simulations.

The so called external sources of uncertainty can be hardly suppressed, since they are closely

related to the very nature of mathematical modelling. Ensuring that the analytical equations

model the real world accurately is the process known as validation. This work does not pay

attention to that kind of uncertainties.

On the other hand, internal uncertainties could be eliminated more easily. Round-off errors

can be decreased as much as desired getting rid of machine native floating-point arithmetic,

and using instead a software implemented multiple precision arithmetic, fitted to the particular needs of each problem [1]. Once the round-off errors are controlled, the solution can be

improved by progressive refinement of the discretization mesh.

Assuming that current codes do not implement multiple precision arithmetic, the quality of

the computed solution must be ensured by other methods. Reference [110] considers that

the numerical solution computed by a code is uniquely related to the analytical equations as

long as the following items are taken into account:

1. Estimation of the associated errors.

2. Comparison with well known analytical solutions.

3. Replacement of the solution into the original equations.

The two first items above imply an a priori verification of the solution. On the other hand,

item 3 is an a posteriori method.

With respect to item 1, binding of the truncation error may be a cumbersome task. First of

all, it may be difficult to find an analytical expresion for the error associated to a numerical

method. Secondly, finding upper bounds of the error in certain ranges of the spatio-temporal

domain might not be trivial.

Moreover, simulation codes result from coupling several sections, each of them accounting for

certain physical models, yielding feedback loops. For instance, the RELAP5 code comprises

a hydrodynamic section and a heat structure section among many others. Each of them is

solved with its own numerical method. As a consequence, the boundary conditions of each

section are already computed with a certain error, making it difficult to bind the error of the

overall system.

With respect to item 2, the solution computed by the code can be compared to the analytical

solution only in some cases. The water faucet and the oscillating manometer problems

described in [83] are typical examples. Unfortunately, analytical solutions can be found

in these cases at the expense of oversimplifying of the modelling hypotheses. For instance,

constant and uniform pressure to avoid the use of water property tables, separated phases, no

mass, momentum and energy interchange between phases, and incompressible and non viscid

flows, are common hypotheses. The range of physical phenomena tested with those examples

1-3
is then rather constrained, specially when compared to the range of all possible phenomena

that may occur during a transient. Comparison with analytical solutions seems to be suitable

just to test the numerical methods during the earlier stages of the developmental process.

Fulfilment of those tests is anyway a necessary but not a sufficient condition to ensure the

quality of the code.

An a posteriori verification of each particular calculation is much more advisable according

to [85, 50, 70]. Substitution of the solution into the original analytical equations seems to

be the natural way to check the results. However, this approach faces a great obstacle:

solutions in the discrete domain must be substituted in equations defined in a continuous

domain. Either continuous functions must be obtained from the discrete solutions, or the

analytical equations must be discretized before replacement.

The first choice implies fitting the discrete results to continuous curves with a predefined

shape. The curves should be then replaced into the analytical equations. The most important

problem with this approach is that the higher the order of a derivative, the less reliable it

is. The comparison could lead thus to negative conclusions even if the discrete solution is

acceptable.

The second choice is the replacement of the discrete solution into a discretized form of

the analytical equations. If the discretization is just the numerical method used to obtain

the discrete solution, the problem becomes trivial. That is the reason why the discretized

equations in this work are not the original ones but other rigorously derived from them.

Section 2 is mainly devoted to the derivation of these new equations.

1.1.3 Interpretation of results

Another problem that the code users face usually is the right interpretation of the results

computed by the code [48]. The codes supply a large amount of output information. However,

only a small fraction is used by the user to analyze the results. The right interpretation of

the phenomena occurred during the transient may be hindered by several factors:

• Ignorance of the analysts about the models actually included in the code.

• Tendency of the analysts to explain the results in terms of models simpler than those

embeded in the code (the homogeneous equilibrium model is perhaps the most representative example).

• Tendency of the analysts to explain the code results in terms of physical phenomena

not modelled at all in the code.

1.1.4 User effect

Thermal hydraulic codes have several options, many of which are taken by default, that must

be chosen by the users in the input file. These options allow for the selection of different

1-4
models, solution procedures, convergence criteria, etc. Furthermore, different users may

solve the same problem by means of different strategies and procedures (nodalization, time

step, cross-flow or normal junctions, models, etc.), leading to dramatically different results.

This is what is called the undesirable user effect, which has caused a great concern in the

international community [6].

1.2 Objectives

The main objective of this work is the development of a computer tool to help the users

of thermal hydraulic codes, and particularly of RELAP5, to solve or alleviate the problems

described in section 1.1. The proposed tool will be achieved by integrating the RELAP5

code in a higher level computing environment that allows for the on-line calculation of

new variables, balances, verifications and information in addition to those available in the

code output files. The tool will comprise a number of computer programs linked with each

other according to a given standard for code connection. Such a standard is the object of

reference [36].

In a finer detail, the tool will be capable of:

• Finding errors in the input file.

• Determining the local contribution of the several contributors to the global result of

the code.

• Checking the consistency of the calculation with the original equations.

• Comparing different codes, models and even machines and compilers. This may help

the user to ensure that his assumptions to interpret the code results are valid at least

in the particular transient.

As a summary, the proposed tool will execute what we shall call in-depth postprocessing of

the RELAP5 solutions, which must not be confused with the more traditional concept of

postprocessing that makes reference to user friendly output visualization.

The analysis tool will comprise the following codes:

• The modular simulation language BABIECA [49], which have been coupled to RELAP5, providing new computation capabilities.

• The Parallel Virtual Machine (PVM) [28,27] message passing library functions. These

functions will perform the information exchange between RELAP5 and BABIECA at

every time step, so the latter code can check the solution computed by the former one.

• The graphical visulization program XMGR5 [101, 52], which will be used to plot the

results obtained by both RELAP5 and the analysis tool.

1-5
• The standard UNIX, non-interactive text processor AWK, which will build automatically the BABIECA input file needed to execute the analysis of a given RELAP5 case,

once the user has specified the hydraulic subsystems and control volumes to be checked.

1-6
2 VERIFICATIONS IMPLEMENTED IN THE

ANALYSIS TOOL

2.1 Introduction

This section shows the verifications and additional computations that have been implemented

in tha analysis tool up to now. These verifications will enable us to achieve the goals stated in

section 1, i.e., interpretation of results, assurance of the quality of the solution computed by

RELAP5, fulfillment of the balance equations, comparison or different models and machines,

etc.

The starting point for the verifications is the following set of time and space averaged equations for the hydrodynamic section of the RELAP5 code. The derivation of these equations

can be found in [41, 82]. The nomenclature used hereinafter can be found in appendix 6.3.

Conservation of mass:

∂

∂t

(αkAρk) + ∂

∂x

(αkAρkvk) = AΓk (1)

Conservation of momentum:

∂

∂t

(αkAρkvk) + ∂

∂x

(αkAρkv

2

k

) = −αkA

∂P

∂x

+ αkρkBxA

− αkρkA FWkvk + AΓkvi − αkρkA FIk(vk − vk

0)

− Cαkαk

0ρmA



∂

∂t

(vk − vk

0) + vk0

∂vk

∂x

− vk

∂vk

0

∂x



−

1

2

Kαkρk |vk| vkδ(x − x0)

(2)

Conservation of energy:

∂

∂t

(αkAρkuk) + ∂

∂x

(αkAρkukvk) = −AP ∂αk

∂t

− P

∂

∂x

(αkAvk)

+ AQwk + AQik + AΓikh

∗

k + AΓwkh

0

k + A DISSk

(3)

In the following sections the new equations used to analyse the RELAP5 results, both in

analytical and discretized form, will be derived.

2.2 Mass conservation equation

The RELAP5 code currently checks the conservation of the mixture mass in full thermal

hydraulic systems. This way of controlling the calculation can fail because of two reasons:

2-1
• Positive mass errors in certain control volumes may be compensated by negative mass

errors in other volumes. In other words, the mass may be globally well computed,

although the local distribution may be wrong.

• Relatively large mass errors in the vapor phase may be masked when compared to the

total mass, since the mass of liquid is in most cases much larger.

As a conclusion, checking of the mass errors in individual control volumes and small subsystems, for each pase, seems to be necessary. However, we must say that the first item has

already been implemented in the 3.2.2beta version of RELAP5.

2.2.1 Analytical derivation

If we integrate equation (1) along a thermal hydraulic system of lenght L we obtain:

dmk

dt =

Z L

0

AΓk dx + Win

k − Wout

k

(4)

where

• mk ≡

Z L

0

αkAρk dx is the mass of phase k in the system and

• Wk ≡ αkAρkvk is the mass flow.

Integrating with respect to time we obtain the integral form:

mk(t) = mk(0) + Z t

0

Z L

0

AΓk dx + Win

k − Wout

k



dt (5)

2.2.2 Discretized form

The fulfillment of the mass conservation equation in a RELAP5 calculation must be checked

using a discretized for of equation (5), since the output information is only available at given

points of the spatio-temporal mesh (nodes of the spatial discretization and time steps.) The

mass in the thermal hydraulic system to be checked is approximated as follows:

mk ≈

X

N

l=1

α

l

kV

l

ρ

l

k

(6)

where the superindex l ranges over the control volumes in the subsystem. In a similar way

the space integral in the right hand side of equation (5) can be approximated by

Z L

0

AΓk dx ≈

X

N

l=1

V

lΓl

k

(7)

2-2
The inlet mass flow is computed as

Win

k ≡ α

in

k A

inρin

k

v

in

k

(8)

If several junctions are attached to the inlet side of the control volume, the following definitions hold, according to the flow mixing scheme described on section 3.1.7 of [95]:

α

in

k ≡

X

M

j=1

α

j

kA

j

X

M

j=1

A

j

(9)

ρ

in

k ≡

X

M

j=1

α

j

kA

j

ρ

j

k

X

M

j=1

α

j

kA

j

(10)

v

in

k ≡

 X

M

j=1

α

j

kA

j

ρ

j

k

v

j

k

! X

M

j=1

A

j

!

 X

M

j=1

α

j

kA

j

ρ

j

k

!

A

in

(11)

The superindex j ranges over all the junctions attached to the inlet face of control volume l.

Ain is the inlet area. Similar definitions hold for the outlet face.

The discretized form of the mass conservation equation remains then as follows:

dmk

dt

≈

X

N

l=1

V

lΓl

k + Win

k − Wout

k

(12)

The right hand side of this equation may be integrated with respect to time with a trapezoidal

rule. Its comparison with (6) provides the way to check the conservation of the mass of each

phase.

2.3 Mixture momentum equation

Checking this equation could seem trivial at first sight, since it is one of the original equations

solved by RELAP5. However, it will be useful to ensure that the pressure drop along a pipe

equals the pressure difference between the inlet and outlet sides.

2-3
The sum of the two equations (2) yields:

∂

∂t(Aρmvm) + ∂∂x(Aρmv

2

m) = −

∂

∂x 

αgαf ρgρfA

ρm

(vg − vf )

2



− A

∂P

∂x + ρmABx − αgρgA FWgvg − αf ρfA FWf vf

−

1

2

Kαgρg |vg| vgδ(x − x0) −

1

2

Kαf ρf |vf | vf δ(x − x0)

(13)

where mixture density and mixture velocity are respectively defined as:

ρm = αgρg + αf ρf (14)

vm =

αgρgvg + αf ρf vf

ρm

(15)

and x0 stands for the location of the local pressure drop.

The convective term ∂

∂x 

αgαf ρgρfA

ρm

(vg − vf )

2



accounts for the difference of the two fluid

model with respect to the homogeneous equilibrium model.

Integrating (13) along the direction x we get:

∂

∂t Z L

0

Aρmvm dx + Aρmv

2

m





out

− Aρmv

2

m





in

=

αgαf ρgρfA

ρm

(vg − vf )

2









in

−

αgαf ρgρfA

ρm

(vg − vf )

2









out

−

Z L

0

A

∂P

∂x dx +

Z L

0

ρmABx dx

−

Z L

0

αgρgA FWgvg dx −

Z L

0

αf ρfA FWf vf dx

−

1

2

Kαgρg |vg| vg −

1

2

Kαf ρf |vf | vf

(16)

We can assume that the cross-sectional is uniform within a control volume. Furthermore,

if the integrands are also considered as uniform within the control volume, the previous

equation becomes:

P

in − Pout =

∂

∂t(ρmvmL) + ρmv

2

m





out

− ρmv

2

m





in

+

αgαf ρgρf

ρm

(vg − vf )

2









out

−

αgαf ρgρf

ρm

(vg − vf )

2









in

− ρmHg + αgρgL FWgvg + αf ρfL FWf vf

−

1

2

K

A

αgρg |vg| vg −

1

2

K

A

αf ρf |vf | vf

(17)

2-4
where the body force term has been transformed as follows:

ρmLBx = ρmLg cos(θ) = ρmHg (18)

The right hand side of the previous equation, computed at every time step with the output

information provided by RELAP5, can be compared with the left hand side. Any discrepancy

between both sides of the equation is an indicator of error in the solution.

2.4 Pressure and volume equations

These are new integral balances, derived from the mass and energy equations. It provides a

new way of checking the RELAP5 results and interpreting the pressure and level evolution

in TH systems.

2.4.1 Analytical derivation

First of all, we derive the enthalpy equation from the energy equation (3), taking into account

that hk = uk + P θk and neglecting hereinafter the dissipation term, which is taken into

account by RELAP5 only if a control volume contains a pump:

∂

∂t(αkAρkhk) + ∂∂x(αkAρkhkvk) = αkA

∂P

∂t + αkAvk

∂P

∂x

+ AQwk + AQik + AΓikh

∗

k + AΓwkh

0

k

(19)

Taking into account the relationship

∂hk

∂t + vk

∂hk

∂x =



∂ρk

∂t + vk

∂ρk

∂x  ∂hk∂ρk



P

+



∂P

∂t + vk

∂P

∂x  ∂hk∂P 

ρk

(20)

the enthalpy conservation equation (19) is transformed into

αkA



∂ ln ρk

∂t + vk

∂ ln ρk

∂x 

=

αkAθk



∂P

∂t + vk

∂P

∂x  ∂ρk∂hk



P

"

θk −



∂hk

∂P 

ρk

#

+ Aθ2

k



∂ρk

∂hk



P

[Qwk + Qik + Γikh

∗

k + Γwkh

0

k − Γkhk]

(21)

The last two factors of the first term in the right hand side of equation (21) can be simplified

as follows:



∂ρk

∂hk



P

"

θk −



∂hk

∂P 

ρk

#

= θk



∂ρk

∂hk



P

+



∂ρk

∂P 

hk

=



∂hk

∂P 

sk



∂ρk

∂hk



P

+



∂ρk

∂P 

hk

=



∂ρk

∂P 

sk

(22)

2-5
where the following relatioships have been used:



∂x

∂y 

z



∂y

∂z 

x



∂z

∂x

y

= −1



∂x

∂y 

z

=



∂x

∂y 

t

+



∂t

∂y

z



∂x

∂t 

y

ρk =



∂P

∂hk



sk

If the isobaric expansion coefficient is defined as

πk ≡



∂θk

∂hk



P

(23)

and the isentropic compressibility coefficient as

γk ≡



∂ ln P

∂ ln ρk



sk

(24)

the final form of the enthalpy conservation equation is obtained:

αkA



∂ ln ρk

∂t + vk

∂ ln ρk

∂x 

=

αk

γk

A



∂ ln P

∂t + vk

∂ ln P

∂x 

− Aπk [Qwk + Qik + Γikh

∗

k + Γwkh

0

k − Γkhk]

(25)

Moreover, if the derivatives in the mass conservation (1) are expanded, and the whole equation is divided by ρk, we obtain

∂

∂t(αkA) + αkA

∂ ln ρk

∂t +

∂

∂x(αkAvk) + αkAvk

∂ ln ρk

∂x = A

Γk

ρk

(26)

The substitution of (26) into (25) and the integration along the x axis yields the combined

pressure and level equation for phase k:

dVk

dt + Ck

dhln Pik

dt = Jk + Swk + Dk + Ack (27)

The following variables have been defined in the previous equation:

• Vk is the volume occupied by the phase k,

• Ck ≡

Z L

0

A

αk

γk

dx is the phase k system compressibility,

2-6
• hln Pik ≡

Z L

0

A

αk

γk

ln P dx

Z L

0

A

αk

γk

dx

,

• Jk ≡ αkAvk|

in − αkAvk|out

is the difference between the inlet and outlet flows in the

TH system,

• Swk ≡

Z L

0

A

Γk

ρ

sat

k

dx is the expansion/contraction due to phase k appearance/dissappearance,

• Dk ≡

Z L

0

A[πk(Qwk + Qik + Γikh

∗

k + Γwkh

0

k − Γkhk)

+ Γk(θk − θ

sat

k

)] dx

is the expansion/contraction of phase k due to enthalpy variations,

• Ack ≡

Z L

0

A



(ln P − hln Pik)

∂

∂t



αk

γk



−

αk

γk

vk

∂ ln P

∂x



dx is a term dominated by

pressure grandients.

The relation

Z L

0

A

αk

γk



∂ ln P

∂t

+ vk

∂ ln P

∂x



dx = Ck

dhln Pik

dt − Ack (28)

has been also taken into account.

If the two equations (27) are summed, one for each phase, the following pressure equation is

obtained:

dhln Pi

dt =

X

k

Jk + Swk + Dk + Ack

X

k

Ck

(29)

where

dhln Pi

dt

≡

X

k

Ck

dhln Pik

dt

X

k

Ck

(30)

Equation (29) shows that the pressure evolution in a TH system is the result of the accomodation of volume changes. The greater the compressibility of the system, the smaller

the impact of those changes in the pressure. The sources of volume change are the inlet

and outlet volumetric flows, the swelling of the phases, the thermal expansions and changes

caused by the pressure distribution along the system.

2-7
Assuming that dhln Pik

dt ≈

dhln Pi

dt , we obtain the following level equation:

dVf

dt = Jf + Swf + Df + Acf − Cf

dhln Pi

dt (31)

The equation above clearly shows that variations of the volume of liquid in the system,

which is closely related to the level, can be caused by a mismatch between the inlet and outlet

volumetric flows, by the appearance/dissapearance of liquid phase, by the thermal expansion

of the liquid, by spatial variations of the pressure and, finally, by temporal variations of the

global pressure. The greater the compressibility of the liquid, the greater the influence of

the variations of the global pressure in the evolution of the level.

2.4.2 Discretized form

The terms in the right hand side of the pressure and level equation can be discretized as

follows:

Ck ≈

X

N

l=1

α

l

k

γ

l

k

V

l

(32)

Swk ≈

X

N

l=1

V

l Γ

l

k

ρ

satl

k

(33)

Dk ≈

X

N

l=1

V

l

h

π

l

k

(Q

l

wk + Q

l

ik + Γl

ikh

∗

l

k + Γl

wkh

0

l

k − Γ

l

kh

l

k

) + Γl

k



θ

l

k − θ

satl

k

i (34)

Ack ≈

X

N

l=1

V

l



ln P

l − hln Pik

 ∂

∂t 

α

l

k

γ

l

k



+

X

N

l=1

A

lα

l

k

γ

l

k

v

l

k

ln 

P

inl

Poutl

!

(35)

The volumetric flow Jk is computed with the equations (9) and (11).

The partial derivative with respect to time in equation (35) is estimated by finite differences:

∂

∂t 

α

l

k

γ

l

k



≈

1

∆t

 

α

l,n

k

γ

l,n

k

−

α

l,n−1

k

γ

l,n−1

k

!

(36)

where the superindices n and n − 1 stand for two successive time steps.

The right hand side of equation (29) is integrated with respect to time with a BABIECA

module that implements the trapezoidal rule. The result is compared to

hln Pik ≈

X

N

l=1

V

lα

l

k

γ

l

k

ln P

l

X

N

l=1

V

lα

l

k

γ

l

k

(37)

2-8
Similarly, the right hand side of equation (31) is numerically integrated and compared with

Vf ≈

X

N

l=1

α

l

fV

l

(38)

2.5 Non-equilibrium mass equation

This integral balance, derived also from the mass and energy equations, has been developed

with two purposes:

• Provide an alternative way to check the consistency of the solution with the conservation equations.

• Under certain hipoteses, a form of the conservation equations that shows the tendence

of two-phase systems towards thermal equilibrium can be obtained. This tendence is

specially strong in the emerging phase, even if the constitutive equations do not indicate

this behavior in principle. If this tendence towards equilibrium in the emerging phase

is confirmed, simplified models can take advantage of that feature. This assumption

is used, for instance, in the HIPA code [108], which leads to more simplified models.

Checking of the equilibrium hipothesis in the emerging phase in a wide variety of

transients would confirm the validity of those simplified models, in which the two

phases are decoupled from each other. More efficient numerical schemes can then be

devised.

2.5.1 Analytical derivation

The continuity equation can be rewritten as follows:

∂

∂t(αkAρk) + ∂∂x(αkAρkvk) = ρk



∂

∂t(αkA) + ∂∂x(αkAvk)



+ αkA



∂ρk

∂t + vk

∂ρk

∂x 

= AΓk

(39)

Defining

δρnq

k ≡ ρ

sat

k − ρk (40)

A∆Γk ≡

∂

∂t(αkAδρnq

k

) + ∂

∂x(αkAδρnq

k

vk) (41)

and taking into account the continuity equation (1), the saturation density fulfills the following conservation equation:

∂

∂t(αkAρsat

k

) + ∂

∂x(αkAρsat

k

vk) = ∂

∂t(αkAδρnq

k

) + ∂

∂x(αkAδρnq

k

vk)

+

∂

∂t(αkAρk) + ∂∂x(αkAρkvk) = A(Γk + ∆Γk)

(42)

2-9
If we expand the left hand side of the previous equation we get:

ρ

sat

k



∂

∂t(αkA) + ∂∂x(αkAvk)



+ αkA



∂ρsat

k

∂t + vk

∂ρsat

k

∂x 

=

A (Γk + ∆Γk)

(43)

Substracting equations (43) and (39), previously divided by ρ

sat

k

and ρk, respectively, we

obtain

αkA



∂ ln ρ

sat

k

∂t + vk

∂ ln ρ

sat

k

∂x −

∂ ln ρk

∂t − vk

∂ ln ρk

∂x 

=

AΓk



θ

sat

k − θk



+ A

∆Γk

ρ

sat

k

(44)

If we define the compressibility along the saturation line as

λ

sat

k ≡

d ln P

d ln ρ

sat

k

(45)

and we use equations (25) and (41), we get

∂

∂t(αkAδρnq

k

)+ ∂

∂x(αkAδρnq

k

vk) =

ρ

sat

k

 1

λ

sat

k

−

1

γk



αkA



∂ ln P

∂t + vk

∂ ln P

∂x 

+ dk

 (46)

where dk is the integrand of the thermal expansion term, i.e., dk ≡

∂Dk

∂x .

Defining

d

eq

k ≡ − 

1

λ

sat

k

−

1

γk



αkA



∂ ln P

∂t + vk

∂ ln P

∂x 

(47)

and

d

nq

k ≡ dk − d

eq

k

(48)

we obtain the following differential form of the non-equilibrium mass conservation equation:

∂

∂t (αkAδρnq

k

) + ∂

∂x (αkAδρnq

k

vk) = ρ

sat

k d

nq

k

(49)

Integrating along the x axis:

dmnq

k

dt =

Z L

0

ρ

sat

k d

nq

k

dx + W

nq

k

|

in − W

nq

k

|

out (50)

where the non-equilibrium mass m

nq

k

has been defined as

m

nq

k ≡

Z L

0

αkAδρnq

k

dx (51)

2-10
and the non-equilibrium mass flow as

W

nq

k ≡ αkAδρnq

k

vk (52)

The definitions (47) and (48) are physically meaningful. If phase k is in equilibrium, the left

hand side of equation (49) vanishes, yielding

dk = d

eq

k = −



1

λ

sat

k

−

1

γk



αkA



∂ ln P

∂t + vk

∂ ln P

∂x 

(53)

This is the reason for the definition of (47). The difference between the actual term dk and

that defined as the equilibrium term is just the definition (48).

When phase k is in thermal equilibrium, the terms that include any of the Γ variables in the

expresion of dk vanish. dk becomes then

d

eq

k = Aπk(Qwk + Q

eq

ik

) (54)

where Q

eq

ik

is the interfacial heat in those conditions. The heat transferred to phase k is then

donnored to the other phase through the interfacial surface, subtracting the heat necessary

to accomodate the new saturation conditions imposed by the spatio-temporal variations of

the pressure. The contribution of the pressure is accounted for with the term d

eq

k

.

2.5.2 Discretized form

The integral in the right hand side of equation (50) is approximated, within a control volume

l, as follows:

Z Ll

0

ρ

sat

k d

nq

k

dx ≈

ρ

satl

k D

l

k +

Z Ll

0

ρ

sat

k

 

1

λ

sat

k

−

1

γk

!

αkA



∂ ln P

∂t + vk

∂ ln P

∂x 

dx ≈

ρ

satl

k

"

D

l

k + γ

l

k



1

λ

satl

k

−

1

γ

l

k

 Z Ll

0

A

αk

γk



∂ ln P

∂t + vk

∂ ln P

∂x 

dx#

=

ρ

satl

k



D

l

k + γ

l

k



1

λ

satl

k

−

1

γ

l

k

 J

l

k + Swlk + D

l

k −

dV l

k

dt 

(55)

The relations (28) and (31) have been used in the last part of the previous equation.

2-11
The right hand side of the non-equilibrium mass equation (50) is approximated in a whole

TH system by the sum of all the equations (55) that represent each control volume:

Z L

0

ρ

sat

k d

nq

k

dx ≈

X

N

l=1

ρ

satl

k

γ

l

k

λ

satl

k



J

l

k + Swl

k + D

l

k −

dV l

k

dt 

−

X

N

l=1

ρ

satl

k



J

l

k + Swl

k −

dV l

k

dt 

+ W

nq

k

|

in − W

nq

k

|

out

(56)

The saturation density in the definition of the non-equilibrium mass flows is that corresponding to the inlet (or outlet) pressure of the system. The equation (56), integrated with respect

to time, is compared then with the following approximation of the non-equilibrium mass of

phase k in the whole system:

m

nq

k ≈

X

N

l=1

V

l

k



ρ

satl

k − ρ

l

k



(57)

The comparison of the two sides of equation (50) can be used to check the consistency of

the solutions provided by the RELAP5 code, as already declared at the beginning of this

section.

2.5.3 Uncoupling of the non-equilibrium mass equations

The thermal expansion term dk in the non-equilibrium mass equation can be simplified

under certain hipotheses, leading to the uncoupling of the two phases. If those hipotheses

are confirmed, the uncoupled equations could be used as the basis for more efficient numerical

schemes.

The term dk can be rewritten as follows:

dk =A



πk (Qwk + Qik + Γikh

∗

k + Γwkh

0

k − Γkhk) + Γk



θk − θ

sat

k

 =

Aπk



Qwk + Q

w

ik + Q

b

ik



+ AΓik



πk (h

∗

k − hk) + 

θk − θ

sat

k



+AΓwk



πk (h

0

k − hk) + 

θk − θ

sat

k



(58)

where both the interfacial heat and the generation rate of phase k have been split into their

contributions in the wall and the bulk of the fluid, according to the equations

Qik = Q

w

ik + Q

b

ik

(59)

Γk = Γwk + Γik (60)

2-12
If Γik < 0 then h

∗

k = hk (see the definition of h

∗

k

in section 2.6), and the term with Γik in the

left hand side of equation (58) remains in the form

AΓik



πk (h

∗

k − hk) + 

θk − θ

sat

k

 = AΓik



θk − θ

sat

k



(61)

In this case the two phases cannot be uncoupled, since the expresion of the generation rate

of vapor in the bulk

Γik = −

Hik (T

sat−Tk) + Hik

0 (T

sat − Tk

0)

h

∗

k − h

∗

k

0

(62)

contains variables relative to the other phase.

On the other hand, if Γik > 0 then h

∗

k = h

sat

k

, and the term with Γik in the left hand side of

equation (58) takes the form

AΓik



πk (h

∗

k − hk) + 

θk − θ

sat

k

 =

AΓik



πk



h

sat

k − hk



+



θk − θ

sat

k

 (63)

If the specific volumes are expanded in a Taylor series:

θ

sat

k = θk +



∂θk

∂hk



P

(h

sat

k − hk) + 1

2



∂

2θk

∂h2

k



P

(h

sat

k − hk)

2 + · · · (64)

Neglecting the second and higher order terms in equation (64), and taking into account

the definition of πk, equation (63) becomes trivial, simplifying the non-equilibrium mass

equation.

Moreover, if Γwk > 0 then h

0

k = h

sat

k

and the term Γwk in the right hand side of equation (58)

can also be neglected. In this case the non-equilibrium mass equation remains as follows:

∂

∂t (αkAδρnq

k

) + ∂

∂x (αkAδρnq

k

vk) =

ρ

sat

k Aπk(Qwk + Q

w

ik + Q

b

ik

) − ρ

sat

k d

eq

k

(65)

Since we assume that Γwk > 0, this phase appears in equilibrium in the wall, and hence

Qw

ik = 0. The interfacial heat in the bulk is defined by the expresion:

Q

b

ik = Hik(T

sat − Tk) (66)

Expanding the previous equation by a Taylor series up to the first order:

Q

b

ik ≈ Hikδρnq

k



∂T

∂ρ sat

P

= −

Hik

ρ

sat

k

β

sat

k

δρnq

k

(67)

2-13
The final form of the non-equilibrium mass equation, assuming that Γik > 0 y Γwk > 0, is:

∂

∂t (αkAδρnq

k

) + ∂

∂x (αkAδρnq

k

vk) ≈ −

Hik

β

sat

k

πkAδρnq

k + ρ

sat

k AπkQwk

+ ρ

sat

k



1

λ

sat

k

−

1

γk



αkA



∂ ln P

∂t + vk

∂ ln P

∂x  (68)

where all the variables are defined for the phase k itself, demonstrating the uncoupling from

the other phase.

Let’s remind that the validity of this model is guarantedd only under the following assumptions:

• Γik [πk (h

sat

k − hk) + (θk − θ

sat

k

)] ≈ 0

• Γwk [πk (h

sat

k − hk) + (θk − θ

sat

k

)] ≈ 0

• T

sat − Tk ≈ −

δρnq

k

ρ

sat

k

β

sat

k

On the other hand, if Γwk < 0 then h

0

k = hk and the terms that involve the interfacial heat

in the wall and the generation rate of phase k in the wall become

A



πkQ

w

ik + Γwk(θk − θ

sat

k

)



=AΓwk



(θk − θ

sat

k

) − πk (h

0

k − h

0

k

0)



=

AΓwk



(θk − θ

sat

k

) − πk(hk − h

sat

k

0 )

 (69)

where the following relation taken from the page 4-130 of reference [97] has been used :

Γwk = −

Qw

ik

h

0

k − h

0

k

0

(70)

The reference [97] also suggests on page 4-132 the following expresions for the generation

rate of vapor and liquid in the wall:

Γwg =

Qwg

max(hg − h

sat

f

, 104J /Kg)

(wall condensation) (71)

Γwf = −

Qwf

max(h

sat

g − hf , 104J /Kg)

Mul (wall boiling) (72)

Assuming that |hk − h

sat

k

0 | > 104J/Kg, and taking into account that θk − θ

sat

k ≈

δ

nq

l

ρ

sat

k

2 , the

following expresion of the non-equilibrium mass equation is obtained:

∂

∂t (αkAδρnq

k

) + ∂

∂x (αkAδρnq

k

vk) ≈



QwkMul

ρ

sat

k

(hk − h

sat

k

0 )

− πk

Hik

β

sat

k



Aδρnq

k

+ ρ

sat

k AπkQwk (1 − Mul)

+ ρ

sat

k



1

λ

sat

k

−

1

γk



αkA



∂ ln P

∂t + vk

∂ ln P

∂x 

(73)

2-14
Like in the case in which Γwk > 0, the previous equation is decoupled from the other phase,

since h

sat

k

0 depends only on the pressure. The multiplier Mul depends only on the pressure

as well. This multiplier equals 1 for the vapor phase. In this case the first term with the

variable Qwk in equation (73) vanishes.

It is convenient to remind here that these conclusions are valid only for the phase in which

Γik > 0 and Γwk < 0, under the following assumptions:

• Γik [πk (h

sat

k − hk) + (θk − θ

sat

k

)] ≈ 0

• T

sat − Tk ≈ −

δρnq

k

ρkβk

• θk − θ

sat

k ≈

δ

nq

l

ρ

sat

k

2

Confirmation of these assumptions in a wide range of transients will allow to validate the

new model based on the non-equilibrium mass equations.

2.6 Correspondence with the RELAP5 output variables

To evaluate the integral balances described in the sections 2.2 to 2.5 it is necessary to associate

the variables involved in those balances with the output variables provided by the RELAP5

output files. The partial derivatives are obtained from the three partial derivatives obtained

in RELAP5, i.e.:

• CP ≡



∂h

∂T 

P

• β ≡

1

θ



∂θ

∂T 

P

• η ≡



∂ρ

∂P 

u

On the contrary, the partial derivatives available in the BABIECA module r5prop, needed

to evaluate the properties along the saturation line, are the following:

• CP ≡



∂h

∂T 

P

• Cθ ≡



∂u

∂T 

θ

• β ≡

1

θ



∂θ

∂T 

P

Several derivatives of thermodynamic properties, computed as function of the two groups on

variables above, are shown in Appendix 6.3.

The correspondences are shown below, with the RELAP5 variables on the right hand side

of the equivalences.

2-15
Variables concerning control volumes

C

l

P g

≡ csubpg

C

l

P f ≡ csubpf

β

l

g ≡ betagg

β

l

f ≡ betaff

η

l

g ≡ drgdp

η

l

f ≡ drfdp

V

l ≡ vvol

Al ≡ avol

P

l ≡ p

α

l

g ≡ voidg

α

l

f ≡ voidf

ρ

l

g ≡ rhog

ρ

l

f ≡ rhof

θ

l

g ≡

1

rhog

θ

l

f ≡

1

rhof

u

l

g ≡ ug

u

l

f ≡ uf

v

l

g ≡ velg

v

l

f ≡ velf

Γ

l

ig ≡ gammai

Γ

l

if ≡ −gammai

Γ

l

wg ≡ gammaw

Γ

l

wf ≡ −gammaw

Γ

l

g ≡ gammaw + gammai

Γ

l

f ≡ −(gammaw + gammai)

h

l

g ≡ ug +

p

rhog

h

l

f ≡ uf +

p

rhof

h

∗

g

l ≡

(

h

sat

g

l

(p) if gammai > 0

h

l

g

if gammai < 0

2-16
h

∗

f

l ≡

(

h

sat

f

l

(p) if gammai < 0

h

l

f

if gammai > 0

h

0

g

l ≡

(

h

sat

g

l

(p) if gammaw > 0

h

l

g

if gammaw < 0

h

0

f

l ≡

(

h

sat

f

l

(p) if gammaw < 0

h

l

f

if gammaw > 0

Hl

ig ≡ hig

Hl

if ≡ hif

T

satl

≡ satt

T

l

g ≡ tempg

T

l

f ≡ tempf

Ql

wg ≡

qwg

vvol

Ql

wf ≡

q − qwg

vvol

Qwl

ig ≡

(

−gammaw(h

0

g

l − h

0

f

l

) if gammaw < 0

0 if gammaw > 0

Qwl

if ≡

(

−gammaw(h

0

g

l − h

0

f

l

) if gammaw > 0

0 if gammaw < 0

Qbl

ig ≡ hig(sattemp − tempg)

Qbl

if ≡ hif(sattemp − tempf)

FWl

g ≡ voidg * rhog * fwalg

FWl

f ≡ voidf * rhof * fwalf

Variables concerning junctions

v

j

g ≡ velgj

v

j

f ≡ velfj

α

j

g ≡ voidgj

α

j

f ≡ voidfj

ρ

j

g ≡ rhogj

ρ

j

f ≡ rhofj

Aj ≡ ajun

2-17
K

j

f ≡ formgj

Kj

r ≡ formfj

2-18
3 DESCRIPTION OF THE ANALYSIS TOOL

3.1 Introduction

This section describes the codes and computer programs used to build the proposed analysis

tool and the way they are connected to perform the in-depth postprocess of the results

obtained in RELAP5 calculations.

3.2 Description of the programs used in the analysis tool

3.2.1 The RELAP5 code

RELAP5 is the thermalhydraulic code whose results will be checked with the analysis tool.

Thus, it is the central code of it. Please refer to [95] for details on the code.

3.2.2 The BABIECA simulation language

BABIECA is the driver of the continuous, general purpose simulation language integrated

in the package CAMPEADOR [49]. BABIECA will be the core of the analysis tool. It is the

central program to which the rest of the codes will be connected. It performs the additional

calculations described in section 2.

The BABIECA simulation language is modular, which means that the problem to be solved

is defined as a block diagram. Each block may be considered as a multi input-multi output

relation between time-evolving variables, and represents a physical system or a mathematical procedure. The input-output relation consists of a set of differential equations plus a

numerical solution algorithm (implicit). There is no common solution algorithm for all the

blocks, as it is the norm in most simulation languages. Blocks are particular instances of

computational entities called modules. The set of private data of the block defines it, while

it is the connection among the blocks and the overall computation order that constitute the

global numerical scheme. Each block has a number, defined by the user in the input file.

The block outputs are numbered successively starting from the block number. The user must

take care of avoiding output number overlaping. The driver routine of BABIECA manages

the time step control and calls the modules sequentially in the user-defined order. When all

the blocks have been successfully computed the time step is considered to be finished, and a

new time step calculation begins.

Modules cover a broad range of mathematical tools, physical models and special components,

and are mainly oriented, but not limited, to the solution of large thermal hydraulic networks

like those appearing in nuclear power plants. Among all the modules available, only few will

be used in this tool. The most important one is the module called FUNIN, which is a parser

that processes, at each time step, a FORTRAN-like mathematical expresion dependent upon

the block inputs. Other important modules are LOGATE, which obtains logical variables from

3-1
analogical inputs, R5STEAM, which contains the RELAP5 water properties tables, FINT, which

implements time dependent functions, WRITES, used to write column formatted output files

and finally SNDCODE and RCVCODE, used for the connection with other codes.

3.2.3 Parallel Virtual Machine (PVM)

Parallel Virtual Machine (PVM) [27, 28] is a software for the parallelization and exchange

of information between different computer processes. It runs on top of the UNIX sockets.

PVM is interoperable, i.e., the computer processes to be connected can run even on different

machines of different nature. It is only required that the machines be connected through the

TCP/IP protocol.

PVM comprises a library of C and FORTRAN functions and a daemon program called pvmd.

The library provides functions to spawn a new process from a running one, to pack data in

buffers, to send these buffers, to receive them and to unpack the data. These functions, when

properly inserted in the source code of the original programs, allow the developers to make

the programs work concurrently to perform an overall task.

It is convenient here to make a reference to the Message Passing Interface (MPI) software [32].

It is more oriented towards parallelization of codes running in multiprocesor machines than

towards distributed computing. It only can work between machines of the same type. Another drawback is the incapability to spawn processes. On the other hand, it shows a better

performance in the exchange of information between processes. The University of Tennessee

and the Oak Ridge National Laboratory are planning to develop a product that would support all the capabilities of both PVM and MPI, called PVMPI [23]. If this product is finally

released, it is almost sure that it will become the new standard for parallelization and connection of programs.

3.2.4 The text editor AWK

AWK is a non-interactive text editor included in all standard distributions of UNIX-like

operating systems. Details and reference manual can be found in any UNIX reference manual.

Generally speaking, AWK is a C-like interpreted language that allows users to use and operate

variables on the fly without previous definition. The AWK command are usually written in

a file. These commands read information from a set of files, process the information, and

generate another set of files. The file containing the AWK commands comprises three parts:

• A section called BEGIN, where the user can initialize variables and define parameters

used along the rest of the file.

• A main body, in which AWK searchs for lines containing given patterns in a set of

files specified by the user. Depending on the matching of these patterns, and the

information contained in the files, AWK can generate new information, in form of new

variables, operations between variables, etc.

3-2
• An END section, in which AWK can generate new files depending on the information

generated in the main body.

Due to its special features, AWK is specially useful for automatic generation of particular

purpose input files of general purpose programs.

3.2.5 XMGR5

XMGR [101] is a program for the treatment and graphical display of scientifical data. The

XMGR5 program [52] is an extension of the previous one, which is capable of reading the

information stored in the RELAP5 restart-plot files. In addition, XMGR5 can access the

RELAP5 water property tables. For these reasons, XMGR5 has been chosen to display the

results of the RELAP5 in-depth postprocessing.

3.3 Linkage of the codes

In this section we describe how the previous codes are linked to build the postprocessing

tool.

3.3.1 The BABIECA-RELAP5 coupling

BABIECA is the central program of the postprocessing tool. It will be connected to RELAP5

via the PVM library functions, allowing the exchange of information between them. Output

information from RELAP5 will be transferred to properly built BABIECA blocks in order

to perform additional verifications of the RELAP5 calculations.

The coupling between BABIECA and RELAP5 was established in a general way that could

be used to couple any other code. This may allow to postprocess other codes in the future,

aside from RELAP5, or just to run combined simulations where each code is responsible for

the calculation of certain phenomena. The first step towards generalization of code coupling

was the definition of a standard specifying how a scientific code must be written to facilitate

the connection to a general purpose modular simulation language such as BABIECA. A full

description of this standard will be the object of another report. A description of the code

connection philosophy can be found in [38]. However, some general ideas will be given here.

The proposed standard assumes that the codes will be coupled to a modular simulation

language with capabilities similar to those of BABIECA. The connected codes will behave

then as blocks of the modular simulation language. The user can now connect the inputs

and outputs of the codes by defining a connection topology in the modular language.

Instead of writing a different module for each code coupled to the system, the standard establishes that the modular language will link to any other code by means of two modules called

respectively sndcode and rcvcode. When using the module sndcode, the user must specify

3-3
in the BABIECA input file the code to be used, with the proper command line including

options, and the names of the variables that will be modified externally by BABIECA. These

variables can be boundary or initial conditions. The sndcode spawns the remote code, using

the command line defined in the input file, and sends it the names of the boundary and

initial conditions that will be supplied by BABIECA. At each time step, BABIECA also

sends the remote code the value of the step, the values of the boundary conditions for the

current time step, and the values of the initial conditions if some flag is activated. rcvcode

is the counterpart of sndcode. The user must specify in the BABIECA input file the names

of the variables whose values will be received from the remote file at the end of each time

step. rcvcode receives from the corresponding sndcode the process identification number of

the remote code, provided by PVM at the spawning time.

The standard also determines how the codes to be coupled must be written in order to

facilitate a proper inclusion of PVM functions, that will allow a synchronized information

exchange with the modules sndcode and rcvcode. The PVM library functions will be executed only if the code detects that it has a parent process, and hence it has been spawned

by BABIECA. This allows to use the same executable file of the code for coupling with

BABIECA and for standalone calculations. After being spawned, and after reading the corresponding input file, the remote code will receive from sndcode the names of the boundary

and initial conditions to be transferred by BABIECA. These names must be in agreement

with a established nomenclature, which is code dependent. With these names the coupled

code must be capable of finding a pointer to the values of the corresponding boundary and

initial conditions. The code also receives from rcvcode the names of the output variables to

be sent to BABIECA, in order to obtain pointers to the memory allocation of those variables.

At each time step, the code receives from sndcode the time step size and the values of the

boundary conditions. Initial conditions are also received if necessary. The received values

are used to overwrite those computed from the code input file and stored in the memory

positions pointed by the pointers mentioned above. Once the solution is advanced one time

step, the code sends to rcvcode the values of the demanded outputs.

Although the RELAP5 code does not comply with the standard, PVM routines have been

properly inserted into the source code to make it behave as if it met the requirements. Not all

the capabilities specified in the standard have been implemented in the RELAP5-BABIECA

coupling. For instance, only boundary conditions specified by means of time dependent

volume or junctions can be overwritten. No initial conditions can be supplied, since this

feature is not necessary for postprocessing purposes.

3.3.2 The role of the AWK editor

The non-interactive text editor AWK is used to build the BABIECA input file necessary

to check the results of a given RELAP5 case and once the user has specified the control

volumes to which the checks must be applied. The checks are hence written in a file called

babpost.awk, which contains AWK commands. The file is listed in appendix 6.3. With this

3-4
BABIECA RELAP5 restart−plot file

RELAP5

Output

data files

XMGR5

AWK

BABPOST.AWK Postprocessing

input file output file

RELAP5

input file

BABIECA

Figure 1: Functioning diagram of the analysis tool.

file, and depending on the particular RELAP5 calculation and the volumes to be checked,

the AWK editor builds the corresponding BABIECA input file.

3.3.3 The role of the XMGR5 program

XMGR5 is just used to graphically display the RELAP5 and the postprocessing results after

the end of the calculations. The tool takes advantage of the XMGR5 capabilities to read

RELAP5 restart-plot files.

3.4 Functioning of the analysis tool

The analysis tool described in this report works as depicted in figure 1.

First of all, the user must write an ASCII file containing the following information in successive lines:

3-5
FILE = rootword

HOST = host

INITTIME = inittime

STARTTIME = starttime

ENDTIME = endtime

FREQ = freq

NSYSTEMS = nsystems

For each thermalhydraulic subsystem the file must contain also:

SYSNAME = sysname

NVOLS = nvols

cccvv0000

The words in typewriter type must be written literally. The words in italics have the following

meaning:

• rootword is the root name of the RELAP5 case to be checked. It is assumed that the

input file has the extension .i appended to the root name. The RELAP5 output file

will be called rootword.o and the restart-plot file will be rootword.r.

• host is the name of the host where the RELAP5 executable file is allocated.

• inittime is a real number specifying the transient instant, in seconds, at which RELAP5

will be spawned by BABIECA. It is used to synchronize the times of BABIECA and

RELAP5, specially when the RELAP5 calculation is a restart case.

• starttime is a real number specifying the transient instant, in seconds, at which the

checks begin.

• endtime is a real number specifying the transient instant, in seconds, at which the

checks end.

• freq is an integer number specifying the frequency used to write output data, in time

steps.

• nsystems is the number of thermalhydraulic subsystems to be checked. A TH subsystem is a set of RELAP5 control volumes defined by the user. They may be connected

or not.

• sysname is a name given to each TH subsystem. The results of the verifications in

each subsystem will be written in a file called

rootword_sysname.dat.

• nvols is the number of control volumes in the current TH subsystem.

• cccvv0000 is a nine digit string denoting each control volume, according to the RELAP5

nomenclature. The three digit substring ccc refers to the RELAP5 hydrodynamic

3-6
component and the two digit substring vv refers to the number of the volume within

the component (01 for a single volume). The last four digits are always 0000.

In the following lines an example of a file of this type is shown:

FILE = liq_pres

HOST = spp2k

INITTIME = 0.0

STARTTIME = 200.0

ENDTIME = 400.0

FREQ = 5

NSYSTEMS = 1

SYSNAME = mainpipe

NVOLS = 10

404010000

404020000

404030000

404040000

404050000

404060000

404070000

404080000

404090000

404100000

After writing a file like this, the user must execute from the UNIX command prompt the

following sentence:

awk -f babpost.awk inpfile rootword.o > babfile.bab

The previous line performs the following actions: the AWK editor reads the file of AWK

commands contained in the file babpost.awk and looks for the information in the file inpfile.

Once this information has been read, and AWK knows about the control volumes to be

checked, the AWK editor looks into the RELAP5 output file rootword.o to identify the

junctions connecting the control volumes to be checked. This file must be available by

running the RELAP5 input file rootword.i, preferably in check mode. Finally, AWK writes

the BABIECA input file babfile.bab, which performs the ckekings of the RELAP5 calculation.

The following step consists in running PVM with a configuration file specifying the hosts

that will constitute the virtual machines, executable paths, working directories, etc. Here is

an example of such a file:

3-7
# Configuration file for pvm3

#

spp2k dx=/opt/pvm3/lib/pvmd

ep=$HOME/bin:$HOME/relap/pvmcomp/selap

bx=/users/rhs/casos/testpvm/debugger

wd=$HOME/relap/postcases/liq_pres

The PVM daemon is activated just by typing

pvm pvm conf file

from the command prompt, where pvm conf file is the configuration file.

The postprocess of the RELAP5 case is then executed by typing

BABIECA -n babfile.bab

BABIECA spawns then a RELAP5 process and sets the communication between them. After finishing a time step calculation, RELAP5 sends the required variables to BABIECA.

The latter computes then the proper verifications. Once the calculation is finished, PVM

must be deactivated. The results of each TH subsystem are stored in files named rootword_sysname.dat. The results concerning individual volumes are stored in files rootword_cccvv.dat. The variables in these files can be displayed with XMGR5.

3-8
4 APPLICATION EXAMPLES

4.1 Introduction

This section illustrates the capabilities of the analysis tool by means of some application

examples.

Example 4.2 reveals an error in the input file due to the user. Section 4.3 is a good example

of interpretation of the results computed by the code, which demonstrates a fake argument

commonly used to explain the different depressurization rates obtained when a breach appears in the vapor or liquid region of a hydraulic system. The same example is used to verify

the non-equilibrium model derived in section 2.5. Example 4.4 points out the boundary

condition overspecification problem in several TH codes. Finally, application example 4.5 is

devoted to other problem usually found in TH codes: flow mixing and splitting in converging

pipes.

4.2 Compression caused by heating in a closed pipe

4.2.1 Example description

This example consists in an 18 node horizontal pipe. Allthough all the nodes are equal, it

is convenient to discriminate between the ten central nodes and the two groups of 4 nodes

each one located at the tips of the pipe. The noding is shown in figure 2. The pipe is

closed in both sides, and initially filled with liquid and vapor in equilibrium conditions, in

a horizontally stratified regime. The pressure is similar to that of the primary circuit in a

PWR. After running a null transient, to let the system reach a steady state, a heat power is

introduced in each of the ten central nodes. The total power is represented in figure 3.

500040000500030000500020000500010000404100000404090000404080000404070000404060000404050000404040000404030000404020000404010000402040000402030000402010000402010000

SNGLJUN 5010000SNGLJUN 4030000

Figure 2: Nodalization used in the example.

As a result of the heating, and being the pipe closed in both sides, we expect the pressure

to rise, along with the void fraction. Since the problem shows a clear spatial simmetry,

simmetric results are so expected.

4-1
0 50 100 150 200

0

0.2

0.4

0.6

0.8

1

Time (s)

Power (Mw)

Figure 3: Power introduced in the pipe.

4.2.2 Analysis of results

Figure 4 shows the two sides of the pressure equation (29), in the TH subsystem defined by

the ten central nodes that constitute the pipe 402. Both sides of the equation are identical.

No anomaly in the solution can be inferred from this results. The figure also shows the

expected increase of the system pressure.

The comparison of the two sides of the level equation is fully satisfactory either, according

to figure 5. Nevertheless, an increase of the liquid level in the system is observed, contrary

to what is expected. This observation suggest an error in the simulation of the example.

Figure 6 shows the expected increase of the vapor mass, even though great discrepancies

between the two sides of the equation can be noticed. Mass errors in the vapor phase are

very frequently observed in RELAP5 calculations. The mass error is neglibible in the liquid

phase, represented in figure 7. This figure also shows, contrary to what is expected, an

increase of the liquid mass.

The two sides of the non-equilibrium mass equation, for the vapor phase, shown in figure 8,

are not coincidental because of the mistmach of the vapor mass. On the other hand, the

verification of the liquid non-equilibrium mass equation is satisfactory, as shown in figure 9.

The terms taking part in the pressure and level equations are displayed in figure 10. The

only non-zero terms are the volumetric ones, which have surprisingly the same shape in both

phases.

Figures 11 to 17 illustrate the same analysis in pipe 500. The postprocessing of the pressure

equation leads to results identical to those obtained in the pipe 402. However, the liquid

volume decreases during the transient, unlike in pipe 402. The simmetry of the problems

does not seem to allow a result like this, reenforcing the suspects of an error in the solution.

The two sides of the vapor mass equation are quite diferent either.

4-2
0 50 100 150 200

16.816.716.616.5

•



•



•



•



Time (s)

P ln

• Left hand side  Right hand side

Figure 4: Verification of the pressure equation. Pipe 402.

0 50 100 150 200

3.83.63.43.2

•



•



•



•



Time (s)

)3 Liquid volume (m

• Left hand side  Right hand side

Figure 5: Verification of the level equation. Pipe 402.

0 50 100 150 200

560540520500480

•



•



•



•



Time (s)

Vapor mass (Kg)

• Left hand side  Right hand side

Figure 6: Verification of the vapor mass. Pipe 402.

0 50 100 150 200

2200210020001900

•



•



•



•



Time (s)

Liquid mass (Kg)

• Left hand side  Right hand side

Figure 7: Verification of the liquid mass. Pipe 402.

4-3
0 50 100 150 200

0

50

150100

•



•



•



•



Time (s)

Non-equilibrium vapor mass (Kg)

• Left hand side  Right hand side

Figure 8: Non-equilibrium vapor mass. Pipe 402.

0 50 100 150 200

−300 −200 −1000

•



•



•



•



Time (s)

Non-equilibrium liquid mass (Kg)

• Left hand side  Right hand side

Figure 9: Non-equilibrium liquid mass. Pipe 402.

0 50 100 150

0

0.0080.0060.0040.002

0.01

0.012

• ◦    ♦

•

◦

 



♦

•

◦







♦ • ◦







♦

•

Time (s)

)1 −s 3 Terms of pressure eq. (m

•

J

g

◦

J

f



D

g



D

f

 Sw

g

♦ Sw

f

Figure 10: Terms of the pressure equation. Pipe 402.

4-4
It can also be noticed that the mass vapor is different in pipes 402 and 500. The liquid mass

decreases as well, unlike what happens in pipe 402. Discrepancies in the non-equilibrium

mass equation, caused by the errors in the vapor mass, are still observed.

The only non-negligible terms in the pressure and volume equations are still the volumetric

ones (see figure 17). However, the shapes of the vapor and liquid volumetric terms are quite

different, contrary to pipe 402. This additional element of assimmetry is another indicator

of an error in the definiton of the problem, very probably induced through the input file.

Looking thoroughly into the input file, it was found out that the homegeneous equilibrium

model had been in specified in the junction 403, very probably as a result of a cut and paste

operation. This specification introduces an element of assimetry in the problem, which is

enough to justify the different results obtained in the pipes 402 and 500. The inadverted

use of the homegeneous equilibrium model in the junction 403 explains why the volumetric

flows in figure 10 have the same shape. In a homogeneous model the velocity of each phase

is identical. Thus the difference in the volumetric flows is caused by the scaling of the void

fraction. Once the error in junction 403 has been fixed, the example and the postprocessing

tool have been rerun.

The figure 18 shows that, once more, the analysis of the pressure equation is satisfactory.

Both sides of the level equation (see figure 19) are also in good agreement. It must be

realize that the level decreases as expected. Significant mass errors (figure 20) are still

observed in the vapor phase, suggesting that the solution is not completely right even when

the homogeneous model flag has been corrected. on the other hand, the liquid mass shown

in figure 21 is properly preserved. As a consequence of the mass errors, the non-equilibrium

vapor mass analysis is not satisfactory either. The non-equilibrium liquid mass is preserved,

because the liquid mass is. The terms of the pressure and level equations are plotted in

figure 24. The only non-negligible terms are the volumetric ones. It is very curious that in

the permanent regime at the end of the transient the vapor volumetric flow is compensated

by the vapor flow, resulting in a steady pressure. On the contrary, the level never reaches a

steady state, remaining in an oscillating permanent regime, since only the liquid volumetric

flow plays a role in the corresponding equation.

The results in the pipe 500 are identical to those obtained in pipe 402, as shown in figures 25

to 31. This confirms that, as expected, the results are symmetric with respect to the spatial

variable x.

4.3 Depressurization in a circuit with liquid and vapor

4.3.1 Justification of the example

The example shown in this section illustrates the use of the analyisis tool to interpret the

results computed by the RELAP5 code. It will be also used to check the hypotheses that

lead to the simplified non-equilibrium mass equations derived in section 2.5. The example

consists in a closed hydraulic circuit, nodalized as represented in figure 32, initially filled with

4-5
0 50 100 150 200

16.816.716.616.5

•



•



•



•



Time (s)

P ln

• Left hand side  Right hand side

Figure 11: Verification of the pressure equation. Pipe 500.

0 50 100 150 200 2.83

3.43.2

•



•



•



•



Time (s)

)3 Liquid volume (m

• Left hand side  Right hand side

Figure 12: Verification of the level equation. Pipe 500.

0 50 100 150 200

650600550500450

•



•



•



•



Time (s)

Vapor mass (Kg)

• Left hand side  Right hand side

Figure 13: Verification of the vapor mass. Pipe 500.

0 50 100 150 200

2000190018001700

•



•



•



•



Time (s)

Liquid mass (Kg)

• Left hand side  Right hand side

Figure 14: Verification of the liquid mass. Pipe 500.

4-6
0 50 100 150 200

0

50

200150100

•



•



•



•



Time (s)

Non-equilibrium vapor mass (Kg)

• Left hand side  Right hand side

Figure 15: Non-equilibrium vapor mass. Pipe 500.

0 50 100 150 200

−250 −200 −150 −−

100

500

•



•



•



•



Time (s)

Non-equilibrium liquid mass (Kg)

• Left hand side  Right hand side

Figure 16: Non-equilibrium liquid mass. Pipe 500.

0 50 100 150

−0.010

0.030.020.01

• ◦  



♦

•

◦

 



♦

•

◦







♦

•

◦







♦

•

Time (s)

)1 −s 3 Terms of pressure eq. (m

•

J

g

◦

J

f



D

g



D

f

 Sw

g

♦ Sw

f

Figure 17: Terms of the pressure equation. Pipe 500.

4-7
0 50 100 150 200

16.816.716.616.5

•



•



•



•



Time (s)

P ln

• Left miembro  Right hand side

Figure 18: Verification of the pressure equation. Pipe 402.

Revised example.

0 50 100 150 200

3

3.33.23.1

•



•



•



•



Time (s)

)3 Liquid volume (m

• Left hand side  Right hand side

Figure 19: Verification of the level equation. Pipe 402.

Revised example.

0 50 100 150 200

650600550500450

•



•



•



•



Time (s)

Vapor mass (Kg)

• Left hand side  Right hand side

Figure 20: Verification of the vapor mass. Pipe 402. Revised example.

0 50 100 150 200

1950190018501800

•



•



•



•



Time (s)

Liquid mass (Kg)

• Left hand side  Right hand side

Figure 21: Verification of the liquid mass. Pipe 402. Revised example.

4-8
0 50 100 150 200

0

50

200150100

•



•



•



•



Time (s)

Non-equilibrium vapor mass (Kg)

• Left hand side  Right hand side

Figure 22: Non-equilibrium vapor mass. Pipe 402. Revised example.

0 50 100 150 200

−250 −200 −150 −−

100

500

•



•



•



•



Time (s)

Non-equilibrium liquid mass (Kg)

• Left hand side  Right hand side

Figure 23: Non-equilibrium liquid mass. Pipe 402. Revised example.

0 50 100 150

−0.010

0.030.020.01

• ◦    ♦

•

◦

 



♦

•

◦







♦

•

◦







♦

•

Time (s)

)1 −s 3 Terms of pressure eq. (m

•

J

g

◦

J

f



D

g



D

f

 Sw

g

♦ Sw

f

Figure 24: Terms of the pressure eq. Pipe 402. Revised

example.

4-9
0 50 100 150 200

16.816.716.616.5

•



•



•



•



Time (s)

P ln

• Left hand side  Right hand side

Figure 25: Verification of the pressure equation. Pipe 500.

Revised example.

0 50 100 150 200

3

3.33.23.1

•



•



•



•



Time (s)

)3 Liquid volume (m

• Left hand side  Right hand side

Figure 26: Verification of the level equation. Pipe 500.

Revised example.

0 50 100 150 200

650600550500450

•



•



•



•



Time (s)

Vapor mass (Kg)

• Left hand side  Right hand side

Figure 27: Verification of the vapor mass. Pipe 500. Revised example.

0 50 100 150 200

1950190018501800

•



•



•



•



Time (s)

Liquid mass (Kg)

• Left hand side  Right hand side

Figure 28: Verification of the liquid mass. Pipe 500. Revised example.

4-10
0 50 100 150 200

0

50

200150100

•



•



•



•



Time (s)

Non-equilibrium vapor mass (Kg)

• Left hand side  Right hand side

Figure 29: Non-equilibrium vapor mass. Pipe 500. Revised example.

0 50 100 150 200

−250 −200 −150 −−

100

500

•



•



•



•



Time (s)

Non-equilibrium liquid mass(Kg)

• Left hand side  Right hand side

Figure 30: Non-equilibrium liquid mass. Pipe 500. Revised example.

0 50 100 150

−0.010

0.030.020.01

• ◦    ♦

•

◦

 



♦

•

◦







♦

•

◦







♦

•

Time (s)

)1 −s 3 Terms of the pressure eq. (m

•

J

g

◦

J

f



D

g



D

f

 Sw

g

♦ Sw

f

Figure 31: Terms of the pressure eq. Pipe 500. Revised

example.

4-11
100010000

100020000

100030000

100040000

100050000

100060000

100070000

200010000

200020000

200030000

200040000

200050000

200060000

200070000

Figure 32: Circuit nodalization.

liquid until approximately half the level of the circuit. The other half is filled with vapor.

The thermodynamic conditions are similar to those of the secondary circuit of a PWR.

Being in stagnant conditions, the liquid occupies the lower half of the circuit and the vapor

occupies the upper half. The exercise is focused in the comparison of the depressurization

rates obtained when a breach of the circuit takes place either at the uppper part or at the

lower part. It is well known that a break in the steam line of a secondary circuit leads to a

greater depressurization rate that a break in the feedwater line. The explanation given by

many authors ( [3] among them), is that the energy released through the break is greater if

steam leaks. This argument assumes a direct relationship between the specific enthalpy of

the fluid leaking through the break and the system pressure which is not demonstrated.

Figure 33 shows how, as predicted, the depressurization rate is grater if the break is induced

in the upper part of the circuit, filled with vapor.

4.3.2 Verification of the balance equations

Before proceeding to interpret and explain the results, the fulfillment of the mass, pressure

and level equations will be checked, according to the equations (1), (29) and (31).

Figure 34 shows the two sides of the pressure equation, when the break takes place in the

vapor region. The agreement between them is fair. No objections can be made to the results

from this viewpoint at least.

The two sides of the level equation (31), shown in figure 35, are also in good agreement.

4-12
0 20 40 60 80 100 14

14.5

15

15.5

16

• 

•



•



•



•



•



•



Time (s)

ln

P

• Breach in vapor region

 Breach in liquid region

Figure 33: Pressure evolution.

On the contrary, the postprocess of the vapor and liquid mass equations, shown respectively

in figures 36 and 37, leads to dissapointing results, questioning the quality of the solution.

Note that the errors in the vapor and the liquid phase are of similar order, but with opposite

sign. This is a good example of compensation of the mass errors between the phases, which

is not detected by the RELAP5 mass verification.

If the break takes place in the liquid region, the analysis of the pressure, level and vapor and

liquid mass, represented respectively in figures 38, 39, 40 and 41, leads to similar results.

Error compensation between the liquid and vapor phases is observed as well, although it is

smaller than when the break occurs in the vapor region.

4.3.3 Interpretation of results

Although the specific internal energy and enthalpy are greater for the vapor phase than for

the liquid phase, the energy and enthalpy flows released through the break are greater when

the break takes place in the liquid region, because of the higher density of this phase. This

is confirmed in figures 42 and 43. As a conclusion, the higher depressurization rate when

the break occurs in the vapor region cannot be explained in terms of the released energy.

Another explanation must be found.

The results computed by RELAP5 can be interpreted according to the pressure equation (29).

Figure 44 shows the terms in the numerator of the pressure equation, except the negligilbe

Ac term, when the break is induced in the vapor region. The same terms, for the case of

break in the liquid region, are shown in figure 45.

It is easy to realize that the depressurization is mainly driven by two term, in the first

part of the transient at least. Those are the volumetric term J (for the vapor phase in the

first case and for the liquid phase in the second one) and the swelling term Swg (caused

by the appearance of vapor). Both terms tend towards mutual compensation, although the

4-13
0 20 40 60 80 100 14

14.5

15

15.5

16

•

⊗

•

⊗

•

⊗

•

⊗

•

⊗

•

⊗

•

⊗

Time (s)

P ln

• Left hand side ⊗ Right hand side

Figure 34: Pressure analysis. Break in vapor region.

0 20 40 60 80 100

2.82.62.42.233.2

•

⊗

•

⊗

•

⊗

•

⊗

•

⊗

•

⊗

•

⊗

Time (s)

)3 Liquid volume (m

• Left hand side ⊗ Right hand side

Figure 35: Liquid volume analysis. Break in vapor region.

0 20 40 60 80 100

−−

100

500

50

150100

•

⊗

•

⊗

•

⊗

•

⊗

•

⊗

•

⊗

•

⊗

Time (s)

Masa de vapor (Kg)

• Left hand side ⊗ Right hand side

Figure 36: Vapor mass analysis. Break in vapor region.

0 20 40 60 80 100

240023002200210020001900

•

⊗

•

⊗

•

⊗

•

⊗

•

⊗

•

⊗

•

⊗

Time (s)

Liquid mass (Kg)

• Left hand side ⊗ Right hand side

Figure 37: Liquid mass analysis. Break in vapor region.

4-14
0 20 40 60 80 100 15

15.815.615.415.2

•

⊗

•

⊗

•

⊗

•

⊗

•

⊗

•

⊗

•

⊗

Time (s)

P ln

• Left hand side ⊗ Right hand side

Figure 38: Pressure analysis. Break in liquid region.

0 20 40 60 80 100

3210

•

⊗

•

⊗

•

⊗

•

⊗

•

⊗

•

⊗

•

⊗

Time (s)

)3 Liquid volume (m

• Left hand side ⊗ Right hand side

Figure 39: Level analysis. Break in liquid region.

0 20 40 60 80 100

180160140120

•

⊗

•

⊗

•

⊗

•

⊗

•

⊗

•

⊗

•

⊗

Time (s)

Vapor mass (Kg)

• Left hand side ⊗ Right hand side

Figure 40: Vapor mass analysis. Break in liquid region.

0 20 40 60 80 100

0

500

2500200015001000

•

⊗

•

⊗

•

⊗

•

⊗

•

⊗

•

⊗

•

⊗

Time (s)

Liquid mass (Kg)

• Left hand side ⊗ Right hand side

Figure 41: Liquid mass analysis. Break in liquid region.

4-15
0 20 40 60 80 100

0

40302010

•



•



•



•



•



•



•



Time (s)

Internal energy flow (G Kg2 s 3 − )

• Break in vapor region  Break in liquid region

Figure 42: Energy flow released through the breaks.

0 20 40 60 80 100

0

40302010

•



•



•



•



•



•



•



Time (s)

Enthalpy flow (G Kg2 s 3 − )

• Break in vapor region  Break in liquid region

Figure 43: Enthalpy flow released through the breaks.

0 20 40 60 80 100

−0.50

0.51

• ◦  



♦

•

◦







♦

•

◦







♦

•

◦







♦

•

◦







♦

•

◦





Time (s)

)1 −s 3 Terms of pressure eq. (m

•

J

g

◦

J

f



D

g



D

f

 Sw

g

♦ Sw

f

Figure 44: Terms of pressure eq. Break in vapor region.

0 20 40 60 80 100

−−

0.15

0.1

−0.050

0.05

• ◦  



♦

•

◦







♦

•

◦







♦

•

◦







♦

•

◦







♦

•

◦





Time (s)

)1 −s 3 Terms of the pressure eq. (m

•

J

g

◦

J

f



D

g



D

f

 Sw

g

♦ Sw

f

Figure 45: Terms of pressure eq. Break in liquid region.

4-16
0 20 40 60 80 100 3

4

5

6

•  •



•



•



•



•



•



Time (s)

Compressibility (m3

)

• Break in vapor region

 Break in liquid region

Figure 46: System compressibility.

volumetric term is always the dominant one. The sum of the two terms is greater when

the break occurs in the vapor region, leading in this case to a greater numerator in the

pressure equation. Moreover, the system compressibility, which acts as the denominator

of the pressure equation, is greater when the break takes place in the liquid, as shown in

figure 46. The global effect is that the depressurization rate is greater for a break in the

vapor region.

4.3.4 Verification of the simplified non-equilibrium model

This section is devoted to the verification of the hypotheses under which the simplified nonequilibrium mass equations described in section 2.5 are valid and the two phases remain

decoupled from each other. Fulfillment of equations (68) and (73) will then be checked in

the current example. For the sake of brevity, only the control volumes 10001 (in the upper

part of the circuit) and 10001 (in the lower part) will be checked. We remind that this is

an exercise to illustrate how a code can be used to validate, as if it were an experimental

facility, simpler models. We do not intend to validate the above mentioned hypotheses at

the sight of this exercise. A true validation would require a huge number of transients and

calculations.

If the break occurs in the vapor region, the vapor generation rate in volume 10001 is positive

during the whole transient. Hence the verifications must be performed in this phase.

Figure 47 represents the right hand side of equation (49) and the term of that side including

the dependency on Γig. It is clear that this term contributes very weakly to the right hand

side of equation (49).

The terms that depends on Γw is zero, since no heat is transferred through the wall.

Figure 48 displays the bulk interfacial heat versus its approximation according to equation (67). The agreement is excellent.

4-17
The liquid generation rate is positive in volume 20001 during all the transient, with the

exception of the first instants. The right hand side of equation (49) is much larger than the

term with Γif , as shown in figure 49. The bulk interfacial heat for the liquid phase is almost

identical to its approximation (see figure 50). During the first instants of the transient the

interfacial heat is zero according to the figure. This only means that Γif is negative during

those instants and the simplified model is not applicable for the liquid phase. It must not

be understood as a true zero value.

If the break occurs in the liquid region we come out with the similar conclusions, as shown

in the figures 51 and 54.

It can be inferred at the sight of these results that the simplifying hypotheses of the nonequilibrium mass equation could be applied in this example at least.

4.4 Over specification of boundary conditions

4.4.1 Motivation and background

This example tries to show how the post-processing techniques can be used to identify potential mistakes committed during the development of a TH computer code, which can lead

to unphysical systems even if the problem is well posed from the mathematical point of view.

A historical review of the boundary condition over specification problem is pertinent here.

During the 1996 Fall CAMP Meeting [35] the overspecification of boundary conditions in the

RELAP5 code when using time dependent junctions was already pointed out. The problem

was illustrated with an example based on a simplified pressurizer model. No correcting

actions were taken at that time, probably because the root cause of the problem had not

been identified yet.

During the 2000 Fall CAMP Meeting, Dr. Jingzao Zhang from Tractebel presented a simple

RELAP5 case which led to surprising and unphysical results. It will be demonstrated here

that the cause of these results is, like in the pressurizer case presented in [35], the overspecification of boundary conditions. Zhang’s case will be finally used to illustrate the problem

and explain the root causes, since it is much simpler and leads to more dramatic results than

the pressurizer case.

Zhang’s case, depicted in figure 55, comprises a time dependent volume (TDV) at the inlet

side and another at the outlet side, one single volume, one time dependent junction (TDJ)

that connects the inlet TDV to the single volume to specify the inlet flow, and a single

junction at the outlet side. The pressure in the inlet TDV is set to 4 MPa and the temperature

to 553 K. The pressure of the outlet TDV is set 2.1 MPa, and the temperature, which does

not affect the result since the volume is placed downstream, to 523 K. The mass flow in the

TDJ is kept constant at a value of 10 Kg s−1. The initial conditions in the single volume are

those of the outlet TDV. The initial velocity in the single junctions is zero. In the conditions

described above, the system contains superheated steam. Since the inlet TDJ forces the

fluid from the inlet TDV to replace the fluid of the single volume, we expect a increase of its

4-18
0 20 40 60 80 100

−0.04 −0.03 −0.02 −0.010

0.01

•

⊗

•

⊗

•

⊗

•

⊗

•

⊗

•

⊗

•

⊗

Time (s)

)1 −s 1 − Non-equilibrium terms (Kg m

• Right hand side ⊗ Term with Γi Figure 47: Neglection of term with Γi in the non- equilibrium eq. Vapor phase. Volume 10001. Break in

vapor region.

0 20 40 60 80 100

−

4

×10

4

−

2

×1004

2

×10

4

•

⊗

•

⊗

•

⊗

•

⊗

•

⊗

•

⊗

•

⊗

Time (s)

)1 −s 3 − Bulk interfacial heat (J m

• Exact ⊗ Approximated Figure 48: Approximation of the interfacial heat power in the vapor phase. Volume 10001. Break in vapor region.

0 20 40 60 80 100

−0.001

−

8

×10

−

4

−

6

×10

−

4

−

4

×10

−

4

−

2

×10

−

04

•

⊗

•

⊗

•

⊗

•

⊗

•

⊗

•

⊗

•

⊗

Time (s)

)1 −s 1 − Non-equilibrium terms (Kg m

• Right hand side ⊗ Term with Γi

Figure 49: Neglection of term with Γi in the nonequilibrium eq. Liquid phase. Volume 20001. Break in

vapor region.

0 20 40 60 80 100

−10000

4000300020001000

•

⊗

•

⊗

•

⊗

•

⊗

•

⊗

•

⊗

•

⊗

Time (s)

)1 −s 3 − Bulk interfacial heat (J m

• Exact ⊗ Approximated

Figure 50: Approximation of the interfacial heat power in

the liquid phase. Volume 20001. Break in vapor region.

4-19
0 20 40 60 80 100

−−

0.15

0.1

−0.050

0.05

0.1

•

⊗

•

⊗

•

⊗

•

⊗

•

⊗

•

⊗

•

⊗

Time (s)

)1 −s 1 − Non-equilibrium terms (Kg m

• Right hand side ⊗ Term with Γi

Figure 51: Neglection of term with Γi in the nonequilibrium eq. Vapor phase. Volume 10001. Break in

liquid region.

0 20 40 60 80 100

0

2

×10

4

4

×10

4

6

×10

4

•

⊗

•

⊗

•

⊗

•

⊗

•

⊗

•

⊗

•

⊗

Time (s)

)1 −s 3 − Bulk interfacial heat (J m

• Exact ⊗ Approximated

Figure 52: Approximation of the interfacial heat power in

the vapor phase. Volume 10001. Break in liquid region.

0 20 40 60 80 100

−0.002 −−

0.0015

0.001

−

5

×10

−

04

•

⊗

•

⊗

•

⊗

•

⊗

•

⊗

•

⊗

•

⊗

Time (s)

)1 −s 1 − Non-equilibrium terms (Kg m

• Right hand side ⊗ Term with Γi

Figure 53: Neglection of term with Γi in the nonequilibrium eq. Liquid phase. Volume 20001. Break in

liquid region.

0 20 40 60 80 100

−10000

4000300020001000

•

⊗

•

⊗

•

⊗

•

⊗

•

⊗

•

⊗

•

⊗

Time (s)

)1 −s 3 − Bulk interfacial heat (J m

• Exact ⊗ Approximated

Figure 54: Approximation of the interfacial heat power in

the liquid phase. Volume 20001. Break in liquid region.

4-20
temperature. In the final steady-state, the thermodynamic properties of the single volume

should be very similar to the boundary conditions specified in the inlet TDV.

P = 2.1 MPa

T = 523 K

500

TMDPVOL TMDPVOL

350

P = 4 MPa

T = 553 K

TMDPJUN SNGLJUN

351 410

SNGLVOL

400

T = 523 K

w = 10 kg/s P = 2.1 MPa

Figure 55: Zhang’s problem.

4.4.2 Original case

The postprocessing of Zhang’s example reveals some inconsistencies. First of all, the global

pressure equation is not fully satisfied, as shown in figure 56. Figure 57 shows that, although a

little liquid fraction appears in volume 400 during the transient, that fraction is not accounted

for in the right hand side of the level equation. The vapor mass, represented in 58, is properly

preserved. The non-equilibrium vapor mass balance in figure 59 is not fulfilled. The pressure

drop derived from the momentum equation, and caused mainly by the friction in volume 400,

has been represented against the difference P350 − P500 in figure 60. The mismatch between

the two computed variables is evident.

Direct observation of some physical variables provides evidences of unphysical results as well.

Figure 61 shows that the temperature in volume 400 decreases during the transient, contrary

to expectations. The vapor enthalpy in figure 62 undergoes an unexpected variation too. The

temperature and the enthalpy were just the two variables that moved Dr. Zhang to present

his results. Other variables present an abnormal behavior, such as the density in figure 63,

and the pressure in figure 64.

4.4.3 Zhang’s problem with PV term

Reference [107] tries to explain the results obtained in Zhang’s problem and to provide a

solution that leads to physical results.

That reference states that the internal energy equation (3) is not able to preserve the enthalpy,

since its discretization leads to the following convective terms upstream and downstream, in

the single phase case:

(  ̇ρj+1u ̇ j+1 + PL) vj+1Aj+1 (74)

− (  ̇ρju ̇ j + PL) vjAj (75)

where L stands for the single volume 400. The term (74) represents a donnor cell formulation

of the enthalpy equation convective term in the downstream junction, while the term (75)

does not represent an equivalent upstream term. For this to occur, the donnor cell pressure

PK should appear in the term instead of the downstream pressure PL.

4-21
0 20 40 60 80 100 13.8

14

14.814.614.414.2

•

◦

•

◦

•

◦

•

◦

•

◦

Time (s)

P ln

• Left hand side ◦ Right hand side

Figure 56: Zhang’s problem: pressure postprocessing.

0 20 40 60 80 100

−

5

×10

−

05

5

×10

−

5

10

−

4

1.5

×10

−

4

2

×10

−

4

• ◦ • ◦ • ◦

•

◦

•

◦

Time (s)

)3 Liquid volume (m

• Left hand side ◦ Right hand side

Figure 57: Zhang’s problem: level postprocessing.

0 20 40 60 80 100

9590

110105100

•

◦

•

◦

•

◦

•

◦

•

◦

Time (s)

Vapor mass (kg)

• Left hand side ◦ Right hand side

Figure 58: Zhang’s problem: vapor mass postprocessing.

0 20 40 60 80 100

−

505

1510

•

◦

•

◦

•

◦

•

◦

•

◦

Time (s)

Non-equilibrium vapor mass (kg)

• Left hand side ◦ Right hand side

Figure 59: Zhang’s problem: non-equilibrium vapor mass

postprocessing.

4-22
0 20 40 60 80 100 −5×105

0

5×105

106

1.5×106

2×106

2.5×106

•

◦

•

◦

•

◦

•

◦

•

◦

Time (s)

Pressure drop (Pa)

• Left hand side

◦ Right hand side

Figure 60: Zhang’s problem: pressure drop postprocessing.

To force this behavior, a new option has been added to the junctions of a developmental

version of the RELAP5 code. Upon activation of this option, called the e-flag, the code adds

the term − (PK − PL) vjAj to the energy equation in the corresponding junction, where KK

stands for he upstream TDV 350. This term is referred to as the PV term in the RELAP5

documentation.

The results obtained with the activation of the e-flag in the inlet time dependent junction

couldn’t have been postprocessed as the developmental version of RELAP5 including the

PV term in the TDJs has not been available. Physical inconsistencies still arise anyway.

Although the vapor enthalpy approaches asymptotically the value defined in volume 350

(see figure 66), the temperature does not show the same behavior (see figure 65). The

temperature is increased during the transient, but it never reaches the value in volume 350.

The density, represented in figure 67, remains constant in its initial value. The pressure,

shown in figure 68, is kept in its initial value as well.

4.4.4 Over specification suppression with pressure feedback

Having proved the inefficiency of the PV term, it is necessary to explain the cause of the

unphysical results obtained with Zhang’s problem and why the PV term fixes the enthalpy

balance even when other variables such as the temperature and the density do not behave

as expected. Single phase flow will be assumed in the following, which does not result in a

lack of generality.

When using time dependent volumes only, without time dependent junctions, the following

boundary conditions are specified:

• the upstream pressure,

4-23
0 20 40 60 80 100

560540520500480

•

◦



•

◦



•

◦



•

◦



•

◦



Time (s)

Vapor temperature (K)

• tempg-350 ◦ tempg-400  tempg-500

Figure 61: Zhang’s problem: vapor temperature.

0 20 40 60 80 100 2.75×106

2.8

×10

6

2.85

×10

6

2.9

×10

6

2.95

×10

6

•

◦



•

◦



•

◦



•

◦



•

◦



Time (s)

Vapor enthalpy (J/kg)

• hg-350 ◦ hg-400  hg-500

Figure 62: Zhang’s problem: vapor enthalpy.

0 20 40 60 80 100

8

201816141210

•

◦



•

◦



•

◦



•

◦



•

◦



Time (s)

)3 Vapor density (kg/m

• rhog-350 ◦ rhog-400  rhog-500

Figure 63: Zhang’s problem: vapor density.

0 20 40 60 80 100

2

×10

6

2.5

×10

6

3

×10

6

3.5

×10

6

4

×10

6

4.5

×10

6

•

◦



•

◦



•

◦



•

◦



•

◦



Time (s)

Pressure (Pa)

• p-350 ◦ p-400  p-500

Figure 64: Zhang’s problem: pressure.

4-24
0 20 40 60 80 100

560550540530520

•

◦



•

◦



•

◦



•

◦



•

◦



Time (s)

Vapor temperature (K)

• tempg-350 ◦ tempg-400  tempg-500

Figure 65: Vapor temperature with PV term.

0 20 40 60 80 100

2.896

×10

6

2.898

×10

6

2.9

×10

6

2.902

×10

6

•

◦



•

◦



•

◦



• ◦



• ◦



Time (s)

Vapor enthalpy (J/kg)

• hg-350 ◦ hg-400  hg-500

Figure 66: Vapor enthalpy with PV term.

0 20 40 60 80 100

8

201816141210

•

◦



•

◦



•

◦



•

◦



•

◦



Time (s)

)3 Vapor density (kg/m

• rhog-350 ◦ rhog-400  rhog-500

Figure 67: Vapor density with PV term.

0 20 40 60 80 100

2

×10

6

2.5

×10

6

3

×10

6

3.5

×10

6

4

×10

6

4.5

×10

6

•

◦



•

◦



•

◦



•

◦



•

◦



Time (s)

Pressure (Pa)

• p-350 ◦ p-400  p-500

Figure 68: Pressure with PV term.

4-25
• a thermodynamic property defined upstream (typically the temperature or the internal

energy)

• the downstream pressure (the rest of variables defined in the downstream time dependent volume are not donnored and have no influence in the code results, although the

code requests the user to input those values)

The number of boundary conditions is then three. The RELAP5 solves in this case the

following set of linearized equations (see [95] for details):

Ax = b + g1v

n+1

j+1 + g2v

n+1

j

(76)

where the matrices are defined as follows:

x =





u ̃

n+1

L − u

n

L

P

n+1

L − P

n

L



 (77)

A =















∂ρ

∂u

n

L



∂ρ

∂P

n

L

uL



∂ρ

∂u

n

L

+ ρ

n

L u

n

L



∂ρ

∂P

n

L













b =





0

(Q

n

w,L + DISSn

L

)∆t



 (78)

g1 =





ρ ̇

n

j+1Aj+1∆t/VL

−(  ̇ρ

n

j+1u ̇

n

j+1 + P

n

L

)Aj+1∆t/VL



 g2 =





−ρ ̇

n

j Aj∆t/VL

(  ̇ρ

n

j u ̇

n

j + P

n

L

)Aj∆t/VL



 (79)

It is assumed that the density in matrix A depends on the pressure P and the internal energy

u. When a partial derivative of the density is present in that matrix, with respect to a given

variable, it must be understood that the other variable is kept constant.

The two linear equation system (76) is obtained from the mass and energy equations, discretized in the control volume L. The whole system is obtained by adding the two equations

obtained from the discretization of the momentum equation in the junctions j and j + 1:

−∆t



P

n+1

L − P

n+1

j



= −ρ

n

j Bx

∆xL

2

∆t

+

1

2

ρ ̇

n

j

h

v

2

n

L

−



v

2

n

j

i

∆t − ρ

n

j

∆xL

2

v

n

j

+



ρ

n

j

∆xL

2



1 + FWn

j ∆t



+  ̇ρ

n

j HLOSSn

j ∆t



v

n+1

j

(80)

4-26
−∆t



P

n+1

j+1 − P

n+1

L



= −ρ

n

j+1Bx

∆xL

2

∆t

+

1

2

ρ ̇

n

j+1 h

v

2

n

j+1 −



v

2

n

L

i

∆t − ρ

n

j+1

∆xL

2

v

n

j+1

+



ρ

n

j+1

∆xL

2



1 + FWn

j+1∆t



+  ̇ρ

n

j+1HLOSSn

j+1∆t



v

n+1

j+1

(81)

The previous four equation set has the following unknowns: P

n+1

L

, u

n+1

L

, v

n+1

j y v

n+1

j+1 . The

variable P

n+1

j

in equation (80) refers to the pressure in the upstream TDV.

When a time dependent junction is used, a new boundary condition, the inlet velocity, is

added. This makes a total of four boundary conditions. This increase of the number of

degrees of freedom is a clear index of error, since that number is inherent to the physical

system and should not be changed by the choice of the set of variables that will act as

boundary conditions. The increase of boundary conditions is caused by the non-solving

of the momentum equation in the TDJ. It’s mistakenly believed that this equation is not

necessary, since inlet velocities are provided. As a consequence, the discrete momentum

equation in the inlet junction is suppresed, and the number of equations decreases from

four to three. The mathematical problem is still consistent, since the unknown variables are

also three ((P

n+1

L

, u

n+1

L

and v

n+1

j+1 ). However, it is not consistent from the physical point of

view, since the number of equations cannot be arbitrarily decreased. Once the momentum

equation (81) is not solved, the pressures P

n+1

L

and P

n+1

j

are no longer linked by any phisical

principle. This observation modifies all the forms of the energy equation, since the upstream

pressure P

n+1

j which should be computed by the code defines, along with the upstream

temperature, a wrong density and internal energy. These two variables are introduced in the

energy equation through the convective terms.

If the momentum equation were solved in the inlet junction, the system of linear equations

would be:

Ax = c + g1v

n+1

j+1 (82)

where

c =





−ρ ̇

n

j Aj∆t/VL

(Q

n

w,L + DISSn

L

)∆t +



ρ ̇

n

j u ̇

n

j + P

n

L



Aj∆t/VLv

n+1

j



 (83)

Note that c is the result of adding b and g2v

n+1

j

, since the latter term is no longer an unknown.

The momentum equations (80) and (81) are also a part of the system. Nevertheless, the

unknown variable in equation (80) is now P

n+1

j

instead of v

n+1

j

. With this system the

number of equations (four) and unknowns (P

n+1

L

, u

n+1

L

, v

n+1

j+1 y P

n+1

j

) is preserved.

Once the root cause of the abnormal results obtained in Zhang’s problem has been found,

it is necessary to explain why the PV term is enough to preserve the enthalpy, even though

the momentum equation is not solved in the inlet junction yet.

4-27
As the spatial mesh is finer and finer, the PV term tends to vA∂P

∂x .

Adding that term to the analytical form of the internal energy equation (3), assuming single phase regime, unheated pipe, and neglecting the energy dissipated by friction, such an

equation becomes:

∂

∂t (Aρu) + ∂∂x (Aρuv) + vA∂P∂x = −P

∂Av

∂x (84)

Grouping some terms, and taking into account that the enthalpy is expressed as h = u +

P

ρ

,

we obtain

∂

∂t (Aρh) + ∂∂x (Aρhv) = ∂∂t (AP) (85)

Integrating (85) in space and time:

Z

V

Aρh dx(t) = Z

V

Aρh dx(0) + Z t

0



Aρhv|

in − Aρhv|out

dt

+

Z

V

AP dx(t) + Z

V

AP dx(0)

(86)

If the temporal changes of the pressure are negligible as compared to the terms carrying

the enthalpy, the previous equation becomes an enthalpy balance with no influence of the

upstream and downstream pressures. Even if the pressure gradient is very large, as it is the

case in Zhang’s problem, the balance (86) will be preserved anyway. This the reason why

the enthalpy balance is fulfilled when the PV term is introduced.

It must be highlighted that equations (84) and (85) do not represent any physical principle,

since they are derived from adding a ficticious term to a physically meaningfull equation.

It has been proven that the root cause of Zhang’s results is the over specification of boundary

conditions, which derives in turn from skipping the computation of the momentum equation

in the time dependent junctions. The ideal solution would be the modification of the RELAP5 code, to apply a different solution algorithm when TDJs are used. However, a less

traumatic solution can be devised. It consists in computing the momentum equation in the

inlet junction through the control variables supplied by the code.

The pressure in the upstream time dependent volume is no longer set by the user. It equals

the pressure in the centre of volume 400, plus the pressure drop due to the momentum

equation. This approach leads to the following equation, which is valid for single phase flow

and a pipe with uniform cross-section:

ρ



∂v

∂t +

1

2

∂v2

∂x 

= −

∂P

∂x − FWAL v (87)

Denoting the inlet time dependent junction by j, the volume number 400 by L and the inlet

time dependent junction by K, the semi-implicit discretization of equation (87) yields:

ρj

∂vj

∂t +

1

2

ρj

v

2

L − v

2

j

∆xj

= −

PL − PK

∆xj

− FWALL vL (88)

4-28
Taking into account that ∆xj =

∆xL

2

, the upstream pressure can be computed as:

PK = PL + ρj

∂vj

∂t

∆xL

2

+

1

2

ρj



v

2

L − v

2

j



+ FWALLvL

∆xL

2

(89)

If the boundary conditions in the inlet time depedent junction is specified as a constant

velocity, instead of as a constant mass flow, the term with the time derivative in equation (89)

is cancelled. The computation of a numerical derivative is then avoided. This little change

does not affect the essence of Zhang’s problem.

The momentum equation (89) was implemented through RELAP5 control variables to feedback the pressure into the upstream TDV. The following results were obtained.

Figures 69 to 72 show the results of postprocessing the pressure, the volume, the vapor mass

and the vapor non-equilibrium mass respectively. The agreement between both sides of the

respective equations is excellent. A discrepancy between both sides of the pressure drop

equation, represented in figure 73, is observed during the first time step. The cause is the

joint effect of the discretization and the initialization of the velocities to zero values. The

system spend this first time step to reach the inlet velocity specified through the TDJ.

The quality of the solution obtained by feeding the pressure back is confirmed by the good

behavior of other variables, such as the temperature in volume 400 shown in figure 74. This

temperature tends to that in the inlet TDV as expected. This behavior is not observed when

using the PV term, as shown in figure 65. The enthalpy in volume 400 also approaches the

value in the inlet TDV, according to figure 75. The density in figure 76 behaves in a similar

way. It can be realized in figure 77 that the pressure is almost identical in the three volumes,

because the frictional pressure drop is negligible as compared to the global system pressure.

4.5 Full plant model. Flow mixing problem

4.5.1 Introduction

In this last example a transient in a full plant model is analyzed. The transient, which is one

of the sequences obtained in a Probabilistic Safety Analysis, consists in a steam generator

tube rupture with HPIS failure, CVCS failure, accumulator success, steam dump success and

RHRS success.

The subsystem to be analyzed is the downcomer in one of the steam generators, since the

transient seems to be very demanding in that component. Flow reversal can be observed in

figure 78.

Figure 79 shows the analysis of the global pressure equation in the downcomer. The comparison between both sides of the equation is completely unsatisfactory. On the other hand, the

analysis of the liquid volume equation (see figure 80), is acceptable. The analysis of the vapor

and liquid mass equations (figures 81 and 82) is also satisfactory except for a certain offset

in the vapor, which can be attributed to a certain spike in the derivative of that quantitie. A

4-29
0 20 40 60 80 100 14

14.814.614.414.2

15

•

◦

•

◦

•

◦

•

◦

•

◦

Time (s)

P ln

• Left hand side ◦ Right hand side

Figure 69: Pressure equation with momentum calculation.

0 20 40 60 80 100

−

4

×10

−

5

−

2

×10

−

05

2

×10

−

5

4

×10

−

5

• ◦ • ◦ • ◦ • ◦ • ◦

Time (s)

)3 Liquid volume (m

• Left hand side ◦ Right hand side

Figure 70: Liquid volume equation with momentum calculation.

0 20 40 60 80 100

9492908886

•

◦

•

◦

•

◦

•

◦ • ◦

Time (s)

Vapor mass (kg)

• Left hand side ◦ Right hand side

Figure 71: Mass equation with momentum calculation.

0 20 40 60 80 100

201816141210

•

◦

•

◦

•

◦

•

◦

•

◦

Time (s)

Non-equilibrium vapor mass (kg)

• Left hand side ◦ Right hand side

Figure 72: Non-equilibrium mass equation with momentum calculation.

4-30
0 20 40 60 80 100

−300

−200

−100

0

100

•

◦ • ◦ • ◦ • ◦ • ◦

Time (s)

Pressure drop (Pa)

• Left hand side

◦ Right hand side

Figure 73: Pressure drop equation with momentum calculation.

direct comparison of the derivatives of both sides of the equation would be more convincing.

The analyses of the non-equilibrium vapor and liquid mass equations (figures 83 and 84) is

not satisfactory either, as they are affected by the pressure equation. Figure 85 shows the

terms of the pressure and liquid volume equations. The inlet vapor volumetric flow and the

vapor swelling are the dominant terms. Both terms tend to compensate each other.

A possible explanation for the results obtained in the analysis of the pressure equation is

the flow mixing that takes place at the downcomer inlet. The feedwater, separator and

recirculation flows are mixed at that point. The three flows have very different thermodynamic properties. To prove this hypothesis, the same analysis have been undertaken again

excluding the first control volume in the downcomer. The resulting subsystem is strictly

one-dimensional, with one inlet junction and one outlet junction.

Figure 86 shows that the pressure analysis is more satisfactory when removing the first

control volume. Similar comments apply to the liquid volume and vapor and liquid mass

equations (figures 87 to 89). However, fullfilment of the non-equilibrium mass equations

(figures 90 and 91) is not properly achieved yet. The pressure equation terms (figure 92)

resemble those of the analysis with the whole downcomer.

The results seem to confirm that flow mixing is not properly treated by the RELAP5 code.

The following lines will try to explain why the RELAP5 treatment of flow mixing is not

satisfactory.

The one-dimensional formulation of two-phase flow dynamics allows to solve problems in

pipes with two well defined ends (i.e., inlet and outlet). In this kind of pipes the direction

along the pipe plays the role of the independent variable in a parametric representation,

ranging from 0 to L, where the latter is the whole length of the pipe. In the case of flow

mixing, where n pipes converge into a single one as described in figure 93, the overall problem

4-31
0 20 40 60 80 100

560550540530520

•

◦



•

◦



•

◦



•

◦



•

◦



Time (s)

Vapor temperature (K)

• tempg-350 ◦ tempg-400  tempg-500 Figure 74: Vapor temperature with momentum calculation.

0 20 40 60 80 100 2.88×106

2.9

×10

6

2.92

×10

6

2.94

×10

6

2.96

×10

6

2.98

×10

6

3

×10

6

•

◦



•

◦



•

◦



•

◦



•

◦



Time (s)

Vapor enthalpy (J/kg)

• hg-350 ◦ hg-400  hg-500 Figure 75: Enthalpy with momentum calculation.

0 20 40 60 80 100

8.88.699.69.49.2

•

◦



•

◦



•

◦



•

◦



•

◦



Time (s)

)3 Vapor density (kg/m

• rhog-350 ◦ rhog-400  rhog-500

Figure 76: Vapor density with momentum calculation.

0 20 40 60 80 100

2.099

×10

6

2.1

×10

6

2.101

×10

6

•

◦

 • ◦

 • ◦

 • ◦

 • ◦



Time (s)

Pressure (Pa)

• p-350 ◦ p-400  p-500

Figure 77: Pressure with momentum calculation.

4-32
0 2000 4000 6000 −0.5

0

0.5

1

1.5

•



•

 •



Time (s)

Volumetric flux (m s

−1

)

• Vapor

 Liquid

Figure 78: Volumetric flow in junction 5 of the downcomer.

comprises actually n + 1 one-dimensional subproblems, each one defined in a range [0, Li

].

The n + 1 are coupled among them. They are linked in such a way that the boundary

conditions supplied to the pipe on the right hand side in figure 93 fullfil the conservation

equations. Those boundary conditions must be obtained by integrating on a null volume

(i.e., with zero length) the conservation equations (1), (2) and (3). Since the integral of the

volumetric sources is considered to be zero in such a null volume, only the convective terms,

i.e. those affected by partial derivatives with respect to the spatial variable, contribute to

the equations. The integration of a convective term leads to a difference between the sums of

inlet and outlet flows. If a convective terms has the form ∂Ψv

∂x

, where Ψ is a generic variable

and v is the flow velocity, the integral on a zero volume results in Ψv|

out − Ψv|in. Note that

integration on a zero volume requires that the partial derivative with respect to time affect

all the factors, because terms such as φ

∂Ψv

∂x would not have a well defined integral. As a

conclusion, integration on a null volume must only be applied to the so called conservative

form of the conservation equations.

For the mass equation, the convective terms meet that requirement to yield

X αkAρkvk|

in = αkAρkvk|out (90)

The internal energy equation includes a term of the form −P

∂

∂x

(αkAvk), which cannot integrated directly. I.e. the internal energy equation is not a conservative form. In order to

introduce the pressure into the gradient, the kinetic energy equation is added to the internal

energy equation, which results from multiplying the momentum equation by the velocity.

4-33
0 2000 4000 6000

40302010

•



•



•



•



•



•



Time (s)

P ln

• Left hand side  Right hand side Figure 79: Analysis of the pressure equation in the downcomer.

0 2000 4000 6000

5

201510

•



•



•



•



•



•



Time (s)

)3 Liquid volume (m

• Left hand side  Right hand side Figure 80: Analysis of the liquid volume equation in the

downcomer.

0 2000 4000 6000

−500

50

250200150100

•



•



•



•



•



•



Time (s)

Vapor mass (kg)

• Left hand side  Right hand side

Figure 81: Analysis of the vapor mass equation.

0 2000 4000 6000

800060004000

10

4

1.2

×10

4

1.4

×10

4

•



•



•



•



•



•



Time (s)

Liquid mass (kg)

• Left hand side  Right hand side

Figure 82: Analysis of the liquid mass equation in the

downcomer.

4-34
0 2000 4000 6000

−40 −30 −20 −100

10

•



•



•



•



•



•



Time (s)

Non-equilibrium vapor mass (kg)

• Left hand side  Right hand side

Figure 83: Analysis of the non-equilibrium vapor mass

equation in the downcomer.

0 2000 4000 6000

−

3

×10

4

−

2

×10

4

−1004

10

4

•



•



•



•



•



•



Time (s)

Non-equilibrium liquid mass (kg)

• Left hand side  Right hand side Figure 84: Analysis of the non-equilibrium liquid mass

equation in the downcomer.

0 2000 4000 6000

−0.6 −0.4 −0.20

0.60.40.2

•

◦







♦

•

◦







♦

•

◦







♦

•

◦







♦

Time (s)

)1 −s 3 Terms of pressure eq. (m

•

J

g

◦

J

f



D

g



D

f

 Sw

g

♦ Sw

f

Figure 85: Terms of the pressure equation in the downcomer.

4-35
0 2000 4000 6000

1615141312

•



•



•



•



•



•



Time (s)

P ln

• Left hand side  Right hand side

Figure 86: Analysis of the pressure equation in downcomer

subsystem.

0 2000 4000 6000

864

1210

•



•



•



•



•



•



Time (s)

)3 Liquid volume (m

• Left hand side  Right hand side

Figure 87: Analysis of the level equation in downcomer

subsystem.

0 2000 4000 6000

−200

80604020

•



•



•



•



•



•



Time (s)

Vapor mass (kg)

• Left hand side  Right hand side

Figure 88: Analysis of the vapor mass equation in downcomer subsystem.

0 2000 4000 6000

90008000700060005000

10

4

•



•



•



•



•



•



Time (s)

Liquid mass (kg)

• Left hand side  Right hand side

Figure 89: Analysis of the liquid mass equation in downcomer subsystem.

4-36
0 2000 4000 6000

−−

108 −6 −4 −202

•



•



•



•



•



•



Time (s)

Non-equilibrium vapor mass (kg)

• Left hand side  Right hand side

Figure 90: Analysis of the non-equilibrium vapor mass

equation in downcomer subsystem.

0 2000 4000 6000

−10000

50004000300020001000

•



•



•



•



•



•



Time (s)

Non-equilibrium liquid mass (kg)

• Left hand side  Right hand side

Figure 91: Analysis of the non-equilibrium liquid mass

equation in downcomer subsystem.

0 2000 4000 6000

−0.4 −0.20

0.40.2

•

◦







♦

•

◦







♦

•

◦







♦

•

◦  



♦

Time (s)

)1 −s 3 Terms of pressure eq. m

•

J

g

◦

J

f



D

g



D

f

 Sw

g

♦ Sw

f

Figure 92: Pressure equation terms in downcomer subsystem.

4-37



	


	


	


Figure 93: One-dimensional flow mixing.

The kinetic energy equation is as follows:

1

2

αkAρk

∂vk

∂t

+

1

2

αkAρk

∂v

2

k

∂x

= −αkAvk

∂P

∂x

+ αkρkBxAvk

− αkρkA FWkv

2

k + AΓkvivk − αkρkA FIk(vk − vk

0)vk

− Cαkαk

0ρmA



∂

∂t

(vk − vk

0) + vk0

∂vk

∂x

− vk

∂vk

0

∂x



vk

−

1

2

Kαkρkv

3

k

δ(x − x0)

(91)

where the continuity equation (1) has been taken into account.

Adding (91) to (3), the term with the pressure takes the integrable form −

∂

∂x

(αkP Avk). The

mixing condition is then:

X αkAρk



uk +

1

2

v

2

k



vk









in

− αkAρk



uk +

1

2

v

2

k



vk









out

= −

X αkP Avk|

in + αkP Avk|out

(92)

Taking into account that h = u + P θ, the previous equation can be written as

X αkAρk



hk +

1

2

v

2

k



vk









in

= αkAρk



hk +

1

2

v

2

k



vk









out

(93)

The momentum equation (2) cannot be directly integrated on a null volume, since a term

of the form −αkA

∂P

∂x

is found on the right hand side. The factors αk and A, which lie

inside the partial derivative in the original three-dimensional equation, are factored out in

the one-dimensional form by using the Gauss divergence theorem:

αkA

∂P

∂x

=

∂

∂x

(αkAP) + lim

∆x→0

1

∆x

Z

AI

PnxdA + lim

∆x→0

1

∆x

Z

AW

PnxdA (94)

4-38
where AI is the interfacial area within the pipe interval ∆x, AW is the wall area in the same

interval, and nx is the projection of the unit normal vector to the surface (either interface

or wall) onto the x axis. Even assuming that the interfacial term is zero, the wall term

would still remain. In case of flow mixing, or discontinuous area change, the computation

of that term would remain undetermined. If the discontinuity is seen as the limit case of

a series of problems with ever increasing slope in the representation of the cross-sectional

area with respect to the x direction, the final result would depend on the infinite possible

ways of approximation. A relationship between inlet and outlet properties can be found

for the mass and total energy equations because the terms with spatial derivative represent

fluxes (i.e. they include the factor Avk). Since the velocity is parallel to the wall, the flux

through the wall is always zero. On the other hand, the term with the spatial derivative in

the momentum equation is not a flux and thus the corresponding wall integral is not zero.

As a conclusion, it is impossible to rigorously describe flow mixing or abrupt area change

problems with the one-dimensional formulation. The momentum equation has not been used

in the derivation of the global pressure equation anyway, so it does not justify the results

obtained in the analysis of the downcomer. The previous study just tries to highlight that

extreme care must be taken with flow mixing in order to achieve proper conservation of

the thermodynamic variables. In the case of the momentum equation, the hypotheses to

calculate the local pressure drop in a flow mixing or abrupt area change must be clearly

specified. Current codes do not pay much attention to this issue, since the local pressure

drops are used to tune the circuit flow.

It is time to explain now why the pressure analysis is not satisfactory when flow mixing is

present. The RELAP5 manual does not refer anywhere to flow mixing. The discontinuities

caused by merging flows with different thermodynamic properties at a sharp point, or by

abrupt area changes, are not taken into account. When a control volume is attached to

several inlet junctions, RELAP5 computes the internal energy convective term by adding

the energy fluxes in each junction. Each of these fluxes has the form  ̇α

n

k,j (  ̇ρ

n

k,ju

n

k,j + P

n

L

)v

n+1

k,j .

The donnor cell quantities are referred to the upstream side of the junction. In order to

avoid the discontinuities in the junctions, they should be referred to the downstream side.

Of course, the conservation equations should be used to compute the downstream variables as

a function of the upstream values. This treatment of the convective terms does not preserve

the energy balance rigorously, what justifies the results obtained in the pressure analysis.

4-39
0 2000 4000 6000

−

505

1510

•



♦

•



♦

•



♦

•



Time (s)

Mass flow kg s 1 − )

• Downcomer inlet  First junction ♦ Second junction

Figure 94: Vapor mass flows in the downcomer.

0 2000 4000 6000

0

600400200

•



♦

•



♦

•



♦

•



Time (s)

Mass flow (kg s 1 − )

• Downcomer inlet  First junction ♦ Second junction

Figure 95: Liquid mass flows in the downcomer.

0 2000 4000 6000

−

6

×10

7

−

4

×10

7

−

2

×1007

2

×10

7

4

×10

7

•



♦

•



♦

•



♦

•



Time (s)

Energy flow (J s 1 − )

• Downcomer inlet  First junction ♦ Second junction

Figure 96: Vapor energy flows in the downcomer.

0 2000 4000 6000

0

2

×10

8

4

×10

8

6

×10

8

•



♦

•



♦

•



♦

•



Time (s)

Energy flow (J s 1 − )

• Downcome inlet  First junction ♦ Second junction

Figure 97: Liquid energy flows in the downcomer.

4-40
5 CONCLUSIONS

This report demonstrates the convenience of utilities for analysis and postprocess of computer

codes. The utility has been particularly successful in the following areas:

• Correct interpretation of the results in terms of models more suitable to explain the evolution of certain variables, such as the global pressure (29) and the liquid volume (31)

equations. These equations have been used in application example 4.3 to refutate a

classical argument to explain the results obtained when the secondary circuit of a PWR

is broken.

• Diagnosis of errors, which may be due to several causes. Example 4.2 shows how

the analysis tool has been used to identify a user error in the input file. Case 4.4

illustrates how the tool can reveal a code misconception that affects not only RELAP5

but also TRAC-P [93] and TRAC-B [84]. RETRAN03 [13] developers seem to have

solved that error successfully, since the input file only requires the velocity and the

enthalpy of the fluid as inlet boundary conditions. Furthermore, the tools pointed

out in example 4.5 the problems that may arise when mixing flows with different

thermodynamic properties.

• Validation of alternative models. Those models may be more simplified, with the aim

of speeding up the overall calculation or simplifiyng the resolution scheme, as demonstrated in example 4.3.4 with the non-equilibrium mass model derived in section 2.5.

As a conclusion, the development of a new generation of computer codes with estimation of

error upper bounds is highly recommended. This is the only way to scientifically ensure the

quality of the results.

5-1
6 RECOMMENDATIONS FOR FUTURE

DEVELOPMENTS

6.1 Analysis of other codes and models

Verification of the solutions computed by simulation codes by means of alternative balance

equations is a subject open to research. Any other equation rigorously derived from the

original equations can be added to enhance the tool. Balance equations derived in section 2

are just a sample of the large number of possibilities offered by this technique.

The heat structures and the power generation section seem to be natural candidates for the

extension of the postprocessing ideas.

6.2 Identification of lower order models

If transient dynamics is very involved, a previous simplification of the models may be necessary. Section 2.5.3 is a good example of this kind of simplifications. It shows how simpler

models, with an uncoupled phase, can be derived from the non-equilibrium mass equations.

Many other simplified models, using a number of equations between 3 and 6, are found in

the history of this discipline [77]. Most of them can be demonstrated to be valid under some

assumptions. Validation of those models in certain regions of operation can be performed

with techniques similar to those shown in this work.

A typical application of simplified models is the Probabilistic Safety Assessment (PSA) of

nuclear power plants. The multifarious sequences that can stem from an initiating event in

a level 1 PSA demand the use of simplified, conservative models, in order to decrease the

overall computation time [46].

However, some other applications require even more simplified thermal hydraulic dynamics,

so it can be integrated with other type of phenomena. For instance, new phenomena arise in

level 2 PSA, derived from the degraded core as a consequence of level 1 PSA. Those phenomena are very often of stochastic, barely known nature, subject to a high degree of uncertainty,

resulting in a wide variety of possibilities for further evolution of the sequence. That kind

of dynamics can hardly be incorporated into the risk calculations, and very specially to the

delineation of the so called Accident Progression Event Trees (APET) [21, 10].

Techniques to be used in those cases consist mainly in model identification. A general

mathematical form, dependent on some cefficients, is assumed for the dynamic evolutions.

The coefficients are tuned to fit a sufficient number of transients precalculated with best

estimate codes such as RELAP5 or MELCOR. This process can be termed as identification

or training of the system. Once the system is trained, it is used to compute non precalculated

transient evolutions. Choice of format as physically meaningful as possible is essential. At

this point, Dynamic Systems Theory may be helpful.

6-1
For example, system dynamics can be regarded as comprising several time intervals, within

each one the system can be linearized (piecewise linearization). It can be demonstrated that

the behavior of any system can be approximated this way, with the possible exceptions of

chaotic systems or presence of discontinuities caused by explosive phenomena. The main

drawback of this approach is that the order of the linearized system may eventually be too

high and the range of validation very narrow. The main advantage is that the previous

history of the system is collected through the state vector. Some integral representations

may obviate the high order problem, at the expense of dealing with the previous history

explicitly. Some examples can be found in reference [75].

Rigorous inclusion of those generic PSA models can be done with the help of the latest trends

in dynamic reliability [58, 59].

Model identification, in the terms explained above, can be another application of the postprocessing techniques shown in this work.

6.3 Development of codes with error control

The postprocessing tools has proven to be more effective in the interpretation of results and

identification of programming errors than in the diagnosis of errors due to an inappropriate

nodalization or time step choice. Identification of such a type of errors would imply a

comparison of the discrete solution provided by the code with an hypothetical analytical

solution. The latter is of course unknown. Verification of the discrete solution by replacement

into a discretized set of equations seems to be close to a tautology. It would mean that

the solution is checked versus the same premises with wich it has been obtained. It is

not surprising that the solution fulfills the balance equations in every node, although very

probably the global analytical equations would not be satisfied.

The discretization, which depends strongly on the code user, is still one of the main contributors to the overall code uncertainty. Moreover, discretization errors can make the verification

and validation processes merge inappropriately. Figures 98 and 99 illustrate this statement.

Verification is the process which ensures that the discrete solution approaches the true

analytical solution within a certain tolerance margin. Verification implies matching discrete

with continuous mathematical forms. It must be noted that the verification process does

not have to do with the capability of the analytical models to represent the real world.

Verification of the solution is attempted by very few codes.

The validation process can be launched only after a proper verification of the solution. It

implies a checking of the capability of the models included in the code to reproduce a set

of experimental data. The process consists in matching continuous domain maths with the

physical reality. Moreover, the term validation makes reference to a certain experiment for

set of experiments. It is not an absolute term as it is often understood. Figure 98 emphasizes

that the verification and validation processes must be clearly separated from each other.

6-2
	



 !

"$#&%'!

(*)+!,.-/%10

243"0! 5 678:9; <

"!=0>?!

@BA	C "ED2"F%10

G!=-D=" "

"/#&%'H!

I2"ED .-/%10

2" ) 3! 5

Figure 98: Verification and validation processes.

Since the verification process is seldom undertaken, it is usually merged with validation

as shown in figure 99. This means that the solutions computed by the code are directly

compared with the experimental data, which is a risky although common practice. If the

comparison between code results and experimental data is not satisfactory, a good model

could be rejected even if the cause of discrepancies lies in an inadequate nodalization. On

the contrary, the analyst may try to improve the solution by refining the noding mesh,

although the analytical model might be the cause of the insatisfactory results. It is difficult

to accurately determine the source of errors if the verification and validation processes are

merged.



	



! #"%$'&)(+* 



, #-%./102

34$526&7"6 #-8 

 )91:(;-%$5/=<2 > ?A@
B #"8$5! C<-D(=*

"6 )26*E-%2

Figure 99: Collapsed verification and validation processes.

The verification task can be undertaken by means of the so called precise numerical methods [2,1]. These methods take into account the intrinsic discrete nature of both the numerical

methods and the computing machine.

The problem to be solved no longer consists in solving the stages of the numerical method

in the user defined computational mesh. On the contrary, the user must specify the discrete

points at which the solution is to be observed, as well as the required precision. Note that

the observation mesh may not be coincident with the computational mesh necessary to find

a solution within the desired tolerance margin. Moreover, the latter depends strongly on

the former. The precision of the solution can be known only if an upper bound of the

truncation error is estimated. If the error associated to any of the output variables under

observation is greater than the desired precision, the transient must be recomputed with a

finer spation-temporal nodalization. Although current codes usually consider just one kind

of computational mesh, The following types must be discriminated:

• The spatial mesh used to define certain input parameters. For instance, the crosssectional areas of the pipes. The greater the spatial variations of those parameters are,

the finer this mesh must be.

• The spatial mesh used to define the initial conditions at discrete points, which must

be finer as long as the initial conditions contain high frequency spatial components.

6-3
• The temporal mesh used to define the boundary conditions. The higher the time

frequency of the boundary conditions is, the finer the mesh must be.

• The spatio-temporal mesh formed by the points at which the user desires to observe

certain output variables.

• The calculational mesh used to solve the numerical method.

For most current codes all the types of discretization described above are the same, even

though each of them accounts for very different aspects. If the error associated to any of

the desired output variables is larger than the required precision a new calculation must

be attempted with a finer spatio-temporal nodalization. If the numerical method is proven

to be both consistent and convergent, the new noding scheme should yield smaller truncation errors. The proposed approach needs of course a certain method for automatic mesh

generation. The numerical discretization recovers then its strict algorithmical meaning. It

does not depend on the user’s choice but on the desired output variables and the required

precision. The plant nodalization is no longer a contributor to the so called user efect. This

is restricted just to the choice of optional models.

The estimation of the truncation errors associated to a certain numerical method usually

requires the use of higher order derivatives of mathematical functions. An analytical expression of those derivatives is usually unknown when the code is programmed. Derivation of

the analytical expressions demands the use of symbolic calculus, which adds an extra degree

of complexity into the overall problesm.

Besides the truncation error associated to the numerical methods, round-off errors must be

controlled as well. Digital computers, being discrete machines, can represent only a subset

of the rational numbers and none of the irrational numbers with their native floating-point

arithmetic. Although some authors such as [110] state that round-off errors are negligible as

compared to truncation errors, several evidences on the contrary have been found. Another

evidence of the importance of round-off errors is provided in [69], which shows that different

results can be obtained, even with the same machine, when the thermal conductivity of water

in presence of non-condensible gases is calculated by linear interpolation based either on the

leftmost point,

y(x) = y0 +

y(x1) − y(x0)

x1 − x0

(x − x0)

or the rightmost point,

y(x) = y1 +

y(x1) − y(x0)

x1 − x0

(x − x1)

Both formulations are completely equivalent. Any discrepancy in the results can only be

explained by the different effects of each formulation in the round-off errors.

The precise numerical methods focus on the control of any source of error. They require

the use of a special type of floating-point arithmetic called range arithmetic. Real numbers

are represented by data structures such as struct in C language or TYPE in FORTRAN 90.

6-4
Every digit in the mantissa is represented by a native integer type. Another native integer

data type accounts for the exponent. The number of digits in the mantissa is not fixed,

as it is in ordinary native floating-point arithmetics. An extra integer digit represents an

upper bound of the error associated to the floating-point number. For instance, the number

1.5984336 ̃2E-2 means that its value lies in the interval 1.5984336×10−2 ± 2 × 10−9.

Whenever an operation between numbers is performed, the round-off error is accounted for

either incrementing the error digit or, if the latter is greater than 9, decrementing the number

of digits in the mantissa. It is clear than the greater the number of operations used to compute

a number, the smaller the precision is. If the error associated to any of the user required

variables is greater than the maximum allowed, the transient must be computed from the

beginning, starting with a larger initial precision. The number of digits in the mantissa

can be changed by using the dynamic memory allocation capabilities provided by advanced

programming languages. With range arithmetic the precision is no longer limited by any

machine word length (usually 64 bits for double precision) but by the memory available in

the computer. Note that, since the precision is progressively decreased during the course of

the transient, a very large initial precision might be required to obtain an output precision

of just a few digits.

The use of precise numerical methods yields the following cascade effects:

• Since range arithmetic is implemented through integer data types, and the result of operations between integer numbers is always exact, the results are machine independent.

The so called machine-compiler effect dissapears.

• Since the working precision is unlimited (although it is always finite), the round-off

errors can be as small as desired.

• As a consequence of the item above, nodalizations can be refined as much as necessary to obtain the required precision in the output variables. The refinement implies a

greater number of operations and thus greater round-off errors, but they can be compensated by a larger initial precision. The nodalization needed to obtain the desired

final precision is automatically chosen by the code, not by the user. The nodalization

is not then a contributor to the user effect.

6-5
6-6
7 REFERENCES

[1] Oliver Aberth. Precise Numerical Methods Using C++. Academic Press, 1998.

[2] Oliver Aberth and Mark J. Schaefer. Precise computation using range arithmetic, via

C++. ACM Transactions on Mathematical Software, 18(4):481–491, December 1992.

[3] P.D. Abramson. Guidebook to Light Water Reactor Safety Analysis. Hemisphere Publishing Corporation.

[4] S.N. Aksan, F. D’Auria, and St ̈adtke. User effects on the thermal-hydraulic system

code calculations. Nuclear Engineering and Design, 145:159–174, 1993.

[5] H. Asaka, V.G. Zimin, T. Iguchi, and Y. Anoda. Coupling of the thermal-hydraulic

code TRAC with 3D neutron kinetics code SKETCH-N. In OECD-CSNI Workshop on

Advanced ‘Thermal-Hydraulic and Neutronic Codes: Current and Future Applications’.

Barcelona, April 2000.

[6] R. Ashley, M. El-Shanawany, F. Eltawila, and F. D’Auria. Good practices

for user effect reduction. Status report. Working draft 2. Technical Report

OECD/NEA/CSNI/PWG2 TG on THA, OECD/NEA, April 1998.

[7] Anthony Baratta. Interface requirements for coupling a containment code to a reactor

system thermal hydraulic code. In OECD/CSNI Workshop on ‘Transient ThermalHydraulic and Neutronic Requirements’. Annapolis, November 1996.

[8] A. L. Beguelin et al. PVM–3.3: Parallel Virtual Machine System. Univ. of TennesseeKnoxville; Oak Ridge National Laboratory; Amory University, Atlanta, Georgia, 1992.

[9] A. Bengaouer and G. Geffraye. Three dimensional kinetics coupling to thermal hydraulics. In OECD/CSNI Seminar on ‘Best Estimate Methods in Thermal-Hydraulics

Safety Analysis’, Ankara, June 1998.

[10] A. S. Benjamin, V. Behr, D. M. Kunsman, and W. B. Murfin. Containment event

analysis for postulated severe accidents: Surry power station, Unit 1. Technical Report NUREG/CR-4700, SAND 86-1135, US Nuclear Regulatory Commission, February

1987.

[11] B. Brun. Current implementation and future plans on new code architecture, programming language and user interface. In OECD/CSNI Workshop on ‘Transient ThermalHydraulic and Neutronic Requirements’. Annapolis, November 1996.

7-1
[12] F. Camous, F. Jacq, P. Chatelard, and J.M. Flores. Interface requirements to couple thermal hydraulics codes to severe accident codes: ICARE/CATHARE. In

OECD/CSNI Workshop on ‘Transient Thermal-Hydraulic and Neutronic Requirements’. Annapolis, November 1996.

[13] Computer Simulation Flow Systems. RETRAN-03: A program for transient thermalhydraulic analysis of complex fluid flow systems. volume 1: Theory and numerics.

Technical Report NP-7450, Volume 1. Research Project 889-10, Electric Power Research Institute, May 1992.

[14] Michael Corradini. Fundamentals of multiphase flow. Technical report, Department of

Engineering Physics. University of Wisconsin, August 1997.

http://loca.neep.wisc.edu/~sam/2phase/ALL/main/main.html.

[15] James F. Cremer, Richard S. Palmer, and Richard E. Zippel. Creating scientific software. Transactions of the Society for Computer Simulation, 14(1):37–39, 1997.

[16] F. D’Auria, E. Cojnack, H. Glaeser, C. Lage, and T. Wickett. Overview of uncertainty

issues and methodologies. In OECD/CSNI Seminar on ‘Best Estimate Methods in

Thermal-Hydraulics Safety Analysis’, Ankara, June 1998.

[17] X. Delhaye, Callaert M., C. Schneidesch, Ph. Damas, and L. Vanhoenacker. Coupling of

the neutronics code PANTHER with RELAP5. The BELGATOM approach to simulate

the core response of non-symmetric reactivity transients. In Spring 98 CAMP meeting.

Ankara, 1998.

[18] Tom Downar, Barber Doug, Vince Mousseau, Dave Ebert, and Joe M. Kelly. RELAP5/PARCS. Generalized thermal-hydraulics/neutronic interface. In Spring 98

CAMP meeting. Ankara, 1998.

[19] D.A. Drew. Mathematical modeling of two-phase flow. Annual Review of Fluid Mechanics, 15:261–291, 1983.

[20] S. Mittag et al. Validation of coupled codes for vvers by analysis of plant transients. In

OECD-CSNI Workshop on ‘Advanced Thermal-Hydraulic and Neutronic Codes: Current and Future Applications’. Barcelona, April 2000.

[21] J.M. Evrard, J.P. Mireau, P. Lardjane, and B. Lucas. KANT: a probabilistic software

for level 2 PSA. In Proceedings of the Fourth International Conference on Probabilistic

Safety Assessment and Management, New York, September 1998.

[22] Graham E. Fagg and Jack J. Dongarra. PVMPI: An integration of the PVM and MPI

systems, April 1996.

http://www.www.netligb.org/utk/papers/pvmpi/paper.html.

7-2
[23] Graham E. Fagg, Jack J. Dongarra, and Al Geist. Heterogeneous MPI application

interoperation and process management under PVMPI. In Euro PVM-MPI conference,

Cracow, Poland, November 1997.

http://www.netlib.org/utk/papers/pvmmpi97.ps.

[24] Fauske & Associates Inc. MAAP 3.0B, User’s Manual, 1995.

[25] Lynn R. Feinauer. Compiler issues associated with safety-related software. Nuclear

Technology, 93:116–122, January 1991.

[26] T.L. Freeman and C. Phillips. Parallel Numerical Algorithms. International Series in

Computer Science. Prentice Hall, 1992.

[27] Al Geist et al. PVM, Parallel Virtual Machine. A User’s Guide and Tutorial for Networked Parallel Computing. The MIT press; Scientific and Engineering Computation

Series, 1994.

ftp://netlib2.cs.utk.edu/pvm3/book/pvm-book.ps.

[28] Al Geist et al. PVM3 Users Guide and Reference Manual. Oak Ridge National Laboratory, September 1994.

ftp://netlib2.cs.utk.edu/pvm3/ug.ps.

[29] G.A. Geist, J.A. Kohl, and P.M. Papadopoulos. PVM and MPI: a comparison of

features. Calculateurs Parallels, 8(2), May 1996.

http://www.epm.ornl.gov/pvm/PVMvsMPI.ps.

[30] Jean J. Ginoux. Two-Phase Flows and Heat Transfer. McGraw Hill, 1978.

[31] Torbj ̈orn Granlund. The GNU Multiple Precision Arithmetic Library, 2.0.2 edition,

June 1996.

ftp://ftp.rediris.es/mirror/gnu/gmp/gmp-2.0.2.tar.gz.

[32] B. Gropp, R. Lusk, and A. Skjellum. Using MPI. MIT press, 1994.

[33] A. H ̈am ̈al ̈ainen, T. Vanttola, and P. Siltanen. Advanced analysis of steam line break

with the codes HEXTRAN and SMABRE for Loviisa NPP. In OECD-CSNI Workshop

on ‘Advanced Thermal-Hydraulic and Neutronic Codes: Current and Future Applications’. Barcelona, April 2000.

[34] V. Hern ́andez, A. Vidal, I. Blanquer, J. Rom ́an, Flich S., G Verd ́u, J. L. Mu ̃noz Cobo,

A. Escriv ́a, X. Sancho, J. Serra, and A. G ́omez. Reducci ́on del tiempo de respuesta del

c ́odigo de an ́alisis de transitorios TRAC-BF1 mediante computaci ́on de altas prestaciones. In Proc. of the XXII meeting of the Spanish Nuclear Society, Santander, October 1996.

[35] R. Herrero. Specification of initial and boundary conditions in RELAP5/Mod3.2. In

9th CAMP Fall Meeting. Santa F ́e, October 1996.

7-3
[36] Roberto Herrero. A standardized methodology for the linkage of computer codes.

application to RELAP5/Mod3.2. Technical Report NUREG/IA-0179, US Nuclear

Regulatory Commission. Office of Nuclear Regulatory Research, March 2000.

[37] Roberto Herrero. Development of a standardised protocol for connection of nuclear

safety codes. application to TRAC-M. Technical report, Universidad Polit ́ecnica de

Madrid, November 2001.

[38] Roberto Herrero and Enrique Mel ́endez. Linkage and parallelisation of scientific programs with a modular simulation language. Submitted to Transactions of the Society

for Computer Simulation.

[39] Gad Hetsroni, editor. Handbook of Multiphase Systems. Hemisphere Publishing Corporation, 1982.

[40] B. Holmes, G.R. Kimber, J.N. Lillington, M. Parkes, and R. Page. RELAP5-

PANTHER coupled code transient analysis. In OECD-CSNI Workshop on ‘Advanced Thermal-Hydraulic and Neutronic Codes: Current and Future Applications’.

Barcelona, April 2000.

[41] E.D. Hughes. An evaluation of state-of-the-art two-velocity two-phase flow models

and their applicability to nuclear reactor transient analysis. Technical Report NP-143,

EPRI, 1976.

[42] I.E. Idelchik. Handbook of Hydraulic Resistance. Hemisphere Publishing Corporation,

2ndedition, 1986.

[43] M. Ishii. Thermo-Fluid Dynamic Theory of Two-Phase Flows. Eyrolles, 1975.

[44] K. Ivanov, A. Baratta, and E. Sartori. OECD/NRC MSLB benchmark – a systematic

approach to validate best-estimate coupled codes using a multi-level methodology. In

OECD-CSNI Workshop on ‘Advanced Thermal-Hydraulic and Neutronic Codes: Current and Future Applications’. Barcelona, April 2000.

[45] J.M. Izquierdo, R. Mendiz ́abal, and J.M. Rey. Fundamentos de ecuaciones de conservaci ́on para caudales bif ́asicos. Technical Report ICAP, Consejo de Seguridad Nuclear,

January 1989.

[46] J.M. Izquierdo, C. Queral, R. Herrero, J. Hortal, M. S ́anchez, and R. Mu ̃noz. Role of

fast running codes and their coupling with PSA tools. In OECD-CSNI Workshop on

‘Advanced Thermal-Hydraulic and Neutronic Codes: Current and Future Applications’.

Barcelona, April 2000.

[47] Jos ́e Mar ́ıa Izquierdo et al. TRETA and TIZONA fast running thermal hydraulic

codes. Annals of Nuclear Energy, 34:533–549, 2007.

7-4
[48] Jos ́e Mar ́ıa Izquierdo, Javier Hortal, and L. Vanhoenacker. Merits and limits of thermalhydraulic plant simulations — towards a unified approach to qualify plant models.

Nuclear Engineering and Design, 145:175–205, 1993.

[49] Jos ́e Mar ́ıa Izquierdo and Miguel S ́anchez Perea. CAMPEADOR: An implicit simulation language for continuous sytems combined with discrete events able to apply

protection theory. In 1994 European Simulation Multiconference (ESM’94). Barcelona,

Spain, June 1994.

[50] Claes Johnson, Rolf Rannacher, and Mats Boman. Numerics and hydrodynamic stability: Toward error control in computational fluid dynamics. SIAM J. Numer. Anal.,

32(4):1058–1079, August 1995.

[51] A. Jones et al. Experience from the development of the severe accident code system

ESTER. In Proc of the ANS Winter Meeting, Washington, November 1994.

[52] Ken Jones. XMGR5 extensions. Idaho National Engineering Laboratory, 1995.

[53] Walter J. Karplus and H. Jurgen Halin. Mathematical modeling and digital computer  ̈

simulation of engineering and scientific systems. Seminar 94.6, ETH Zurich, June 1997.

[54] Ricahard Kesley, William Clinger, and Jonathan Rees. Revised5 Report on the Algorithmic Language Scheme, February 1998.

http://www-swiss.ai.mit.edu/scheme-reports/r5rs.ps.gz.

[55] N.A. Kheir. Systems Modeling and Computer Simulation. Marcel Dekker Inc., New

York, 1988.

[56] G. Kocamustafaogullari and M. Ishii. Foundation of the interfacial area transport

equation and its closure relations. Int. J. Heat Mass Transfer, 38(3):481–493, 1995.

[57] Kyrki-Rajam ̈aki. The need of coupled 3D neutronics in DBA and BDBA analyses using

conservative or best-estimate approach. In OECD/CSNI Seminar on ‘Best Estimate

Methods in Thermal-Hydraulics Safety Analysis’. Ankara, June 1998.

[58] Pierre Etienne Labeau and Jos ́e Mar ́ıa Izquierdo. Modelling PSA problems I: The

stimulus-driven theory of probabilistic dynamics. NSE Nuclear Science and Engineering, 150:115–139, 2005.

[59] Pierre Etienne Labeau and Jos ́e Mar ́ıa Izquierdo. Modelling PSA problems II: A cellto-cell transport theory approach. NSE Nuclear Science and Engineering, 150:140–154,

2005.

[60] S. Langenbuch, H. Austregesilo, P. Fomitchenko, U. Rohde, and K. Velkov. Interface

requirements to couple thermal-hydraulic codes to 3D neutronic codes. In OECD/CSNI

Workshop on ‘Transient Thermal-Hydraulic and Neutronic Requirements’. Annapolis,

November 1996.

7-5
[61] G.S. Lellouche and B. Chexal. A full-range drift flux correlation for vertical flows, rev.

1. Technical Report NP-3969-SR, EPRI, 1986.

[62] Amable Li ̃n ́an. Mec ́anica de Fluidos. Secci ́on de Publicaciones de la Escuela T ́ecnica

Superior de Ingenieros Aeron ́auticos, October 1967.

[63] Lorie M. Liebrock. Parallelisation and automatic data distribution for nuclear reactor

simulations. In Proc of the OECD/CSNI Workshop on transient thermal-hydraulic and

neutronic code requirements; Annapolis, 5–8 November 1996.

[64] Sandra Loosemore, Roland McGrath, Andrew Oram, and Richard M. Stallman. The

GNU C Library Reference Manual, 0.05 edition, August 1993.

ftp://ftp.rediris.es/pub/gnu/gcc.

[65] Alfredo L ́opez and Jos ́e Mar ́ıa Sierra. Contraste de resultados obtenidos con RELAP5/Mod3.2 en diferentes entornos de computaci ́on. In First Technical Session

CAMP Spain. Barcelona, April 1997.

[66] J. Mahhaffy and C. Murray. An exterior communications interface for the USNRC

consolidated code. In OECD-CSNI Workshop on ‘Advanced Thermal-Hydraulic and

Neutronic Codes: Current and Future Applications’. Barcelona, April 2000.

[67] Fernando Merino, Carol Ahnert, and Jos ́e Mar ́ıa Aragon ́es. Development and validation

of the 3-D PWR core dynamics SIMTRAN code. In Joint Intl Conf on math methods

and supercomputing in nuclear applications, Karlsruhe, April 1993.

[68] R. L. Moore, C. S. Miller, and C. D. Fletcher. Linking external models with RELAP5

using PVM. Technical report, Idaho National Engineering Laboratory.

[69] Glen A. Mortensen. One root cause of numerical problems that occur in large codes.

In Reuni ́on CAMP de oto ̃no, October 1999.

[70] Willian L. Oberkampf and Frederick G. Blotner. Issues in Computational Fluid Dynamics. Code verification and validation. Technical Report SAND95-1352, Sandia

National Laboratory, 1997.

[71] OECD Halden Reactor Project. COPMA-II User’s Manual, 1996.

[72] Ohio Supercomputer Center. The Ohio State University. MPI Primer / Developing

with LAM, November 1996.

http://www.itl.nist.gov/div895/sasg/LAM/lam61.doc.ps.

[73] J. Olive. Thermo-hydraulique diphasique monodimensionnelle. Technical Report

96NB00116, Electricit ́e de France. Direction des Etudes et Recherches, November 1995.

7-6
[74] R. Page and J.R. Jones. Development of an integrated thermal-hydraulics capability

incorporating RELAP5 and PANTHER neutronics code. In OECD/CSNI Workshop

on ‘Transient Thermal-Hydraulic and Neutronic Requirements’. Annapolis, November

1996.

[75] Miguel S ́anchez Perea. An ́alisis y simulaci ́on de redes de subsistemas lineales mediante

desarrollos en serie de funciones de Lagu`erre. PhD thesis, Universidad Pontificia

de Comillas. Escuela T ́ecnica Superior de Ingenieros Industriales (ICAI). Dpto. de

Electr ́onica y Autom ́atica, 1996.

[76] William H. Press, Saul A. Teukolsky, William T. Vetterling, and Brian P. Flannery.

Numerical Recipes in C. The Art of Scientific Computing. Cambridge University Press,

2ndedition, 1995.

http://www.nr.com.

[77] C ́esar Queral. Algoritmo para la resoluci ́on de las ecuaciones de conservaci ́on de fluidos bif ́asicos. Aplicaci ́on a centrales nucleares. PhD thesis, Universidad Nacional de

Educaci ́on a Distancia. Ftad. de Ciencias. Dpto. de F ́ısica Fundamental, 1995.

[78] C ́esar Queral and Ma. Amparo Garc ́ıa Zamorano. 3er informe de avance sobre el

acuerdo espec ́ıfico CSN-UPM para el desarrollo de herramientas de evaluaci ́on de gu ́ıas

de accidente. Technical report, Departamento de Sistemas Energ ́eticos, UPM, junio

1997.

[79] C ́esar Queral and Ma. Amparo Garc ́ıa Zamorano. 3rd Progress report on the specific

agreement CSN-UPM for the development of accident management guide evaluation

tools. Technical report, Departamento de Sistemas Energ ́eticos, UPM, June 1997.

[80] C ́esar Queral and Ma. Amparo Garc ́ıa Zamorano. Final report on the specific agreement CSN-UPM for the development of accident management guide evaluation tools.

Technical report, Departamento de Sistemas Energ ́eticos, UPM, December 1997.

[81] Paul Raines. Tcl/Tl Pocket Reference. O’Reilly & Associates, Inc., 1stedition, October

1998.

[82] V. H. Ransom. A numerical model of two-phase flows. In Ecole d’Ete d’Analyse

Numerique, May 1989. EGG-EAST-8546.

[83] V.H. Ransom. Faucet flow, oscillating manometer. In G.F. Hewitt, J.M. Delhaye,

and N. Zuber, editors, Multiphase Science and Technology, pages 465–470. Hemisphere

Publishing Corporation, 1987.

[84] W. H. Rettig and N. L. Wade. TRAC-BF1/MOD1: An advanced best-estimate

computer program for BWR accident analysis. User’s guide. Technical Report

NUREG/CR-4356. EGG-2626. Vol. 2 R4, Idaho National Laboratory, June 1992.

7-7
[85] P.J. Roache. Quantification of uncertainty in computational fluid dynamics. Annual

Review of Fluid Mechanics, 29:123–160, 1997.

[86] Arnold D. Robbins. Effective AWK Programming, 1.0.3 edition, February 1997.

ftp://ftp.rediris.es/pub/gnu/gawk/gawk-3.0.3-ps.tar.gz.

[87] Kenneth H. Rosen, Richard R. Rosinski, and James M. Farber. UNIX Sistema V

Versi ́on 4. Osborne McGraw-Hill, 1stedition, 1993.

[88] T. Rothe. Linking external models to RELAP5: A new era of RELAP5 applications.

In Proc. of the Intl. Conf. on New trends in Nuclear System Thermohydraulics, Pisa,

1994.

[89] Joachim Schrod. The CWEB Class, November 1995.

CTAN/macros/latex/contrib/supported/cweb/cweb-user.dvi.

[90] Lee A. Segel. Mathematics Applied to Continuum Mechanics. Dover Publicantions Inc.

[91] R.W Shumway. Athena: Advanced thermal-hydraulic energy network analyzer. Technical Report EG&G-TFM-7925, Idaho National Engineering Laboratory, October 1987.

[92] J.C. Slattery. Momentum, Energy and Mass Transfer. McGraw-Hill, 1972.

[93] Jay W. et al Spore. TRAC- PF1/MOD2. Volume I . Theory manual. Technical Report

LA-12031-M, Vol. I. NUREG/CR-5673, Los Alamos National Laboratory, 1993.

[94] Zoran Stosic. Enhancing the scope of applications of standard thermal hydraulic codes

by linking with others. In Proc of the ASME International Conference on Nuclear

Engineering, New orleans, volume 1, part. B, 1996.

[95] The RELAP5 Code Development Team. RELAP5/MOD3 code manual, volume I:

Code structure, system models and solution methods. Technical Report NUREG/CR5535, INEL-95/0174, Idaho National Engineering Laboratory, June 1995.

[96] The RELAP5 Code Development Team. RELAP5/MOD3 code manual, volume II:

User’s guide and input requirements. Technical Report NUREG/CR-5535, INEL95/0174, Idaho National Engineering Laboratory, June 1995.

[97] The RELAP5 Code Development Team. RELAP5/MOD3 code manual, volume IV:

Models and correlations. Technical Report NUREG/CR-5535, INEL-95/0174, Idaho

National Engineering Laboratory, June 1995.

[98] L.S. Tong and Y.S. Tang. Boiling Heat Transfer and Two-Phase Flow. Taylor &

Francis, 2ndedition, 1997.

[99] K. Trambauer. Computer and compiler effects on code results. Technical Report (97)6,

OECD/CSNI, 1997.

7-8
[100] Klaus Trambauer. Interface requirements to couple thermal-hydraulic codes to severe

accident codes: ATHLET-CD. In OECD/CSNI Workshop on ‘Transient ThermalHydraulic and Neutronic Requirements’. Annapolis, November 1996.

[101] Paul J. Turner. ACE/gr Users Manual. Graphics for exploratory data analysis. Software Documentation Series, SDS3, 91-3. Center for Coastal and Land-Margin Research. Oregon Graduate Institute of Science and Technology, 19600 NW von Neumann

Dr., Beaverton, Oregon, 97006-1999, 1993.

[102] P.J. Turner. ACE/gr Users Manual. Graphics for exploratory data analysis. Center for

Coastal and Land-Margin Research. Oregon Graduate Institute of Technology, 1993.

[103] J. Uhle and B. Aktas. USNRC code consolidation and development program. In OECDCSNI Workshop on ‘Advanced Thermal-Hydraulic and Neutronic Codes: Current and

Future Applications’. Barcelona, April 2000.

[104] Guido van Rossum. Python Reference Manual, version 1.5.2. Corporation for National

Research Initiatives (CNRI), October 1998.

http://www.python.org/ftp/python/doc/postscript-a4-1.5.2a2.tgz.

[105] Larry Wall, Tom Christiansen, and Randal L. Schwartz. Programming Perl. O’Reilly

& Associates, Inc., 2ndedition, September 1996.

[106] G.B. Wallis. One-Dimensional Two-Phase Flow. McGraw Hill, 1969.

[107] Dan Prelewicz Weidong Wang, Glen Mortensen. Energy conservation in RELAP5.

Technical Report SCIE-NRC-392-99, SCIENTECH, Inc., November 1999.

[108] W. Wulff, H.S. Cheng, S.V. Lekach, and A.N. Mallen. The BWR plant analyzer.

Technical Report NUREG/CR-3943. BNL-NUREG-51812, Brookhaven National Laboratory, August 1984.

[109] W. Wulff et al. The BWR plant analyzer. Final report. Technical Report NUREG

CR-3943, 1988.

[110] Wolfgang Wulff. Computational methods for multiphase flow. In Second International

Workshop on Two-Phase Flow Fundamentals. Rensselaer Polytechnic Institute, March

1987.

7-9
7-10
Appendix A. Nomenclature

Latin letters

t time (s).

x spatial variable (m).

v fluid velocity (m s−1).

viinterphase velocity (m s−1).

A cross-sectional area (m2).

V volume (m3).

m mass (Kg).

W mass flow (Kg s−1).

P pressure (Pa).

Bx projection of gravity onto the pipe direction (m s−2).

FW wall friction coefficient (s−1).

FI interphase friction coefficient (s−1).

C virtual mass coefficient (non-dimensional).

compressibility (m3).

K local pressure drop coefficient (non-dimensional).

HLOSS form loss coefficient (m s−1). HLOSS = 1

2K|v|

u specific internal energy (J Kg−1

).

H heat transmission coefficient per unit volumen

(J s−1 m−3 K

−1

),

control volume height (m).

Q heat power per unit volume (J s−1 m−3).

h specific enthalpy (J Kg−1).

T temperature (K).

s specific entropy (J Kg−1 K

−1

).

DISS dissipation power per unit volume (J s−1 m−3).

L length of a one-dimensional TH system (m).

N number of control volumes in a TH system.

M number of inlet or outlet junctions in a TH system.

J difference between inlet and outlet volumetric flows

(m3s

−1

).

Sw expansion/contraction due to appearance/disappearance of phase

(m3s

−1

).

D dilation of phase, caused by energy interchanges (m3s

−1

).

Ac term dominated by pressure gradients (m3s

−1

).

CP constant pressure specific heat capacity (J Kg−1 K

−1

).

Cθ constant volume specific heat capacity (J Kg−1 K

−1

).

g gravity acceleration (m s−2).

A-1
Greek letters

α fraction of phase (non-dimensional).

ρ density (Kg m−3).

Γ phase generation rate per unit volume (Kg m−3s

−1

).

δ(x − x0) Dirac’s delta function, centered around the point x0 (m−1).

θ specific volume(m3 Kg−1).

π thermal expansion coefficient (m3 J

−1

).

γ isentropic compressibility coefficient(non-dimensional).

λ compressibility coefficient along the saturation line

(non-dimensional).

β isobaric thermal expansion coefficient (K−1).

η



∂ρ

∂P 

u

(m−2s

2

).

θ angle between a control volume and the vertical direction

(non-dimensional).

Subindices

k phase (liquid or vapor).

k

0 phase opposite to phase k.

i relative to the interphase.

w relative to the wall.

b relative to the fluid bulk.

m relative to the mixture.

g relative to vapor.

f relative to liquid.

Superindices

in relative to the inlet face.

out relative to the outlet face.

nq non- equilibrium.

eq equilibrium.

n time step.

sat relative to the saturation state.

RELAP5 output variables: control volumes

csubpg CP,g (J Kg−1 K

−1

).

csubpf CP,f (J Kg−1 K

−1

).

betagg βg (K−1).

betaff βf (K−1

).

drgdp ηg (m−2s

2

).

A-2
drfdp ηf (m−2

s

2

).

vvol volume (m3).

avol cross-sectional area (m2).

p control volume pressure (Pa).

voidg vapor fraction (non-dimensional).

voidf liquid fraction (non-dimensional).

rhog vapor density (Kg m−3).

rhof liquid density(Kg m−3).

ug vapor specific internal energy (J Kg−1).

uf liquid specific internal energy (J Kg−1).

gammai vapor generation rate per unit volume in the fluid bulk

(Kg m−3s

−1

).

gammaw vapor generation rate per unit volume in the wall

pared

(Kg m−3s

−1

).

velg vapor velocity (m s−1).

velf liquid velocity (m s−1).

q total heat power transferred to the fluid through the wall

(J s−1).

qwg heat power transferred to vapor through the wall

(J s−1).

hig vapor heat transfer coefficient per unit volume

(J s−1 m−3 K

−1

).

hif liquid heat transfer coefficient per unit volume

(J s−1 m−3 K

−1

).

satt saturation temperature at total pressure, as an output variable

(K).

tsatt saturation temperature at total pressure, as a boundary condition

(K).

quale equilibrium qualtiy (non-dimensional).

boron boron conentration (parts of boron per parts of water).

tempg vapor temperature (K).

tempf liquid temperature (K).

fwalgx wall friction coefficient for vapor phase (Kg m−3s

−1

).

fwalfx wall friction coefficient for liquid phase (Kg m−3s

−1

).

RELAP5 output variables : junctions

velgj vapor velocity (m s−1).

velfj liquid velocity (m s−1).

mflowgj vapor mass flow, as a boundary condition (Kg s−1).

mflowfj liquid mass flow, as a boundary condition (Kg s−1).

voidgj vapor fraction (non-dimensional).

A-3
voidfj liquid fraction (non-dimensional).

rhogj vapor density (Kg m−3).

rhofj liquid density (Kg m−3).

formgj local pressure drop coefficient for vapor phase (non-dimensional).

formfj local pressure drop coefficient for liquid phase (non-dimensional).

A-4
Appendix B: Partial derivatives of thermodynamic

properties

Partial derivatives as a function of CP , Cθ y β



∂u

∂T



P

= CP − P θβ



∂u

∂θ



P

=

CP − P θβ

θβ



∂T

∂s



θ

=

T

Cθ



∂T

∂s



P

=

T

CP



∂θ

∂s



P

=

T θβ

CP



∂T

∂P



s

=

T θβ

CP



∂u

∂s



P

= (CP − P θβ)

T

CP



∂s

∂P



T

= −θβ



∂P

∂T



θ

=

CP − Cθ

Tθβ



∂P

∂θ



T

=

Cθ − CP

Tθ

2β2



∂θ

∂P



s

=

CθT θ2β

2

CP (Cθ − CP )



∂u

∂θ



T

=

CP − Cθ − P θβ

θβ



∂θ

∂h



P

=

θβ

CP

1

γ

≡



∂ ln ρ

∂ ln P



s

=

PCθT θβ2

CP (CP − Cθ)

1

λ

≡



d ln ρ

d ln P



sat

= −PT β 

θβ

Cθ − CP

+

θfg

hfg



B-1
Partial derivatives as a function of η, CP y β



∂ρ

∂u

P

=

ρ

2β

P β − ρCP



∂u

∂P 

ρ

= η

ρCP − P β

ρ

2β



∂P

∂s 

θ

=

T βρ2

η(ρCP − P β)



∂θ

∂P 

s

=

η(P β − ρCP )

CP ρ

3



∂T

∂s 

θ

=

T

CP



1 −

ρβ2T

η(P β − ρCP )





∂θ

∂s 

u

=

T

P



∂T

∂θ 

s

=

T βρ2

η(P β − ρCP )



∂θ

∂s 

T

= −

η(P β − ρCP ) − ρβ2T

βρ2CP

Cθ =

ηCP (P β − ρCP )

η(P β − ρCP ) − ρβ2T

B-2
Appendix C: File babpost.awk

# This AWK command file automatically generates the BABIECA input file

# necessary to execute the thermalhydraulic postprocess of a

# given RELAP5/MOD3.2 case.

#

# First of all, you need to write an ASCII file (generically denoted

# as ’inpfile’), with the format described bellow.

# Words in capital letters must be written literally.

# Lower case words are generic names that make reference to RELAP5

# output files, restart-plot files, volumes to be postprocessed, etc.

# Blanks at both sides of the equal sign ’=’ are mandatory. The number

# of blanks between words is irrelevant (1 at least, of course).

#

# LINE 1: FILE = rootword

# LINE 2: HOST = host

# LINE 3: INITTIME = inittime

# LINE 4: STARTTIME = starttime

# LINE 5: ENDTIME = endtime

# LINE 6: FREQ = freq

# LINE 7: NSYSTEMS = nsystems

# For each thermalhydraulic subsystem (i = 1 to nsystems):

# LINE : SYSNAME = sysname

# LINE : NVOLS = nvols

# LINE : cccvv0000

# .

# .

# .

# LINE : cccvv0000

# LINE : NHEATSTRS = nheatstrs

# For each heat structure:

# LINE : cccg0nn

# .

# .

# .

#

# where:

# ’rootword’ is the root name of the RELAP5 input file to be

# postprocessed, which must be appended by the extension ’.i’.

# The output file ’rootword.o’ must exist prior to the

# execution of this awk file. The restart plot-file will

# be named ’rootword.r’.

# The root name will also be used in the postprocessing

# output files.

# The results of the postprocess of each thermalhydraulic

# subsystem defined in the ’inpfile’ will be written in

# ASCII files with the names ’rootword_sysname.dat’. The results

# The data files ’rootword_cccvv.dat’ contain the results of the

# control volume ’cccvv’, where ccc stands for the component

# number and vv for the volume number within the component.

# ’host’ is the name of the host where RELAP5 executable file is allocated.

# ’inittime’ is the transient instant, in seconds, at which the RELAP5

# process is spawned. Useful for restart cases.

# ’starttime’ is the transient instant, in seconds, at which the

# postprocess begins.

# ’endtime’ is the transient instant, in seconds, at which

# the postprocess ends.

# ’freq’ is the frequency used to write output data (in time steps).

# ’nsystems’ is the number of thermalhydraulic systems to be postprocessed.

# ’sysname’ is the name of the thermalhydraulic system. The results of the

# postprocess of each system will be written in the file

# ’rootword_sysname.dat’.

# ’nvols’ is the number of control volumes to be postprocessed in

# the current th subsystem.

C-1
# ’cccvv0000’ is a nine digit string denoting the volume(s) to be

# postprocessed.

# The three digit substring ’ccc’ refers to the hydrodynamic

# component to which the control volume belongs. The two

# digit substring ’vv’ refers to the number of the subvolume

# within the hydrodynamic component (01 for a single volume).

# The last four digits are always 0000.

# ’heatstrs’ is the number of heat structures to be postprocessed

# (axial nodes).

# ’cccg0nn’ is a seven digit string denoting the heat structure to be

# postprocessed.

# The three digit string ’ccc’ stands for the heat structure

# number. Digit ’g’ stands for the geometry number (see RELAP5

# manual. The two digit string ’nn’ stands for the axial node.

#

# This utility must be executed, from the UNIX prompt, as follows:

# awk -f babpost.awk ’inpfile’ ’rootword.o’ > ’rootword.bab’

# where:

# ’inpfile’ is the ASCII file described at the top.

# ’rootword.o’ is the RELAP5 output file.

# ’rootword.bab’ is the BABIECA file generated by this utility.

#

# Now, you must delete the RELAP5 files ’rootword.o’ and

# ’rootword.r’, if they exist.

#

# Run pvm with proper host, executable paths and working directories.

#

# To run the thermalhydraulic postprocessor, execute

# BAIECA -n rootword.bab

#

# The variables contained in the output files can be displayed

# with XMGR5.

#

##############################################################################

# RELAP5/MOD3.2 postprocessor

#

# Initializing variables.

BEGIN{

# njuns = number of junctions in the problem (internal junctions of

# the systems plus boundaries)

njuns=0

# newvcount = number of control volumes attached to any of the subsystems

# to be postprocessed, but are not part of them.

newvcount = 0

# nvolouts = number of output signals per control volume to be postprocessed.

nvolouts = 28

# njunouts = number of output signals per junction.

njunouts = 9

# nnewvouts = number of output signals per control volume attached to any

# of the subsystems to be postprocessed, but are not part of them.

nnewvouts = 1

# TOTVOLS = total number of volumes to be postprocessd

TOTVOLS = 0

# nhtouts = number of output signals per heat structure

nhtouts = 5

PI = 3.1415926535897932

}

# Reading data from ’inpfile’.

/FILE/{

if(($1 == "FILE") && ($2 == "=")) FILE=$3

getline

if(($1 == "HOST") && ($2 == "=")) HOST = $3

getline

if(($1 == "INITTIME") && ($2 == "=")) INITTIME = $3

C-2
getline

if(($1 == "STARTTIME") && ($2 == "=")) STARTTIME = $3

getline

if(($1 == "ENDTIME") && ($2 == "=")) ENDTIME = $3

getline

if(($1 == "FREQ") && ($2 == "=")) FREQ = $3

getline

if(($1 == "NSYSTEMS") && ($2 == "=")) NSYSTEMS = $3

for(sys=1;sys<=NSYSTEMS;sys++){

getline

if($1 == "SYSNAME" && ($2 == "=")) SYSNAME[sys] = $3

getline

if($1 == "NVOLS" && ($2 == "=")) NVOLS[sys] = $3

if(1 == sys){

initloop = 0

}

else{

initloop += NVOLS[sys-1]

}

for(i=1;i<=NVOLS[sys];i++){

getline

VOLINSYS[i+initloop]=$1

newsysvolume =1

newvolume = 1

for(k=1;k<i;k++){

if(VOLINSYS[k+initloop] == VOLINSYS[i+initloop]){

newsysvolume = 0

}

}

if(!newsysvolume){

printf "# TH system with repeated volumes.\n"

printf "# Subsystem %s. Volumes %s and %s.\n", SYSNAME[sys], \

VOLINSYS[k+initloop], VOLINSYS[i+initloop]

stop

}

for(k=1;k<=TOTVOLS;k++){

if(VOLUME[k] == VOLINSYS[i+initloop]){

newvolume = 0

break

}

}

if(newvolume){

VOLUME[++TOTVOLS] = VOLINSYS[i+initloop]

}

}

}

getline

if(($1 == "NHEATSTRS") && ($2 == "=")) NHEATSTRS = $3

for(nht=1;nht<=NHEATSTRS;nht++){

getline

heatst[nht] = $1

}

}

/^ end time min.time step max.time step option minor edit /{

getline

getline

MAXDT = $3

NSTEPS = ((ENDTIME-INITTIME)/MAXDT)

}

/0Gravitational constant is/{

GRAV = $4

}

C-3
# Searching in ’rootword.o’ for all the possible junctions

# attached to the control volumes to be postprocessed.

/^0 Jun\.no\. from vol\. to vol\. liq\.j\.vel/{

while ($0 !~ /voidfj/){

getline

# For each line between ’0 Jun.no. from vol. ,etc.’ and ’voidfj’

# we will check if either ’from vol.’ or ’to vol.’ is one of our control

# volumes.

for (i=1;i<=TOTVOLS;i++) {

# ’fstart’ and ’tstart’ are counters that contain the position

# of the first character to be read from a word that possibly contains

# one of the control volumes.

fstart=1; tstart=1

COMPONENT=substr(VOLUME[i],1,3)

SUBVOLUME=substr(VOLUME[i],4,2)

DIRECTION=substr(VOLUME[i],9,1)

if( substr($2,1,1) == "-" ) fstart=2

if( substr($3,1,1) == "-" ) tstart=2

pvf=substr($2,fstart, 3)

pvt=substr($3,tstart,3)

psvf=substr($2,4+fstart,2)

psvt=substr($3,4+tstart,2)

if (pvf == COMPONENT){

if (psvf==SUBVOLUME) {

njuns++

JUNCTION[njuns]=substr($1,1,3) substr($1,5,2) "0000"

FROMVOL[njuns]=pvf psvf "0000"

FROMSIGN[njuns]=signi[fstart]

TOVOL[njuns]=pvt psvt "0000"

TOSIGN[njuns]=signi[tstart]

if (substr($2,6+fstart,4) == "0000"){

INOUTFLAGFROM[njuns]=1

if (substr($2,4+fstart,2) == "01") INOUTFLAGFROM[njuns]=2

}

else {

INOUTFLAGFROM[njuns]=substr($2,9+fstart,1)

}

if (substr($3,6+tstart,4) == "0000"){

INOUTFLAGTO[njuns]=1

if (substr($3,4+tstart,2) == "01") INOUTFLAGTO[njuns]=2

}

else {INOUTFLAGTO[njuns]=substr($3,9+tstart,1)}

}

}

if (pvt == COMPONENT){

if (psvt==SUBVOLUME) {

njuns++

JUNCTION[njuns]=substr($1,1,3) substr($1,5,2) "0000"

FROMVOL[njuns]=pvf psvf "0000"

FROMSIGN[njuns]=signi[fstart]

TOVOL[njuns]=pvt psvt "0000"

TOSIGN[njuns]=signi[tstart]

{ if (substr($2,6+fstart,4) == "0000"){

INOUTFLAGFROM[njuns]=1

if (substr($2,4+fstart,2) == "01") INOUTFLAGFROM[njuns]=2

}

else {INOUTFLAGFROM[njuns]=substr($2,9+fstart,1)}

}

{ if (substr($3,6+tstart,4) == "0000"){

INOUTFLAGTO[njuns]=1

if (substr($3,4+tstart,2) == "01") INOUTFLAGTO[njuns]=2

}

else {INOUTFLAGTO[njuns]=substr($3,9+tstart,1)}

C-4
}

}

}

for(k=1;k<njuns;k++){

if(JUNCTION[k]==JUNCTION[njuns]) njuns--

}

}

}

}

/^0 Vol no. coord. flow area flow length sp.x. chng. sp.y. chng. sp.z. chng./{

while ($0 !~ /Vol no. i.c. i.c.value 1 i.c.value 2 i.c.value 3 i.c.value 4/){

getline

for(i=1;i<=TOTVOLS;i++) {

if($1 == VOLUME[i]) {

HEIGHT[VOLUME[i]]=$7

# printf "# Height of volume %s: %s\n", VOLUME[i], HEIGHT[VOLUME[i]]

}

}

}

}

/^0 Input data for heat structure-geometry/{

if (NHEATSTRS > 0){

htgeom = $NF

while ($0 !~ / number of mesh points/){

getline

}

meshpoints = $NF

getline

geomtype = $NF

while ($0 !~ /0mesh point number, mesh point coordinate/){

getline

}

getline

for(meshind=1; meshind<=meshpoints; meshind++) {

meshcoord[meshind] = $(2*meshind)

}

sumvolfacts=0.0

for(meshind=1; meshind<meshpoints; meshind++) {

volfact[meshind] = (meshcoord[meshind+1] * meshcoord[meshind+1])\

- (meshcoord[meshind] * meshcoord[meshind])

sumvolfacts += volfact[meshind]

}

for(meshind=1; meshind<meshpoints; meshind++) {

if(sumvolfacts == 0.0) {

volfact[meshind] = 1.0 / (meshpoints-1)

}

else {

volfact[meshind] /= sumvolfacts

}

}

while ($0 !~ /0mesh point number, composition number/){

getline

}

getline

nmp=2

for(nfields=1; nmp<=meshpoints; nfields+=2) {

field = $nfields

subslen = length(field)-1

provmpoint = substr(field,1,subslen)

mat = $(nfields+1)

if (substr(mat,1,1) == "-") {

mat = substr(mat,2,length(mat))

}

C-5
for(meshind=nmp; meshind<=provmpoint; meshind++) {

matnumb[meshind-1] = mat

}

nmp = provmpoint+1

}

while ($0 !~ /0mesh point number, source factor/){

getline

}

getline

nmp=2

sumfactors=0.0

for(nfields=1; nmp<=meshpoints; nfields+=2) {

field = $nfields

subslen = length(field)-1

provmpoint = substr(field,1,subslen)

factor = $(nfields+1)

for(meshind=nmp; meshind<=provmpoint; meshind++) {

srfact[meshind-1] = factor

sumfactors += factor

}

nmp = provmpoint+1

}

for(meshind=1; meshind<meshpoints; meshind++){

if(sumfactors == 0.0) {

srfact[meshind] = 1.0 / (meshpoints-1)

}

else {

srfact[meshind] /= sumfactors

}

}

while ($0 !~ /^0Structure source internal source/){

getline

}

getline

getline

for(i=1; $0 !~ /^0Structure left vol. left left/; i++) {

pinsrc[i] = $3

getline

}

while ($0 !~ /^0Structure right vol. right right right surface/){

getline

}

getline

getline

for(i=1; $0 !~ /^0 right right right right/; i++){

prightsrf[i] = $5

getline

}

for(nht=1;nht<=NHEATSTRS; nht++) {

heatstroot = substr(heatst[nht],1,4)

if (heatstroot == htgeom) {

if(geomtype != "cylindrical") {

printf "Heat structure %s is not cylindrical.\n", heatst[nht]

printf "It cannot be postprocessed."

exit

}

nmpoints[nht] = meshpoints

htmshpoint = nht * 100

for(meshind=1; meshind<meshpoints; meshind++) {

htmshpoint++

htcoord[htmshpoint] = meshcoord[meshind]

htmatnumb[htmshpoint] = matnumb[meshind]

srcfactor[htmshpoint] = srfact[meshind]

volfactor[htmshpoint] = volfact[meshind]

}

C-6
leftind = nht * 100

lefthtmatind = leftind + 1

rightind = (nht * 100) + 1

righthtmatind = leftind + meshpoints -1

composition[leftind] = htmatnumb[lefthtmatind]

composition[rightind] = htmatnumb[righthtmatind]

htmshpoint = leftind + meshpoints

htcoord[htmshpoint] = meshcoord[meshpoints]

rightindex = leftind +meshpoints

htvol[nht] = htstrhgt[nht]*htcoord[rightindex]*htcoord[rightindex]\

*PI

i = int(substr(heatst[nht],6,2))

insrcfac[nht] = pinsrc[i]

rightsrf[nht] = prightsrf[i]

}

}

}

}

/^0 Data for composition/{

if (NHEATSTRS > 0) {

while ($0 ~ /^0 Data for composition/) {

curcomp = $NF

for(nht=1; nht<=NHEATSTRS; nht++) {

leftind = nht * 100

rightind = (nht * 100) + 1

if((composition[leftind] == curcomp) || (composition[rightind] == curcomp)) {

while ($0 !~ /olumetric heat capacity/){

getline

}

if($4 == "table") {

deftype[curcomp] = "table"

getline

getline

getline

vcppoint = 1

while ($0 ~ /^ /) {

for(i=2; i<= NF; i+=2) {

comppoint = (curcomp*100) + vcppoint

vcpx[comppoint] = $(i-1)

vcpy[comppoint] = $i

vcppoint++

}

getline

}

tablepoints[curcomp] = --vcppoint

comppoint = (curcomp*100) + 1

initstengy[comppoint] = 0.0

for(vcppoint=2; vcppoint<=tablepoints[curcomp]; vcppoint++) {

comppoint = (curcomp*100) + vcppoint

difx1x0 = vcpx[comppoint]-vcpx[comppoint-1]

dify1y0 = vcpy[comppoint]-vcpy[comppoint-1]

slope[comppoint-1] = dify1y0/difx1x0

semisumy1y0 = (vcpy[comppoint]+vcpy[comppoint-1])/2.0

initstengy[comppoint] = (difx1x0*semisumy1y0) + initstengy[comppoint-1]

}

}

else if($4 == "function") {

deftype[curcomp] = "function"

getline

getline

getline

vcppoint = 1

while ($0 ~ /^ /) {

C-7
comppoint = (curcomp*100) + vcppoint

lowtemp[comppoint] = $1

hightemp[comppoint] = $2

a0[comppoint] = $3

a1[comppoint] = $4

a2[comppoint] = $5

a3[comppoint] = $6

a4[comppoint] = $7

a_1[comppoint] = $8

cterm[comppoint] = $9

if (vcppoint == 1){

initstengy[comppoint] = 0.0

}

else {

initstengy[comppoint] = (lowtemp[comppoint]-cterm[comppoint])*\

(lowtemp[comppoint]-cterm[comppoint])*((a1[comppoint]/2)+\

(lowtemp[comppoint]-cterm[comppoint])*((a2[comppoint]/3)+\

(lowtemp[comppoint]-cterm[comppoint])*((a3[comppoint]/4)+\

(lowtemp[comppoint]-cterm[comppoint])*(a4[comppoint]/5))))+\

(a0*lowtemp[comppoint])+a_1[comppoint]*log(lowtemp[comppoint]-cterm[comppoint])-\

initstengy[comppoint-1]

}

vcppoint++

getline

}

funcpoints[curcomp] = --vcppoint

}

else if(($4 == "is") && ($5 == "constant")) {

deftype[curcomp] = "constant"

comppoint = (curcomp*100) + 1

vcpy[comppoint] = $7

getline

}

}

else getline

}

}

}

}

END{

for(i=1;i<=njuns;i++) {

extravol = 1

for(j=1;j<=TOTVOLS;j++) {

if(FROMVOL[i] == VOLUME[j]) {

extravol = 0

break

}

}

if (extravol == 1) {

++newvcount

NEWVOL[newvcount] = FROMVOL[i]

}

}

for(i=1;i<=njuns;i++) {

extravol = 1

for(j=1;j<=TOTVOLS;j++) {

if(TOVOL[i] == VOLUME[j]) {

extravol = 0

break

}

}

if (extravol == 1) {

++newvcount

C-8
NEWVOL[newvcount] = TOVOL[i]

}

}

trtouts = TOTVOLS*nvolouts+njuns*njunouts+newvcount*nnewvouts\

+NHEATSTRS*nhtouts

# VOLPOS["vvol"] = 1

# VOLPOS["avol"] = 2

# VOLPOS["p"] = 3

# VOLPOS["uf"] = 4

# VOLPOS["ug"] = 5

# VOLPOS["voidf"] = 6

# VOLPOS["voidg"] = 7

# VOLPOS["rhof"] = 8

# VOLPOS["rhog"] = 9

# VOLPOS["satt"] = 10

# VOLPOS["tempf"] = 11

# VOLPOS["tempg"] = 12

# VOLPOS["velf"] = 13

# VOLPOS["velg"] = 14

# VOLPOS["betaff"] = 15

# VOLPOS["betagg"] = 16

# VOLPOS["csubpf"] = 17

# VOLPOS["csubpg"] = 18

# VOLPOS["hif"] = 19

# VOLPOS["hig"] = 20

# VOLPOS["gammaw"] = 21

# VOLPOS["gammai"] = 22

# VOLPOS["qwf"] = 23

# VOLPOS["qwg"] = 24

# VOLPOS["drfdp"] = 25

# VOLPOS["drgdp"] = 26

# VOLPOS["fwalfx"] = 27

# VOLPOS["fwalgx"] = 28

# JUNPOS["velfj"] = 1

# JUNPOS["velgj"] = 2

# JUNPOS["voidfj"] = 3

# JUNPOS["voidgj"] = 4

# JUNPOS["rhofj"] = 5

# JUNPOS["rhogj"] = 6

# JUNPOS["ajun"] = 7

# NEWVPOS["p"] = 1

# HEATPOS["htrnrn"] = 1

# HEATPOS["htpown"] = 2

# HEATPOS["htsrfn"] = 3

# HEATPOS["httmp"] = 4 left side

# HEATPOS["httmp"] = 5 right side

printf "***************************************************************** \n"

printf "Postprocess of RELAP5 file %s.i\n", FILE

printf "* The following nodes will be postprocessed: \n"

for (i=1;i<=TOTVOLS;i++) {

printf "* %s\n", VOLUME[i]

}

printf "%6d %s %s\n", NSTEPS, MAXDT, INITTIME

printf "1\n"

OUTCOUNT = 1

printf "***************************************************************** \n"

printf "TIME\n"

printf "%s\n", OUTCOUNT

printf "0\n"

printf "27\n"

C-9
printf "*----------\n"

printf "[T]\n"

TIME = OUTCOUNT++

printf "***************************************************************** \n"

printf "STEP AT STARTTIME\n"

printf "%s\n", OUTCOUNT

printf "0\n"

printf "27\n"

printf "*----------\n"

printf "STEP([T]-%s)\n", STARTTIME

STEPTIME = OUTCOUNT++

printf "***************************************************************** \n"

printf "PULSE AT STARTTIME\n"

printf "%s\n", OUTCOUNT

printf "0\n"

printf "15\n"

printf "*----------\n"

printf "5\n"

printf "%7.5f %7.5f %7.5f %7.5f %7.5f\n", INITIME-MAXDT, STARTTIME-(MAXDT/2.0), \

STARTTIME, STARTTIME+(MAXDT/2.0), \

ENDTIME

printf "0.0 0.0 1.0 0.0 0.0\n"

PULSETIME = OUTCOUNT++

printf "***************************************************************** \n"

printf "ACTIVATION SIGNAL FOR MODULE SNDCODE\n"

printf "%s\n", OUTCOUNT

printf "0\n"

printf "15\n"

printf "*----------\n"

printf "4\n"

printf "%3.1f %9.7f %s %3.1f\n", INITTIME-100.0, INITTIME-0.0000001, \

INITTIME, ENDTIME

printf "0.0 0.0 1.0 1.0\n"

act_signal = OUTCOUNT++

printf "***************************************************************** \n"

printf "CONSTANT 1\n"

printf "%s\n", OUTCOUNT

printf "0\n"

printf "15\n"

printf "*----------\n"

printf "2\n"

printf "-100.0 100.0\n"

printf "1.0 1.0\n"

CONST1 = OUTCOUNT++

printf "***************************************************************** \n"

printf "CONSTANT 0\n"

printf "%s\n", OUTCOUNT

printf "0\n"

printf "15\n"

printf "*----------\n"

printf "2\n"

printf "-100.0 100.0\n"

printf "0.0 0.0\n"

CONST0 = OUTCOUNT++

printf "***************************************************************** \n"

printf "EMISSION MODULE\n"

printf "%s\n", OUTCOUNT

printf "%s\n", act_signal

printf "60\n"

printf "*----------\n"

printf "1\n"

printf "%s\n", HOST

printf "relap5.x -i %s.i -o %s.o -r %s.r\n",\

FILE, FILE, FILE

printf "1\n"

C-10
printf "0\n"

printf "0\n"

rcodetid = OUTCOUNT++

printf "***************************************************************** \n"

printf "RECEPTION MODULE\n"

printf "%s\n", OUTCOUNT

printf "%s %s\n", act_signal, rcodetid

printf "61\n"

printf "*----------\n"

printf "%s\n", trtouts

for (i=1;i<=TOTVOLS;i++) {

printf " vvol-%s\n", VOLUME[i]

printf " avol-%s\n", VOLUME[i]

printf " p-%s\n", VOLUME[i]

printf " uf-%s\n", VOLUME[i]

printf " ug-%s\n", VOLUME[i]

printf " voidf-%s\n", VOLUME[i]

printf " voidg-%s\n", VOLUME[i]

printf " rhof-%s\n", VOLUME[i]

printf " rhog-%s\n", VOLUME[i]

printf " satt-%s\n", VOLUME[i]

printf " tempf-%s\n", VOLUME[i]

printf " tempg-%s\n", VOLUME[i]

printf " velf-%s\n", VOLUME[i]

printf " velg-%s\n", VOLUME[i]

printf " betaff-%s\n", VOLUME[i]

printf " betagg-%s\n", VOLUME[i]

printf " csubpf-%s\n", VOLUME[i]

printf " csubpg-%s\n", VOLUME[i]

printf " hif-%s\n", VOLUME[i]

printf " hig-%s\n", VOLUME[i]

printf " gammaw-%s\n", VOLUME[i]

printf " gammai-%s\n", VOLUME[i]

printf " qwf-%s\n", VOLUME[i]

printf " qwg-%s\n", VOLUME[i]

printf " drfdp-%s\n", VOLUME[i]

printf " drgdp-%s\n", VOLUME[i]

printf " fwalfx-%s\n", VOLUME[i]

printf " fwalgx-%s\n", VOLUME[i]

vvol[VOLUME[i]] = OUTCOUNT++

avol[VOLUME[i]] = OUTCOUNT++

p[VOLUME[i]] = OUTCOUNT++

uf[VOLUME[i]] = OUTCOUNT++

ug[VOLUME[i]] = OUTCOUNT++

voidf[VOLUME[i]] = OUTCOUNT++

voidg[VOLUME[i]] = OUTCOUNT++

rhof[VOLUME[i]] = OUTCOUNT++

rhog[VOLUME[i]] = OUTCOUNT++

satt[VOLUME[i]] = OUTCOUNT++

tempf[VOLUME[i]] = OUTCOUNT++

tempg[VOLUME[i]] = OUTCOUNT++

velf[VOLUME[i]] = OUTCOUNT++

velg[VOLUME[i]] = OUTCOUNT++

betaff[VOLUME[i]] = OUTCOUNT++

betagg[VOLUME[i]] = OUTCOUNT++

csubpf[VOLUME[i]] = OUTCOUNT++

csubpg[VOLUME[i]] = OUTCOUNT++

hif[VOLUME[i]] = OUTCOUNT++

hig[VOLUME[i]] = OUTCOUNT++

gammaw[VOLUME[i]] = OUTCOUNT++

gammai[VOLUME[i]] = OUTCOUNT++

qwf[VOLUME[i]] = OUTCOUNT++

qwg[VOLUME[i]] = OUTCOUNT++

drfdp[VOLUME[i]] = OUTCOUNT++

drgdp[VOLUME[i]] = OUTCOUNT++

C-11
fwalfx[VOLUME[i]] = OUTCOUNT++

fwalgx[VOLUME[i]] = OUTCOUNT++

}

for(i=1; i<=njuns;i++) {

printf " velfj-%s\n", JUNCTION[i]

printf " velgj-%s\n", JUNCTION[i]

printf " voidfj-%s\n", JUNCTION[i]

printf " voidgj-%s\n", JUNCTION[i]

printf " rhofj-%s\n", JUNCTION[i]

printf " rhogj-%s\n", JUNCTION[i]

printf " ajun-%s\n", JUNCTION[i]

printf " formfj-%s\n", JUNCTION[i]

printf " formgj-%s\n", JUNCTION[i]

velfj[JUNCTION[i]] = OUTCOUNT++

velgj[JUNCTION[i]] = OUTCOUNT++

voidfj[JUNCTION[i]] = OUTCOUNT++

voidgj[JUNCTION[i]] = OUTCOUNT++

rhofj[JUNCTION[i]] = OUTCOUNT++

rhogj[JUNCTION[i]] = OUTCOUNT++

ajun[JUNCTION[i]] = OUTCOUNT++

formfj[JUNCTION[i]] = OUTCOUNT++

formgj[JUNCTION[i]] = OUTCOUNT++

}

for(i=1;i<=newvcount;i++) {

printf " p-%s\n", NEWVOL[i]

p[NEWVOL[i]] = OUTCOUNT++

}

for(nht=1; nht<=NHEATSTRS; nht++){

printf " htrnrn-%9d\n", heatst[nht]*100

printf " htpown-%9d\n", heatst[nht]*100

printf " htsrfn-%9d\n", heatst[nht]*100

printf " httmp-%9d\n", (heatst[nht]*100) + 1

printf " httmp-%9d\n", (heatst[nht]*100) + nmpoints[nht]

htrnrn[nht] = OUTCOUNT++

htpown[nht] = OUTCOUNT++

htsrfn[nht] = OUTCOUNT++

httmpleft[nht] = OUTCOUNT++

httmpright[nht] = OUTCOUNT++

}

printf "*****************************************************************\n"

printf "********** Computation of junction related variables ************\n"

printf "*****************************************************************\n"

for(j=1;j<=njuns;j++) {

printf "Area * vapor fraction in junction %s\n", JUNCTION[j]

printf "%s\n", OUTCOUNT

printf "%s %s\n", ajun[JUNCTION[j]], voidgj[JUNCTION[j]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]\n"

avoidg[JUNCTION[j]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Area * liquid fraction in junction %s\n", JUNCTION[j]

printf "%s\n", OUTCOUNT

printf "%s %s\n", ajun[JUNCTION[j]], voidfj[JUNCTION[j]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]\n"

avoidf[JUNCTION[j]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Area * vapor fraction * density in junction %s\n", JUNCTION[j]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", ajun[JUNCTION[j]], voidgj[JUNCTION[j]], rhogj[JUNCTION[j]]

printf "27\n"

printf "*----------\n"

C-12
printf "[1]*[2]*[3]\n"

avoidrhog[JUNCTION[j]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Area * liquid fraction * density in junction %s\n", JUNCTION[j]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", ajun[JUNCTION[j]], voidfj[JUNCTION[j]], rhofj[JUNCTION[j]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]*[3]\n"

avoidrhof[JUNCTION[j]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Area * mixture density in junction %s\n", JUNCTION[j]

printf "%s\n", OUTCOUNT

printf "%s %s\n", avoidrhog[JUNCTION[j]], avoidrhof[JUNCTION[j]]

printf "27\n"

printf "*----------\n"

printf "[1]+[2]\n"

arhomix[JUNCTION[j]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Area * vapor fraction * density * velocity in junction %s\n", JUNCTION[j]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", ajun[JUNCTION[j]], voidgj[JUNCTION[j]], \

rhogj[JUNCTION[j]], velgj[JUNCTION[j]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]*[3]*[4]\n"

avoidrhovelg[JUNCTION[j]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Area * liquid fraction * density * velocity in junction %s\n", JUNCTION[j]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", ajun[JUNCTION[j]], voidfj[JUNCTION[j]], \

rhofj[JUNCTION[j]], velfj[JUNCTION[j]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]*[3]*[4]\n"

avoidrhovelf[JUNCTION[j]] = OUTCOUNT++

printf "***************************************************************** \n"

# printf "Mixture velocity in junction %s\n", JUNCTION[j]

# printf "%s\n", OUTCOUNT

# printf "%s %s %s\n", avoidrhovelg[JUNCTION[j]], avoidrhovelf[JUNCTION[j]],

# arhovmix[JUNCTION[j]]

# printf "27\n"

# printf "*----------\n"

# printf "([1]*[2])/[3]\n"

# velmixj[JUNCTION[j]] = OUTCOUNT++

# printf "***************************************************************** \n"

# printf "Area* mixture density * mixture velocity**2 in junction %s\n",

# JUNCTION[j]

# printf "%s\n", OUTCOUNT

# printf "%s %s %s\n", arhomix[JUNCTION[j]], velmixj[JUNCTION[j]],

# velmixj[JUNCTION[j]]

# printf "27\n"

# printf "*----------\n"

# printf "[1]*[2]*[3]\n"

# arhovel2mix[JUNCTION[j]] = OUTCOUNT++

# printf "***************************************************************** \n"

# printf "Slip in junction %s\n", JUNCTION[j]

# printf "%s\n", OUTCOUNT

# printf "%s %s\n", velgj[JUNCTION[j]], velfj[JUNCTION[j]]

# printf "27\n"

# printf "*----------\n"

# printf "[1]-[2]\n"

# slip[JUNCTION[j]] = OUTCOUNT++

# printf "***************************************************************** \n"

# printf "Non homogeneous momentum term in junction %s\n", JUNCTION[j]

C-13
# printf "%s\n", OUTCOUNT

# printf "%s %s %s %s %s\n, avoidrhog[JUNCTION[j]], avoidrhof[JUNCTION[j]],

# slip[JUNCTION[j]], slip[JUNCTION[j]],

# arhomix[JUNCTION[j]]

# printf "27\n"

# printf "*----------\n"

# printf "([1]*[2]*[3]*[4])/[5]\n"

# nhommom[JUNCTION[j]] = OUTCOUNT++

# printf "***************************************************************** \n"

printf "Pressure in junction (vapor) %s\n", JUNCTION[j]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", p[TOVOL[j]], p[FROMVOL[j]], velgj[JUNCTION[j]]

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "0.0\n"

pjg[JUNCTION[j]] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Pressure in junction (liquid) %s\n", JUNCTION[j]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", p[TOVOL[j]], p[FROMVOL[j]], velfj[JUNCTION[j]]

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "0.0\n"

pjf[JUNCTION[j]] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Area * vapor fraction * pjg in junction %s\n", JUNCTION[j]

printf "%s\n", OUTCOUNT

printf "%s %s\n", avoidg[JUNCTION[j]], pjg[JUNCTION[j]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]\n"

avoidpjg[JUNCTION[j]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Area * liquid fraction * pjf in junction %s\n", JUNCTION[j]

printf "%s\n", OUTCOUNT

printf "%s %s\n", avoidf[JUNCTION[j]], pjf[JUNCTION[j]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]\n"

avoidpjf[JUNCTION[j]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Local pressure drop (vapor phase) in junction %s\n", JUNCTION[j]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", voidgj[JUNCTION[j]], rhogj[JUNCTION[j]],

velgj[JUNCTION[j]], formgj[JUNCTION[j]]

printf "27\n"

printf "*----------\n"

printf "0.5*[1]*[2]*abs([3])*[3]*[4]\n"

locdpjg[JUNCTION[j]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Local pressure drop (liquid phase) in junction %s\n", JUNCTION[j]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", voidfj[JUNCTION[j]], rhofj[JUNCTION[j]],

velfj[JUNCTION[j]], formfj[JUNCTION[j]]

printf "27\n"

printf "*----------\n"

printf "0.5*[1]*[2]*abs([3])*[3]*[4]\n"

locdpjf[JUNCTION[j]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Local pressure drop in junction %s\n", JUNCTION[j]

printf "%s\n", OUTCOUNT

C-14
printf "%s %s\n", locdpjg[JUNCTION[j]], locdpjf[JUNCTION[j]]

printf "27\n"

printf "*----------\n"

printf "[1]+[2]\n"

locdpj[JUNCTION[j]] = OUTCOUNT++

printf "***************************************************************** \n"

}

# End of junction loop

# printf "OUTPUT FILE LOCAL PRESSURE DROPS\n"

# printf "%s\n", OUTCOUNT

# for(j=1;j<njuns;j++) {

# printf "%s \\\n", locdpj[JUNCTION[j]]

# }

# printf "%s\n", locdpj[JUNCTION[njuns]]

# printf "38\n"

# printf "*----------\n"

# printf "%s_locdpj.dat\n", FILE

# printf "(%s(E17.8))\n", njuns+1

# printf "(%s(A16,x))\n", njuns+1

# printf "%s 0 %6d\n", FREQ, ((STARTTIME-INITTIME)/MAXDT)+2

# for(j=1;j<=njuns;j++) {

# printf "locdpj-%s\n", JUNCTION[j]

# }

# locdpjoutfile = OUTCOUNT++

printf "***************************************************************** \n"

for(i=1;i<=TOTVOLS;i++) {

printf "***************************************************************** \n"

printf "************ Postprocess of control volume %s ************\n", VOLUME[i]

printf "***************************************************************** \n"

printf "Mixture density %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", voidg[VOLUME[i]], rhog[VOLUME[i]],\

voidf[VOLUME[i]], rhof[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]+[3]*[4]\n"

provrhomix[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Non-zero mixture density %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", CONST1, provrhomix[VOLUME[i]], TIME

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "%s\n", INITTIME-MAXDT/2.0

rhomix[VOLUME[i]] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Numerator of mixture velocity %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s %s %s\n", voidg[VOLUME[i]], rhog[VOLUME[i]], \

velg[VOLUME[i]], voidf[VOLUME[i]], \

rhof[VOLUME[i]], velf[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "([1]*[2]*[3])+([4]*[5]*[6])\n"

numvelmix[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Mixture velocity %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", numvelmix[VOLUME[i]], rhomix[VOLUME[i]]

printf "27\n"

C-15
printf "*----------\n"

printf "[1]/[2]\n"

velmix[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Mixture momentum %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", vvol[VOLUME[i]], numvelmix[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]\n"

mommix[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Time derivative of mixture momentum %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s\n", mommix[VOLUME[i]]

printf "43\n"

printf "*----------\n"

printf "16 1.0\n"

dermommix[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Auxiliary variable for csubvg %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s %s\n", drgdp[VOLUME[i]], p[VOLUME[i]], \

betagg[VOLUME[i]], rhog[VOLUME[i]], \

csubpg[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*(([2]*[3])-([4]*[5]))\n"

auxcvg[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Denominator of csubvg %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", auxcvg[VOLUME[i]], rhog[VOLUME[i]], \

betagg[VOLUME[i]], tempg[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "([1]-([2]*[3]*[3]*[4]))\n"

provdencvg[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Non-zero denominator of csubvg %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", CONST1, provdencvg[VOLUME[i]], TIME

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "%s\n", INITTIME-MAXDT/2.0

dencvg[VOLUME[i]] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "csubvg %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", auxcvg[VOLUME[i]], csubpg[VOLUME[i]], \

dencvg[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]/[3]\n"

csubvg[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Auxiliary variable for csubvf %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s %s\n", drfdp[VOLUME[i]], p[VOLUME[i]], \

betaff[VOLUME[i]], rhof[VOLUME[i]], \

C-16
csubpf[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*(([2]*[3])-([4]*[5]))\n"

auxcvf[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Denominator of csubvf %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", auxcvf[VOLUME[i]], rhof[VOLUME[i]], \

betaff[VOLUME[i]], tempf[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "([1]-([2]*[3]*[3]*[4]))\n"

provdencvf[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Non-zero denominator of csubvf %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", CONST1, provdencvf[VOLUME[i]], TIME

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "%s\n", INITTIME-MAXDT/2.0

dencvf[VOLUME[i]] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "csubvf %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", auxcvf[VOLUME[i]], csubpf[VOLUME[i]], \

dencvf[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]/[3]\n"

csubvf[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Saturated vapor variables %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", p[VOLUME[i]], CONST1

printf "62\n"

printf "*----------\n"

printf "P x\n"

printf "cpg cvg betagg hg rhog\n"

satcpg[VOLUME[i]] = OUTCOUNT++

satcvg[VOLUME[i]] = OUTCOUNT++

satbetagg[VOLUME[i]] = OUTCOUNT++

sathg[VOLUME[i]] = OUTCOUNT++

satrhog[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Saturated liquid variables %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", p[VOLUME[i]], CONST0

printf "62\n"

printf "*----------\n"

printf "P x\n"

printf "cpf cvf betaff hf rhof\n"

satcpf[VOLUME[i]] = OUTCOUNT++

satcvf[VOLUME[i]] = OUTCOUNT++

satbetaff[VOLUME[i]] = OUTCOUNT++

sathf[VOLUME[i]] = OUTCOUNT++

satrhof[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Non-zero vapor density %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", CONST1, rhog[VOLUME[i]], TIME

printf "14\n"

printf "*----------\n"

C-17
printf "3\n"

printf "%s\n", INITTIME-MAXDT/2.0

nzrhog[VOLUME[i]] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Vapor enthalpy %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", ug[VOLUME[i]], p[VOLUME[i]], nzrhog[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]+([2]/[3])\n"

hg[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Non-zero lilquid density %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", CONST1, rhof[VOLUME[i]], TIME

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "%s\n", INITTIME-MAXDT/2.0

nzrhof[VOLUME[i]] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Liquid enthalpy %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", uf[VOLUME[i]], p[VOLUME[i]], nzrhof[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]+([2]/[3])\n"

hf[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Saturation enthalpy jump %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", sathg[VOLUME[i]], sathf[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]-[2]\n"

hfg[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Saturation volume jump %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", satrhog[VOLUME[i]], satrhof[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "(1.0/[1])-(1.0/[2])\n"

vfg[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Vapor generation rate %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", gammaw[VOLUME[i]], gammai[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]+[2]\n"

gammag[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Liquid generation rate %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s\n", gammag[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "-1.0*[1]\n"

gammaf[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Liquid generation rate in volume %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

C-18
printf "%s %s\n", vvol[VOLUME[i]], gammaf[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]\n"

genmf[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Computation of hstarg %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", hg[VOLUME[i]], sathg[VOLUME[i]], gammai[VOLUME[i]]

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "0.0\n"

hstarg[VOLUME[i]] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Computation of hstarf %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", sathf[VOLUME[i]], hf[VOLUME[i]], gammai[VOLUME[i]]

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "0.0\n"

hstarf[VOLUME[i]] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Computation of hprimeg %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", hg[VOLUME[i]], sathg[VOLUME[i]], gammaw[VOLUME[i]]

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "0.0\n"

hprimeg[VOLUME[i]] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Computation of hprimef %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", sathf[VOLUME[i]], hf[VOLUME[i]], gammaw[VOLUME[i]]

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "0.0\n"

hprimef[VOLUME[i]] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Wall interfacial heat power (vapor) %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", hprimeg[VOLUME[i]]+1, hprimef[VOLUME[i]], \

hprimeg[VOLUME[i]], gammaw[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "(1.0 - [1])*([2]-[3])*[4]\n"

qiwg[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Wall interfacial heat power (liquid) %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", hprimeg[VOLUME[i]]+1, hprimef[VOLUME[i]], \

hprimeg[VOLUME[i]], gammaw[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*([2]-[3])*[4]\n"

qiwf[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Bulk interfacial heat power (vapor) %s\n", VOLUME[i]

C-19
printf "%s\n", OUTCOUNT

printf "%s %s %s\n", hig[VOLUME[i]], satt[VOLUME[i]], tempg[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*([2]-[3])\n"

qibg[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Bulk interfacial heat power (liquid) %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", hif[VOLUME[i]], satt[VOLUME[i]], tempf[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*([2]-[3])\n"

qibf[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Total interfacial heat power (vapor) %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", qiwg[VOLUME[i]], qibg[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]+[2]\n"

qig[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Total interfacial heat power (liquid) %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", qiwf[VOLUME[i]], qibf[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]+[2]\n"

qif[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Enthalpy transferred to vapor through the interphase %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", gammai[VOLUME[i]], hstarg[VOLUME[i]], \

gammaw[VOLUME[i]], hprimeg[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]+[3]*[4]\n"

gammahig[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Enthalpy transferred to liquid through the interphase %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", gammai[VOLUME[i]], hstarf[VOLUME[i]], \

gammaw[VOLUME[i]], hprimef[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "-1.0*([1]*[2]+[3]*[4])\n"

gammahif[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Gamma * h (vapor) %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", gammag[VOLUME[i]], hg[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]\n"

gammaghg[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Gamma * h (liquid) %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", gammaf[VOLUME[i]], hf[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]\n"

gammafhf[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

C-20
printf "Non-zero csubpg %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", CONST1, csubpg[VOLUME[i]], TIME

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "%s\n", INITTIME-MAXDT/2.0

nzcsubpg[VOLUME[i]] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Vapor isobaric expansion coefficient %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", betagg[VOLUME[i]], nzrhog[VOLUME[i]], nzcsubpg[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]/([2]*[3])\n"

pig[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Non-zero csubpf %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", CONST1, csubpf[VOLUME[i]], TIME

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "%s\n", INITTIME-MAXDT/2.0

nzcsubpf[VOLUME[i]] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Liquid isobaric expansion coefficient %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", betaff[VOLUME[i]], nzrhof[VOLUME[i]], nzcsubpf[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]/([2]*[3])\n"

pif[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Vapor swelling %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", vvol[VOLUME[i]], gammag[VOLUME[i]], satrhog[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "([1]*[2])/[3]\n"

swellg[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Liquid swelling %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", vvol[VOLUME[i]], gammaf[VOLUME[i]], satrhof[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "([1]*[2])/[3]\n"

swellf[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Non-zero vvol %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", CONST1, vvol[VOLUME[i]], TIME

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "%s\n", INITTIME-MAXDT/2.0

nzvvol[VOLUME[i]] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Auxiliary term 1 for thermal expansion plus swelling (vapor) %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s %s %s\n", qwg[VOLUME[i]], nzvvol[VOLUME[i]], qig[VOLUME[i]],\

C-21
gammahig[VOLUME[i]], gammag[VOLUME[i]], hg[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "([1]/[2])+[3]+[4]-([5]*[6])\n"

thswaux1g[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Thermal expansion plus swelling (vapor) %s\n", \

VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s %s\n", pig[VOLUME[i]], thswaux1g[VOLUME[i]], \

gammag[VOLUME[i]], nzrhog[VOLUME[i]], vvol[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "(([1]*[2])+([3]/[4]))*[5]\n"

thswg[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Nq term with q wall (vapor) %s\n", \

VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", qwg[VOLUME[i]], pig[VOLUME[i]], satrhog[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]*[3]\n"

qwtermg[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Nq term with interfacial heat (vapor) %s\n", \

VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", vvol[VOLUME[i]], qig[VOLUME[i]], pig[VOLUME[i]], \

satrhog[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]*[3]*[4]\n"

qitermg[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Nq term with gamma (vapor) %s\n", \

VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s %s %s\n", gammahig[VOLUME[i]], gammag[VOLUME[i]], \

nzrhog[VOLUME[i]], satrhog[VOLUME[i]], \

pig[VOLUME[i]], vvol[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "(([5]*[1])-([2]*((1.0/[3])-(1.0/[4]))))*[6]*[4]\n"

gammtg[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Auxiliary term 1 for thermal expansion plus swelling (liquid) %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s %s %s\n", qwf[VOLUME[i]], nzvvol[VOLUME[i]], qif[VOLUME[i]],\

gammahif[VOLUME[i]], gammaf[VOLUME[i]], hf[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "([1]/[2])+[3]+[4]-([5]*[6])\n"

thswaux1f[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Thermal expansion plus swelling (liquid) %s\n", \

VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s %s\n", pif[VOLUME[i]], thswaux1f[VOLUME[i]], \

gammaf[VOLUME[i]], nzrhof[VOLUME[i]], vvol[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "(([1]*[2])+([3]/[4]))*[5]\n"

thswf[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

C-22
printf "Nq term with q wall (liquid) %s\n", \

VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", qwf[VOLUME[i]], pif[VOLUME[i]], satrhof[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]*[3]\n"

qwtermf[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Nq term with interfacial heat (liquid) %s\n", \

VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", vvol[VOLUME[i]], qif[VOLUME[i]], pif[VOLUME[i]], \

satrhof[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]*[3]*[4]\n"

qitermf[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Nq term with gamma (liquid) %s\n", \

VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s %s %s\n", gammahif[VOLUME[i]], gammaf[VOLUME[i]], \

nzrhof[VOLUME[i]], satrhof[VOLUME[i]], \

pif[VOLUME[i]], vvol[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "(([5]*[1])-([2]*((1.0/[3])-(1.0/[4]))))*[6]*[4]\n"

gammtf[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Vapor thermal expansion %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", thswg[VOLUME[i]], swellg[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]-[2]\n"

thexpg[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Liquid thermal expansion %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", thswf[VOLUME[i]], swellf[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]-[2]\n"

thexpf[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Vapor isentropic compressibility %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s %s %s\n", tempg[VOLUME[i]], p[VOLUME[i]], betagg[VOLUME[i]], \

csubvg[VOLUME[i]], nzrhog[VOLUME[i]], nzcsubpg[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "([1]*[2]*[3]*[3]*[4])/([5]*[6]*([6]-[4]))\n"

compg[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Vapor fraction * isentropic compressibility %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", voidg[VOLUME[i]], compg[VOLUME[i]]

printf "27\n"

printf "*----------\n"

C-23
printf "[1]*[2]\n"

voidcompg[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Time derivative of vapor fraction * isentropic compressibility %s\n", \

VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s\n", voidcompg[VOLUME[i]]

printf "43\n"

printf "*----------\n"

printf "16 1.0\n"

dervoidcompg[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Non zero vapor isentropic compressibility %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", CONST1, compg[VOLUME[i]], compg[VOLUME[i]]

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "1.0e-10\n"

nzcompg[VOLUME[i]] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Liquid isentropic compressibility %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s %s %s\n", tempf[VOLUME[i]], p[VOLUME[i]], betaff[VOLUME[i]], \

csubvf[VOLUME[i]], nzrhof[VOLUME[i]], nzcsubpf[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "([1]*[2]*[3]*[3]*[4])/([5]*[6]*([6]-[4]))\n"

compf[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Liquid fraction * isentropic compressibility %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", voidf[VOLUME[i]], compf[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]\n"

voidcompf[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Time derivative of liquid fraction * isentropic compressibility %s\n", \

VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s\n", voidcompf[VOLUME[i]]

printf "43\n"

printf "*----------\n"

printf "16 1.0\n"

dervoidcompf[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Non zero liquid isentropic compressibility %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", CONST1, compf[VOLUME[i]], compf[VOLUME[i]]

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "1.0e-10\n"

nzcompf[VOLUME[i]] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Vapor isentropic compressibility integrated in the whole node %s\n",

VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", vvol[VOLUME[i]], voidg[VOLUME[i]], compg[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]*[3]\n"

C-24
nodecompg[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Liquid isentropic compressibility integrated in the whole node %s\n",

VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", vvol[VOLUME[i]], voidf[VOLUME[i]], compf[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]*[3]\n"

nodecompf[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Total node compressibility %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", nodecompg[VOLUME[i]], nodecompf[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]+[2]\n"

totnodecomp[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Non zero total node compressibility %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", CONST1, totnodecomp[VOLUME[i]], totnodecomp[VOLUME[i]]

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "1.0e-10\n"

nztotncomp[VOLUME[i]] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Vapor compressibility along the saturation line %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s %s %s %s %s\n", p[VOLUME[i]], satt[VOLUME[i]], satbetagg[VOLUME[i]], \

vfg[VOLUME[i]], hfg[VOLUME[i]], satrhog[VOLUME[i]], \

satcvg[VOLUME[i]], satcpg[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "-1.0*[1]*[2]*[3]*(([4]/[5])+([3]/([6]*([7]-[8))))\n"

satcompg[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Liquid compressibility along the saturation line %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s %s %s %s %s\n", p[VOLUME[i]], satt[VOLUME[i]], satbetaff[VOLUME[i]], \

vfg[VOLUME[i]], hfg[VOLUME[i]], satrhof[VOLUME[i]], \

satcvf[VOLUME[i]], satcpf[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "-1.0*[1]*[2]*[3]*(([4]/[5])+([3]/([6]*([7]-[8))))\n"

satcompf[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Vapor volume %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", voidg[VOLUME[i]], vvol[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]\n"

volg[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Liquid volume %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", voidf[VOLUME[i]], vvol[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]\n"

volf[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

C-25
printf "Time derivative of liquid volume %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s\n", volf[VOLUME[i]]

printf "43\n"

printf "*----------\n"

printf "16 1.0\n"

dvfdt[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Vapor mass %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", volg[VOLUME[i]], rhog[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]\n"

massg[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Liquid mass %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", volf[VOLUME[i]], rhof[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]\n"

massf[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Vapor wall friction %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

# printf "%s %s %s\n", massg[VOLUME[i]], velg[VOLUME[i]], fwalgx[VOLUME[i]]

printf "%s %s %s\n", vvol[VOLUME[i]], velg[VOLUME[i]], fwalgx[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]*[3]\n"

wfricg[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Liquid wall friction %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

# printf "%s %s %s\n", massf[VOLUME[i]], velf[VOLUME[i]], fwalfx[VOLUME[i]]

printf "%s %s %s\n", vvol[VOLUME[i]], velf[VOLUME[i]], fwalfx[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]*[3]\n"

wfricf[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Vapor buoyancy term %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", avol[VOLUME[i]], voidg[VOLUME[i]], rhog[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "%s*%s*[1]*[2]*[3]\n", GRAV, HEIGHT[VOLUME[i]]

buoyg[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Liquid buoyancy term %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", avol[VOLUME[i]], voidf[VOLUME[i]], rhof[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "%s*%s*[1]*[2]*[3]\n", GRAV, HEIGHT[VOLUME[i]]

buoyf[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Vapor non-equilibrium mass %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", volg[VOLUME[i]], satrhog[VOLUME[i]], rhog[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*([2]-[3])\n"

nqmg[VOLUME[i]] = OUTCOUNT++

C-26
printf "***************************************************************** \n"

printf "Liquid non-equilibrium mass %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", volf[VOLUME[i]], satrhof[VOLUME[i]], rhof[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*([2]-[3])\n"

nqmf[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

for(j=1;j<=njuns;j++) {

inletx[j] = ""

outletx[j] = ""

inlety[j] = ""

outlety[j] = ""

inletz[j] = ""

outletz[j] = ""

if(TOVOL[j] == VOLUME[i]) {

if (INOUTFLAGTO[j] == 1) {

inletx[j] = "+"

}

else if(INOUTFLAGTO[j] == 2) {

outletx[j] = "-"

}

else if(INOUTFLAGTO[j] == 3) {

inlety[j] = "+"

}

else if(INOUTFLAGTO[j] == 4) {

outlety[j] = "-"

}

else if(INOUTFLAGTO[j] == 5) {

inletz[j] = "+"

}

else if(INOUTFLAGTO[j] == 6) {

outletz[j] = "-"

}

}

else if(FROMVOL[j] == VOLUME[i]) {

if (INOUTFLAGFROM[j] == 1) {

inletx[j] = "-"

}

else if(INOUTFLAGFROM[j] == 2) {

outletx[j] = "+"

}

else if(INOUTFLAGFROM[j] == 3) {

inlety[j] = "-"

}

else if(INOUTFLAGFROM[j] == 4) {

outlety[j] = "+"

}

else if(INOUTFLAGFROM[j] == 5) {

inletz[j] = "-"

}

else if(INOUTFLAGFROM[j] == 6) {

outletz[j] = "+"

}

}

}

# End of junction loop

printf "Inlet area x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(j=1;j<=njuns;j++) {

if(inletx[j] != "") {

printf "%s ", ajun[JUNCTION[j]]

C-27
}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(j=1;j<=njuns;j++) {

if(inletx[j] != ""){

printf "+[%s]", auxcount++

}

}

printf "\n"

inareax[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet area * voidg x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(j=1;j<=njuns;j++) {

if(inletx[j] != "") {

printf "%s ", avoidg[JUNCTION[j]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(j=1;j<=njuns;j++) {

if(inletx[j] != "") {

printf "+[%s]", auxcount++

}

}

printf "\n"

inavoidgx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet area * voidf x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(j=1;j<=njuns;j++) {

if(inletx[j] != "") {

printf "%s ", avoidf[JUNCTION[j]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(j=1;j<=njuns;j++) {

if(inletx[j] != "") {

printf "+[%s]", auxcount++

}

}

printf "\n"

inavoidfx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet area * voidg * rhog x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(j=1;j<=njuns;j++) {

if(inletx[j] != "") {

printf "%s ", avoidrhog[JUNCTION[j]]

}

}

C-28
printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(j=1;j<=njuns;j++) {

if(inletx[j] != "") {

printf "+[%s]", auxcount++

}

}

printf "\n"

inavoidrhogx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet area * voidf * rhof x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(j=1;j<=njuns;j++) {

if(inletx[j] != "") {

printf "%s ", avoidrhof[JUNCTION[j]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(j=1;j<=njuns;j++) {

if(inletx[j] != "") {

printf "+[%s]", auxcount++

}

}

printf "\n"

inavoidrhofx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet area * voidg * rhog * velg x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(j=1;j<=njuns;j++) {

if(inletx[j] != "") {

printf "%s ", avoidrhovelg[JUNCTION[j]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(j=1;j<=njuns;j++) {

if(inletx[j] != "") {

printf "%s[%s]", inletx[j], auxcount++

}

}

printf "\n"

inavoidrhovelgx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet area * voidf * rhog * velf x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(j=1;j<=njuns;j++) {

if(inletx[j] != "") {

printf "%s ", avoidrhovelf[JUNCTION[j]]

}

}

printf "\n"

printf "27\n"

C-29
printf "*----------\n"

printf "[1]"

auxcount = 2

for(j=1;j<=njuns;j++) {

if(inletx[j] != "") {

printf "%s[%s]", inletx[j], auxcount++

}

}

printf "\n"

inavoidrhovelfx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet area * voidg * pressure x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(j=1;j<=njuns;j++) {

if(inletx[j] != "") {

printf "%s ", avoidpjg[JUNCTION[j]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(j=1;j<=njuns;j++) {

if(inletx[j] != "") {

printf "+[%s]", auxcount++

}

}

printf "\n"

inavoidpjgx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet area * voidf * pressure x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(j=1;j<=njuns;j++) {

if(inletx[j] != "") {

printf "%s ", avoidpjf[JUNCTION[j]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(j=1;j<=njuns;j++) {

if(inletx[j] != "") {

printf "+[%s]", auxcount++

}

}

printf "\n"

inavoidpjfx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet area x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(j=1;j<=njuns;j++) {

if(outletx[j] != "") {

printf "%s ", ajun[JUNCTION[j]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

C-30
auxcount = 2

for(j=1;j<=njuns;j++) {

if(outletx[j] != ""){

printf "+[%s]", auxcount++

}

}

printf "\n"

outareax[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet area * voidg x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(j=1;j<=njuns;j++) {

if(outletx[j] != "") {

printf "%s ", avoidg[JUNCTION[j]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(j=1;j<=njuns;j++) {

if(outletx[j] != "") {

printf "+[%s]", auxcount++

}

}

printf "\n"

outavoidgx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet area * voidf x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(j=1;j<=njuns;j++) {

if(outletx[j] != "") {

printf "%s ", avoidf[JUNCTION[j]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(j=1;j<=njuns;j++) {

if(outletx[j] != "") {

printf "+[%s]", auxcount++

}

}

printf "\n"

outavoidfx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet area * voidg * rhog x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(j=1;j<=njuns;j++) {

if(outletx[j] != "") {

printf "%s ", avoidrhog[JUNCTION[j]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(j=1;j<=njuns;j++) {

C-31
if(outletx[j] != "") {

printf "+[%s]", auxcount++

}

}

printf "\n"

outavoidrhogx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet area * voidf * rhof x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(j=1;j<=njuns;j++) {

if(outletx[j] != "") {

printf "%s ", avoidrhof[JUNCTION[j]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(j=1;j<=njuns;j++) {

if(outletx[j] != "") {

printf "+[%s]", auxcount++

}

}

printf "\n"

outavoidrhofx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet area * voidg * rhog * velg x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(j=1;j<=njuns;j++) {

if(outletx[j] != "") {

printf "%s ", avoidrhovelg[JUNCTION[j]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(j=1;j<=njuns;j++) {

if(outletx[j] != "") {

printf "%s[%s]", outletx[j], auxcount++

}

}

printf "\n"

outavoidrhovelgx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet area * voidf * rhog * velf x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(j=1;j<=njuns;j++) {

if(outletx[j] != "") {

printf "%s ", avoidrhovelf[JUNCTION[j]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(j=1;j<=njuns;j++) {

if(outletx[j] != "") {

printf "%s[%s]", outletx[j], auxcount++

C-32
}

}

printf "\n"

outavoidrhovelfx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet area * voidg * pressure x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(j=1;j<=njuns;j++) {

if(outletx[j] != "") {

printf "%s ", avoidpjg[JUNCTION[j]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(j=1;j<=njuns;j++) {

if(outletx[j] != "") {

printf "+[%s]", auxcount++

}

}

printf "\n"

outavoidpjgx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet area * voidf * pressure x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(j=1;j<=njuns;j++) {

if(outletx[j] != "") {

printf "%s ", avoidpjf[JUNCTION[j]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(j=1;j<=njuns;j++) {

if(outletx[j] != "") {

printf "+[%s]", auxcount++

}

}

printf "\n"

outavoidpjfx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Non zero inlet area x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", CONST1, inareax[VOLUME[i]], inareax[VOLUME[i]]

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "1.0e-10\n"

nzinareax[VOLUME[i]] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Non zero outlet area x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", CONST1, outareax[VOLUME[i]], outareax[VOLUME[i]]

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "1.0e-10\n"

nzoutareax[VOLUME[i]] = OUTCOUNT++

C-33
OUTCOUNT++

printf "***************************************************************** \n"

printf "Vapor fraction at node inlet x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", nzinareax[VOLUME[i]]+1, inavoidgx[VOLUME[i]], \

nzinareax[VOLUME[i]], voidg[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "([1]*[2]/[3])+((1.0-[1])*[4])\n"

invoidgx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Liquid fraction at node inlet x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", nzinareax[VOLUME[i]]+1, inavoidfx[VOLUME[i]], \

nzinareax[VOLUME[i]], voidf[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "([1]*[2]/[3])+((1.0-[1])*[4])\n"

invoidfx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Vapor fraction at node outlet x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", nzoutareax[VOLUME[i]]+1, outavoidgx[VOLUME[i]], \

nzoutareax[VOLUME[i]], voidg[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "([1]*[2]/[3])+((1.0-[1])*[4])\n"

outvoidgx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Liquid fraction at node outlet x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", nzoutareax[VOLUME[i]]+1, outavoidfx[VOLUME[i]], \

nzoutareax[VOLUME[i]], voidf[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "([1]*[2]/[3])+((1.0-[1])*[4])\n"

outvoidfx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Non zero inlet area * voidg x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", CONST1, inavoidgx[VOLUME[i]], inavoidgx[VOLUME[i]]

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "1.0e-10\n"

nzinavoidgx[VOLUME[i]] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Non zero inlet area * voidf x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", CONST1, inavoidfx[VOLUME[i]], inavoidfx[VOLUME[i]]

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "1.0e-10\n"

nzinavoidfx[VOLUME[i]] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Non zero outlet area * voidg x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", CONST1, outavoidgx [VOLUME[i]], outavoidgx [VOLUME[i]]

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "1.0e-10\n"

C-34
nzoutavoidgx [VOLUME[i]] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Non zero outlet area * voidf x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", CONST1, outavoidfx[VOLUME[i]], outavoidfx[VOLUME[i]]

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "1.0e-10\n"

nzoutavoidfx[VOLUME[i]] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Vapor density at node inlet x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", nzinavoidgx[VOLUME[i]]+1, inavoidrhogx[VOLUME[i]], \

nzinavoidgx[VOLUME[i]], rhog[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "([1]*[2]/[3])+((1.0-[1])*[4])\n"

inrhogx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Liquid density at node inlet x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", nzinavoidfx[VOLUME[i]]+1, inavoidrhofx[VOLUME[i]], \

nzinavoidfx[VOLUME[i]], rhof[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "([1]*[2]/[3])+((1.0-[1])*[4])\n"

inrhofx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Vapor density at node outlet x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", nzoutavoidgx[VOLUME[i]]+1, outavoidrhogx[VOLUME[i]], \

nzoutavoidgx[VOLUME[i]], rhog[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "([1]*[2]/[3])+((1.0-[1])*[4])\n"

outrhogx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Liquid density at node outlet x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", nzoutavoidfx[VOLUME[i]]+1, outavoidrhofx[VOLUME[i]], \

nzoutavoidfx[VOLUME[i]], rhof[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "([1]*[2]/[3])+((1.0-[1])*[4])\n"

outrhofx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet mixture density x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s %s\n", nzinareax[VOLUME[i]]+1, inavoidrhogx[VOLUME[i]], \

inavoidrhofx[VOLUME[i]], nzinareax[VOLUME[i]], \

rhomix[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "([1]*([2]+[3])/[4])+((1.0-[1])*[5])\n"

inrhomixx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet mixture density x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s %s\n", nzoutareax [VOLUME[i]]+1, outavoidrhogx [VOLUME[i]], \

outavoidrhofx [VOLUME[i]], nzoutareax [VOLUME[i]], \

rhomix[VOLUME[i]]

printf "27\n"

C-35
printf "*----------\n"

printf "([1]*([2]+[3])/[4])+((1.0-[1])*[5])\n"

outrhomixx [VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet pressure (vapor) x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", nzinavoidgx[VOLUME[i]]+1, inavoidpjgx[VOLUME[i]], \

nzinavoidgx[VOLUME[i]], p[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "([1]*[2]/[3])+((1.0-[1])*[4])\n"

provinpjgx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet pressure (liquid) x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", nzinavoidfx[VOLUME[i]]+1, inavoidpjfx[VOLUME[i]], \

nzinavoidfx[VOLUME[i]], p[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "([1]*[2]/[3])+((1.0-[1])*[4])\n"

provinpjfx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet pressure (vapor) x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", nzoutavoidgx[VOLUME[i]]+1, outavoidpjgx[VOLUME[i]], \

nzoutavoidgx[VOLUME[i]], p[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "([1]*[2]/[3])+((1.0-[1])*[4])\n"

provoutpjgx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet pressure (liquid) x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", nzoutavoidfx[VOLUME[i]]+1, outavoidpjfx[VOLUME[i]], \

nzoutavoidfx[VOLUME[i]], p[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "([1]*[2]/[3])+((1.0-[1])*[4])\n"

provoutpjfx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet area y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(j=1;j<=njuns;j++) {

if(inlety[j] != "") {

printf "%s ", ajun[JUNCTION[j]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(j=1;j<=njuns;j++) {

if(inlety[j] != ""){

printf "+[%s]", auxcount++

}

}

printf "\n"

inareay[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet area * voidg y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

C-36
for(j=1;j<=njuns;j++) {

if(inlety[j] != "") {

printf "%s ", avoidg[JUNCTION[j]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(j=1;j<=njuns;j++) {

if(inlety[j] != "") {

printf "+[%s]", auxcount++

}

}

printf "\n"

inavoidgy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet area * voidf y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(j=1;j<=njuns;j++) {

if(inlety[j] != "") {

printf "%s ", avoidf[JUNCTION[j]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(j=1;j<=njuns;j++) {

if(inlety[j] != "") {

printf "+[%s]", auxcount++

}

}

printf "\n"

inavoidfy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet area * voidg * rhog y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(j=1;j<=njuns;j++) {

if(inlety[j] != "") {

printf "%s ", avoidrhog[JUNCTION[j]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(j=1;j<=njuns;j++) {

if(inlety[j] != "") {

printf "+[%s]", auxcount++

}

}

printf "\n"

inavoidrhogy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet area * voidf * rhof y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(j=1;j<=njuns;j++) {

if(inlety[j] != "") {

C-37
printf "%s ", avoidrhof[JUNCTION[j]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(j=1;j<=njuns;j++) {

if(inlety[j] != "") {

printf "+[%s]", auxcount++

}

}

printf "\n"

inavoidrhofy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet area * voidg * rhog * velg y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(j=1;j<=njuns;j++) {

if(inlety[j] != "") {

printf "%s ", avoidrhovelg[JUNCTION[j]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(j=1;j<=njuns;j++) {

if(inlety[j] != "") {

printf "%s[%s]", inlety[j], auxcount++

}

}

printf "\n"

inavoidrhovelgy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet area * voidf * rhog * velf y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(j=1;j<=njuns;j++) {

if(inlety[j] != "") {

printf "%s ", avoidrhovelf[JUNCTION[j]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(j=1;j<=njuns;j++) {

if(inlety[j] != "") {

printf "%s[%s]", inlety[j], auxcount++

}

}

printf "\n"

inavoidrhovelfy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet area * voidg * pressure y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(j=1;j<=njuns;j++) {

if(inlety[j] != "") {

printf "%s ", avoidpjg[JUNCTION[j]]

}

C-38
}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(j=1;j<=njuns;j++) {

if(inlety[j] != "") {

printf "+[%s]", auxcount++

}

}

printf "\n"

inavoidpjgy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet area * voidf * pressure y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(j=1;j<=njuns;j++) {

if(inlety[j] != "") {

printf "%s ", avoidpjf[JUNCTION[j]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(j=1;j<=njuns;j++) {

if(inlety[j] != "") {

printf "+[%s]", auxcount++

}

}

printf "\n"

inavoidpjfy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet area y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(j=1;j<=njuns;j++) {

if(outlety[j] != "") {

printf "%s ", ajun[JUNCTION[j]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(j=1;j<=njuns;j++) {

if(outlety[j] != ""){

printf "+[%s]", auxcount++

}

}

printf "\n"

outareay[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet area * voidg y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(j=1;j<=njuns;j++) {

if(outlety[j] != "") {

printf "%s ", avoidg[JUNCTION[j]]

}

}

printf "\n"

C-39
printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(j=1;j<=njuns;j++) {

if(outlety[j] != "") {

printf "+[%s]", auxcount++

}

}

printf "\n"

outavoidgy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet area * voidf y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(j=1;j<=njuns;j++) {

if(outlety[j] != "") {

printf "%s ", avoidf[JUNCTION[j]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(j=1;j<=njuns;j++) {

if(outlety[j] != "") {

printf "+[%s]", auxcount++

}

}

printf "\n"

outavoidfy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet area * voidg * rhog y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(j=1;j<=njuns;j++) {

if(outlety[j] != "") {

printf "%s ", avoidrhog[JUNCTION[j]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(j=1;j<=njuns;j++) {

if(outlety[j] != "") {

printf "+[%s]", auxcount++

}

}

printf "\n"

outavoidrhogy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet area * voidf * rhof y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(j=1;j<=njuns;j++) {

if(outlety[j] != "") {

printf "%s ", avoidrhof[JUNCTION[j]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

C-40
printf "[1]"

auxcount = 2

for(j=1;j<=njuns;j++) {

if(outlety[j] != "") {

printf "+[%s]", auxcount++

}

}

printf "\n"

outavoidrhofy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet area * voidg * rhog * velg y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(j=1;j<=njuns;j++) {

if(outlety[j] != "") {

printf "%s ", avoidrhovelg[JUNCTION[j]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(j=1;j<=njuns;j++) {

if(outlety[j] != "") {

printf "%s[%s]", outlety[j], auxcount++

}

}

printf "\n"

outavoidrhovelgy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet area * voidf * rhog * velf y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(j=1;j<=njuns;j++) {

if(outlety[j] != "") {

printf "%s ", avoidrhovelf[JUNCTION[j]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(j=1;j<=njuns;j++) {

if(outlety[j] != "") {

printf "%s[%s]", outlety[j], auxcount++

}

}

printf "\n"

outavoidrhovelfy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet area * voidg * pressure y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(j=1;j<=njuns;j++) {

if(outlety[j] != "") {

printf "%s ", avoidpjg[JUNCTION[j]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

C-41
for(j=1;j<=njuns;j++) {

if(outlety[j] != "") {

printf "+[%s]", auxcount++

}

}

printf "\n"

outavoidpjgy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet area * voidf * pressure y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(j=1;j<=njuns;j++) {

if(outlety[j] != "") {

printf "%s ", avoidpjf[JUNCTION[j]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(j=1;j<=njuns;j++) {

if(outlety[j] != "") {

printf "+[%s]", auxcount++

}

}

printf "\n"

outavoidpjfy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Non zero inlet area y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", CONST1, inareay[VOLUME[i]], inareay[VOLUME[i]]

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "1.0e-10\n"

nzinareay[VOLUME[i]] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Non zero outlet area y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", CONST1, outareay[VOLUME[i]], outareay[VOLUME[i]]

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "1.0e-10\n"

nzoutareay[VOLUME[i]] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Vapor fraction at node inlet y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", nzinareay[VOLUME[i]]+1, inavoidgy[VOLUME[i]], \

nzinareay[VOLUME[i]], voidg[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "([1]*[2]/[3])+((1.0-[1])*[4])\n"

invoidgy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Liquid fraction at node inlet y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", nzinareay[VOLUME[i]]+1, inavoidfy[VOLUME[i]], \

nzinareay[VOLUME[i]], voidf[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "([1]*[2]/[3])+((1.0-[1])*[4])\n"

C-42
invoidfy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Vapor fraction at node outlet y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", nzoutareay[VOLUME[i]]+1, outavoidgy[VOLUME[i]], \

nzoutareay[VOLUME[i]], voidg[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "([1]*[2]/[3])+((1.0-[1])*[4])\n"

outvoidgy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Liquid fraction at node outlet y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", nzoutareay[VOLUME[i]]+1, outavoidfy[VOLUME[i]], \

nzoutareay[VOLUME[i]], voidf[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "([1]*[2]/[3])+((1.0-[1])*[4])\n"

outvoidfy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Non zero inlet area * voidg y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", CONST1, inavoidgy[VOLUME[i]], inavoidgy[VOLUME[i]]

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "1.0e-10\n"

nzinavoidgy[VOLUME[i]] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Non zero inlet area * voidf y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", CONST1, inavoidfy[VOLUME[i]], inavoidfy[VOLUME[i]]

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "1.0e-10\n"

nzinavoidfy[VOLUME[i]] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Non zero outlet area * voidg y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", CONST1, outavoidgy [VOLUME[i]], outavoidgy [VOLUME[i]]

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "1.0e-10\n"

nzoutavoidgy [VOLUME[i]] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Non zero outlet area * voidf y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", CONST1, outavoidfy[VOLUME[i]], outavoidfy[VOLUME[i]]

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "1.0e-10\n"

nzoutavoidfy[VOLUME[i]] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Vapor density at node inlet y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", nzinavoidgy[VOLUME[i]]+1, inavoidrhogy[VOLUME[i]], \

nzinavoidgy[VOLUME[i]], rhog[VOLUME[i]]

printf "27\n"

C-43
printf "*----------\n"

printf "([1]*[2]/[3])+((1.0-[1])*[4])\n"

inrhogy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Liquid density at node inlet y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", nzinavoidfy[VOLUME[i]]+1, inavoidrhofy[VOLUME[i]], \

nzinavoidfy[VOLUME[i]], rhof[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "([1]*[2]/[3])+((1.0-[1])*[4])\n"

inrhofy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Vapor density at node outlet y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", nzoutavoidgy[VOLUME[i]]+1, outavoidrhogy[VOLUME[i]], \

nzoutavoidgy[VOLUME[i]], rhog[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "([1]*[2]/[3])+((1.0-[1])*[4])\n"

outrhogy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Liquid density at node outlet y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", nzoutavoidfy[VOLUME[i]]+1, outavoidrhofy[VOLUME[i]], \

nzoutavoidfy[VOLUME[i]], rhof[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "([1]*[2]/[3])+((1.0-[1])*[4])\n"

outrhofy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet mixture density y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s %s\n", nzinareay[VOLUME[i]]+1, inavoidrhogy[VOLUME[i]], \

inavoidrhofy[VOLUME[i]], nzinareay[VOLUME[i]], \

rhomix[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "([1]*([2]+[3])/[4])+((1.0-[1])*[5])\n"

inrhomixy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet mixture density y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s %s\n", nzoutareay [VOLUME[i]]+1, outavoidrhogy [VOLUME[i]], \

outavoidrhofy [VOLUME[i]], nzoutareay [VOLUME[i]], \

rhomix[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "([1]*([2]+[3])/[4])+((1.0-[1])*[5])\n"

outrhomixy [VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet pressure (vapor) y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", nzinavoidgy[VOLUME[i]]+1, inavoidpjgy[VOLUME[i]], \

nzinavoidgy[VOLUME[i]], p[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "([1]*[2]/[3])+((1.0-[1])*[4])\n"

inpjgy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet pressure (liquid) y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", nzinavoidfy[VOLUME[i]]+1, inavoidpjfy[VOLUME[i]], \

nzinavoidfy[VOLUME[i]], p[VOLUME[i]]

printf "27\n"

C-44
printf "*----------\n"

printf "([1]*[2]/[3])+((1.0-[1])*[4])\n"

inpjfy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet pressure (vapor) y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", nzoutavoidgy[VOLUME[i]]+1, outavoidpjgy[VOLUME[i]], \

nzoutavoidgy[VOLUME[i]], p[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "([1]*[2]/[3])+((1.0-[1])*[4])\n"

outpjgy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet pressure (liquid) y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", nzoutavoidfy[VOLUME[i]]+1, outavoidpjfy[VOLUME[i]], \

nzoutavoidfy[VOLUME[i]], p[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "([1]*[2]/[3])+((1.0-[1])*[4])\n"

outpjfy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet area z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(j=1;j<=njuns;j++) {

if(inletz[j] != "") {

printf "%s ", ajun[JUNCTION[j]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(j=1;j<=njuns;j++) {

if(inletz[j] != ""){

printf "+[%s]", auxcount++

}

}

printf "\n"

inareaz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet area * voidg z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(j=1;j<=njuns;j++) {

if(inletz[j] != "") {

printf "%s ", avoidg[JUNCTION[j]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(j=1;j<=njuns;j++) {

if(inletz[j] != "") {

printf "+[%s]", auxcount++

}

}

printf "\n"

inavoidgz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

C-45
printf "Inlet area * voidf z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(j=1;j<=njuns;j++) {

if(inletz[j] != "") {

printf "%s ", avoidf[JUNCTION[j]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(j=1;j<=njuns;j++) {

if(inletz[j] != "") {

printf "+[%s]", auxcount++

}

}

printf "\n"

inavoidfz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet area * voidg * rhog z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(j=1;j<=njuns;j++) {

if(inletz[j] != "") {

printf "%s ", avoidrhog[JUNCTION[j]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(j=1;j<=njuns;j++) {

if(inletz[j] != "") {

printf "+[%s]", auxcount++

}

}

printf "\n"

inavoidrhogz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet area * voidf * rhof z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(j=1;j<=njuns;j++) {

if(inletz[j] != "") {

printf "%s ", avoidrhof[JUNCTION[j]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(j=1;j<=njuns;j++) {

if(inletz[j] != "") {

printf "+[%s]", auxcount++

}

}

printf "\n"

inavoidrhofz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet area * voidg * rhog * velg z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

C-46
printf "%s ", CONST0

for(j=1;j<=njuns;j++) {

if(inletz[j] != "") {

printf "%s ", avoidrhovelg[JUNCTION[j]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(j=1;j<=njuns;j++) {

if(inletz[j] != "") {

printf "%s[%s]", inletz[j], auxcount++

}

}

printf "\n"

inavoidrhovelgz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet area * voidf * rhog * velf z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(j=1;j<=njuns;j++) {

if(inletz[j] != "") {

printf "%s ", avoidrhovelf[JUNCTION[j]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(j=1;j<=njuns;j++) {

if(inletz[j] != "") {

printf "%s[%s]", inletz[j], auxcount++

}

}

printf "\n"

inavoidrhovelfz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet area * voidg * pressure z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(j=1;j<=njuns;j++) {

if(inletz[j] != "") {

printf "%s ", avoidpjg[JUNCTION[j]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(j=1;j<=njuns;j++) {

if(inletz[j] != "") {

printf "+[%s]", auxcount++

}

}

printf "\n"

inavoidpjgz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet area * voidf * pressure z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(j=1;j<=njuns;j++) {

C-47
if(inletz[j] != "") {

printf "%s ", avoidpjf[JUNCTION[j]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(j=1;j<=njuns;j++) {

if(inletz[j] != "") {

printf "+[%s]", auxcount++

}

}

printf "\n"

inavoidpjfz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet area z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(j=1;j<=njuns;j++) {

if(outletz[j] != "") {

printf "%s ", ajun[JUNCTION[j]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(j=1;j<=njuns;j++) {

if(outletz[j] != ""){

printf "+[%s]", auxcount++

}

}

printf "\n"

outareaz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet area * voidg z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(j=1;j<=njuns;j++) {

if(outletz[j] != "") {

printf "%s ", avoidg[JUNCTION[j]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(j=1;j<=njuns;j++) {

if(outletz[j] != "") {

printf "+[%s]", auxcount++

}

}

printf "\n"

outavoidgz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet area * voidf z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(j=1;j<=njuns;j++) {

if(outletz[j] != "") {

printf "%s ", avoidf[JUNCTION[j]]

C-48
}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(j=1;j<=njuns;j++) {

if(outletz[j] != "") {

printf "+[%s]", auxcount++

}

}

printf "\n"

outavoidfz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet area * voidg * rhog z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(j=1;j<=njuns;j++) {

if(outletz[j] != "") {

printf "%s ", avoidrhog[JUNCTION[j]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(j=1;j<=njuns;j++) {

if(outletz[j] != "") {

printf "+[%s]", auxcount++

}

}

printf "\n"

outavoidrhogz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet area * voidf * rhof z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(j=1;j<=njuns;j++) {

if(outletz[j] != "") {

printf "%s ", avoidrhof[JUNCTION[j]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(j=1;j<=njuns;j++) {

if(outletz[j] != "") {

printf "+[%s]", auxcount++

}

}

printf "\n"

outavoidrhofz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet area * voidg * rhog * velg z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(j=1;j<=njuns;j++) {

if(outletz[j] != "") {

printf "%s ", avoidrhovelg[JUNCTION[j]]

}

}

C-49
printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(j=1;j<=njuns;j++) {

if(outletz[j] != "") {

printf "%s[%s]", outletz[j], auxcount++

}

}

printf "\n"

outavoidrhovelgz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet area * voidf * rhog * velf z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(j=1;j<=njuns;j++) {

if(outletz[j] != "") {

printf "%s ", avoidrhovelf[JUNCTION[j]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(j=1;j<=njuns;j++) {

if(outletz[j] != "") {

printf "+[%s]", auxcount++

}

}

printf "\n"

outavoidrhovelfz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet area * voidg * pressure z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(j=1;j<=njuns;j++) {

if(outletz[j] != "") {

printf "%s ", avoidpjg[JUNCTION[j]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(j=1;j<=njuns;j++) {

if(outletz[j] != "") {

printf "+[%s]", auxcount++

}

}

printf "\n"

outavoidpjgz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet area * voidf * pressure z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(j=1;j<=njuns;j++) {

if(outletz[j] != "") {

printf "%s ", avoidpjf[JUNCTION[j]]

}

}

printf "\n"

printf "27\n"

C-50
printf "*----------\n"

printf "[1]"

auxcount = 2

for(j=1;j<=njuns;j++) {

if(outletz[j] != "") {

printf "+[%s]", auxcount++

}

}

printf "\n"

outavoidpjfz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Non zero inlet area z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", CONST1, inareaz[VOLUME[i]], inareaz[VOLUME[i]]

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "1.0e-10\n"

nzinareaz[VOLUME[i]] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Non zero outlet area z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", CONST1, outareaz[VOLUME[i]], outareaz[VOLUME[i]]

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "1.0e-10\n"

nzoutareaz[VOLUME[i]] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Vapor fraction at node inlet z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", nzinareaz[VOLUME[i]]+1, inavoidgz[VOLUME[i]], \

nzinareaz[VOLUME[i]], voidg[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "([1]*[2]/[3])+((1.0-[1])*[4])\n"

invoidgz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Liquid fraction at node inlet z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", nzinareaz[VOLUME[i]]+1, inavoidfz[VOLUME[i]], \

nzinareaz[VOLUME[i]], voidf[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "([1]*[2]/[3])+((1.0-[1])*[4])\n"

invoidfz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Vapor fraction at node outlet z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", nzoutareaz[VOLUME[i]]+1, outavoidgz[VOLUME[i]], \

nzoutareaz[VOLUME[i]], voidg[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "([1]*[2]/[3])+((1.0-[1])*[4])\n"

outvoidgz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Liquid fraction at node outlet z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", nzoutareaz[VOLUME[i]]+1, outavoidfz[VOLUME[i]], \

nzoutareaz[VOLUME[i]], voidf[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "([1]*[2]/[3])+((1.0-[1])*[4])\n"

C-51
outvoidfz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Non zero inlet area * voidg z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", CONST1, inavoidgz[VOLUME[i]], inavoidgz[VOLUME[i]]

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "1.0e-10\n"

nzinavoidgz[VOLUME[i]] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Non zero inlet area * voidf z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", CONST1, inavoidfz[VOLUME[i]], inavoidfz[VOLUME[i]]

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "1.0e-10\n"

nzinavoidfz[VOLUME[i]] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Non zero outlet area * voidg z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", CONST1, outavoidgz [VOLUME[i]], outavoidgz [VOLUME[i]]

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "1.0e-10\n"

nzoutavoidgz [VOLUME[i]] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Non zero outlet area * voidf z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", CONST1, outavoidfz[VOLUME[i]], outavoidfz[VOLUME[i]]

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "1.0e-10\n"

nzoutavoidfz[VOLUME[i]] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Vapor density at node inlet z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", nzinavoidgz[VOLUME[i]]+1, inavoidrhogz[VOLUME[i]], \

nzinavoidgz[VOLUME[i]], rhog[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "([1]*[2]/[3])+((1.0-[1])*[4])\n"

inrhogz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Liquid density at node inlet z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", nzinavoidfz[VOLUME[i]]+1, inavoidrhofz[VOLUME[i]], \

nzinavoidfz[VOLUME[i]], rhof[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "([1]*[2]/[3])+((1.0-[1])*[4])\n"

inrhofz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Vapor density at node outlet z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", nzoutavoidgz[VOLUME[i]]+1, outavoidrhogz[VOLUME[i]], \

nzoutavoidgz[VOLUME[i]], rhog[VOLUME[i]]

printf "27\n"

C-52
printf "*----------\n"

printf "([1]*[2]/[3])+((1.0-[1])*[4])\n"

outrhogz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Liquid density at node outlet z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", nzoutavoidfz[VOLUME[i]]+1, outavoidrhofz[VOLUME[i]], \

nzoutavoidfz[VOLUME[i]], rhof[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "([1]*[2]/[3])+((1.0-[1])*[4])\n"

outrhofz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet mixture density z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s %s\n", nzinareaz[VOLUME[i]]+1, inavoidrhogz[VOLUME[i]], \

inavoidrhofz[VOLUME[i]], nzinareaz[VOLUME[i]], \

rhomix[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "([1]*([2]+[3])/[4])+((1.0-[1])*[5])\n"

inrhomixz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet mixture density z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s %s\n", nzoutareaz [VOLUME[i]]+1, outavoidrhogz [VOLUME[i]], \

outavoidrhofz [VOLUME[i]], nzoutareaz [VOLUME[i]], \

rhomix[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "([1]*([2]+[3])/[4])+((1.0-[1])*[5])\n"

outrhomixz [VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet pressure (vapor) z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", nzinavoidgz[VOLUME[i]]+1, inavoidpjgz[VOLUME[i]], \

nzinavoidgz[VOLUME[i]], p[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "([1]*[2]/[3])+((1.0-[1])*[4])\n"

inpjgz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet pressure (liquid) z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", nzinavoidfz[VOLUME[i]]+1, inavoidpjfz[VOLUME[i]], \

nzinavoidfz[VOLUME[i]], p[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "([1]*[2]/[3])+((1.0-[1])*[4])\n"

inpjfz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet pressure (vapor) z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", nzoutavoidgz[VOLUME[i]]+1, outavoidpjgz[VOLUME[i]], \

nzoutavoidgz[VOLUME[i]], p[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "([1]*[2]/[3])+((1.0-[1])*[4])\n"

outpjgz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet pressure (liquid) z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", nzoutavoidfz[VOLUME[i]]+1, outavoidpjfz[VOLUME[i]], \

nzoutavoidfz[VOLUME[i]], p[VOLUME[i]]

printf "27\n"

C-53
printf "*----------\n"

printf "([1]*[2]/[3])+((1.0-[1])*[4])\n"

outpjfz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Non-zero inpjgx %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", CONST1, provinpjgx[VOLUME[i]], TIME

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "%s\n", INITTIME-MAXDT/2.0

inpjgx[VOLUME[i]] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Non-zero outpjgx %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", CONST1, provoutpjgx[VOLUME[i]], TIME

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "%s\n", INITTIME-MAXDT/2.0

outpjgx[VOLUME[i]] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "In - out vapor pressure %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", inpjgx[VOLUME[i]], outpjgx[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]-[2]\n"

deltapgx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Non-zero inpjfx %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", CONST1, provinpjfx[VOLUME[i]], TIME

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "%s\n", INITTIME-MAXDT/2.0

inpjfx[VOLUME[i]] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Non-zero outpjfx %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", CONST1, provoutpjfx[VOLUME[i]], TIME

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "%s\n", INITTIME-MAXDT/2.0

outpjfx[VOLUME[i]] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "In - out liquid pressure %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", inpjfx[VOLUME[i]], outpjfx[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]-[2]\n"

deltapfx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Non zero inavoidrhogx %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", CONST1, inavoidrhogx[VOLUME[i]], inavoidrhogx[VOLUME[i]]

printf "14\n"

printf "*----------\n"

C-54
printf "3\n"

printf "1.0e-10\n"

nzinavoidrhogx[VOLUME[i]] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet vapor volumetric flow x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", nzinavoidrhogx[VOLUME[i]]+1, inavoidgx[VOLUME[i]], \

inavoidrhovelgx[VOLUME[i]], nzinavoidrhogx[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]*[3]/[4]\n"

invflowgx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Non zero inavoidrhof x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", CONST1, inavoidrhofx[VOLUME[i]], inavoidrhofx[VOLUME[i]]

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "1.0e-10\n"

nzinavoidrhofx[VOLUME[i]] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet liquid volumetric flow x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", nzinavoidrhofx[VOLUME[i]]+1, inavoidfx[VOLUME[i]], \

inavoidrhovelfx[VOLUME[i]], nzinavoidrhofx[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]*[3]/[4]\n"

invflowfx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Non zero outavoidrhog x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", CONST1, outavoidrhogx[VOLUME[i]], outavoidrhogx[VOLUME[i]]

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "1.0e-10\n"

nzoutavoidrhogx[VOLUME[i]] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet vapor volumetric flow x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", nzoutavoidrhogx [VOLUME[i]]+1, outavoidgx [VOLUME[i]], \

outavoidrhovelgx [VOLUME[i]], nzoutavoidrhogx [VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]*[3]/[4]\n"

outvflowgx [VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Non zero outavoidrhof x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", CONST1, outavoidrhofx[VOLUME[i]], outavoidrhofx[VOLUME[i]]

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "1.0e-10\n"

nzoutavoidrhofx[VOLUME[i]] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet liquid volumetric flow x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", nzoutavoidrhofx[VOLUME[i]]+1, outavoidfx[VOLUME[i]], \

C-55
outavoidrhovelfx[VOLUME[i]], nzoutavoidrhofx[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]*[3]/[4]\n"

outvflowfx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Vapor inlet velocity x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", nzinavoidgx[VOLUME[i]]+1, invflowgx[VOLUME[i]], \

nzinavoidgx[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]/[3]\n"

invelgx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Liquid inlet velocity x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", nzinavoidfx[VOLUME[i]]+1, invflowfx[VOLUME[i]], \

nzinavoidfx[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]/[3]\n"

invelfx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Vapor outlet velocity x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", nzoutavoidgx[VOLUME[i]]+1, outvflowgx[VOLUME[i]], \

nzoutavoidgx[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]/[3]\n"

outvelgx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Liquid outlet velocity x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", nzoutavoidfx[VOLUME[i]]+1, outvflowfx[VOLUME[i]], \

nzoutavoidfx[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]/[3]\n"

outvelfx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Vapor inlet momentum flow x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", inavoidrhovelgx[VOLUME[i]], invelgx[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]\n"

inmomflowgx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Liquid inlet momentum flow x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", inavoidrhovelfx[VOLUME[i]], invelfx[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]\n"

inmomflowfx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet momentum flow x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", inmomflowgx[VOLUME[i]], inmomflowfx[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]+[2]\n"

inmomflowx[VOLUME[i]] = OUTCOUNT++

C-56
printf "***************************************************************** \n"

printf "Inlet slip x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", invelgx[VOLUME[i]], invelfx[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]-[2]\n"

inslipx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet (A * rhog * voidg) * (A * rhof * voidf) x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", inavoidrhogx[VOLUME[i]], inavoidrhofx[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]\n"

inprodavoidrhox[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet non-homogeneous convective term x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", inprodavoidrhox[VOLUME[i]], inslipx[VOLUME[i]],

nzinareax[VOLUME[i]], inrhomixx[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]*[2]/([3]*[4])\n"

innonhmx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Vapor outlet momentum flow x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", outavoidrhovelgx[VOLUME[i]], outvelgx[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]\n"

outmomflowgx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Liquid outlet momentum flow x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", outavoidrhovelfx[VOLUME[i]], outvelfx[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]\n"

outmomflowfx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet momentum flow x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", outmomflowgx[VOLUME[i]], outmomflowfx[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]+[2]\n"

outmomflowx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet slip x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", outvelgx[VOLUME[i]],outvelfx[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]-[2]\n"

outslipx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet (A * rhog * voidg) * (A * rhof * voidf) x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n",outavoidrhogx[VOLUME[i]],outavoidrhofx[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]\n"

outprodavoidrhox[VOLUME[i]] = OUTCOUNT++

C-57
printf "***************************************************************** \n"

printf "Outlet non-homogeneous convective term x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n",outprodavoidrhox[VOLUME[i]],outslipx[VOLUME[i]],

nzinareax[VOLUME[i]],outrhomixx[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]*[2]/([3]*[4])\n"

outnonhmx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Non zero inavoidrhogy %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", CONST1, inavoidrhogy[VOLUME[i]], inavoidrhogy[VOLUME[i]]

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "1.0e-10\n"

nzinavoidrhogy[VOLUME[i]] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet vapor volumetric flow y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", nzinavoidrhogy[VOLUME[i]]+1, inavoidgy[VOLUME[i]], \

inavoidrhovelgy[VOLUME[i]], nzinavoidrhogy[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]*[3]/[4]\n"

invflowgy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Non zero inavoidrhof y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", CONST1, inavoidrhofy[VOLUME[i]], inavoidrhofy[VOLUME[i]]

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "1.0e-10\n"

nzinavoidrhofy[VOLUME[i]] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet liquid volumetric flow y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", nzinavoidrhofy[VOLUME[i]]+1, inavoidfy[VOLUME[i]], \

inavoidrhovelfy[VOLUME[i]], nzinavoidrhofy[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]*[3]/[4]\n"

invflowfy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Non zero outavoidrhog y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", CONST1, outavoidrhogy[VOLUME[i]], outavoidrhogy[VOLUME[i]]

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "1.0e-10\n"

nzoutavoidrhogy[VOLUME[i]] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet vapor volumetric flow y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", nzoutavoidrhogy [VOLUME[i]]+1, outavoidgy [VOLUME[i]], \

outavoidrhovelgy [VOLUME[i]], nzoutavoidrhogy [VOLUME[i]]

C-58
printf "27\n"

printf "*----------\n"

printf "[1]*[2]*[3]/[4]\n"

outvflowgy [VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Non zero outavoidrhof y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", CONST1, outavoidrhofy[VOLUME[i]], outavoidrhofy[VOLUME[i]]

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "1.0e-10\n"

nzoutavoidrhofy[VOLUME[i]] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet liquid volumetric flow y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", nzoutavoidrhofy[VOLUME[i]]+1, outavoidfy[VOLUME[i]], \

outavoidrhovelfy[VOLUME[i]], nzoutavoidrhofy[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]*[3]/[4]\n"

outvflowfy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Vapor inlet velocity y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", nzinavoidgy[VOLUME[i]]+1, invflowgy[VOLUME[i]], \

nzinavoidgy[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]/[3]\n"

invelgy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Liquid inlet velocity y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", nzinavoidfy[VOLUME[i]]+1, invflowfy[VOLUME[i]], \

nzinavoidfy[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]/[3]\n"

invelfy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Vapor outlet velocity y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", nzoutavoidgy[VOLUME[i]]+1, outvflowgy[VOLUME[i]], \

nzoutavoidgy[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]/[3]\n"

outvelgy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Liquid outlet velocity y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", nzoutavoidfy[VOLUME[i]]+1, outvflowfy[VOLUME[i]], \

nzoutavoidfy[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]/[3]\n"

outvelfy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Vapor inlet momentum flow y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", inavoidrhovelgy[VOLUME[i]], invelgy[VOLUME[i]]

printf "27\n"

printf "*----------\n"

C-59
printf "[1]*[2]\n"

inmomflowgy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Liquid inlet momentum flow y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", inavoidrhovelfy[VOLUME[i]], invelfy[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]\n"

inmomflowfy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet momentum flow y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", inmomflowgy[VOLUME[i]], inmomflowfy[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]+[2]\n"

inmomflowy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet slip y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", invelgy[VOLUME[i]], invelfy[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]-[2]\n"

inslipy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet (A * rhog * voidg) * (A * rhof * voidf) y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", inavoidrhogy[VOLUME[i]], inavoidrhofx[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]\n"

inprodavoidrhoy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet non-homogeneous convective term y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", inprodavoidrhoy[VOLUME[i]], inslipy[VOLUME[i]],

nzinareay[VOLUME[i]], inrhomixy[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]*[2]/([3]*[4])\n"

innonhmy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Vapor outlet momentum flow y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", outavoidrhovelgy[VOLUME[i]], outvelgy[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]\n"

outmomflowgy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Liquid outlet momentum flow y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", outavoidrhovelfy[VOLUME[i]], outvelfy[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]\n"

outmomflowfy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet momentum flow y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", outmomflowgy[VOLUME[i]], outmomflowfy[VOLUME[i]]

printf "27\n"

printf "*----------\n"

C-60
printf "[1]+[2]\n"

outmomflowy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet slip y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", outvelgy[VOLUME[i]],outvelfy[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]-[2]\n"

outslipy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet (A * rhog * voidg) * (A * rhof * voidf) y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n",outavoidrhogy[VOLUME[i]],outavoidrhofx[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]\n"

outprodavoidrhoy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet non-homogeneous convective term y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n",outprodavoidrhoy[VOLUME[i]],outslipy[VOLUME[i]],

nzinareay[VOLUME[i]],outrhomixy[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]*[2]/([3]*[4])\n"

outnonhmy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Non zero inavoidrhogz %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", CONST1, inavoidrhogz[VOLUME[i]], inavoidrhogz[VOLUME[i]]

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "1.0e-10\n"

nzinavoidrhogz[VOLUME[i]] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet vapor volumetric flow z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", nzinavoidrhogz[VOLUME[i]]+1, inavoidgz[VOLUME[i]], \

inavoidrhovelgz[VOLUME[i]], nzinavoidrhogz[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]*[3]/[4]\n"

invflowgz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Non zero inavoidrhof z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", CONST1, inavoidrhofz[VOLUME[i]], inavoidrhofz[VOLUME[i]]

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "1.0e-10\n"

nzinavoidrhofz[VOLUME[i]] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet liquid volumetric flow z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", nzinavoidrhofz[VOLUME[i]]+1, inavoidfz[VOLUME[i]], \

inavoidrhovelfz[VOLUME[i]], nzinavoidrhofz[VOLUME[i]]

printf "27\n"

printf "*----------\n"

C-61
printf "[1]*[2]*[3]/[4]\n"

invflowfz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Non zero outavoidrhog z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", CONST1, outavoidrhogz[VOLUME[i]], outavoidrhogz[VOLUME[i]]

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "1.0e-10\n"

nzoutavoidrhogz[VOLUME[i]] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet vapor volumetric flow z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", nzoutavoidrhogz [VOLUME[i]]+1, outavoidgz [VOLUME[i]], \

outavoidrhovelgz [VOLUME[i]], nzoutavoidrhogz [VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]*[3]/[4]\n"

outvflowgz [VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Non zero outavoidrhof z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", CONST1, outavoidrhofz[VOLUME[i]], outavoidrhofz[VOLUME[i]]

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "1.0e-10\n"

nzoutavoidrhofz[VOLUME[i]] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet liquid volumetric flow z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", nzoutavoidrhofz[VOLUME[i]]+1, outavoidfz[VOLUME[i]], \

outavoidrhovelfz[VOLUME[i]], nzoutavoidrhofz[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]*[3]/[4]\n"

outvflowfz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Vapor inlet velocity y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", nzinavoidgz[VOLUME[i]]+1, invflowgz[VOLUME[i]], \

nzinavoidgz[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]/[3]\n"

invelgz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Liquid inlet velocity z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", nzinavoidfz[VOLUME[i]]+1, invflowfz[VOLUME[i]], \

nzinavoidfz[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]/[3]\n"

invelfz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Vapor outlet velocity z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", nzoutavoidgz[VOLUME[i]]+1, outvflowgz[VOLUME[i]], \

nzoutavoidgz[VOLUME[i]]

printf "27\n"

printf "*----------\n"

C-62
printf "[1]*[2]/[3]\n"

outvelgz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Liquid outlet velocity z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", nzoutavoidfz[VOLUME[i]]+1, outvflowfz[VOLUME[i]], \

nzoutavoidfz[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]/[3]\n"

outvelfz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Vapor inlet momentum flow z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", inavoidrhovelgz[VOLUME[i]], invelgz[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]\n"

inmomflowgz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Liquid inlet momentum flow z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", inavoidrhovelfz[VOLUME[i]], invelfz[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]\n"

inmomflowfz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet momentum flow z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", inmomflowgz[VOLUME[i]], inmomflowfz[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]+[2]\n"

inmomflowz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet slip z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", invelgz[VOLUME[i]], invelfz[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]-[2]\n"

inslipz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet (A * rhog * voidg) * (A * rhof * voidf) z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", inavoidrhogz[VOLUME[i]], inavoidrhofx[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]\n"

inprodavoidrhoz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet non-homogeneous convective term z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", inprodavoidrhoz[VOLUME[i]], inslipz[VOLUME[i]],

nzinareaz[VOLUME[i]], inrhomixz[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]*[2]/([3]*[4])\n"

innonhmz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Vapor outlet momentum flow z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", outavoidrhovelgz[VOLUME[i]], outvelgz[VOLUME[i]]

printf "27\n"

C-63
printf "*----------\n"

printf "[1]*[2]\n"

outmomflowgz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Liquid outlet momentum flow z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", outavoidrhovelfz[VOLUME[i]], outvelfz[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]\n"

outmomflowfz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet momentum flow z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", outmomflowgz[VOLUME[i]], outmomflowfz[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]+[2]\n"

outmomflowz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet slip z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", outvelgz[VOLUME[i]], outvelfz[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]-[2]\n"

outslipz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet (A * rhog * voidg) * (A * rhof * voidf) z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", outavoidrhogz[VOLUME[i]], outavoidrhofx[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]\n"

outprodavoidrhoz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet non-homogeneous convective term z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n",outprodavoidrhoz[VOLUME[i]],outslipz[VOLUME[i]],

nzinareaz[VOLUME[i]],outrhomixz[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]*[2]/([3]*[4])\n"

outnonhmz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "In -out mixture momentum flow %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s %s %s\n", inmomflowx[VOLUME[i]], inmomflowy[VOLUME[i]],

inmomflowz[VOLUME[i]], outmomflowx[VOLUME[i]],

outmomflowy[VOLUME[i]], outmomflowz[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "([1]+[2]+[3])-([4]+[5]+[6])\n"

mommixconv[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "In - out non homogeneous convective term %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s %s %s\n", innonhmx[VOLUME[i]], innonhmy[VOLUME[i]],

innonhmz[VOLUME[i]], outnonhmx[VOLUME[i]],

outnonhmy[VOLUME[i]], outnonhmz[VOLUME[i]]

printf "27\n"

C-64
printf "*----------\n"

printf "([1]+[2]+[3])-([4]+[5]+[6])\n"

nonhmconv[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Pressure drop in volume %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s %s %s %s %s\n", wfricg[VOLUME[i]], wfricf[VOLUME[i]],

buoyg[VOLUME[i]], buoyf[VOLUME[i]],

mommixconv[VOLUME[i]], nonhmconv[VOLUME[i]],

dermommix[VOLUME[i]], avol[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "([1]+[2]+[3]+[4]-[5]-[6]+[7])/[8]\n"

deltap[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet pressure in volume %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", p[VOLUME[i]], deltap[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]+0.5*[2]\n"

inp[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet pressure in volume %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", p[VOLUME[i]], deltap[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]-0.5*[2]\n"

outp[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Vapor acoustic term %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s %s %s\n", avol[VOLUME[i]], voidg[VOLUME[i]], \

compg[VOLUME[i]], velg[VOLUME[i]], \

inpjgx[VOLUME[i]], outpjgx[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]*[3]*[4]*LN([5]/[6])\n"

acg[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Liquid acoustic term %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s %s %s\n", avol[VOLUME[i]], voidf[VOLUME[i]], \

compf[VOLUME[i]], velf[VOLUME[i]], \

inpjfx[VOLUME[i]], outpjfx[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]*[3]*[4]*LN([5]/[6])\n"

acf[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

# printf "Inlet mixture velocity x %s\n", VOLUME[i]

# printf "%s\n", OUTCOUNT

# printf "%s %s %s %s %s %s %s\n", invoidgx[VOLUME[i]], inrhogx[VOLUME[i]], \

# invelgx[VOLUME[i]], invoidfx[VOLUME[i]], \

# inrhofx[VOLUME[i]], invelfx[VOLUME[i]], \

# inrhomixx[VOLUME[i]]

# printf "27\n"

# printf "*----------\n"

# printf "([1]*[2]*[3]+[4]*[5]*[6])/[7]\n"

# inmixvelx[VOLUME[i]] = OUTCOUNT++

# printf "***************************************************************** \n"

# printf "Outlet mixture velocity x %s\n", VOLUME[i]

C-65
# printf "%s\n", OUTCOUNT

# printf "%s %s %s %s %s %s %s\n", outvoidgx[VOLUME[i]], outrhogx[VOLUME[i]], \

# outvelgx[VOLUME[i]], outvoidfx[VOLUME[i]], \

# outrhofx[VOLUME[i]], outvelfx[VOLUME[i]], \

# outrhomixx[VOLUME[i]]

# printf "27\n"

# printf "*----------\n"

# printf "([1]*[2]*[3]+[4]*[5]*[6])/[7]\n"

# outmixvelx[VOLUME[i]] = OUTCOUNT++

# printf "***************************************************************** \n"

printf "Volumetric flow in - volumetric flow out (vapor) %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s %s %s\n", invflowgx[VOLUME[i]], invflowgy[VOLUME[i]], \

invflowgz[VOLUME[i]], outvflowgx[VOLUME[i]], \

outvflowgy[VOLUME[i]], outvflowgz[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]+[2]+[3]-[4]-[5]-[6]\n"

jtermg[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Volumetric flow in - volumetric flow out (liquid) %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s %s %s\n", invflowfx[VOLUME[i]], invflowfy[VOLUME[i]], \

invflowfz[VOLUME[i]], outvflowfx[VOLUME[i]], \

outvflowfy[VOLUME[i]], outvflowfz[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]+[2]+[3]-[4]-[5]-[6]\n"

jtermf[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Volumetric term + thermal exp. + swelling (vapor) %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", jtermg[VOLUME[i]], thswg[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]+[2]\n"

jthswg[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Volumetric term + thermal exp. + swelling (liquid) %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", jtermf[VOLUME[i]], thswf[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]+[2]\n"

jthswf[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Vol. term + thermal exp. + swelling + ac. term (vapor) %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", jthswg[VOLUME[i]], acg[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]+[2]\n"

jthswacg[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Vol. term + thermal exp. + swelling + ac. term (liquid) %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", jthswf[VOLUME[i]], acf[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]+[2]\n"

jthswacf[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Non filtered postprocessed time derivative of ln p %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", jthswacg[VOLUME[i]], jthswacf[VOLUME[i]], \

C-66
nztotncomp[VOLUME[i]], nztotncomp[VOLUME[i]]+1

printf "27\n"

printf "*----------\n"

printf "[4]*([1]+[2])/[3]\n"

nfpostdlnpdt[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Non-zero pressure in node %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", CONST1, p[VOLUME[i]], TIME

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "%s\n", INITTIME-MAXDT/2.0

nzp[VOLUME[i]] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "ln pressure in node %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s\n", nzp[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "LN[1]\n"

lnp[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Non-zero avol in volume %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", CONST1, avol[VOLUME[i]], TIME

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "%s\n", INITTIME-MAXDT/2.0

nzavol[VOLUME[i]] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Second term of vapor acoustic term in volume %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", dervoidcompg[VOLUME[i]], vvol[VOLUME[i]], nzavol[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]/[3]\n"

ac2g[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Second term of liquid acoustic term in volume %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", dervoidcompf[VOLUME[i]], vvol[VOLUME[i]], nzavol[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]/[3]\n"

ac2f[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "First term of vapor acoustic term in volume %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", lnp[VOLUME[i]], ac2g[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]\n"

ac1g[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "First term of vapor acoustic term in volume %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", lnp[VOLUME[i]], ac2f[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]\n"

ac1f[VOLUME[i]] = OUTCOUNT++

C-67
printf "***************************************************************** \n"

printf "Time derivative of ln p in node %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s\n", lnp[VOLUME[i]]

printf "43\n"

printf "*----------\n"

printf "16 1.0\n"

dlnpdt[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Non filtered post. time derivative of liquid volume %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", jthswacf[VOLUME[i]], \

nodecompf[VOLUME[i]], nfpostdlnpdt[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]-([2]*[3])\n"

nfpostdvfdt[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Postprocessed time derivative of vapor mass %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s %s %s %s %s\n", inavoidrhovelgx[VOLUME[i]], \

inavoidrhovelgy[VOLUME[i]], \

inavoidrhovelgz[VOLUME[i]], \

outavoidrhovelgx[VOLUME[i]], \

outavoidrhovelgy[VOLUME[i]], \

outavoidrhovelgz[VOLUME[i]], \

vvol[VOLUME[i]], gammag[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]+[2]+[3]-[4]-[5]-[6]+([7]*[8])\n"

nfpostdmgdt[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Time derivative of vapor mass %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s\n", massg[VOLUME[i]]

printf "43\n"

printf "*----------\n"

printf "16 1.0\n"

dmgdt[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Postprocessed time derivative of liquid mass %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s %s %s %s %s\n", inavoidrhovelfx[VOLUME[i]], \

inavoidrhovelfy[VOLUME[i]], \

inavoidrhovelfz[VOLUME[i]], \

outavoidrhovelfx[VOLUME[i]], \

outavoidrhovelfy[VOLUME[i]], \

outavoidrhovelfz[VOLUME[i]], \

vvol[VOLUME[i]], gammaf[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]+[2]+[3]-[4]-[5]-[6]+([7]*[8])\n"

nfpostdmfdt[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Time derivative of liquid mass %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s\n", massf[VOLUME[i]]

printf "43\n"

printf "*----------\n"

printf "16 1.0\n"

dmfdt[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Density of saturated vapor at node inlet x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", inpjgx[VOLUME[i]], CONST1

C-68
printf "62\n"

printf "*----------\n"

printf "P x\n"

printf "rhog\n"

insatrhogx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Density of saturated liquid at node inlet x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", inpjfx[VOLUME[i]], CONST0

printf "62\n"

printf "*----------\n"

printf "P x\n"

printf "rhof\n"

insatrhofx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Density of saturated vapor at node outlet x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", outpjgx[VOLUME[i]], CONST1

printf "62\n"

printf "*----------\n"

printf "P x\n"

printf "rhog\n"

outsatrhogx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Density of saturated liquid at node outlet x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", outpjfx[VOLUME[i]], CONST0

printf "62\n"

printf "*----------\n"

printf "P x\n"

printf "rhof\n"

outsatrhofx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Density of saturated vapor at node inlet y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", inpjgy[VOLUME[i]], CONST1

printf "62\n"

printf "*----------\n"

printf "P x\n"

printf "rhog\n"

insatrhogy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Density of saturated liquid at node inlet y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", inpjfy[VOLUME[i]], CONST0

printf "62\n"

printf "*----------\n"

printf "P x\n"

printf "rhof\n"

insatrhofy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Density of saturated vapor at node outlet y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", outpjgy[VOLUME[i]], CONST1

printf "62\n"

printf "*----------\n"

printf "P x\n"

printf "rhog\n"

outsatrhogy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Density of saturated liquid at node outlet y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", outpjfy[VOLUME[i]], CONST0

printf "62\n"

printf "*----------\n"

C-69
printf "P x\n"

printf "rhof\n"

outsatrhofy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Density of saturated vapor at node inlet z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", inpjgz[VOLUME[i]], CONST1

printf "62\n"

printf "*----------\n"

printf "P x\n"

printf "rhog\n"

insatrhogz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Density of saturated liquid at node inlet z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", inpjfz[VOLUME[i]], CONST0

printf "62\n"

printf "*----------\n"

printf "P x\n"

printf "rhof\n"

insatrhofz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Density of saturated vapor at node outlet z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", outpjgz[VOLUME[i]], CONST1

printf "62\n"

printf "*----------\n"

printf "P x\n"

printf "rhog\n"

outsatrhogz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Density of saturated liquid at node outlet z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", outpjfz[VOLUME[i]], CONST0

printf "62\n"

printf "*----------\n"

printf "P x\n"

printf "rhof\n"

outsatrhofz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Vapor equilibrium thermal expansion * -1 %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s %s\n", satcompg[VOLUME[i]], nzcompg[VOLUME[i]], \

jthswg[VOLUME[i]], nfpostdvfdt[VOLUME[i]], \

nzcompg[VOLUME[i]]+1

printf "27\n"

printf "*----------\n"

printf "[5]*([1]-[2])*([3]+[4])/[2]\n"

eqthexpg[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Liquid equilibrium thermal expansion * -1 %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s %s\n", satcompf[VOLUME[i]], nzcompf[VOLUME[i]], \

jthswf[VOLUME[i]], nfpostdvfdt[VOLUME[i]], \

nzcompf[VOLUME[i]]+1

printf "27\n"

printf "*----------\n"

printf "[5]*([1]-[2])*([3]-[4])/[2]\n"

eqthexpf[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet saturated mass flow for vapor phase x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", invflowgx[VOLUME[i]], insatrhogx[VOLUME[i]]

printf "27\n"

printf "*----------\n"

C-70
printf "[1]*[2]\n"

insatmflowgx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet saturated mass flow for liquid phase x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", invflowfx[VOLUME[i]], insatrhofx[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]\n"

insatmflowfx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet saturated mass flow for vapor phase x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", outvflowgx[VOLUME[i]], outsatrhogx[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]\n"

outsatmflowgx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet saturated mass flow for liquid phase x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", outvflowfx[VOLUME[i]], outsatrhofx[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]\n"

outsatmflowfx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet non-equilibrium mass flow for vapor phase x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", insatmflowgx[VOLUME[i]], inavoidrhovelgx[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]-[2]\n"

innqmflowgx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet non-equilibrium mass flow for liquid phase x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", insatmflowfx[VOLUME[i]], inavoidrhovelfx[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]-[2]\n"

innqmflowfx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet non-equilibrium mass flow for vapor phase x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", outsatmflowgx[VOLUME[i]], outavoidrhovelgx[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]-[2]\n"

outnqmflowgx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet non-equilibrium mass flow for liquid phase x %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", outsatmflowfx[VOLUME[i]], outavoidrhovelfx[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]-[2]\n"

outnqmflowfx[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet saturated mass flow for vapor phase y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", invflowgy[VOLUME[i]], insatrhogy[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]\n"

C-71
insatmflowgy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet saturated mass flow for liquid phase y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", invflowfy[VOLUME[i]], insatrhofy[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]\n"

insatmflowfy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet saturated mass flow for vapor phase y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", outvflowgy[VOLUME[i]], outsatrhogy[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]\n"

outsatmflowgy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet saturated mass flow for liquid phase y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", outvflowfy[VOLUME[i]], outsatrhofy[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]\n"

outsatmflowfy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet non-equilibrium mass flow for vapor phase y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", insatmflowgy[VOLUME[i]], inavoidrhovelgy[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]-[2]\n"

innqmflowgy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet non-equilibrium mass flow for liquid phase y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", insatmflowfy[VOLUME[i]], inavoidrhovelfy[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]-[2]\n"

innqmflowfy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet non-equilibrium mass flow for vapor phase y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", outsatmflowgy[VOLUME[i]], outavoidrhovelgy[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]-[2]\n"

outnqmflowgy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet non-equilibrium mass flow for liquid phase y %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", outsatmflowfy[VOLUME[i]], outavoidrhovelfy[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]-[2]\n"

outnqmflowfy[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet saturated mass flow for vapor phase z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", invflowgz[VOLUME[i]], insatrhogz[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]\n"

insatmflowgz[VOLUME[i]] = OUTCOUNT++

C-72
printf "***************************************************************** \n"

printf "Inlet saturated mass flow for liquid phase z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", invflowfz[VOLUME[i]], insatrhofz[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]\n"

insatmflowfz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet saturated mass flow for vapor phase z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", outvflowgz[VOLUME[i]], outsatrhogz[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]\n"

outsatmflowgz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet saturated mass flow for liquid phase z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", outvflowfz[VOLUME[i]], outsatrhofz[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]\n"

outsatmflowfz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet non-equilibrium mass flow for vapor phase z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", insatmflowgz[VOLUME[i]], inavoidrhovelgz[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]-[2]\n"

innqmflowgz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet non-equilibrium mass flow for liquid phase z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", insatmflowfz[VOLUME[i]], inavoidrhovelfz[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]-[2]\n"

innqmflowfz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet non-equilibrium mass flow for vapor phase z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", outsatmflowgz[VOLUME[i]], outavoidrhovelgz[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]-[2]\n"

outnqmflowgz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet non-equilibrium mass flow for liquid phase z %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", outsatmflowfz[VOLUME[i]], outavoidrhovelfz[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]-[2]\n"

outnqmflowfz[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet mass flow for vapor phase %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", inavoidrhovelgx[VOLUME[i]], inavoidrhovelgy[VOLUME[i]], \

inavoidrhovelgz[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]+[2]+[3]\n"

inmflowg[VOLUME[i]] = OUTCOUNT++

C-73
printf "***************************************************************** \n"

printf "Outlet mass flow for vapor phase %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", outavoidrhovelgx[VOLUME[i]], outavoidrhovelgy[VOLUME[i]], \

outavoidrhovelgz[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]+[2]+[3]\n"

outmflowg[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet mass flow for liquid phase %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", inavoidrhovelfx[VOLUME[i]], inavoidrhovelfy[VOLUME[i]], \

inavoidrhovelfz[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]+[2]+[3]\n"

inmflowf[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet mass flow for liquid phase %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", outavoidrhovelfx[VOLUME[i]], outavoidrhovelfy[VOLUME[i]], \

outavoidrhovelfz[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]+[2]+[3]\n"

outmflowf[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet non-equilibrium mass flow for vapor phase %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", innqmflowgx[VOLUME[i]], innqmflowgy[VOLUME[i]], \

innqmflowgz[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]+[2]+[3]\n"

innqmflowg[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet non-equilibrium mass flow for vapor phase %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", outnqmflowgx[VOLUME[i]], outnqmflowgy[VOLUME[i]], \

outnqmflowgz[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]+[2]+[3]\n"

outnqmflowg[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet non-equilibrium mass flow for liquid phase %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", innqmflowfx[VOLUME[i]], innqmflowfy[VOLUME[i]], \

innqmflowfz[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]+[2]+[3]\n"

innqmflowf[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet non-equilibrium mass flow for liquid phase %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", outnqmflowfx[VOLUME[i]], outnqmflowfy[VOLUME[i]], \

outnqmflowfz[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]+[2]+[3]\n"

outnqmflowf[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Vapor non-equilibrium thermal expansion %s\n", VOLUME[i]

C-74
printf "%s\n", OUTCOUNT

printf "%s %s %s\n", satrhog[VOLUME[i]], thexpg[VOLUME[i]], eqthexpg[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*([2]+[3])\n"

nqthexpg[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Liquid non-equilibrium thermal expansion %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", satrhof[VOLUME[i]], thexpf[VOLUME[i]], eqthexpf[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*([2]+[3])\n"

nqthexpf[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Postprocessed time derivative of vapor non-equilibrium mass %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s %s %s %s\n", innqmflowgx[VOLUME[i]], innqmflowgy[VOLUME[i]], \

innqmflowgz[VOLUME[i]], outnqmflowgx[VOLUME[i]], \

outnqmflowgy[VOLUME[i]], outnqmflowgz[VOLUME[i]], \

nqthexpg[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[7]+[1]+[2]+[3]-[4]-[5]-[6]\n"

nfpostdnqmgdt[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Postprocessed time derivative of liquid non-equilibrium mass %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s %s %s %s\n", innqmflowfx[VOLUME[i]], innqmflowfy[VOLUME[i]], \

innqmflowfz[VOLUME[i]], outnqmflowfx[VOLUME[i]], \

outnqmflowfy[VOLUME[i]], outnqmflowfz[VOLUME[i]], \

nqthexpf[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[7]+[1]+[2]+[3]-[4]-[5]-[6]\n"

nfpostdnqmfdt[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Time derivative of vapor non-equilibrium mass %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s\n", nqmg[VOLUME[i]]

printf "43\n"

printf "*----------\n"

printf "16 1.0\n"

dnqmgdt[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Time derivative of liquid non-equilibrium mass %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s\n", nqmf[VOLUME[i]]

printf "43\n"

printf "*----------\n"

printf "16 1.0\n"

dnqmfdt[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Initial value of postlnp %s\n", VOLUME[i]

printf "%s 0 2\n", OUTCOUNT

printf "%s %s %s\n", OUTCOUNT, lnp[VOLUME[i]], PULSETIME

printf "14 0 0.0 0.0\n"

printf "*----------\n"

printf "3\n"

printf "0.5\n"

initlnp[VOLUME[i]] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Postprocessed time derivative of ln p %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

C-75
printf "%s %s\n", STEPTIME, nfpostdlnpdt[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]\n"

postdlnpdt[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Integral of postdlnpdt %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s\n", postdlnpdt[VOLUME[i]]

printf "1 0 0.0\n"

printf "*----------\n"

printf "0 0\n"

printf "1.0e+10 -1.0e+10 0.0\n"

intdlnpdt[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Postprocessed ln p %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", initlnp[VOLUME[i]], intdlnpdt[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]+[2]\n"

postlnp[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Initial value of postvf %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", OUTCOUNT, volf[VOLUME[i]], PULSETIME

printf "14 0 0.0 0.0\n"

printf "*----------\n"

printf "3\n"

printf "0.5\n"

initvf[VOLUME[i]] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Postprocessed time derivative of liquid volume %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", STEPTIME, nfpostdvfdt[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]\n"

postdvfdt[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Integral of postdvfdt %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s\n", postdvfdt[VOLUME[i]]

printf "1 0 0.0\n"

printf "*----------\n"

printf "0 0\n"

printf "1.0e+10 -1.0e+10 0.0\n"

intdvfdt[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Postprocessed liquid volume %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", initvf[VOLUME[i]], intdvfdt[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]+[2]\n"

postvf[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Initial value of vapor mass %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", OUTCOUNT, massg[VOLUME[i]], PULSETIME

printf "14 0 0.0 0.0\n"

printf "*----------\n"

printf "3\n"

printf "0.5\n"

C-76
initmg[VOLUME[i]] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Postprocessed time derivative of vapor mass %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", STEPTIME, nfpostdmgdt[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]\n"

postdmgdt[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Integral of postdmgdt %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s\n", postdmgdt[VOLUME[i]]

printf "1 0 0.0\n"

printf "*----------\n"

printf "0 0\n"

printf "1.0e+10 -1.0e+10 0.0\n"

intdmgdt[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Postprocessed vapor mass %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", initmg[VOLUME[i]], intdmgdt[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]+[2]\n"

postmg[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Initial value of liquid mass %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", OUTCOUNT, massf[VOLUME[i]], PULSETIME

printf "14 0 0.0 0.0\n"

printf "*----------\n"

printf "3\n"

printf "0.5\n"

initmf[VOLUME[i]] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Postprocessed time derivative of liquid mass %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", STEPTIME, nfpostdmfdt[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]\n"

postdmfdt[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Integral of postdmfdt %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s\n", postdmfdt[VOLUME[i]]

printf "1 0 0.0\n"

printf "*----------\n"

printf "0 0\n"

printf "1.0e+10 -1.0e+10 0.0\n"

intdmfdt[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Postprocessed liquid mass %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", initmf[VOLUME[i]], intdmfdt[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]+[2]\n"

postmf[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Initial value of non equilibrium vapor mass %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

C-77
printf "%s %s %s\n", OUTCOUNT, nqmg[VOLUME[i]], PULSETIME

printf "14 0 0.0 0.0\n"

printf "*----------\n"

printf "3\n"

printf "0.5\n"

initnqmg[VOLUME[i]] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Postprocessed time derivative of non equilibrium vapor mass %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", STEPTIME, nfpostdnqmgdt[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]\n"

postdnqmgdt[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Integral of postdnqmgdt %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s\n", postdnqmgdt[VOLUME[i]]

printf "1 0 0.0\n"

printf "*----------\n"

printf "0 0\n"

printf "1.0e+10 -1.0e+10 0.0\n"

intdnqmgdt[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Postprocessed non equilibrium vapor mass %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", initnqmg[VOLUME[i]], intdnqmgdt[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]+[2]\n"

postnqmg[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Initial value of non equilibrium liquid mass %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", OUTCOUNT, nqmf[VOLUME[i]], PULSETIME

printf "14 0 0.0 0.0\n"

printf "*----------\n"

printf "3\n"

printf "0.5\n"

initnqmf[VOLUME[i]] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Post. time derivative of non equilibrium liquid mass %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", STEPTIME, nfpostdnqmfdt[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]\n"

postdnqmfdt[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Integral of postdnqmfdt %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s\n", postdnqmfdt[VOLUME[i]]

printf "1 0 0.0\n"

printf "*----------\n"

printf "0 0\n"

printf "1.0e+10 -1.0e+10 0.0\n"

intdnqmfdt[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Postprocessed non equilibrium liquid mass %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s\n", initnqmf[VOLUME[i]], intdnqmfdt[VOLUME[i]]

printf "27\n"

printf "*----------\n"

C-78
printf "[1]+[2]\n"

postnqmf[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Term with gamma bulk in the non-eq vapor mass equation %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s %s %s %s %s\n", hstarg[VOLUME[i]]+1, vvol[VOLUME[i]], \

gammai[VOLUME[i]], pig[VOLUME[i]], \

hstarg[VOLUME[i]], hg[VOLUME[i]], \

rhog[VOLUME[i]], satrhog[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]*[3]*[8]*([4]*([5]-[6])+(1.0/[7])-(1.0/[8]))\n"

nqgammaitg[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Term with gamma bulk in the non-eq liquid mass equation %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s %s %s %s %s\n", hstarf[VOLUME[i]]+1, vvol[VOLUME[i]], \

gammai[VOLUME[i]], pif[VOLUME[i]], \

hstarf[VOLUME[i]], hf[VOLUME[i]], \

rhof[VOLUME[i]], satrhof[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "([1]-1.0)*[2]*[3]*[8]*([4]*([5]-[6])+(1.0/[7])-(1.0/[8]))\n"

nqgammaitf[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Term with gamma wall in the non-eq vapor mass equation %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s %s %s %s %s\n", hprimeg[VOLUME[i]]+1, vvol[VOLUME[i]], \

gammaw[VOLUME[i]], pig[VOLUME[i]], \

hprimeg[VOLUME[i]], hg[VOLUME[i]], \

rhog[VOLUME[i]], satrhog[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]*[3]*[8]*([4]*([5]-[6])+(1.0/[7])-(1.0/[8]))\n"

nqgammawtg[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Term with gamma wall in the non-eq liquid mass equation %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s %s %s %s %s\n", hprimef[VOLUME[i]]+1, vvol[VOLUME[i]], \

gammaw[VOLUME[i]], pif[VOLUME[i]], \

hprimef[VOLUME[i]], hf[VOLUME[i]], \

rhof[VOLUME[i]], satrhof[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "([1]-1.0)*[2]*[3]*[8]*([4]*([5]-[6])+(1.0/[7])-(1.0/[8]))\n"

nqgammawtf[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Approximated interfacial heat in the bulk (vapor) %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s %s\n", hstarg[VOLUME[i]]+1, satrhog[VOLUME[i]], \

rhog[VOLUME[i]], hig[VOLUME[i]], \

betagg[VOLUME[i]]

printf "27\n"

printf "*----------\n"

printf "[1]*([3]-[2])*[4]/([3]*[5])\n"

appqibg[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Approximated interfacial heat in the bulk (liquid) %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s %s\n", hstarf[VOLUME[i]]+1, satrhof[VOLUME[i]], \

rhof[VOLUME[i]], hif[VOLUME[i]], \

betaff[VOLUME[i]]

printf "27\n"

printf "*----------\n"

C-79
printf "([1]-1.0)*([2]-[3])*[4]/([3]*[5])\n"

appqibf[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "OUTPUT FILE VOLUME %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s %s %s %s %s %s %s %s %s ", \

lnp[VOLUME[i]], postlnp[VOLUME[i]], \

volf[VOLUME[i]], postvf[VOLUME[i]], \

massg[VOLUME[i]], postmg[VOLUME[i]], \

massf[VOLUME[i]], postmf[VOLUME[i]], \

nqmg[VOLUME[i]], postnqmg[VOLUME[i]], \

nqmf[VOLUME[i]], postnqmf[VOLUME[i]]

printf "\n"

printf "38\n"

printf "*----------\n"

printf "%s_%s.dat\n", FILE, VOLUME[i]

printf "(%s(E17.8))\n", 12+1

printf "(%s(A16,x))\n", 12+1

printf "%s 0 %6d\n", FREQ, ((STARTTIME-INITTIME)/MAXDT)+2

printf "lnp-%s\n", VOLUME[i]

printf "postlnp-%s\n", VOLUME[i]

printf "volf-%s\n", VOLUME[i]

printf "postvf-%s\n", VOLUME[i]

printf "massg-%s\n", VOLUME[i]

printf "postmg-%s\n", VOLUME[i]

printf "massf-%s\n", VOLUME[i]

printf "postmf-%s\n", VOLUME[i]

printf "nqmg-%s\n", VOLUME[i]

printf "postnqmg-%s\n", VOLUME[i]

printf "nqmf-%s\n", VOLUME[i]

printf "postnqmf-%s\n", VOLUME[i]

outfile[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

# printf "OUTPUT FILE: DERIVATIVES. VOLUME %s\n", VOLUME[i]

# printf "%s\n", OUTCOUNT

# printf "%s %s %s %s %s %s %s %s %s %s %s %s ", \

# dlnpdt[VOLUME[i]], postdlnpdt[VOLUME[i]], \

# dvfdt[VOLUME[i]], postdvfdt[VOLUME[i]], \

# dmgdt[VOLUME[i]], postdmgdt[VOLUME[i]], \

# dmfdt[VOLUME[i]], postdmfdt[VOLUME[i]], \

# dnqmgdt[VOLUME[i]], postdnqmgdt[VOLUME[i]], \

# dnqmfdt[VOLUME[i]], postdnqmfdt[VOLUME[i]]

# printf "\n"

# printf "38\n"

# printf "*----------\n"

# printf "%s_%s_der.dat\n", FILE, VOLUME[i]

# printf "(%s(E17.8))\n", 12+1

# printf "(%s(A16,x))\n", 12+1

# printf "%s 0 %6d\n", FREQ, ((STARTTIME-INITTIME)/MAXDT)+2

# printf "dlnpdt-%s\n", VOLUME[i]

# printf "postdlnpdt-%s\n", VOLUME[i]

# printf "dvfdt-%s\n", VOLUME[i]

# printf "postdvfdt-%s\n", VOLUME[i]

# printf "dmgdt-%s\n", VOLUME[i]

# printf "postdmgdt-%s\n", VOLUME[i]

# printf "dmfdt-%s\n", VOLUME[i]

# printf "postdmfdt-%s\n", VOLUME[i]

# printf "dnqmgdt-%s\n", VOLUME[i]

# printf "postdnqmgdt-%s\n", VOLUME[i]

# printf "dnqmfdt-%s\n", VOLUME[i]

# printf "postdnqmfdt-%s\n", VOLUME[i]

# deroutfile[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "OUTPUT FILE: TERMS1. VOLUME %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

C-80
printf "%s %s %s %s %s %s %s %s %s %s \n", \

jtermg[VOLUME[i]], jtermf[VOLUME[i]], \

thexpg[VOLUME[i]], thexpf[VOLUME[i]], \

swellg[VOLUME[i]], swellf[VOLUME[i]], \

acg[VOLUME[i]], acf[VOLUME[i]],

nodecompg[VOLUME[i]], nodecompf[VOLUME[i]]

printf "\n"

printf "38\n"

printf "*----------\n"

printf "%s_%s_terms1.dat\n", FILE, VOLUME[i]

printf "(%s(E17.8))\n", 10+1

printf "(%s(A16,x))\n", 10+1

printf "%s 0 %6d\n", FREQ, ((STARTTIME-INITTIME)/MAXDT)+2

printf "jtermg-%s\n", VOLUME[i]

printf "jtermf-%s\n", VOLUME[i]

printf "thexpg-%s\n", VOLUME[i]

printf "thexpf-%s\n", VOLUME[i]

printf "swellg-%s\n", VOLUME[i]

printf "swellf-%s\n", VOLUME[i]

printf "acg-%s\n", VOLUME[i]

printf "acf-%s\n", VOLUME[i]

printf "nodecompg-%s\n", VOLUME[i]

printf "nodecompf-%s\n", VOLUME[i]

terms1outfile[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "OUTPUT FILE: TERMS2. VOLUME %s\n", VOLUME[i]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s %s %s %s %s %s %s \\\n", \

qwtermg[VOLUME[i]], qwtermf[VOLUME[i]], \

qitermg[VOLUME[i]], qitermf[VOLUME[i]], \

gammtg[VOLUME[i]], gammtf[VOLUME[i]], \

eqthexpg[VOLUME[i]], eqthexpf[VOLUME[i]], \

nqthexpg[VOLUME[i]], nqthexpf[VOLUME[i]]

printf "%s %s %s %s %s %s %s %s\n", \

nqgammaitg[VOLUME[i]], nqgammaitf[VOLUME[i]], \

nqgammawtg[VOLUME[i]], nqgammawtf[VOLUME[i]], \

qibg[VOLUME[i]], qibf[VOLUME[i]], \

appqibg[VOLUME[i]], appqibf[VOLUME[i]]

printf "\n"

printf "38\n"

printf "*----------\n"

printf "%s_%s_terms2.dat\n", FILE, VOLUME[i]

printf "(%s(E17.8))\n", 18+1

printf "(%s(A16,x))\n", 18+1

printf "%s 0 %6d\n", FREQ, ((STARTTIME-INITTIME)/MAXDT)+2

printf "qwtermg-%s\n", VOLUME[i]

printf "qwtermf-%s\n", VOLUME[i]

printf "qitermg-%s\n", VOLUME[i]

printf "qitermf-%s\n", VOLUME[i]

printf "gammtg-%s\n", VOLUME[i]

printf "gammtf-%s\n", VOLUME[i]

printf "eqthexpg-%s\n", VOLUME[i]

printf "eqthexpf-%s\n", VOLUME[i]

printf "nqthexpg-%s\n", VOLUME[i]

printf "nqthexpf-%s\n", VOLUME[i]

printf "nqgammaitg-%s\n", VOLUME[i]

printf "nqgammaitf-%s\n", VOLUME[i]

printf "nqgammawtg-%s\n", VOLUME[i]

printf "nqgammawtf-%s\n", VOLUME[i]

printf "qibg-%s\n", VOLUME[i]

printf "qibf-%s\n", VOLUME[i]

printf "appqibg-%s\n", VOLUME[i]

printf "appqibf-%s\n", VOLUME[i]

terms2outfile[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

C-81
# printf "OUTPUT FILE: TERMS3. VOLUME %s\n", VOLUME[i]

# printf "%s\n", OUTCOUNT

# printf "%s %s %s %s %s %s %s %s %s %s %s", \

# deltap[VOLUME[i]], wfricg[VOLUME[i]], \

# wfricf[VOLUME[i]], buoyg[VOLUME[i]], buoyf[VOLUME[i]], \

# mommixconv[VOLUME[i]], nonhmconv[VOLUME[i]], \

# dermommix[VOLUME[i]], avol[VOLUME[i]], \

# deltapgx[VOLUME[i]], \

# deltapfx[VOLUME[i]]

# printf "\n"

# printf "38\n"

# printf "*----------\n"

# printf "%s_%s_terms3.dat\n", FILE, VOLUME[i]

# printf "(%s(E17.8))\n", 11+1

# printf "(%s(A16,x))\n", 11+1

# printf "%s 0 %6d\n", FREQ, ((STARTTIME-INITTIME)/MAXDT)+2

# printf "deltap-%s\n", VOLUME[i]

# printf "wfricg-%s\n", VOLUME[i]

# printf "wfricf-%s\n", VOLUME[i]

# printf "buoyg-%s\n", VOLUME[i]

# printf "buoyf-%s\n", VOLUME[i]

# printf "mommixconv-%s\n", VOLUME[i]

# printf "nonhmconv-%s\n", VOLUME[i]

# printf "dermommix-%s\n", VOLUME[i]

# printf "avol-%s\n", VOLUME[i]

# printf "deltapgx-%s\n", VOLUME[i]

# printf "deltapfx-%s\n", VOLUME[i]

# terms3outfile[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

# printf "OUTPUT FILE: TERMS4. VOLUME %s\n", VOLUME[i]

# printf "%s\n", OUTCOUNT

# printf "%s %s %s %s %s %s %s %s %s %s %s", \

# deltap[VOLUME[i]], deltapgx[VOLUME[i]], deltapfx[VOLUME[i]], \

# inpjgx[VOLUME[i]], outpjgx[VOLUME[i]], \

# inpjfx[VOLUME[i]], outpjfx[VOLUME[i]], \

# inavoidpjgx[VOLUME[i]], outavoidpjgx[VOLUME[i]], \

# inavoidpjfx[VOLUME[i]], outavoidpjfx[VOLUME[i]]

#

# printf "\n"

# printf "38\n"

# printf "*----------\n"

# printf "%s_%s_terms4.dat\n", FILE, VOLUME[i]

# printf "(%s(E17.8))\n", 11+1

# printf "(%s(A16,x))\n", 11+1

# printf "%s 0 %6d\n", FREQ, ((STARTTIME-INITTIME)/MAXDT)+2

# printf "deltap-%s\n", VOLUME[i]

# printf "deltapgx-%s\n", VOLUME[i]

# printf "deltapfx-%s\n", VOLUME[i]

# printf "inpjgx-%s\n", VOLUME[i]

# printf "outpjgx-%s\n", VOLUME[i]

# printf "inpjfx-%s\n", VOLUME[i]

# printf "outpjfx-%s\n", VOLUME[i]

# printf "inavoidpjgx-%s\n", VOLUME[i]

# printf "outavoidpjgx-%s\n", VOLUME[i]

# printf "inavoidpjfx-%s\n", VOLUME[i]

# printf "outavoidpjfx-%s\n", VOLUME[i]

# terms3outfile[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

# printf "OUTPUT FILE: NQ. VOLUME %s\n", VOLUME[i]

# printf "%s\n", OUTCOUNT

# printf "%s %s %s %s %s %s %s %s ", \

# insatmflowfx[VOLUME[i]], outsatmflowfx[VOLUME[i]], \

# invflowfx[VOLUME[i]], outvflowfx[VOLUME[i]], \

# insatrhofx[VOLUME[i]], outsatrhofx[VOLUME[i]], \

# inpjfx[VOLUME[i]], outpjfx[VOLUME[i]]

C-82
# printf "\n"

# printf "38\n"

# printf "*----------\n"

# printf "%s_%s_nq.dat\n", FILE, VOLUME[i]

# printf "(%s(E17.8))\n", 8+1

# printf "(%s(A16,x))\n", 8+1

# printf "%s 0 %6d\n", FREQ, ((STARTTIME-INITTIME)/MAXDT)+2

# printf "insatmflowfx-%s\n", VOLUME[i]

# printf "outsatmflowfx-%s\n", VOLUME[i]

# printf "invflowfx-%s\n", VOLUME[i]

# printf "outvflowfx-%s\n", VOLUME[i]

# printf "insatrhofx-%s\n", VOLUME[i]

# printf "outsatrhofx-%s\n", VOLUME[i]

# printf "inpjfx-%s\n", VOLUME[i]

# printf "outpjfx-%s\n", VOLUME[i]

# nqoutfile[VOLUME[i]] = OUTCOUNT++

# printf "***************************************************************** \n"

# End of volume loop

}

for(sys=1;sys<=NSYSTEMS;sys++) {

# printf "TOTVOLS = %s\n", TOTVOLS

# printf "SYSNAME = %s\n", SYSNAME[sys]

if(1 == sys){

initloop = 0

}

else{

initloop += NVOLS[sys-1]

}

for(i=1;i<=TOTVOLS;i++){

volflag[i] = ""

}

for(i=1;i<=TOTVOLS;i++){

for(k=1;k<=NVOLS[sys];k++){

if(VOLINSYS[k+initloop] == VOLUME[i]){

volflag[i] = "+"

}

}

# printf "volflag[%s] = %s\n", i, volflag[i]

}

printf "***************************************************************** \n"

printf "*************** Postprocess of TH system %s ***************\n", \

SYSNAME[sys]

printf "***************************************************************** \n"

printf "In - out vapor pressure in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s ", deltapgx[VOLUME[i]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s[%s]", volflag[i], auxcount++

}

}

printf "\n"

sysdeltapgx[sys] = OUTCOUNT++

C-83
printf "***************************************************************** \n"

printf "In - out liquid pressure in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s ", deltapfx[VOLUME[i]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s[%s]", volflag[i], auxcount++

}

}

printf "\n"

sysdeltapfx[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "ln p * vapor compressibility in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s %s ", lnp[VOLUME[i]], nodecompg[VOLUME[i]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s[%s]*[%s]", volflag[i], auxcount++, auxcount++

}

}

printf "\n"

syslnpcompg[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "ln p * liquid compressibility in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s %s ", lnp[VOLUME[i]], nodecompf[VOLUME[i]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s[%s]*[%s]", volflag[i], auxcount++, auxcount++

}

}

printf "\n"

syslnpcompf[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Vapor compressibility in system %s\n", SYSNAME[sys]

C-84
printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s ", nodecompg[VOLUME[i]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s[%s]", volflag[i], auxcount++

}

}

printf "\n"

syscompg[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Liquid compressibility in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s ", nodecompf[VOLUME[i]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s[%s]", volflag[i], auxcount++

}

}

printf "\n"

syscompf[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Vapor volume in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s ", volg[VOLUME[i]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s[%s]", volflag[i], auxcount++

}

}

printf "\n"

sysvolg[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Liquid volume in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

C-85
for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s ", volf[VOLUME[i]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s[%s]", volflag[i], auxcount++

}

}

printf "\n"

sysvolf[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Time derivative of liquid volume in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s\n", sysvolf[sys]

printf "43\n"

printf "*----------\n"

printf "16 1.0\n"

sysdvfdt[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Vapor mass in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s ", massg[VOLUME[i]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s[%s]", volflag[i], auxcount++

}

}

printf "\n"

sysmassg[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Time derivative of vapor mass in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s\n", sysmassg[sys]

printf "43\n"

printf "*----------\n"

printf "16 1.0\n"

sysdmgdt[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Liquid mass in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s ", massf[VOLUME[i]]

}

}

printf "\n"

printf "27\n"

C-86
printf "*----------\n"

printf "[1]"

auxcount = 2

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s[%s]", volflag[i], auxcount++

}

}

printf "\n"

sysmassf[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Time derivative of liquid mass in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s\n", sysmassf[sys]

printf "43\n"

printf "*----------\n"

printf "16 1.0\n"

sysdmfdt[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Vapor non-equilibrium mass in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s ", nqmg[VOLUME[i]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s[%s]", volflag[i], auxcount++

}

}

printf "\n"

sysnqmg[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Time derivative of non-eq. vapor mass in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s\n", sysnqmg[sys]

printf "43\n"

printf "*----------\n"

printf "16 1.0\n"

sysdnqmgdt[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Liquid non-equilibrium mass in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s ", nqmf[VOLUME[i]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s[%s]", volflag[i], auxcount++

}

C-87
}

printf "\n"

sysnqmf[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Time derivative of non-eq. liquid mass in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s\n", sysnqmf[sys]

printf "43\n"

printf "*----------\n"

printf "16 1.0\n"

sysdnqmfdt[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Vapor inlet mass flow in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s ", inmflowg[VOLUME[i]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s[%s]", volflag[i], auxcount++

}

}

printf "\n"

sysinmflowg[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Vapor outlet mass flow in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s ", outmflowg[VOLUME[i]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s[%s]", volflag[i], auxcount++

}

}

printf "\n"

sysoutmflowg[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Liquid inlet mass flow in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s ", inmflowf[VOLUME[i]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

C-88
printf "[1]"

auxcount = 2

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s[%s]", volflag[i], auxcount++

}

}

printf "\n"

sysinmflowf[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Liquid outlet mass flow in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s ", outmflowf[VOLUME[i]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s[%s]", volflag[i], auxcount++

}

}

printf "\n"

sysoutmflowf[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Vapor volumetric flow in - volumetric flow out in system %s\n", \

SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s ", jtermg[VOLUME[i]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s[%s]", volflag[i], auxcount++

}

}

printf "\n"

sysjtermg[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Liquid volumetric flow in - volumetric flow out in system %s\n", \

SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s ", jtermf[VOLUME[i]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

C-89
printf "[1]"

auxcount = 2

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s[%s]", volflag[i], auxcount++

}

}

printf "\n"

sysjtermf[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Vapor thermal expansion in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s ", thexpg[VOLUME[i]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s[%s]", volflag[i], auxcount++

}

}

printf "\n"

systhexpg[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Liquid thermal expansion in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s ", thexpf[VOLUME[i]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s[%s]", volflag[i], auxcount++

}

}

printf "\n"

systhexpf[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Vapor swelling in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s ", swellg[VOLUME[i]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

C-90
for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s[%s]", volflag[i], auxcount++

}

}

printf "\n"

sysswellg[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Lilquid swelling in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s ", swellf[VOLUME[i]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s[%s]", volflag[i], auxcount++

}

}

printf "\n"

sysswellf[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Main term of vapor acoustic term in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s ", acg[VOLUME[i]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s[%s]", volflag[i], auxcount++

}

}

printf "\n"

sysmainacg[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Main term of liquid acoustic term in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s ", acf[VOLUME[i]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

C-91
printf "\\\n%s[%s]", volflag[i], auxcount++

}

}

printf "\n"

sysmainacf[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "First term of vapor acoustic term in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s ", ac1g[VOLUME[i]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s[%s]", volflag[i], auxcount++

}

}

printf "\n"

sysac1g[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "First term of liquid acoustic term in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s ", ac1f[VOLUME[i]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s[%s]", volflag[i], auxcount++

}

}

printf "\n"

sysac1f[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Second term of vapor acoustic term in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s ", ac2g[VOLUME[i]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s[%s]", volflag[i], auxcount++

}

C-92
}

printf "\n"

sysac2g[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Second term of liquid acoustic term in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s ", ac2f[VOLUME[i]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s[%s]", volflag[i], auxcount++

}

}

printf "\n"

sysac2f[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Vapor non-equilibrium thermal expansion in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s ", nqthexpg[VOLUME[i]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s[%s]", volflag[i], auxcount++

}

}

printf "\n"

sysnqthexpg[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Liquid non-equilibrium thermal expansion in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s ", nqthexpf[VOLUME[i]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s[%s]", volflag[i], auxcount++

}

}

printf "\n"

C-93
sysnqthexpf[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Vapor generation rate in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s %s ", vvol[VOLUME[i]], gammag[VOLUME[i]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s[%s]*[%s]", volflag[i], auxcount++, auxcount++

}

}

printf "\n"

sysgenrg[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Liquid generation rate in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s %s ", vvol[VOLUME[i]], gammaf[VOLUME[i]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s[%s]*[%s]", volflag[i], auxcount++, auxcount++

}

}

printf "\n"

sysgenrf[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet vapor non-equilibrium mass flow in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s ", innqmflowg[VOLUME[i]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s[%s]", volflag[i], auxcount++

}

}

printf "\n"

sysinnqmflowg[sys] = OUTCOUNT++

printf "***************************************************************** \n"

C-94
printf "Outlet vapor non-equilibrium mass flow in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s ", outnqmflowg[VOLUME[i]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s[%s]", volflag[i], auxcount++

}

}

printf "\n"

sysoutnqmflowg[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet liquid non-equilibrium mass flow in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s ", innqmflowf[VOLUME[i]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s[%s]", volflag[i], auxcount++

}

}

printf "\n"

sysinnqmflowf[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet liquid non-equilibrium mass flow in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s ", outnqmflowf[VOLUME[i]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s[%s]", volflag[i], auxcount++

}

}

printf "\n"

sysoutnqmflowf[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Inlet vapor non-equilibrium mass flow in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

C-95
printf "%s ", CONST0

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s ", innqmflowg[VOLUME[i]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s[%s]", volflag[i], auxcount++

}

}

printf "\n"

sysinnqmflowg[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Outlet vapor non-equilibrium mass flow in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s ", outnqmflowg[VOLUME[i]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s[%s]", volflag[i], auxcount++

}

}

printf"\n"

sysoutnqmflowg[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Non zero compg in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", CONST1, syscompg[sys], syscompg[sys]

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "1.0e-10\n"

nzsyscompg[sys] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Non zero compf in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", CONST1, syscompf[sys], syscompf[sys]

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "1.0e-10\n"

nzsyscompf[sys] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "ln p in vapor phase, system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", nzsyscompg[sys]+1, syslnpcompg[sys], \

nzsyscompg[sys]

printf "27\n"

C-96
printf "*----------\n"

printf "[1]*[2]/[3]\n"

syslnpg[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "ln p in liquid phase, system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", nzsyscompf[sys]+1, syslnpcompf[sys], \

nzsyscompf[sys]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]/[3]\n"

syslnpf[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Vapor acoustic term in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", sysmainacg[sys], sysac1g[sys], syslnpg[sys], \

sysac2g[sys]

printf "27\n"

printf "*----------\n"

printf "[1]+[2]-([3]*[4])\n"

sysacg[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Liquid acoustic term in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", sysmainacf[sys], sysac1f[sys], syslnpf[sys], \

sysac2f[sys]

printf "27\n"

printf "*----------\n"

printf "[1]+[2]-([3]*[4])\n"

sysacf[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "ln p in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", syslnpcompg[sys], syslnpcompf[sys], \

syscompg[sys], syscompf[sys]

printf "27\n"

printf "*----------\n"

printf "([1]+[2])/([3]+[4])\n"

syslnp[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Time derivative of ln p in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s\n", syslnp[sys]

printf "43\n"

printf "*----------\n"

printf "16 1.0\n"

sysdlnpdt[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Pressure in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s\n", syslnp[sys]

printf "27\n"

printf "*----------\n"

printf "EXP([1])\n"

sysp[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Vapor jterm+thexp+swell+ac in %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", sysjtermg[sys], systhexpg[sys], sysswellg[sys], \

sysacg[sys]

printf "27\n"

printf "*----------\n"

printf "[1]+[2]+[3]+[4]\n"

sysjthswacg[sys] = OUTCOUNT++

printf "***************************************************************** \n"

C-97
printf "Liquid jterm+thexp+swell+ac in %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s\n", sysjtermf[sys], systhexpf[sys], sysswellf[sys], \

sysacf[sys]

printf "27\n"

printf "*----------\n"

printf "[1]+[2]+[3]+[4]\n"

sysjthswacf[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Non-filtered postprocessed time derivative of ln p in system %s\n", \

SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s %s %s\n", sysjthswacg[sys], sysjthswacf[sys], \

nzsyscompg[sys]+1, nzsyscompg[sys], \

nzsyscompf[sys]+1, nzsyscompf[sys]

printf "27\n"

printf "*----------\n"

printf "([1]+[2])/(([3]*[4])+([5]*[6]))\n"

nfsyspostdlnpdt[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Initial value of ln p in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", OUTCOUNT, syslnp[sys], PULSETIME

printf "14 0 0.0 0.0\n"

printf "*----------\n"

printf "3\n"

printf "0.5\n"

sysinitlnp[sys] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Postprocessed time derivative of ln p in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s %s\n", STEPTIME, nfsyspostdlnpdt[sys]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]\n"

syspostdlnpdt[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Integral of postdlnpdt in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s\n", syspostdlnpdt[sys]

printf "1 0 0.0\n"

printf "*----------\n"

printf "0 0\n"

printf "1.0e+10 -1.0e+10 0.0\n"

sysintdlnpdt[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Postprocessed ln p in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s %s\n", sysinitlnp[sys], sysintdlnpdt[sys]

printf "27\n"

printf "*----------\n"

printf "[1]+[2]\n"

syspostlnp[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Postprocessed pressure in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s\n", syspostlnp[sys]

printf "27\n"

printf "*----------\n"

printf "EXP([1])\n"

syspostp[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Non-filtered postprocessed time derivative of liquid volume "

printf "in system %s\n", SYSNAME[sys]

C-98
printf "%s\n", OUTCOUNT

printf "%s %s %s %s %s %s %s\n", sysjtermf[sys], systhexpf[sys], \

sysswellf[sys], sysacf[sys], \

nzsyscompf[sys]+1, nzsyscompf[sys], \

syspostdlnpdt[sys]

printf "27\n"

printf "*----------\n"

printf "[1]+[2]+[3]+[4]-([5]*[6]*[7])\n"

nfsyspostdvfdt[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Initial value of liquid volume in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", OUTCOUNT, sysvolf[sys], PULSETIME

printf "14 0 0.0 0.0\n"

printf "*----------\n"

printf "3\n"

printf "0.5\n"

sysinitvolf[sys] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Postprocessed time derivative of liquid volume in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s %s\n", STEPTIME, nfsyspostdvfdt[sys]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]\n"

syspostdvfdt[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Integral of postdvfdt in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s\n", syspostdvfdt[sys]

printf "1 0 0.0\n"

printf "*----------\n"

printf "0 0\n"

printf "1.0e+10 -1.0e+10 0.0\n"

sysintdvfdt[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Postprocessed liquid volume in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s %s\n", sysinitvolf[sys], sysintdvfdt[sys]

printf "27\n"

printf "*----------\n"

printf "[1]+[2]\n"

syspostvolf[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Non-filtered postprocessed time derivative of vapor mass in system %s\n", \

SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", sysinmflowg[sys], sysoutmflowg[sys], sysgenrg[sys]

printf "27\n"

printf "*----------\n"

printf "[1]+[3]-[2]\n"

nfsyspostdmgdt[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Initial value of vapor mass in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", OUTCOUNT, sysmassg[sys], PULSETIME

printf "14 0 0.0 0.0\n"

printf "*----------\n"

printf "3\n"

printf "0.5\n"

sysinitmg[sys] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Postprocessed time derivative of vapor mass in system %s\n", SYSNAME[sys]

C-99
printf "%s\n", OUTCOUNT

printf "%s %s\n", STEPTIME, nfsyspostdmgdt[sys]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]\n"

syspostdmgdt[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Integral of postdmgdt %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s\n", syspostdmgdt[sys]

printf "1 0 0.0\n"

printf "*----------\n"

printf "0 0\n"

printf "1.0e+10 -1.0e+10 0.0\n"

sysintdmgdt[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Postprocessed vapor mass in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s %s\n", sysinitmg[sys], sysintdmgdt[sys]

printf "27\n"

printf "*----------\n"

printf "[1]+[2]\n"

syspostmg[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Non-filtered postprocessed time derivative of liquid mass in system %s\n", \

SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", sysinmflowf[sys], sysoutmflowf[sys], sysgenrf[sys]

printf "27\n"

printf "*----------\n"

printf "[1]+[3]-[2]\n"

nfsyspostdmfdt[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Initial value of liquid mass in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", OUTCOUNT, sysmassf[sys], PULSETIME

printf "14 0 0.0 0.0\n"

printf "*----------\n"

printf "3\n"

printf "0.5\n"

sysinitmf[sys] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Postprocessed time derivative of liquid mass in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s %s\n", STEPTIME, nfsyspostdmfdt[sys]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]\n"

syspostdmfdt[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Integral of postdmfdt %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s\n", syspostdmfdt[sys]

printf "1 0 0.0\n"

printf "*----------\n"

printf "0 0\n"

printf "1.0e+10 -1.0e+10 0.0\n"

sysintdmfdt[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Postprocessed liquid mass in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s %s\n", sysinitmf[sys], sysintdmfdt[sys]

printf "27\n"

printf "*----------\n"

C-100
printf "[1]+[2]\n"

syspostmf[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Non-filtered post. time der. of vapor non-eq. mass in system %s\n", \

SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", sysnqthexpg[sys], sysinnqmflowg[sys], sysoutnqmflowg[sys]

printf "27\n"

printf "*----------\n"

printf "[1]+[2]-[3]\n"

nfsyspostdnqmgdt[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Initial value of non-eq. vapor mass in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", OUTCOUNT, sysnqmg[sys], PULSETIME

printf "14 0 0.0 0.0\n"

printf "*----------\n"

printf "3\n"

printf "0.5\n"

sysinitnqmg[sys] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

printf "Post. time derivative of non-eq. vapor mass in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s %s\n", STEPTIME, nfsyspostdnqmgdt[sys]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]\n"

syspostdnqmgdt[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Integral of postdnqmgdt %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s\n", syspostdnqmgdt[sys]

printf "1 0 0.0\n"

printf "*----------\n"

printf "0 0\n"

printf "1.0e+10 -1.0e+10 0.0\n"

sysintdnqmgdt[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Postprocessed vapor non-eq. mass in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s %s\n", sysinitnqmg[sys], sysintdnqmgdt[sys]

printf "27\n"

printf "*----------\n"

printf "[1]+[2]\n"

syspostnqmg[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Non-filtered post. time der. of liquid non-eq. mass in system %s\n", \

SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", sysnqthexpf[sys], sysinnqmflowf[sys], sysoutnqmflowf[sys]

printf "27\n"

printf "*----------\n"

printf "[1]+[2]-[3]\n"

nfsyspostdnqmfdt[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Initial value of non-eq. liquid mass in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s %s %s\n", OUTCOUNT, sysnqmf[sys], PULSETIME

printf "14 0 0.0 0.0\n"

printf "*----------\n"

printf "3\n"

printf "0.5\n"

sysinitnqmf[sys] = OUTCOUNT++

OUTCOUNT++

C-101
printf "***************************************************************** \n"

printf "Post. time derivative of non-eq. liquid mass in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s %s\n", STEPTIME, nfsyspostdnqmfdt[sys]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]\n"

syspostdnqmfdt[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Integral of postdnqmfdt %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s\n", syspostdnqmfdt[sys]

printf "1 0 0.0\n"

printf "*----------\n"

printf "0 0\n"

printf "1.0e+10 -1.0e+10 0.0\n"

sysintdnqmfdt[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Postprocessed liquid non-eq. mass in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s %s\n", sysinitnqmf[sys], sysintdnqmfdt[sys]

printf "27\n"

printf "*----------\n"

printf "[1]+[2]\n"

syspostnqmf[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Vapor mixture momentum in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s ", mommix[VOLUME[i]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s[%s]", volflag[i], auxcount++

}

}

printf "\n"

sysmommix[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Time derivative of mixture momentum in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s\n", sysmommix[sys]

printf "43\n"

printf "*----------\n"

printf "16 1.0\n"

dersysmommix[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Vapor wall friction in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s ", wfricg[VOLUME[i]]

}

}

printf "\n"

printf "27\n"

C-102
printf "*----------\n"

printf "[1]"

auxcount = 2

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s[%s]", volflag[i], auxcount++

}

}

printf "\n"

syswfricg[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Liquid wall friction in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s ", wfricf[VOLUME[i]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s[%s]", volflag[i], auxcount++

}

}

printf "\n"

syswfricf[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Vapor buoyancy in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s ", buoyg[VOLUME[i]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s[%s]", volflag[i], auxcount++

}

}

printf "\n"

sysbuoyg[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Liquid buoyancy in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s ", buoyf[VOLUME[i]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

C-103
auxcount = 2

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s[%s]", volflag[i], auxcount++

}

}

printf "\n"

sysbuoyf[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Mixture momentum convective term in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s ", mommixconv[VOLUME[i]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s[%s]", volflag[i], auxcount++

}

}

printf "\n"

sysmommixconv[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Non homogeneous convective term in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s ", nonhmconv[VOLUME[i]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s[%s]", volflag[i], auxcount++

}

}

printf "\n"

sysnonhmconv[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Time derivative of mixture momentum in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s ", dermommix[VOLUME[i]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(i=1;i<=TOTVOLS;i++) {

C-104
if(volflag[i] != "") {

printf "\\\n%s[%s]", volflag[i], auxcount++

}

}

printf "\n"

sysdermommix[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Pressure drop in system %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s ", CONST0

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s ", deltap[VOLUME[i]]

}

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

auxcount = 2

for(i=1;i<=TOTVOLS;i++) {

if(volflag[i] != "") {

printf "\\\n%s[%s]", volflag[i], auxcount++

}

}

printf "\n"

sysdeltap[sys] = OUTCOUNT++

printf "***************************************************************** \n"

printf "OUTPUT FILE SYSTEM %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s %s %s %s %s %s %s %s %s ", \

syslnp[sys], syspostlnp[sys], \

sysvolf[sys], syspostvolf[sys], \

sysmassg[sys], syspostmg[sys], \

sysmassf[sys], syspostmf[sys], \

sysnqmg[sys], syspostnqmg[sys], \

sysnqmf[sys], syspostnqmf[sys]

printf "\n"

printf "38\n"

printf "*----------\n"

printf "%s_%s.dat\n", FILE, SYSNAME[sys]

printf "(%s(E17.8))\n", 12+1

printf "(%s(A16,x))\n", 12+1

printf "%s 0 %6d\n", FREQ, ((STARTTIME-INITTIME)/MAXDT)+2

printf "syslnp-%s\n", SYSNAME[sys]

printf "syspostlnp-%s\n", SYSNAME[sys]

printf "sysvolf-%s\n", SYSNAME[sys]

printf "syspostvolf-%s\n", SYSNAME[sys]

printf "sysmassg-%s\n", SYSNAME[sys]

printf "syspostmg-%s\n", SYSNAME[sys]

printf "sysmassf-%s\n", SYSNAME[sys]

printf "syspostmf-%s\n", SYSNAME[sys]

printf "sysnqmg-%s\n", SYSNAME[sys]

printf "syspostnqmg-%s\n", SYSNAME[sys]

printf "sysnqmf-%s\n", SYSNAME[sys]

printf "syspostnqmf-%s\n", SYSNAME[sys]

sysoutfile[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "OUTPUT FILE: DERIVATIVES. SYSTEM %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s %s %s %s %s %s %s %s %s ", \

C-105
sysdlnpdt[sys], syspostdlnpdt[sys], \

sysdvfdt[sys], syspostdvfdt[sys], \

sysdmgdt[sys], syspostdmgdt[sys], \

sysdmfdt[sys], syspostdmfdt[sys], \

sysdnqmgdt[sys], syspostdnqmgdt[sys], \

sysdnqmfdt[sys], syspostdnqmfdt[sys]

printf "\n"

printf "38\n"

printf "*----------\n"

printf "%s_%s_der.dat\n", FILE, SYSNAME[sys]

printf "(%s(E17.8))\n", 12+1

printf "(%s(A16,x))\n", 12+1

printf "%s 0 %6d\n", FREQ, ((STARTTIME-INITTIME)/MAXDT)+2

printf "sysdlnpdt-%s\n", SYSNAME[sys]

printf "syspostdlnpdt-%s\n", SYSNAME[sys]

printf "sysdvfdt-%s\n", SYSNAME[sys]

printf "syspostdvfdt-%s\n", SYSNAME[sys]

printf "sysdmgdt-%s\n", SYSNAME[sys]

printf "syspostdmgdt-%s\n", SYSNAME[sys]

printf "sysdmfdt-%s\n", SYSNAME[sys]

printf "syspostdmfdt-%s\n", SYSNAME[sys]

printf "sysdnqmgdt-%s\n", SYSNAME[sys]

printf "syspostdnqmgdt-%s\n", SYSNAME[sys]

printf "sysdnqmfdt-%s\n", SYSNAME[sys]

printf "syspostdnqmfdt-%s\n", SYSNAME[sys]

sysderoutfile[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

printf "OUTPUT FILE: TERMS. VOLUME %s\n", SYSNAME[sys]

printf "%s\n", OUTCOUNT

printf "%s %s %s %s %s %s %s %s %s %s \\\n", \

sysjtermg[sys], sysjtermf[sys], \

systhexpg[sys], systhexpf[sys], \

sysswellg[sys], sysswellf[sys], \

sysacg[sys], sysacf[sys], \

syscompg[sys], syscompf[sys]

printf "%s %s %s \\\n", \

sysnqthexpg[sys], sysnqthexpf[sys], \

sysdeltap[sys]

printf "%s %s %s %s %s %s %s %s %s", \

syswfricg[sys], syswfricf[sys], \

sysbuoyg[sys], sysbuoyf[sys], \

sysmommixconv[sys], sysnonhmconv[sys], \

sysdermommix[sys], \

sysdeltapgx[sys], sysdeltapfx[sys]

printf "\n"

printf "38\n"

printf "*----------\n"

printf "%s_%s_terms.dat\n", FILE, SYSNAME[sys]

printf "(%s(E17.8))\n", 22+1

printf "(%s(A16,x))\n", 22+1

printf "%s 0 %6d\n", FREQ, ((STARTTIME-INITTIME)/MAXDT)+2

printf "sysjtermg-%s\n", SYSNAME[sys]

printf "sysjtermf-%s\n", SYSNAME[sys]

printf "systhexpg-%s\n", SYSNAME[sys]

printf "systhexpf-%s\n", SYSNAME[sys]

printf "sysswellg-%s\n", SYSNAME[sys]

printf "sysswellf-%s\n", SYSNAME[sys]

printf "sysacg-%s\n", SYSNAME[sys]

printf "sysacf-%s\n", SYSNAME[sys]

printf "syscmpg-%s\n", SYSNAME[sys]

printf "syscmpf-%s\n", SYSNAME[sys]

printf "sysnqthexpg-%s\n", SYSNAME[sys]

printf "sysnqthexpf-%s\n", SYSNAME[sys]

printf "sysdeltap-%s\n", SYSNAME[sys]

printf "syswfricg-%s\n", SYSNAME[sys]

C-106
printf "syswfricf-%s\n", SYSNAME[sys]

printf "sysbuoyg-%s\n", SYSNAME[sys]

printf "sysbuoyf-%s\n", SYSNAME[sys]

printf "sysmommixconv-%s\n", SYSNAME[sys]

printf "sysnonhmconv-%s\n", SYSNAME[sys]

printf "sysdermommix-%s\n", SYSNAME[sys]

printf "sysdeltapgx-%s\n", SYSNAME[sys]

printf "sysdeltapfx-%s\n", SYSNAME[sys]

systermsoutfile[VOLUME[i]] = OUTCOUNT++

printf "***************************************************************** \n"

# End of system loop

}

for(nht=1; nht<=NHEATSTRS; nht++) {

leftind = nht * 100

rightind = nht * 100 + 1

printf "Time derivative of average stored energy in htstr %s\n", heatst[nht]

printf "%s 0 2\n", OUTCOUNT

printf "%s %s\n", htpown[nht], htrnrn[nht]

printf "27\n"

printf "*----------\n"

printf "2.0*(([1]*%s/%s)-[2])/%s\n", insrcfac[nht], rightsrf[nht], \

htcoord[rightindex]

deavgdt[nht] = OUTCOUNT++

printf "***************************************************************** \n"

if (deftype[composition[leftind]] == "table") {

for(vcppoint=1; vcppoint<tablepoints[composition[leftind]]; vcppoint++) {

comppoint = (composition[leftind]*100) + vcppoint

printf "Stored energy in left side of heatst %s. Region %s\n", \

heatst[nht], vcppoint

printf "%s 0 2\n", OUTCOUNT

printf "%s\n", httmpleft[nht]

printf "27\n"

printf "*----------\n"

printf "(([1]-%s)*(%s+(", vcpx[comppoint], \

vcpy[comppoint]

if (slope[comppoint] == 0.0) {

printf "0.0"

}

else {

printf "%s", slope[comppoint]

}

printf "*([1]-%s)/2.0)))+", vcpx[comppoint]

if (vcppoint == 1) {

printf "0.0\n"

}

else {

printf "%s\n", initstengy[comppoint]

}

provleftstengy[comppoint] = OUTCOUNT++

printf "***************************************************************** \n"

}

for(vcppoint=1; vcppoint<tablepoints[composition[leftind]]; vcppoint++) {

comppoint = (composition[leftind]*100) + vcppoint

printf "Temperature gt x0 in region %s. Heatst %s left side\n", \

vcppoint, heatst[nht]

printf "%s 0 2\n", OUTCOUNT

printf "%s %s %s\n", CONST0, CONST1, httmpleft[nht]

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "%s\n", vcpx[comppoint]

tempgtxo[comppoint] = OUTCOUNT++

OUTCOUNT++

C-107
printf "***************************************************************** \n"

}

for(vcppoint=2; vcppoint<=tablepoints[composition[leftind]]; vcppoint++) {

comppoint = (composition[leftind]*100) + vcppoint

printf "Temperature lt x1 in region %s. Heatst %s left side\n", \

vcppoint-1, heatst[nht]

printf "%s 0 2\n", OUTCOUNT

printf "%s %s %s\n", CONST1, CONST0, httmpleft[nht]

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "%s\n", vcpx[comppoint]

templtx1[comppoint-1] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

}

for(vcppoint=1; vcppoint<tablepoints[composition[leftind]]; vcppoint++) {

comppoint = (composition[leftind]*100) + vcppoint

printf "Stored energy in the range x0-x1 in region %s. Heatst %s left side\n", \

vcppoint, heatst[nht]

printf "%s 0 2\n", OUTCOUNT

printf "%s %s %s\n", tempgtxo[comppoint], templtx1[comppoint],\

provleftstengy[comppoint]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]*[3]\n"

leftstengyxox1[comppoint] = OUTCOUNT++

printf "***************************************************************** \n"

}

printf "Stored energy in left side. Heatst %s\n", heatst[nht]

printf "%s 0 2\n", OUTCOUNT

printf "%s", CONST0

for(vcppoint=1; vcppoint<tablepoints[composition[leftind]]; vcppoint++) {

comppoint = (composition[leftind]*100) + vcppoint

printf " %s", leftstengyxox1[comppoint]

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

for(vcppoint=2; vcppoint<=tablepoints[composition[leftind]]; vcppoint++) {

printf "+[%s]", vcppoint

}

printf "\n"

leftstengy[nht] = OUTCOUNT++

printf "***************************************************************** \n"

}

else if(deftype[composition[leftind]] == "function") {

for(vcppoint=1; vcppoint<=funcpoints[composition[leftind]]; vcppoint++) {

comppoint = (composition[leftind]*100) + vcppoint

printf "Stored energy in left side of heatst %s. Region %s\n", \

heatst[nht], vcppoint

printf "%s 0 2\n", OUTCOUNT

printf "%s\n", httmpleft[nht]

printf "27\n"

printf "*----------\n"

printf "([1]-%s)*([1]-%s)*((%s/2.0)+(([1]-%s)*((%s/3.0)+", \

cterm[comppoint], cterm[comppoint], a1[comppoint], \

cterm[comppoint], a2[comppoint]

printf "(([1]-%s)*(%s/4.0)+(([1]-%s)*(%s/5.0))))))+", cterm[comppoint], \

a3[comppoint], cterm[comppoint], \

a4[comppoint]

printf "%s*[1]+%s*LN([1])+", a0[comppoint], a_1[comppoint]

if (vcppoint == 1) {

printf "0.0\n"

C-108
}

else {

printf "%s\n", initstengy[comppoint]

}

provleftstengy[comppoint] = OUTCOUNT++

printf "***************************************************************** \n"

}

for(vcppoint=1; vcppoint<=funcpoints[composition[leftind]]; vcppoint++) {

comppoint = (composition[leftind]*100) + vcppoint

printf "Temperature gt lowtemp in region %s. Heatst %s left side\n", \

vcppoint, heatst[nht]

printf "%s 0 2\n", OUTCOUNT

printf "%s %s %s\n", CONST0, CONST1, httmpleft[nht]

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "%s\n", lowtemp[comppoint]

tempgtlow[comppoint] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

}

for(vcppoint=1; vcppoint<=funcpoints[composition[leftind]]; vcppoint++) {

comppoint = (composition[leftind]*100) + vcppoint

printf "Temperature lt hightemp in region %s. Heatst %s left side\n", \

vcppoint, heatst[nht]

printf "%s 0 2\n", OUTCOUNT

printf "%s %s %s\n", CONST0, CONST1, httmpleft[nht]

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "%s\n", hightemp[comppoint]

templthigh[comppoint] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

}

for(vcppoint=1; vcppoint<=funcpoints[composition[leftind]]; vcppoint++) {

comppoint = (htmatnumb[leftind]*100) + vcppoint

printf "Stored energy in region %s. Heatst %s left side\n", \

vcppoint, heatst[nht]

printf "%s 0 2\n", OUTCOUNT

printf "%s %s %s\n", tempgtlow[comppoint], templthigh[comppoint],\

provleftstengy[comppoint]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]*[3]\n"

leftstengyinreg[comppoint] = OUTCOUNT++

printf "***************************************************************** \n"

}

printf "Stored energy in left side. Heatst %s\n", heatst[nht]

printf "%s 0 2\n", OUTCOUNT

printf "%s", CONST0

for(vcppoint=1; vcppoint<=funcpoints[composition[leftind]]; vcppoint++) {

comppoint = (composition[leftind]*100) + vcppoint

printf " %s", leftstengyinreg[comppoint]

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

for(vcppoint=1; vcppoint<=funcpoints[composition[leftind]]; vcppoint++) {

printf "+[%s]", vcppoint+1

}

printf "\n"

leftstengy[nht] = OUTCOUNT++

printf "***************************************************************** \n"

C-109
}

else if(deftype[composition[leftind]] == "constant") {

comppoint = (composition[leftind]*100) + 1

printf "Stored energy in left side. Heatst %s\n", heatst[nht]

printf "%s 0 2\n", OUTCOUNT

printf "%s\n", httmpleft[nht]

printf "27\n"

printf "*----------\n"

printf "([1]-300.0)*%s", vcpy[comppoint]

leftstengy[nht] = OUTCOUNT++

printf "***************************************************************** \n"

}

if (deftype[composition[rightind]] == "table") {

for(vcppoint=1; vcppoint<tablepoints[composition[rightind]]; vcppoint++) {

comppoint = (composition[rightind]*100) + vcppoint

printf "Stored energy in right side of heatst %s. Region %s\n", \

heatst[nht], vcppoint

printf "%s 0 2\n", OUTCOUNT

printf "%s\n", httmpright[nht]

printf "27\n"

printf "*----------\n"

printf "(([1]-%s)*(%s+(", vcpx[comppoint], \

vcpy[comppoint]

if (slope[comppoint] == 0.0) {

printf "0.0"

}

else {

printf "%s", slope[comppoint]

}

printf "*([1]-%s)/2.0)))+", vcpx[comppoint]

if (vcppoint == 1) {

printf "0.0\n"

}

else {

printf "%s\n", initstengy[comppoint]

}

provrightstengy[comppoint] = OUTCOUNT++

printf "***************************************************************** \n"

}

for(vcppoint=1; vcppoint<tablepoints[composition[rightind]]; vcppoint++) {

comppoint = (composition[rightind]*100) + vcppoint

printf "Temperature gt x0 in region %s. Heatst %s right side\n", \

vcppoint, heatst[nht]

printf "%s 0 2\n", OUTCOUNT

printf "%s %s %s\n", CONST0, CONST1, httmpright[nht]

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "%s\n", vcpx[comppoint]

tempgtxo[comppoint] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

}

for(vcppoint=2; vcppoint<=tablepoints[composition[rightind]]; vcppoint++) {

comppoint = (composition[rightind]*100) + vcppoint

printf "Temperature lt x1 in region %s. Heatst %s right side\n", \

vcppoint-1, heatst[nht]

printf "%s 0 2\n", OUTCOUNT

printf "%s %s %s\n", CONST1, CONST0, httmpright[nht]

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "%s\n", vcpx[comppoint]

templtx1[comppoint-1] = OUTCOUNT++

C-110
OUTCOUNT++

printf "***************************************************************** \n"

}

for(vcppoint=1; vcppoint<tablepoints[composition[rightind]]; vcppoint++) {

comppoint = (composition[rightind]*100) + vcppoint

printf "Stored energy in the range x0-x1 in region %s. Heatst %s right side\n", \

vcppoint, heatst[nht]

printf "%s 0 2\n", OUTCOUNT

printf "%s %s %s\n", tempgtxo[comppoint], templtx1[comppoint],\

provrightstengy[comppoint]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]*[3]\n"

rightstengyxox1[comppoint] = OUTCOUNT++

printf "***************************************************************** \n"

}

printf "Stored energy in right side. Heatst %s\n", heatst[nht]

printf "%s 0 2\n", OUTCOUNT

printf "%s", CONST0

for(vcppoint=1; vcppoint<tablepoints[composition[rightind]]; vcppoint++) {

comppoint = (composition[rightind]*100) + vcppoint

printf " %s", rightstengyxox1[comppoint]

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

for(vcppoint=2; vcppoint<=tablepoints[composition[rightind]]; vcppoint++) {

printf "+[%s]", vcppoint

}

printf "\n"

rightstengy[nht] = OUTCOUNT++

printf "***************************************************************** \n"

}

else if(deftype[composition[rightind]] == "function") {

for(vcppoint=1; vcppoint<=funcpoints[composition[rightind]]; vcppoint++) {

comppoint = comppoint = (composition[rightind]*100) + vcppoint

printf "Stored energy in right side of heatst %s. Region %s\n", \

vcppoint, heatst[nht]

printf "%s 0 2\n", OUTCOUNT

printf "%s\n", httmpright[nht]

printf "27\n"

printf "*----------\n"

printf "([1]-%s)*([1]-%s)*((%s/2.0)+(([1]-%s)*((%s/3.0)+", \

cterm[comppoint], cterm[comppoint], a1[comppoint], \

cterm[comppoint], a2[comppoint]

printf "(([1]-%s)*(%s/4.0)+(([1]-%s)*(%s/5.0))))))+", cterm[comppoint], \

a3[comppoint], cterm[comppoint], a4[comppoint]

printf "%s*[1]+%s*LN([1])+", a0[comppoint], a_1[comppoint], \

initstengy[comppoint]

if (vcppoint == 1) {

printf "0.0\n"

}

else {

printf "%s\n", initstengy[comppoint]

}

provrightstengy[comppoint] = OUTCOUNT++

printf "***************************************************************** \n"

}

for(vcppoint=1; vcppoint<=funcpoints[composition[rightind]]; vcppoint++) {

comppoint = (composition[rightind]*100) + vcppoint

printf "Temperature gt lowtemp in region %s. Heatst %s right side\n", \

vcppoint, heatst[nht]

printf "%s 0 2\n", OUTCOUNT

printf "%s %s %s\n", CONST0, CONST1, httmpright[nht]

C-111
printf "14\n"

printf "*----------\n"

printf "3\n"

printf "%s\n", lowtemp[comppoint]

tempgtlow[comppoint] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

}

for(vcppoint=1; vcppoint<=funcpoints[composition[rightind]]; vcppoint++) {

comppoint = (composition[rightind]*100) + vcppoint

printf "Temperature lt hightemp in region %s. Heatst %s right side\n", \

vcppoint, heatst[nht]

printf "%s 0 2\n", OUTCOUNT

printf "%s %s %s\n", CONST0, CONST1, httmpright[nht]

printf "14\n"

printf "*----------\n"

printf "3\n"

printf "%s\n", hightemp[comppoint]

templthigh[comppoint] = OUTCOUNT++

OUTCOUNT++

printf "***************************************************************** \n"

}

for(vcppoint=1; vcppoint<=funcpoints[composition[rightind]]; vcppoint++) {

comppoint = (composition[rightind]*100) + vcppoint

printf "Stored energy in region %s. Heatst %s right side\n", \

vcppoint, heatst[nht]

printf "%s 0 2\n", OUTCOUNT

printf "%s %s %s\n", tempgtlow[comppoint], templthigh[comppoint],\

provrightstengy[comppoint]

printf "27\n"

printf "*----------\n"

printf "[1]*[2]*[3]\n"

rightstengyinreg[comppoint] = OUTCOUNT++

printf "***************************************************************** \n"

}

printf "Stored energy in right side. Heatst %s\n", heatst[nht]

printf "%s 0 2\n", OUTCOUNT

printf "%s", CONST0

for(vcppoint=1; vcppoint<=funcpoints[composition[rightind]]; vcppoint++) {

comppoint = (composition[rightind]*100) + vcppoint

printf " %s", rightstengyinreg[comppoint]

}

printf "\n"

printf "27\n"

printf "*----------\n"

printf "[1]"

for(vcppoint=1; vcppoint<=funcpoints[composition[rightind]]; vcppoint++) {

printf "+[%s]", vcppoint+1

}

printf "\n"

rightstengy[nht] = OUTCOUNT++

printf "***************************************************************** \n"

}

else if(deftype[composition[rightind]] == "constant") {

comppoint = (composition[rightind]*100) + 1

printf "Stored energy in right side. Heatst %s\n", heatst[nht]

printf "%s 0 2\n", OUTCOUNT

printf "%s\n", httmpright[nht]

printf "27\n"

printf "*----------\n"

printf "([1]-300.0)*%s", vcpy[comppoint]

rightstengy[nht] = OUTCOUNT++

printf "***************************************************************** \n"

}

printf "Left stengy + 2*right stengy in heatst %s\n", heatst[nht]

C-112
printf "%s 0 2\n", OUTCOUNT

printf "%s %s\n", leftstengy[nht], rightstengy[nht]

printf "27\n"

printf "*----------\n"

printf "[1]+2.0*[2]\n"

e1plus2e2[nht] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Time derivative of e1 plus 2*e2 in heatst %s\n", heatst[nht]

printf "%s 0 2\n", OUTCOUNT

printf "%s\n", e1plus2e2[nht]

printf "43\n"

printf "*----------\n"

printf "16 1.0\n"

de1plus2e2dt[nht] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Post. time derivative of av. stored engy. in heatst %s\n", heatst[nht]

printf "%s 0 2\n", OUTCOUNT

printf "%s\n", de1plus2e2dt[nht]

printf "27\n"

printf "*----------\n"

printf "[1]/3.0\n"

postdeavgdt[nht] = OUTCOUNT++

printf "***************************************************************** \n"

printf "Time derivative of e1 plus 2*e2 - 3*eavg in heatst %s\n", heatst[nht]

printf "%s 0 2\n", OUTCOUNT

printf "%s %s\n", de1plus2e2dt[nht], deavgdt[nht]

printf "27\n"

printf "*----------\n"

printf "[1]-3.0*[2]\n"

de1p2e23e3dt[nht] = OUTCOUNT++

printf "***************************************************************** \n"

# End of heat structures loop

}

if(NHEATSTRS > 0) {

printf "OUTPUT FILE HEAT STRUCTURES \n"

printf "%s\n", OUTCOUNT

for (nht=1; nht<=NHEATSTRS; nht++) {

printf "%s %s %s ", deavgdt[nht], de1p2e23e3dt[nht], postdeavgdt[nht]

}

printf "\n"

printf "38\n"

printf "*----------\n"

printf "%s_heatst.dat\n", FILE

printf "(%s(E17.8))\n", 3*NHEATSTRS+1

printf "(%s(A16,x))\n", 3*NHEATSTRS+1

printf "%s 0 %6d\n", FREQ, ((STARTTIME-INITTIME)/MAXDT)+2

for (nht=1; nht<=NHEATSTRS; nht++) {

printf "deavgdt-%s\n", heatst[nht]

printf "de1p2e23e3dt-%s\n", heatst[nht]

printf "postdeavgdt-%s\n", heatst[nht]

}

heatstoutfile = OUTCOUNT++

}

printf "***************************************************************** \n"

}

C-113