Waha3 Manual

Download as pdf or txt
Download as pdf or txt
You are on page 1of 186

JSI Report

IJS-DP-8841, Rev. mar-04

Revision March-04

WAHALoads - Two-phase Flow Water Hammer Transients and


Induced Loads on Materials and Structures of Nuclear Power Plants
Deliverable D10:

WAHA3 Code Manual

I. Tiselj, A. Horvat, G. erne, J. Gale, I. Parzer, B. Mavko,


"Joef Stefan" Institute, Ljubljana, Slovenia
M. Giot, J. M. Seynhaeve, B. Kucienska,
Universit Catholique de Louvain, Louvain-la-Neuve, Belgium
H. Lemonnier,
Comissariat lnergie Atomique, Grenoble, France

Ljubljana, March 04

"Joef Stefan" Institute, Ljubljana, Slovenija

"Joef Stefan" Institute, Ljubljana, Slovenija

Ordered by:

European Commission,
Research Directorate-General
EURATOM FP-5, Key Action "Nuclear Fission"

Performed by:

"Joef Stefan" Institute


1000 Ljubljana, Jamova 39, Slovenia
Reactor Engineering Division

Contract:

in cooperation with:
Universit Catholique de Louvain,Louvain-la-Neuve, Belgium
and:
Comissariat lnergie Atomique, Grenoble, France
WAHALoads project - FIKS-CT-2000-00106

Task coordinator:

Iztok Tiselj

Title of report:

WAHA3 Code Manual

Authors:

Iztok Tiselj, Andrej Horvat, Gregor erne, Janez Gale, Iztok


Parzer, Borut Mavko, Michel Giot, Jean-Marie Seynhaeve,
Beata Kucienska, Herve Lemonnier

Report No.:

IJS-DP-8841 Rev mar-04

Distribution:

Contractors
Library of JSI
Authors
Partners of WAHALoads project

Ljubljana, March, 2004

1-1

"Joef Stefan" Institute, Ljubljana, Slovenija


WAHALoads- Deliverable D10:

WAHA3 code manual


IJS-DP-8841, Revision: March 04
This document contains also the following deliverables, which were planned within
the WAHALoads project, but were not issued as separate documents:
D9 - Report on Physical Models - Chapter 2
D60 - Formulation of Basic Equations - Chapter 2
D64 - Code development final report - Chapter 1

Chapter 1
WAHA Code
Introduction

Manual

Chapter 2, Section 2.3:


Wall friction
Chapter 3:
Numerical Scheme of the
WAHA Code
Chapter 4:
Models of two-phase flow
through sudden expansion or
contraction
Chapter 5:
Calculation of water properties in the WAHA code
Chapter 6:
Forces on the pipes
Chapter 7:
Input file preparation for the
WAHA code

Chapter 9:
Data and code structure

Reviewed by

Approved by

Iztok Tiselj

Janez Gale

Andrej Horvat

Iztok Tiselj

Jean-Marie Seynhaeve

Iztok Parzer

Beata Kucienska

Iztok Tiselj

Jean-Marie Seynhaeve

Iztok Tiselj

Andrej Horvat

Iztok Parzer

Andrej Horvat

Iztok Tiselj

Iztok Parzer

Iztok Tiselj

Andrej Horvat

Jean-Marie Seynhaeve

Iztok Tiselj

Herve Lemonnier

Janez Gale

Janez Gale

Iztok Parzer

Iztok Tiselj

Janez Gale

Iztok Tiselj

Iztok Parzer

Iztok Tiselj

Janez Gale

Iztok Parzer

Chapter 2:
Two-Fluid six-equation model
in the WAHA code (except
Section 2.3. Wall friction)

Chapter 8:
WAHA test cases and results

Prepared by

1-2

Table of Contents

1. WAHA CODE MANUAL - INTRODUCTION ..........................................................1-10


1.1. DOCUMENTS RELATED TO THE WAHA CODE..............................................................1-10
1.2. BRIEF DESCRIPTION OF THE WAHA CODE ..................................................................1-11
1.3. REFERENCES ...............................................................................................................1-12
2 TWO-FLUID SIX-EQUATION MODEL IN WAHA CODE.......................................2-1
2.1 BASIC WAHA EQUATIONS .............................................................................................2-1
2.1.1 Continuity, momentum and energy equations: ......................................................2-1
2.1.2 Pipe elasticity .........................................................................................................2-3
2.1.3 Closure relations.....................................................................................................2-4
2.1.4 Matrix Form of equations.......................................................................................2-6
2.1.5 Equations for integration of relaxation source terms ...........................................2-10
2.1.6 Calculation of matrices, eigenvalues and eigenvectors........................................2-10
2.1.7 Some comments on calculation of matrices and eigenvalues in WAHA code ....2-11
2.2 INTER-PHASE MASS, MOMENTUM, AND ENERGY TRANSFER ..........................................2-12
2.2.1 Transition from dispersed to horizontally stratified flow.....................................2-12
2.2.2 Inter-phase momentum transfer ...........................................................................2-14
2.2.2.1 Dispersed-bubbly flow ..............................................................................2-14
2.2.2.2 Dispersed-droplet flow..............................................................................2-15
2.2.2.3 Dispersed-bubbly-to-droplet transitional flow ..........................................2-16
2.2.2.4 Horizontally stratified flow .......................................................................2-16
2.2.2.5 Dispersed-to-horizontally stratified transition flow ..................................2-18
2.2.3 Inter-phase heat and mass transfer .......................................................................2-19
2.2.3.1 Dispersed flow...........................................................................................2-19
2.2.3.2 Horizontally stratified ...............................................................................2-21
2.2.3.3 Dispersed-to-horizontally stratified transitional flow ...............................2-22
2.3 WALL FRICTION............................................................................................................2-23
2.3.1 Steady wall friction ..............................................................................................2-23
2.3.1.1 Dispersed flow...........................................................................................2-23
2.3.1.2 Horizontally stratified flow .......................................................................2-24
2.3.1.3 Dispersed to horizontally stratified transition flow...................................2-24
2.3.1.4 Minor losses in elbows..............................................................................2-25
2.3.2 Unsteady wall shear stress contribution for the two-fluid model.........................2-25
2.4 REFERENCES ................................................................................................................2-28
3 NUMERICAL SCHEME IN THE WAHA CODE ........................................................3-1
3.1 INTRODUCTION ...............................................................................................................3-1
3.2 NUMERICAL SCHEME ......................................................................................................3-1
3.2.1 Operator splitting....................................................................................................3-2
3.2.2 Convection terms with the non-relaxation source terms ........................................3-4
3.2.2.1 Averaging of the Jacobian matrix ...............................................................3-8
3.2.2.2 Basic variables.............................................................................................3-8
3.2.3 Integration of the relaxation source terms..............................................................3-9
3.2.4 Single-phase to two-phase and two-phase to single-phase transition. .................3-12
3.3 REFERENCES ................................................................................................................3-13
1-3

4 MODELS OF TWO-PHASE FLOW THROUGH SUDDEN EXPANSION,


CONTRACTION, OR BRANCH .......................................................................................4-1
4.1 INTRODUCTION ...............................................................................................................4-1
4.2 ABRUPT AREA CHANGE MODEL ......................................................................................4-1
4.2.1 Form of two-phase flow equations in the WAHA code.........................................4-1
4.2.2 Models of flow through an abrupt area change......................................................4-2
4.2.3 Simplified model ....................................................................................................4-3
4.2.4 Conservative model................................................................................................4-4
4.2.5 Conservative-characteristic model .........................................................................4-6
4.2.6 Time marching algorithm.......................................................................................4-7
4.2.7 Test cases of the abrupt area change model ...........................................................4-9
4.2.8 Conclusions on the abrupt area change models ...................................................4-12
4.3 BRANCH MODEL ...........................................................................................................4-13
4.3.1 Model of flow through the branch........................................................................4-13
4.3.2 Branch model pure liquid (teeliq.dat) ...............................................................4-14
4.3.3 Branch model pure vapor (teevap.dat) ..............................................................4-15
4.3.4 Conclusions and Guidelines on the use of the branch model:..............................4-16
4.4 REFERENCES ................................................................................................................4-17
4.5 APPENDIX.....................................................................................................................4-18
4.5.1 WAHA code input file for flow through the contraction .....................................4-18
4.5.2 WAHA code input file for flow through the expansion.......................................4-18
4.5.3 RELAP5 code input file for flow through the contraction...................................4-19
4.5.4 RELAP5 code input file for flow through an expansion......................................4-19
4.5.5 WAHA code input file for liquid flow through the branch..................................4-20
4.5.6 RELAP5/MOD3.3 input file for flow through the branch ...................................4-21
5 CALCULATION OF WATER PROPERTIES IN THE WAHA CODE ...................5-1
5.1 CREATION OF " h2o_prop " FILE WITH TABULATED WATER PROPERTIES ........................5-1
5.2 HOW TO USE THE WATER PROPERTIES FROM FILE "h2o_prop"........................................5-5
5.2.1 Initialization ...........................................................................................................5-5
5.2.2 Calculation of water properties ..............................................................................5-5
5.3 TEST OF THE WAHA WATER PROPERTY SUBROUTINES ..................................................5-7
5.4 VISCOSITY, THERMAL CONDUCTIVITIY, AND SURFACE TENSION ....................................5-9
5.5 REFERENCES ..................................................................................................................5-9
APPENDIX: LISTING OF THE PROGRAM "CREATE.F": ...........................................................5-10
6 FORCES ON THE PIPES................................................................................................6-1
6.1 INTRODUCTION ...............................................................................................................6-1
6.2 DERIVATION OF FLUID FORCE EQUATIONS ......................................................................6-2
6.3 REFERENCES ..................................................................................................................6-6
7 INPUT FILE PREPARATION FOR THE WAHA3 CODE ........................................7-1
7.1 INTRODUCTION AND GENERAL INFORMATIONS ...............................................................7-1
7.1.1 Data cards...............................................................................................................7-1
7.1.2 Data deck organization...........................................................................................7-2
7.1.3 Input file .................................................................................................................7-2
7.1.4 Output files.............................................................................................................7-2
7.1.5 Executing the WAHA program..............................................................................7-5
7.2 CARDS ............................................................................................................................7-7
7.3 TITLE CARD ....................................................................................................................7-8
1-4

7.4 TIME STEP CARD .............................................................................................................7-9


7.5 SWITCH CARD ...............................................................................................................7-11
7.6 FORCE CARD.................................................................................................................7-13
7.7 PRINT CARD ..................................................................................................................7-14
7.8 COMPONENT CARDS - PIPE ............................................................................................7-16
7.8.1 Type card..............................................................................................................7-16
7.8.2 Geometry card 1 ...................................................................................................7-16
7.8.3 Geometry card 2 ...................................................................................................7-18
7.8.4 State card ..............................................................................................................7-19
7.8.5 Connection card....................................................................................................7-21
7.9 COMPONENT CARDS - TANK .........................................................................................7-23
7.9.1 Type card..............................................................................................................7-23
7.9.2 Geometry card 1 ...................................................................................................7-23
7.9.3 Geometry card 2 ...................................................................................................7-24
7.9.4 State card ..............................................................................................................7-25
7.9.5 Connection card....................................................................................................7-27
7.10 COMPONENT CARDS - PUMP........................................................................................7-29
7.10.1 Type card............................................................................................................7-29
7.10.2 Geometry card 1 .................................................................................................7-29
7.10.3 Geometry card 2 .................................................................................................7-30
7.10.4 State card ............................................................................................................7-31
7.10.5 Connection card..................................................................................................7-33
7.11 COMMENT CARD.........................................................................................................7-35
7.12 TERMINATION CARD ...................................................................................................7-36
7.13 EXAMPLES OF INPUT AND OUTPUT FILES.....................................................................7-37
7.13.1 Input file for the Simpson's pipe problem simpsonel.dat ................................7-37
7.13.2 General output file simpsonel .........................................................................7-38
7.13.3 Minor output file results/simpsonel.out ..........................................................7-40
7.13.4 Major output file results/simpsonel.036..........................................................7-41
7.13.5 Restart file results/restart.002..........................................................................7-42
8 WAHA TEST CASES AND RESULTS ..........................................................................8-1
8.1 SINGLE-PHASE TEST CASES .............................................................................................8-1
8.1.1 Ideal gas shock tube - Sod's problem (shockgas.dat) .............................................8-1
8.1.2 Shock tube with vapor (shockvap1.dat) .................................................................8-3
8.1.3 Shock tube with liquid (shockliq.dat) ....................................................................8-4
8.1.4 Critical flow of ideal gas in convergent-divergent nozzle (sobagas.dat) ...............8-5
8.1.5 Development of the hydrostatic pressure field in a vertical pipe - liquid
(gravliq.dat) .....................................................................................................................8-7
8.1.6 Development of the hydrostatic pressure field in a vertical pipe - vapor
(gravvap.dat) ...................................................................................................................8-8
8.1.7 Abrupt area change model - contraction - liquid (abruptliqcont.dat).....................8-8
8.1.8 Abrupt area change model - expansion - liquid (abruptliqexpa.dat)....................8-10
8.1.9 Abrupt area change model - contraction - vapor (abruptvapcont.dat) .................8-11
8.1.10 Abrupt area change model - expansion - vapor (abruptvapexpa.dat) ................8-12
8.2 TWO-PHASE TEST CASES ...............................................................................................8-14
8.2.1 Two-phase shock tube (sr.dat) .............................................................................8-14
8.2.2 Abrupt area change model - contraction - two-phase (abrupt2fcont.dat) ............8-16
8.2.3 Abrupt area change model - expansion - two-phase (abrupt2fexpa.dat)..............8-18
8.2.4 Separation of liquid and ideal gas (sepliqgas.dat)................................................8-19
1-5

8.2.5 Separation of liquid and vapor (sepliqvap.dat) ....................................................8-19


8.2.6 Oscillations of the liquid column (utube.dat and ucev.dat)..................................8-20
8.2.7 Water faucet problem (faucet.dat)........................................................................8-21
8.2.8 Velocity of small surface waves in horizontally stratified flow (surf.dat)...........8-21
8.2.9 Slug propagation (slug.dat) ..................................................................................8-22
8.2.10 "Dam-break" problem in the horizontal pipe (strat.dat).....................................8-23
8.3 MODELS OF TWO-PHASE FLOW EXPERIMENTS...............................................................8-25
8.3.1 Edwards pipe - discharge of a hot liquid from a horizontal pipe (edwards.dat) ..8-25
8.3.2 Critical flashing flow in a nozzle - Super Moby Dick experiment (moby.dat)....8-26
8.3.3 Simpson's valve closure induced water hammer experiment (simpsonel.dat) .....8-27
8.3.4 UMSICHT water-hammer experiment (ppp307t.dat)..........................................8-29
8.3.5 Cold Water Hammer Test Facility (cwhtf.dat, cwhtf1.dat)..................................8-30
8.3.6 Steam condensation induced water hammer at AEKI (kfki.dat)..........................8-32
8.4 REFERENCES ................................................................................................................8-34
9 DATA AND CODE STRUCTURE..................................................................................9-1
9.1 DATA STRUCTURE ..........................................................................................................9-1
9.1.1 Array or record "pipe"............................................................................................9-2
9.1.2 Main arrays.............................................................................................................9-3
9.1.3 Common blocks......................................................................................................9-5
9.2 CODE STRUCTURE ..........................................................................................................9-6
9.2.1 Input processing subroutines..................................................................................9-6
9.2.2 Output subroutines .................................................................................................9-7
9.2.3 Subroutine "t_integr"..............................................................................................9-7
9.2.4 Calculation of eigenvalues - subroutine "eigen" ....................................................9-9
9.2.5 Relaxation source term subroutines - subroutine "source" ..................................9-10
9.2.6 Boundary conditions, junctions, branches - subroutine "junctions" ....................9-12
9.2.7 Subroutines for calculation of water properties ...................................................9-13
9.2.8 CPU measurement subroutines ............................................................................9-13

1-6

Nomenclature
Uppercase letters:
A
pipe cross-section (m2)
r
A
matrix in front of time derivative of vector
r
AT
matrix in front of time derivative of vector T
Ae
part of pipe cross-section varying due to elasticity (m2)
Af, Ag
cross-section covered by liquid (f) or gas (g) (m2)
r
B
matrix in front of space derivative of vector
Ci
interfacial friction coefficient (kg/m4)
CD
dimensionless interfacial friction coefficient
CVM
virtual mass term (N/m3)
Cvm
virtual mass coefficient (kg/m3)
CVM
virtual mass coefficient ( CVM = Cvm (1 ) ) (kg/m3)
C
Jacobian matrix (C=A-1.B)
++
-C ,C
upwind and downwind part of Jacobian matrix
D
pipe diameter (m)
E
modulus of elasticity for pipe wall material (N/m2)
Fwall
wall friction forces per unit of volume (N/m3)
Frf
wall friction multiplier
F
force (N)
r
F
discrepancy vector in an abrupt area change model
r
r
r
G
source term vector G = L1 Q
Gf, Gg
auxiliary constants in vectorial form of equations
g
gravitational acceleration (m/s2)
Hif, Hig
volumetric heat transfer coefficient ( W/(m3K) )
K
constant of elasticity ( K=D/(d E) )
L
pipe length
L1, L2
stratified-to-dispersed flow transition factors
L
matrix of eigenvectors
Nu
Nusselt number
Pi
interfacial presure ( pi = Pi (1 ) ) (Pa)
Pr
Prandtl number
Qif, Qig
interface-liquid and interface-gas heat transfer rate per unit of volume (W/m3)
r
r
r
Q
source term vector Q = A 1 S
r r
r
R A , RF , Rw
vectors - part of the non-relaxation source terms
Re
Reynolds number
S
stratification factor (between 0 and 1)
r
S
source term vector
r
SN R
non-relaxation source term vector
r
SR
relaxation source term vector
T
temperature (K)
Ts
saturation temperature (K)
r
T
thrust force (N)
T1, T2
auxiliary variables in the inverse matrix A-1
V
volume (m3)
We
Weber number

1-7

Lowercase letters:
agf
interfacial area concentration (m2/m3)
c
sonic velocity (m/s)
cp
specific heat capacity at constant pressure ( J/(kg K) )
d
pipe wall thickness (m)
d0
bubble or droplet radius (m)
e
specific total energy (J/kg)
fg, ff
dimensionless inter-phase friction factors in stratified flow
++ -f ,f
upwind, downwind factors of the numerical scheme
g
9.81 (m/s2)
h
specific enthalpy (J/kg)
k
thermal conductivity
coefficients of unsteady wall friction model
kw , kT
m
mass (kg)
or
orientation of the junction (+1 or -1)
p
pressure (Pa)
pi
interfacial pressure ( pi = Pi (1 ) ) (Pa)
r
pipe radius (m)
r
r
unit direction vector of pipe volume
t
time (s)
u
specific internal energy (J/kg)
v
velocity (m/s)
vcritical
critical velocity for the stratified-to-dispersed flow transition (m/s)
vi
velocity of the interfacial area (m/s)
vm
mixture velocity (m/s)
vr
relative velocity (vr=vg-vf) (m/s)
vfg
modified relative velocity vr
w
pipe velocity in the flow direction (m/s)
x
spatial coordinate (m)
Greek letters:

bub

t
t S

vapor volume fraction


modified vapor volume fraction
angle (Fig. 1a)
time step
time step for integration of the relaxation sources
distance between a pair of neighboring grid points
vapor generation rate ( kg/(m3s) )
relaxation time in the general relaxation equation (s)
WAHA num. scheme variables for evaluation of "smoothness"
auxiliary variable in the vapor heat transfer correlations
1)
pipe inclination (0 horizontal, 90 vertical)
2)
relaxation time for heat and mass transfer in dispersed flow (s)
3)
relaxation time of the unsteady friction model
4)
measure for "smoothness" of the solution in the numerical scheme
eigenvalue
matrix of eigenvalues
dynamic viscosity ( kg/(m s) )
characteristic variables or modified characteristic variables
1-8

density (kg/m3)
surface tension (kg/s2)
1)
vector of variables in the generalized relaxation equation
2)
vector
of conservative variables
r
= [(1 - ) f , g ,(1 - ) f v f , g v g , (1 - ) f e f , g e g ]

s
un

Subscripts:
av
f
g
i, i1,i2

in
j
k

kA, nA
kB, nB
m
n

out
r
s

azimuth
r
vector of basic variables for convection = ( p, , v f ,vg , u f , u g )
r
vector of basic variables for relaxation sources T = ( p, , v f ,vg , T f , Tg )
limiters
mass flow rate (kg/s)
steady component of wall friction (N/m2)
unsteady component of wall friction (N/m2)

average
liquid phase
gas phase
cell indexes
inlet
cell index, index
index - usually denotes k-th component of vector, or number of the pipe
index of cells after a cross-section area change
index of cells before a cross-section area change
mixture
neighboring pipe index
outlet
relative
saturation

Superscripts:
*
intermediate values of the operator splitting procedure
n
time level
++, -upwind and downwind part of matrix or vector

1-9

1. WAHA CODE MANUAL - INTRODUCTION


The goal of Workpackage 2 (WP2) of the WAHALoads project (5th Framework Programme
EURATOM of European Union) is development of the new computer code named WAHA
specialized for simulations of the two-phase flow water hammer phenomena (Giot, 2000, Giot
et. al. 2001). Work within the WP2 was coordinated by "Joef Stefan" Institute (JSI) and
divided into two main parts:
Development of the physical model for the WAHA code,
Development of the numerical scheme for the WAHA code,
The first task was performed by Universite Catholique de Louvain (UCL), CEA Grenoble and
JSI, while the second task was completed by JSI. Theoretical background on the possible
Fluid-Structure-Interaction in future WAHA versions was prepared by CEA (Lemonnier,
2004).
1.1. DOCUMENTS RELATED TO THE WAHA CODE
The present document, foreseen as Deliverable D10 in the WAHALoads contract (Giot,
2000), contains description of the WAHA code physical models, numerical scheme, and
instructions how to use the WAHA code. This manual gives all the necessary information to
understand and run the WAHA code, which is given in the form of two deliverables: D65 source of the WAHA code (Tiselj et. al., 2004), and D66 - source code of the WAHA pre- and
postprocessors (Tiselj et. al., 2004).
"WAHA code manual" is based on some of the previous deliverables of the WAHALoads
project, and also contains parts of the following documents:
D62 - Numerical Method of the WAHA code, Version October-2001. Section 3
presents updated report on the numerical scheme of the WAHA code.
D63 - WAHA code development interim report - WAHA single-phase code,
Version October-2001. D63 - Manual of the single-phase version of WAHA code.
JSI report IJS-DP-8726 - WAHA code - Models of two-phase flow through sudden
expansion and contraction, (Horvat et. al., 2003). This report is now contained in
Chapter 4.
D10 revision October-03 - WAHA2 Code Manual - Code Manual of the previous
code version (Tiselj et. al., 2003).
The present "WAHA code manual" is also replacing the following deliverables planned in the
contract, which were not issued as separate reports:

D9 - Report on Physical Models. The content of the deliverable D9 is in Sections


2.2 and 2.3 of the WAHA code manual, which contain description of the
correlations applied in the WAHA code.
D60 - Formulation of Basic Equation. The content of D60 is in Section 2.1, which
contains description of the basic equations of the WAHA code.
D64 - Code development final report. The content of the D64 is summarized in the
Sections 1.1. and 1.2. of the WAHA code manual. These sections contain basic
facts about the WAHA code.

1-10

The "WAHA Code Manual" is a living document that contains description of the current
release of the WAHA code.
1. The first version of the WAHA code was WAHA0 released in October 2002.
2. The second version was WAHA1 released in June 2003.
3. The third version was WAHA2 code released in October 2003.
4. Current version of the WAHA code described in this manual is WAHA3,
released in March 2004.
Different versions of the WAHA code are independent. The latest version of the WAHA code
is recommended to the users.

1.2. BRIEF DESCRIPTION OF THE WAHA CODE


Main features of the WAHA3 version are:
One-dimensional six-equation two-fluid model for two-phase flow of water. Some
types of simulations are also possible for two-phase flow of water and ideal gas
without inter-phase heat and mass transfer. Hyperbolicity is required.
The code distinguishes two flow regimes: dispersed and horizontally stratified.
The code contains correlations for mass, momentum and heat transfer between
phases, and for wall friction. The correlations are flow regime dependent.
The pipe elasticity and variable pipe cross-section effects are included in the code.
The WAHA code is using its own steam tables.
Special models in the current version of the WAHA code: two pipes can be
connected with an abrupt-area change model, a tank (constant pressure boundary
condition) and a pump (constant velocity boundary condition). A branch model is
used to connect three pipes in a single point.
Explicit numerical scheme based on the operator splitting: the characteristic upwind
discretisation of convective and non-relaxation source terms is used in the first substep, while stiff relaxation source terms (inter-phase exchange terms) are treated in
the second sub-step. Numerical diffusion can be suppressed with the second-order
accurate treatment of the convective terms.
Model of the unsteady wall friction is available.
Forces on the pipes can be calculated.
Main new features of the WAHA3 version compared to the WAHA2 version are:
Branch - it allows connection of three pipes in a single point.
Model of unsteady wall friction.
Calculation of forces on the pipes.
The WAHA3 can be used for modeling of the water hammer transients in piping systems
initiated with the rapid valve closure or opening. The code is capable to simulate the
condensation-induced water hammer in the horizontal pipes, however, further improvement of
the models and correlations is planned to improve the accuracy of the predictions.

1-11

1.3. REFERENCES
1-1. M. Giot, WAHALoads contract FIKS-CT-2000-00106, Annex I, Description of
work: Two-phase flow water hammer transients and induced loads on materials and
structures of nuclear power plants, September, 2000.
1-2. M. Giot, H.M. Prasser, A. Dudlik, G. Ezsol, M. Habip, H. Lemonnier, I. Tiselj, F.
Castrillo, W. Van Hove, R. Perezagua, S. Potapov, Two-phase flow water hammer
transients and induced loads on materials and structures of nuclear power plants
(WAHALoads), FISA 2001 EU research in reactor safety - Proceedings, 2001.
1-3. A. Horvat, I. Tiselj, J. Gale, WAHA code - models of two-phase flow through
sudden expansion and contraction, IJS-DP-8726, Jozef Stefan Institute Report,
January 2003.
1-4. H. Lemonnier, Two-fluid 1D-averaged model equations for a pipe undergoing
arbitrary motions, WAHALoads deliverable D61, CEA-T3.3-D61-300304-rev2 and
CEA technical report DTP/SMTH/LDTA-2002-043, Revision 2, CEA/Grenoble,
2004.
1-5. I. Tiselj, A. Horvat, G. erne, J. Gale, I. Parzer, B. Mavko, M. Giot, J.M.
Seynhaeve, B. Kucienska, H. Lemonnier, WAHA2 code manual, Deliverable D10
of the WAHALoads project, October 2003.
1-6. I. Tiselj, A. Horvat, G. erne, J. Gale, I. Parzer, B. Mavko, M. Giot, J.M.
Seynhaeve, B. Kucienska, H. Lemonnier, Source code of the WAHA3, Deliverable
D65 of the WAHALoads project, March 2004.
1-7. I. Tiselj, A. Horvat, G. erne, J. Gale, I. Parzer, B. Mavko, M. Giot, J.M.
Seynhaeve, B. Kucienska, H. Lemonnier, Source code of the WAHA3 pre- and
post-processors, Deliverable D66 of the WAHALoads project, March 2004.

1-12

2 TWO-FLUID SIX-EQUATION MODEL IN WAHA CODE


This chapter describes equations of the two-phase flow model used in the WAHA code.
2.1 BASIC WAHA EQUATIONS
2.1.1 Continuity, momentum and energy equations:
Basic WAHA code equations represent one-dimensional two-fluid model that takes into
account pipe-elasticity and motion of the pipe with speed w. Two continuity, two momentum,
and two energy equations for each phase of a mixture are:
A (1 - ) f

t
A g
t

A (1 - ) f (v f w)
x

A g (v g w)
x

= Ag ,

(2.1-1)

= Ag ,

(2.1-2)

A(1 - ) f v f
A(1 - ) f v f (v f w)
p

+
+ A(1 - )
A CVM Api
=
t
x
x
x ,
ACi | vr | vr Ag vi + A(1 ) f g cos AF f , wall

A g v g

A g v g (v g w)

+ A
+ A CVM + Ap i
=
t
x
x
x
AC i | v r | v r + Ag v i + A g g cos AFg , wall
+

A (1 ) f e f

A(1 ) f e f (v f w)

+p

t
x
*
2
AQif Ag (h f + v f / 2) + A(1 ) f g cos v f
A g eg

A g eg (vg w)

A(1 ) A(1 ) p(v f w)


+
=
,
t
x

A p (vg w)
A
+
=
.
t
x
t
x
AQig + Ag (hg* + vg2 / 2) + A g g cos vg
+

(2.1-3)

+p

(2.1-4)

(2.1-5)

(2.1-6)

Specific total energy of liquid or gas is e = u + v 2 / 2 and specific enthalpy of liquid or gas is
h = u + p/ .
This model is similar to typical two-fluid models used in computer codes like RELAP5
(Carlson et al., 1990), TRAC (Mahaffy, 1993) or Cathare (Bestion, 1990). Left-hand side of the
equations contain the terms with temporal or spatial derivatives. Hyperbolicity of equations is
ensured with virtual mass coefficient (terms with CVM) and with interfacial pressure term
(terms with pi) in momentum equations (2.1-3), (2.1-4). Terms on the right side of the
equations are terms describing inter-phase heat, mass (terms with g - vapor generation rate

2-1

and volumetric heat fluxes Qif , Qig ) and momentum transfer (terms with Ci), wall friction
( F f , wall , Fg ,wall ) and gravity forces.
Different transformations are performed on the Eqs. (2.1-1) - (2.1-6) to obtain the equations
used in WAHA code. The non-conservative form of momentum equations is obtained when
the continuity equations are multiplied with the phasic velocities and subtracted from the
momentum equations (2.1-3) and (2.1-4):
vf
p

+ (1 - ) f (v f w)
+ (1 - )
CVM p i
=
t
x
x
x ,
C i | v r | v r g (v i v f ) + (1 ) f g cos F f , wall

(1 - ) f

vg

vf

vg

+
+ CVM + p i
=
t
x
x
x .
C i | v r | v r + g (vi v g ) + g g cos Fg , wall

+ g (v g w)

(2.1-7)

(2.1-8)

The kinetic energy equations are obtained with multiplying the momentum equations (2.1-3)
and (2.1-4) with the phasic velocities and rearrange the result into the following form:
A(1 - ) f v 2f / 2
t

A(1 - ) f (v f w)v 2f / 2

+ A(1 - )(v f w)

p
p
+ A(1 - )w
x
x

= Av f C i | v r | v r Ag v i v f + Ag v 2f / 2 + Av f (1 ) f g cos Av f F f , wall
A v f CVM Ap i v f
x

A g v g2 / 2
t

A g (v g w)v g2 / 2

+ A (v g w)

, (2.1-9)

p
p
+ A w
x
x

x
. (2.1-10)

2
+ Av g CVM + Api v g
= Av g C i | v r | v r + Ag vi v g Ag v g / 2 + Av g g g cos Av g Fg , wall
x

The internal energy equations are obtained subtracting the kinetic energy equations (2.1-9)
(2.1-10) from the total energy equations (2.1-5), (2.1-6):
A(1 ) f u f A(1 - ) f u f (v f w)
A(1 - ) (v f w)
A(1 )
p
+
+p
+p
A(1 ) w
t
x
t
x
x ,

+ Av f CVM + Api v f
= AQif Ag h *f Av f Ci | v r | v r + Ag v f (vi v f ) + Av f F f , wall
x
A g u g

A g u g (v g w)

A (v g w)
A
p

+p
+p
Aw Avg CVM Api vg
=
t
x
t
x
x
x .
AQig + Ag hg* + Avg Ci | vr | vr Ag vg (vi vg ) + Avg Fg , wall
+

(2.1-11)

(2.1-12)

Contribution of the kinetic energy equation is partially neglected in the internal energy
equations. All terms that come from the inter-phase exchange of kinetic energy are neglected
in internal energy equation as large uncertainties are connected with inter-phase exchange of
energy. These terms are the virtual mass term, the interfacial pressure term, the interfacial

2-2

friction term and the change of kinetic energy due to the inter-phase mass exchange. The
energy equations used in the WAHA code are:
A(1 - ) (v f w)
A(1 ) f u f A(1 - ) f u f (v f w)
p
A(1 )
+p
A(1 ) w =
+
+p
x , (2.1-13)
t
x
t
x
*
AQif Ag h f + Av f Ff , wall
A g u g

A g u g (v g w)

t
x
AQig + Ag hg* + Avg Fg , wall

+p

A (v g w)
A
p
+p
Aw =
t
x
x .

(2.1-14)

The non-conservative form of the internal energy equations is used in the WAHA code.
Therefore, the continuity equations (2.1-1) and (2.1-2) are multiplied by the phasic internal
energies and subtracted from Eqs. (2.1-13) and (2.1-14), respectively:

(1 ) f

uf
t

+ (1 - ) f (v f w)

uf
x

+p

(1 - ) (v f w)
(1 )
A
+ p(1 )
+p
t
At
x
,

A
p
+ p(1 - )(v f w)
(1 )w = Qif g (h*f u f ) + v f Ff , wall
Ax
x

(v g w)
ug
ug
p
A
A

w =
+ p (v g w)
+ g (v g w)
+p
+ p
+p
x .
Ax
At
x
t
x
t
Qig + g (hg* u g ) + vg Fg , wall

(2.1-15)

(2.1-16)

2.1.2 Pipe elasticity


The diameter of a piping system can change due to the variable geometry and elasticity of
tubes:
A( x, t ) = A( x) + Ae ( p ( x, t )) .

(2.1-17)

The second term with Ae is much smaller than the first one. The pressure pulse changes the
pipe diameter D in accordance with linear relation (Wylie, Streeter, 1978):
dAe
D dp
=
= K dp ,
A( x) d E

(2.1-18)

where d represents wall thickness, and E stands for modulus of elasticity. With relations
(2.1-17), (2.1-18) taken into account the continuity equations become:

2-3

(1 - ) f

p (1 - ) f (v f w)
p
+
+ (1 - ) f (v f w) K
=
x
x
t
t
,
1 dA( x)
g (1 - ) f (v f w)
A( x) dx

+ (1 - ) f K

p g (v g w)
p
+
+ g (v g w) K
=
x
x
t
t
,
1 dA( x)
g g (v g w)
A( x) dx
+ g K

(2.1-19)

(2.1-20)

where temporal changes of the cross-section A are neglected in the denominators of the last
term of Equations (2.1-19) and (2.1-20). The internal energy equations become:

uf
uf
(1 - )(v f w)

p
+ (1 - ) f (v f w)
p
+ p(1 ) K
+p
x
t
x
t
t
, (2.1-21)
1 dA( x)
p
p
*
+ p(1 - )(v f w) K
(1 - )w
= Qif g (h f u f ) + v f Ff , wall (1 )(v f w) p
A( x) dx
x
x

(1 ) f

ug
ug
(v g w)

p
p
+ g (v g w)
+p
+ pK
+p
+ p (v g w) K
t
x
t
t
x
x
.
1
(
)
dA
x
p
w
= Qig + g (hg* u g ) + vg Fg , wall (vg w) p
A( x) dx
x

(2.1-22)

Again, the temporal changes of cross-section A are neglected in the denominators of the last
term of Equations (2.1-21) and (2.1-22).
Equations solved in WAHA code are:
- Continuity equations (2.1-19), (2.1-20),
- Momentum equations (2.1-7), (2.1-8),
- Energy equations (2.1-21), (2.1-22).
2.1.3 Closure relations
Additional closure relations are needed:
1) Two additional equations of state for each phase are needed. The equation of state for phase k
is:
k
k
duk .
d p +
d k =

p u
uk p

k = f,g

(2.1-23)

Derivatives on the right hand side of the Eq. (2.1-23) are determined by the water property
subroutines described in the Chapter "5. Water Properties. Pressure and specific internal
energies or pressure and temperatures are used as input values.

2-4

2) The virtual mass term CVM in the momentum Eqs. (2.1-7) and (2.1-8) is one of the virtual
mass terms discussed by Drew et. all. (1979):
vg v f
v f
vg
CVM = CVM
+ (v f w)
- (v g w)
t
x
t

(2.1-24)

where CVM is the virtual mass coefficient (Tiselj,1997, Carlson et. al. 1990), which ensures
hyperbolicity of equations, if relative velocity is not very high vr 0.3 ctwo fluid :

CVM

1 1 + 2

2 1 a

= (1 S ) m (1 )
1.5 10( 0.4)( 0.6)

3 2 2
(1 )(2 1)

+
(1 + g / f ) 2
2

0.4
0.4 < 0.6

(2.1-25)

> 0.6

The main purpose of the virtual mass term CVM is to ensure hyperbolicity of equations,
thus only absolute velocities are taken into accounts in derivatives in Eq. (2.1-24).
Derivatives of structure velocity w are neglected in virtual mass term CVM. Factor S
determines stratification of the flow. For S = 0 the flow is dispersed, S = 1 means
horizontally stratified flow, and intermediate values mark transition (see section "2.2.1
Transition from dispersed to horizontally stratified flow").
3) The interfacial pressure term in Eqs. (2.1-7) and (2.1-8) contains interfacial pressure pi ,
which exists only in the stratified flow regime in the WAHA code (see Bestion, 1990, or
Carlson et. al. 1990):
pi = S (1 )( f g ) gD .

(2.1-26)

3a)(For users that do not want to use the virtual mass term an alternative interfacial pressure
term can be used to ensure hyperbolicity:
p i = S (1 )( f g ) gD + (1 S )

i g f v r2
f + (1 ) g

.
(2.1-27)

This form of the interfacial pressure ensures hyperbolicity for i 1 and is discussed in
references [2-2,2-17]. Term is activated with modification of the subroutine "eigen" in the
line where interfacial pressure "pin" is calculated. One line of the code must be uncommented. Virtual mass term is disabled in subroutine "virtualmass", where variable
"cvm" is set to zero at the end of the subroutine. WAHA code with such modification was
not tested, so the modification is recommended only for test purposes)
4) The closure relations for mass ( g ), momentum ( C i ) and heat transfer ( Qif , Qig ) between
both phases are described in section "2.2 Inter-phase mass, momentum, and energy
transfer".

2-5

5) The closure relations for wall friction ( F f , wall ,


friction".

Fg , wall )

are described in section "2.3 Wall

6) The closure relation for the velocity of the interfacial area is simply defined as:
v f
vi =
vg

g 0
g < 0

(2.1-28)

which means that momentum density remains unchanged for the disappearing phase.

2.1.4 Matrix Form of equations


Using the relations (2.1-23), (2.1-24) and (2.1-26), the equations of the two-fluid model:
continuity equations (2.1-19) and (2.1-20), momentum equations (2.1-7) and (2.1-8), and
energy equations (2.1-21) and (2.1-22), can be written in vectorial form as:
A

r
r
r

+B
= S ,
t
x

(2.1-29)
r

where represents the vector of the independent variables = ( p, , v f , v g , u f , u g ) . A and


r
B are matrices of the system and S is a vector with nondifferential terms in the equations. The
r
first two lines of the matrices A and B and the first two components of the vector S are from
continuity equations, lines and components 3 and 4 are from momentum equations, and lines
and components 5 and 6 are from energy equations:

f
(1) + f K f
p u

g + g K
g
p u

f
(1)
uf
p

(1)f + CVM

CVM

0
g

ug
p

A=
0

CVM

g + CVM

(1) pK

(1)f

pK

2-6

(2.1-30)

+ f K f (v f w)
(1)(v f w)
p

u f

+ g K
(vg w)
g (vg w)

p ug

f
(1)(v f w)
u f

(1) f

(vg w)

0
g

ug

(1)

pi

(1)(v f w) f +CVM(vg w)

CVM(v f w)

pi

CVM(vg w)

g (vg w) +CVM(v f w)

(1)(p(v f w)K w)

p(v f w)

(1) p

(1)(v f w) f

( p(vg w)K w)

p(vg w)

(vg w)g

2.1-31)

B=

(1 ) f (v f w)
g
(1 ) f
g
g (vg w)
g
r Ci | vr | vr g (vi v f ) + (1 ) f g cos F f , wall
0
0
dA( x)
w
S=
(2.1-32)

+
0
Ci | vr | vr + g (vi vg ) + g g cos Fg , wall
0
A( x)dx
x
Qif g (h*f u f ) + v f F f , wall
(1 )v f p
(1 ) p
Qig + g (hg* u g ) + vg Fg , wall
vg p
p

The following transformations are performed on the matrices A , B and the vector

r
S

1) The first two equations, i.e. the first two lines in the matrices A , B , and the elements 1
r
and 2 in the vector S , are modified by multiplying the liquid energy equation (line 5) with
the expression
f

u f

,
f
p

(2.1-33)

and subtracting it from the line 1, and by multiplying the gas energy equation with the
expression
g

u g

g
p

(2.1-34)

and subtracting it from the line 2. These result in elements in the columns 5 and 6 of the
first two lines being zero. The obtained lines 1 and 2 are further multiplied with:
Gf =

p
1 2 f
f u f

(2.1-35)

and

2-7

Gg =

1
p
1 2 g
g u g

(2.1-36)

respectively, and then divided by (1 ) and , respectively.

2) The energy equations, i.e. the lines 5 and 6 in the matrices A , B , and the elements 5 and 6
r
in the vector S , are divided with (1 ) and , respectively.
3) In the momentum equations, i.e. the lines 3 and 4 in the matrices A , B , and the elements 3
r
and 4 in the vector S , the following new variables are introduced:
CVM = C vm (1 ) ,
p i = Pi (1 )

(2.1-37)

(2.1-38)

Then the liquid momentum equation (line 3) is divided by (1 ) and the vapor
momentum equation (line 4) is divided by . The following are results of the
transformations:
1

c2f

f
(1 )

Cvm

cg2

f + Cvm

Cvm(1 ) g + Cvm(1 ) 0

0
0

A=

pK

p
(1 )
p

pK

(vf w) w f

f u f
p
vg w w g


g ug
cg2
p

c2f

0 g

f (v f w)
(1 )

g (vg w)

Pi

(2.1-39)

(v f w) f + Cvm(vg w)

Cvm(v f w)

(2.1-40)

B=
Pi (1 )

1
p(v f w)K w
p(vg w)K w

p(v f w)
(1 )

p(vg w)

Cvm(vg w)(1 )

g (vg w) + Cvm(v f w)(1 )

(v f w) f

(vg w)g

2-8

New variables introduced in Eqs. (2.1-39) and (2.1-40) are single-phase sound velocities in
the system with elastic pipes:

1
c

2
f ,g

f , g

f , g
1
u f , g

f ,g

2
p f ,g

D f , g
Ed

1
c

2
0 f ,g

+ K f , g .

(2.1-41)

They are defined with derivatives obtained from Water Properties subroutines (see
chapter 5). The source term vector now becomes:

G

f
Gf
f
g (Qif g (h*f u f )) f 1

u f f (1 a ) v f F f , wall u (1 a ) (v w)

p
f
f
f p f

(
)
v

G
g Gg
g
g

vg Fg , wall
g (Qig + g (hg* u g )) g 1 g
r
0
u g g a
0 w
dA( x)
u g g a

p
+
+

S=

0
0 x
(
)
A
x
dx
F f , wall /(1 ) + f g cos
(Ci | vr | vr g (vi v f )) /(1 )
(
)
p
v

w
p
f
Fg , wall / + g g cos
(Ci | vr | vr + g (vi vg )) /
(
)
p
v

w
p
g
*
v f F f , wall /(1 )
(Q (h u )) /(1 )
if

(2.1-42)

vg Fg , wall /

(Qig + g (hg* u g )) /

The inverse matrix A 1 can be calculated explicitly:


(1 )c2f cg2 g

c2f cg2 f

T1

T1

(1 )c2f

(1 )cg2

T1

T1

A =

c2f p( + cg2 (1 )Kg )

cg2 p(1 c2f K f )

f T1

f T1

(1 )c2f p(1 cg2Kg )

gT1

cg2 p((1 ) + c2f K f )

gT1

g + Cvm(1 )

Cvm
T2

T2
Cvm(1 )
T2

f + Cvm

T2

,
0
1

f
0

(2.1-43)

0
0
1

where:
T1 = c 2f f + (1 )cg2 g ,

(2.1-44)

T2 = f g + C vm m ,

(2.1-45)

m = g + (1 ) f .

(2.1-46)

2-9

2.1.5 Equations for integration of relaxation source terms


Relaxation source terms are source terms that describe inter-phase exchange of mass,
momentum and energy. These source terms are treated in a separate sub step (see section 3.2,
Numerical scheme) where the following equation is solved:

AT

r
T
t

r
= S RELAXATION

(2.1-47)

Basic variables for the relaxation source terms


defined as:

+ f K f
(1 )

p T f

+ gK
g
p Tg

(1 ) f + CVM

CVM

are

T = ( p, , v f ,vg , T f , Tg )

f
(1 )
Tf

u f

(1 ) pK + f

p T f

ug

pK + g

p Tg

CVM

g + CVM

Tg

0
u f
(1 ) f
Tf

is

.
0

AT

AT =
0

and matrix

(2.1-48)

0
ug

Tg

This matrix A T is defined and used in the subroutine relaxterm. Thermodynamic derivatives
are obtained from tabulated steam tables (see chapter 5, Calculation of the water properties) in
the subroutines getliquidall_p_t and getvaporall_p_t.

2.1.6 Calculation of matrices, eigenvalues and eigenvectors


Matrices

A 1 , A 1B

are explicitly calculated in WAHA code:

- A 1B in the subroutine aib


- A 1 in the subroutine ainverse
Eigenvalues of the matrix A 1 B are calculated numerically from the equation:
det( A 1B I ) = 0 .

(2.1-49)

Matrices of eigenvectors L and inverse eigenvectors L1 defined as:

2-10

A 1B = L L1 ,

(2.1-50)

are also calculated numerically ( is the diagonal matrix of eigenvalues). The eigenvalues
and eigenvectors are computed in the subroutine lv2n, which calls subroutines from
EISPACK (http://www.netlib.org/eispack) library for the reduced 4x4 system of equations,
while the remaining 2 eigenvalues and eigenvectors are found analytically.

2.1.7 Some comments on calculation of matrices and eigenvalues in WAHA code


1) Analytical evaluation of the inverse matrix A 1 is rather simple, and would probably remain
simple even if some new correlations with temporal derivatives would be added.
2) Accurate analytical approximations can be found for eigenvalues of the A 1 B matrix (see
Tiselj and Petelin, 1997). However, the analytical approach works as long as the closure
relations of the two-fluid model do not contain spatial or temporal derivatives that do not
influence the eigenvalues. Each newly introduced correlation that contains derivatives
requires new analytical approximations, which are more difficult to find due to new terms.
Since there is actually no reason, why the closure relations should not contain the
derivatives, the decision was to use purely numerical approach to find the eigenvalues and
eigenvectors. That, as a consequence, causes larger CPU time consumption (roughly 1.5
times slower code), lower accuracy of calculated eigenvalues at relative velocities close to
zero, and higher accuracy at relative velocities (vr > 5-10 m/s).
3) Analytical evaluation of the product A 1 B is used in the current version of the WAHA code.
Numerical multiplication of the matrices A 1 and B is less accurate as it contains
subtraction of large numbers. However, it would be beneficial to evaluate the product A 1 B
numerically since it is relatively easy to add new correlations that contain derivatives.
4) At locations with zero relative velocity vr = 0, the two-fluid model is not hyperbolic
because only five linearly independent eigenvectors exist in such case. In the current
version of the WAHA code relative velocity 10-7 m/s is artificially maintained in all
hydrodynamic volumes and also in the points between the volumes where the eigenvalues
are calculated.

2-11

2.2 INTER-PHASE MASS, MOMENTUM, AND ENERGY TRANSFER


2.2.1 Transition from dispersed to horizontally stratified flow
The WAHA code recognizes two basic flow regimes: dispersed and horizontally stratified
two-phase flow with transition area between both regimes. Subroutine stratification calculates
the value of the stratification factor S . Value of stratification factor in dispersed flow is S = 0 ,
in horizontally stratified flow S = 1 , and value of stratification factor in transition area is
between 0 < S < 1 .
Stratification factor is calculated as a product of several factors:
(2.2-1)

S = S K H X inclination X v X v X X 1

The main factor S K H stems from an approximation based on the Kelvin-Helmholtz instability
(Chandrasekhar, 1961):

S K H

= L1

v
critical

v r < L 2 v critical

(L1 L2 )

L 2 v critical v r

(2.2-2)

L1 v critical

v r L1 v critical

Factors L2 and L1 are currently set to L1 = 1.0 and L2 = 0.5. Possible modifications of the
factors are foreseen as great uncertainties are related to the transition criteria between the
dispersed and horizontally stratified flow.
Critical velocity for the appearance of the Kelvin-Helmholtz instability used in Eq. (2.2-2) is
(1 )
.
+
v critical = gD( f g )
g
f

(2.2-3)

This critical velocity is at the same time maximum relative velocity, where two-fluid model
with applied interfacial pressure term (2.1-26) and without virtual mass term, is still
hyperbolic.
Next factor in Eq. (2.2-1) is related to the inclination of the pipe. According to RELAP5
(Carlson et. al. 1990), stratification cannot appear in pipes with inclination larger than 45
degrees. Smoothed criteria is used in WAHA:

X inclination

0
= 60 60 0 30 0

)(

< 30 0

(2.2-4)

30 0 60 0

60

Stratification in Eq. (2.2-1) is further limited for high mass fluxes:


X v

= (30000 m v m ) (30000 2500 )

2-12

m v m < 2500 kg / m 2 s
2500 kg / m 2 s m v m 30000 kg / m 2 s

m v m 30000 kg / m s
2

(2.2-5)

Similar, but less "smooth" criterion is used in RELAP5, and Cathare (Bestion, 1990):
mvm > 3000kg / m 2 s .

(2.2-6)

An additional criteria is included in WAHA, which reduces or prevents stratification at large


mixture velocities:
v m < 25 m / s

X v = (100 v m ) (100 25)

25 m / s v m 100 m / s

(2.2-7)

v m 100 m / s

Additional factors in Eq. (2.2-1) reduce stratification at very low or very high vapor volume
fractions:
X

6
10 3 5 10 6
= 5 10

X 1

)(

< 5 10 6
5 10 6 10 3
10 3

6
10 3 5 10 6
= (1 ) 5 10

)(

(1 ) < 5 10 6
5 10 (1 ) 10 3
(1 ) 10 3
6

(2.2-8)

Uncertainties of the applied criteria for transition between dispersed and horizontally
stratified flow are large and changes of the criteria are likely to appear in the next versions of
the code.

2-13

2.2.2 Inter-phase momentum transfer


The coefficient C i in momentum equations (2.1-7) and (2.1-8) is calculated from correlations,
which are valid for two-phase flow of water and vapor and for two-phase flow of water and
ideal gas. The correlations are described below.
2.2.2.1 Dispersed-bubbly flow
For dispersed flow, where < 0.5 (bubbly flow the coefficient Ci is calculated in the
subroutine getceibub (parent subroutine getceidisp) as:
Ci =

1
f CD a gf
8

(2.2-9)

with drag coefficient of the bubble:


CD = 24(1 + 0.1Re0.75 ) / Re ,

(2.2-10)

and interfacial area concentration:


agf = 3.6 bub / d 0

(2.2-11)

Reynolds number in Eq. (2.2-10) is defined as


Re =

(We ) (1 )

f v 2fg

(2.2-12)

The product of the critical Weber number and surface tension is:
(We ) = max(5 , 1010 ) .

(2.2-13)

Modified square of the relative velocity is defined as:

(We )
.
v 2fg = max vr2 ,
1/ 3

f min( D , 0.005 bub )

(2.2-14)

Average bubble diameter is:


d0 =

(We )

f v 2fg

(2.2-15)

The modified vapor volume fraction is:


max(min( , 0.5) ,105 ) 0.3 or 0.5
.
3( 0.3)( 0.5) + 0.3
0.3 < < 0.5

bub =

(2.2-16)

Modification of bub for > 0.3 smoothes the transition from dispersed bubbly to dispersed
droplet flow. Surface tension is calculated as a function of the saturation temperature at
actual pressure in subroutine surftension, liquid viscosity f is calculated in subroutine visc

2-14

as function of liquid density, temperature, pressure, and saturation temperature. Similar type
of correlation is used in RELAP5 code (Carlson et. al., 1990). The correlation works also for a
mixture of liquid water and ideal gas. In that case the surface tension is calculated at the fluid
temperature.

2.2.2.2 Dispersed-droplet flow


For dispersed flow, where > 0.95 (droplet flow), the inter-phase friction coefficient is
calculated in subroutine getceidrp (parent subroutine getceidisp) as:
1

Ci = max g CD agf , 0.1 ,


8

(2.2-17)
with the drag coefficient of the droplet:

C D = min 24(1 + 0.1Re 0.75 ) / Re, 0.5

),

(2.2-18)

and the interfacial area concentration:


a gf = 3.6 max( drp ,104 ) / d 0 .

(2.2-19)

Reynolds number in Eq. (2.2-18) is defined as


Re =

g v fg d 0
.
g

(2.2-20)

The modified relative velocity is defined as


v fg = max( v r ,0.001) .

(2.2-21)

The average droplet diameter is:


(We )
, D .
d 0 = min
g v 2fg

(2.2-22)

Product of the critical Weber number and surface tension is:


(We ) = max(6 , 1010 ) .

(2.2-23)

The modified liquid volume fraction is:


drp = 1 max ( , 0.95) .

(2.2-24)

The surface tension is calculated as a function of the saturation temperature at actual


pressure in the subroutine surftension and the vapor viscosity g is calculated in subroutine
visc as function of vapor density, temperature, pressure, and saturation temperature. A similar
correlation is used in RELAP5 code (Carlson et. al., 1990). The correlation also works for a

2-15

mixture of liquid water and ideal gas. In that case the surface tension is calculated at the fluid
temperature and air viscosity is set to g = 2.0 10 5 kg / (s m )

2.2.2.3 Dispersed-bubbly-to-droplet transitional flow


For dispersed flow 0.5 0.95 (bubbly-to-droplet transition), inter-phase friction coefficient
is calculated with interpolation in the subroutine getceidisp. This subroutine getceidisp first
calls the subroutine for the inter-phase friction coefficient in bubbly flow (getceibub), which
obtains results for inter-phase friction coefficient at vapor volume fraction = 0.5 . Then the
subroutine getceidisp calls for the inter-phase friction coefficient in droplet flow (getceidrp) at
the vapor volume fraction = 0.95 and performs the interpolation:

Ci = Ci bubbly

)q (Ci droplet )(1q) ,

0.95
q=

0.95 0.5

(2.2-25)

r = 0.3 .

(2.2-26)

Very large differences (e.g. a few orders of magnitude) can exist between the Ci bubbly and
Ci droplet . In order to make the bubbly-droplet transition smooth, the value of the parameter r
was tuned and the evaluation of the bub in Eq. (2.2-16) was modified at vapor volume
fractions > 0.3 .

2.2.2.4 Horizontally stratified flow


For horizontally stratified flow, the inter-phase friction coefficient is calculated in the
subroutine getceistrat from the equation, which states that magnitude of the drag force of the
gas on the liquid is equal to the drag force of the liquid on gas:
F f = Fg = C i v r2 ,

1
1
f f f ( v f v i ) 2 = f g g (v g v i ) 2 ,
8
8

(2.2-27)

with the friction factors defined as


f f = (0.79 ln(Re f ) 1.64) 2 ,
f g = (0.79 ln(Re g ) 1.64) 2 ,

(2.2-28)

where Reynolds numbers are defined as

v f v i A f f
Re f = max1000 ,
,
f

v g v i Ag g
Re g = max1000 ,
.
g

(2.2-29)

Interface velocity v i is obtained with a short iterative procedure from Eqs. (2.2-27), (2.2-28) ,
(2.2-29), and inter-phase friction coefficient is then calculated as:

2-16

Ci =

(v g v i ) 2
1
g fg
a gf
8
(v g v f ) 2

Ci =

(or

(v f v i ) 2
1
f ff
a gf ) .
8
(v g v f ) 2

(2.2-30)

The part of the pipe cross-section occupied by vapor is estimated as


Ag = A .

(2.2-31)

Interfacial area concentration a gf in circular pipe shown in Fig. 2.2-1.a should be calculated
from the following set of equations:
=

Ag
A

1
r2

2
sin
r
r2
2
2

(2.2-32)

a
,
2r

(2.2-33)

= 2 arcsin

a gf =

r2

(2.2-34)

(see Bronstejn et. al., 1995 or similar for the formulas)

Ag
r

Ag

Ag

Figure 2.2-1. a - c
As equation for the angle in Fig. 2.2-1.a is implicit, the calculation is rather complicated
and was replaced with approximation:
a gf = a gf 1 a gf 2 =

2 min( , (1 ))
A

(2.2-35)

Equation (2.2-35) is a geometrical average of the interfacial area concentration calculated for
the square pipe shown in Fig. 2.2-1.b:
a gf 1 =

1
A

(2.2-36)

and interfacial area concentration calculated in the square pipe shown in Fig. 2.2-1.c:

2-17

a gf 2 = 2

min( , (1 ))
A

(2.2-37)

Accuracy of the approximation is seen in Fig. 2.2-2 where the interfacial area concentrations
predicted by exact and approximate formulas are plotted as functions of vapor volume fraction.
Interfacial area concentrations
Exact

Approximation

1.40
1.20

agf = a / A

1.00
0.80
0.60
0.40
0.20
0.00
-0.10

0.00

0.10

0.20

0.30

0.40

0.50

0.60

0.70

0.80

0.90

1.00

1.10

= Ag / A

Figure 2.2-2 Interfacial area concentration in horizontally stratified flow as function of the
vapor volume fraction.

2.2.2.5 Dispersed-to-horizontally stratified transition flow


For transition between horizontally stratified and dispersed flow (stratification factor 0 < S < 1 )
the inter-phase friction coefficient is calculated with interpolation:

Ci = S Ci stratified + (1 S ) Ci dispersed

).

(2.2-38)

The interpolation is performed in the main subroutine for integration of the inter-phase
exchange source terms source, which obtains the coefficient for dispersed flow Ci dispersed at
the given conditions (subroutine getceidisp), then the coefficient for horizontally stratified
flow Ci stratified (subroutine getceistrat) at the same conditions and performs the interpolation.

Final value of the inter-phase friction coefficient C i is increased at very small vapor or liquid
volume fractions:

Ci = Ci

max( ,10 3 ) max(1 ,10 5 )

(2.2-39)

This correction is used in all flow regimes described in the sections from 2.2.2.1 to 2.2.2.5 .

2-18

2.2.3 Inter-phase heat and mass transfer


Calculation of inter-phase heat and mass transfer is calculated in subroutine source. If the
equilibrium option is applied in the input file, instantaneous thermal equilibrium is calculated
in subroutine hem (parent subroutine: source). If non-equilibrium heat and mass transfer
option is chosen, heat and mass transfer is calculated in the subroutine relaxall (parent
subroutine: source).
Important: Correlations for inter-phase heat and mass transfer in this section do not work for
two-phase flow of water and ideal gas.
The heat and mass transfer terms in Eqs. (2.1-1)-(2.1-6) are terms with g (vapor generation
rate) and Qif , Qig (liquid-to-interface and gas-to-interface heat fluxes). The vapor generation
rate is calculated from known heat fluxes as:
g =

Qif + Qig
hg* h*f

(2.2-40)

with specific enthalpies


h = u + p/ ,
h*f = h f

(2.2-41)

, hg* = hg saturation

h*f = h f saturation

, hg* = hg

if

g > 0 ,

(2.2-42)

if

g < 0 .

(2.2-43)

The liquid-to-interface and gas-to-interface volumetric heat fluxes Qif , Qig are calculated as:
Qif = H if (TS T f ) ,

(2.2-44)

Qig = H ig (TS T g ) .

(2.2-45)

The volumetric heat transfer coefficients Qif and Qig are flow regime dependent. Their
calculation is described below.

2.2.3.1 Dispersed flow


In dispersed flow the Homogeneous Relaxation Model (HRM) proposed by Downar-Zapolski
(1996), modified by Lemonnier (2002) is used. The vapor generation term is calculated with
the HRM model as:
X X Saturation

g = m

(2.2-46)

with vapor quality:

X =

g
m

(2.2-47)

2-19

and quality at saturation defined as:


X Saturation =

hm h fs
h gs h fs

(2.2-48)

Enthalpies are obtained from internal energies, densities and pressures ( h = u + p / ). Mixture
enthalpy hm is obtained at current pressure and phasic temperatures while the saturation
enthalpies of vapor and liquid hfs, hgs are obtained as saturation values at current pressure.
The correlation for the relaxation time (subroutine thetarelax) is:
2.24

0.257 p
4
6.51 10 w
ps

=
1.76
p

0.540
7
3.84 10 w
pc pS

p 106 Pa

(2.2-49)

p > 106 Pa

p = max(1000 Pa, p S p ) ,

w = min(1, max(10 6 , ) ,

(2.2-50)

pc = 221.2 105 Pa .

(2.2-51)

The relaxation time obtained from Eq. (2.2-49) is further limited as follows:
= max ( , 108 ) .

(2.2-52)

The vapor and liquid volumetric heat transfer coefficients H ig , H if are needed for integration
of inter-phase heat and mass transfer in WAHA code. Vapor heat transfer coefficient H ig is
assumed to be extremely large to bring the vapor in equilibrium at given pressure (similar in
the RELAP5 code for dispersed flows):

*
*

max( , 105 )
1, g hg h f
H ig = min 106
+

(
1

(
100
25

)),
max

TS Tg
max( , 109 )

= max(2 , TS Tg ) .

) ,

(2.2-53)
(2.2-54)

Equations (2.2-40) and (2.2-45) are then used to calculate the Qif :
Qif = Qig g (hg* h*f ) = H ig (TS Tg ) g (hg* h*f ) ,

(2.2-55)
and Equation (2.2-44) to calculate H if :
H if = Qif /(TS T f ) .

(2.2-56)

In some cases values of H ig obtained by Eq. (2.2-53), can be too large and H if calculated
from Eq. (2.2-56) would become negative. In such cases H ig is calculated as:

2-20


g (h g* h *f )

H ig = max1.0 ,

T
S
g

(2.2-57)

and
H if = 1.0 .

(2.2-58)

Corrections of coefficients H ig and H ig are applied also when one or both phases are very
close to equilibrium:
If |Ts-Tf|<10-12 and |Ts-Tg|<10-12 :

Hig=1 and Hif=1 (values are not important).

If |Ts-Tf|<10-12 and |Ts-Tg|>10-12 :

g (h g* h *f )

H ig = max1.0 ,

TS T g

If |Ts-Tf|>10-12 and |Ts-Tg|<10-12 :

Hig=1 and H if = max1.0 ,

and Hif=1 .
g (h g* h *f )
.
TS T f

2.2.3.2 Horizontally stratified


The volumetric heat transfer coefficients in horizontally stratified flow are calculated in the
subroutine gethifgstrat. They are derived as approximations of the heat transfer coefficient
for the turbulent flow near a flat wall (see Mills, Heat Transfer, 1999, Section 4.3 for
example). The heat transfer coefficients hf, hg are calculated as product of Nusselt number and
fluid thermal conductivity, divided by the characteristic length L:

hf =

Nu f k f

Nu g k g

hg =

Lf

Lg

(2.2-59)
In addition, volumetric heat transfer coefficients Hif, Hig, are obtained as
H if = h f a gf

H ig = h g a gf

(2.2-60)

Characteristic lengths are calculated from the known cross-section of the pipe occupide by the
each fluid and from the known width of the surface in circular pipe a (see Fig. 2.2-1.):
Lf =

(1 ) A
a

Lg =

(2.2-61)

Taking into account relation between a, interfacial area concentration agf and pipe crosssection A in Eq. (2.2-34), the volumetric heat transfer coefficients for each phase are
H if =

Nu f a gf2 k f

(1 )

H ig =

Nu g a gf2 k g

(2.2-62)

2-21

Nusselt numbers are calculated as:

(Re
1000
)
Pr
f
f
f

8
Nu f = max 4,
,
ff

0.67
(Pr f 1)
1 + 12.7
8

(Re
1000
)
Pr
g
g
g

8
Nu g = max 4,
.
fg

0.67
(Prg 1)
1 + 12.7
8

(2.2-63)

Friction factors fg and ff are calculated from the Equations (2.2-28), used for inter-phase
friction coefficient in horizontally stratified flow. The same short iteration is performed to
obtain the interface velocity vi from Eqs. (2.2-27), (2.2-28), (2.2-29), which is then used to
calculate Reynolds numbers Ref, Reg (2.2-29) and friction factors fg, ff (2.2-28).
Prandtl numbers are:
Pr f =

c pf f
kf

Prg =

c pg g
kg

(2.2-64)

The part of the pipe cross-section occupied by liquid and gas is approximated as
A f = A(1 ) ,

(2.2-65)

Ag = A .

(2.2-66)

The interfacial area concentration is calculated from Eq. (2.2-35). Specific heat capacities c pf ,
c pg are calculated in the water property subroutines getliquid_p_u, and getvapor_p_u.
Viscosities f , g are calculated in the subroutine visc. Thermal conductivities k f , k g are
calculated in subroutine conductivity.

2.2.3.3 Dispersed-to-horizontally stratified transitional flow


For transition between horizontally stratified and dispersed flow (stratification factor 0 < S < 1 ),
inter-phase heat transfer coefficients are calculated with interpolation:

),

(2.2-67)

),

(2.2-68)

H if = S H if stratified + (1 S ) H if dispersed
H ig = S H ig stratified + (1 S ) H ig dispersed

in the getgamaqfg subroutine, which obtains coefficients for dispersed and/or horizontally
stratified flow inter-phase heat and mass transfer and does the interpolation if necessary.

2-22

2.3 WALL FRICTION


2.3.1 Steady wall friction
The dissipative terms Ff,wall and Fg,wall are calculated in the subroutine source_g_w from the
correlations that are valid for the steady-state flow. Darcy equations modified for the twophase flow used are:
F f , wall = F f f wf

Fg , wall = F f f wg

f v f v f (1 ) f
m

2D

g v g v g g
2D

(2.3-1)

(2.3-2)

where fwf and fwg are the friction coefficients for liquid and gas respectively, Ff user defined
multiplying constant and m is mixture density.
In order to take the inertia of each phase into account, the dissipative terms are multiplied by
the ratio of phase and mixture densities. The friction coefficients fwf and fwg are calculated in
the subroutine wallfr_coeff. The classical steady friction coefficient is based on Reynolds
number and is calculated in the subroutine colbrook. For laminar flows the relation is:
fw =

64
Re

(2.3-3)

where Re is the Reynolds number. For turbulent flow the equation of Colebrook and White is
used:
1
fw

2.51
k
= 2 log
+ 0.27 ,
Re f
D
w

(2.3-4)

where k is the roughness of the wall. For the transition region (2000 < Re < 5000) the
interpolation between both values is used.
The calculation procedure of fwf and fwg depends on the flow regime. If the stratification factor
S = 0, the friction coefficients are calculated in the subroutine dispersed. If the stratification
factor S = 1, the subroutine stratified is called. For 0 < S < 1, the values of friction factors are
interpolated in subroutine trans.

2.3.1.1 Dispersed flow


For > 0.95 , droplet flow is identified. It is assumed that the liquid friction coefficient is
fwf = 0. The gas friction coefficient is based on Reynolds number for gas that is calculated as:
Re g =

m vm D
g

(2.3-5)

2-23

where vm is the mixture velocity and g is gas dynamic viscosity. The mixture momentum is
expressed by: m v m = g v g + (1 ) f v f .
For < 0.5 , bubbly flow is identified. Here, the gas friction coefficient is assumed to be
fwg=0. The liquid friction coefficient fwf is based on Reynolds number for liquid:
Re f =

m vm D
f

( 2.3-6)

where f is liquid dynamic viscosity.


If 0.5 < < 0.95 , the friction factors are interpolated from the extreme values. The values of fwf
and fwg are calculated at the limits = 0.5 and = 0.95 and those values are used to
interpolate both friction factors for the given void fraction :
0.5
f wg =
f wg ( = 0.95) ,
0.45

(2.3-7)

0.95
f wf =
f wf ( = 0.5) .
0.45

(2.3-8)

2.3.1.2 Horizontally stratified flow


For horizontally stratified flow, first the friction factors are calculated from the Reynolds
numbers for both phases:
fwg = fwg(Reg) where Re g =

fwf = fwf(Ref) where Re f =

m vm D
g

m vm D
f

(2.3-9)

(2.3-10)

Then those friction factors are multiplied by the fraction of a wall in contact with each phase.
The fraction of wall in contact with vapor is:
b=

arccos(1 2 )

(2.3-11)

2.3.1.3 Dispersed to horizontally stratified transition flow


If the stratification factor is 0 < S < 1, the friction coefficients are interpolated from the values
calculated in the subroutines dispersed and stratified:

(
= S( f

f wf = S f wf stratified
f wg

wg stratified

) + (1 S )( f
) + (1 S )( f

wf dispersed
wg dispersed

)
.
)

2-24

(2.3-12)

2.3.1.4 Minor losses in elbows


The friction due to the curvatures of the pipes is calculated as:
f ml =

D
2 x

(2.3-13)

where is the angle between neighbouring segments of the pipe and x is the numerical
cell length. This friction factor multiplied with (1 ) and is added to fwf and fwg,
respectively.

2.3.2 Unsteady wall shear stress contribution for the two-fluid model
The comparisons of numerical results with experimental results show that the calculations for
fast transients made with a steady friction formula often do not give good results. The passage
of a water hammer wave has a significant influence on a velocity gradient at the wall, which
is not taken into account in the steady-state friction models. This influence was demonstrated
by Zielke (1968), Eichinger and Lein (1992), Pezzinga (1999), Brunone et al.(2000),
Axworthy et al. (2000) and many others.
Therefore transient friction effect was included into WAHA code. Beata Kucienska, JeanMarie Seynheave and Michel Giot developed the transient shear stress model, called the
Friction Relaxation Model. The PhD thesis of Beata Kucienska (2004) contains the details of
the derivation and application of the Friction Relaxation Model.
The Friction Relaxation model was initially developed for single-phase flows and afterwards
it was extended to two-phase flows. The evolution of a shear stress is interpreted in terms of
two steps. Each step is modelled separately. In fast transient flows a water hammer wave,
during its passage, causes some kind of translation of the velocity profile in whole pipe
section and therefore produces a very large velocity gradient in the close neighbourhood of
the wall. The first step of the shear stress evolution is this dramatic change of the velocity
gradient at the wall. The shear stress jump, during the first step, is supposed to be proportional
to the amplitude of the pressure wave:
(2.3-14)

= k w p wave = k w cv

where kw is a coefficient of proportionality, which has to be adjusted against experiments, c is


a water hammer wave velocity that is very close to the fluid speed of sound, and v is a
difference between the velocities before and after the wave passage. For the fast closure of a
valve this difference is equal to the initial velocity.
The second step is relaxation of the transient shear stress after passage of the wave. The
velocity profile at the wall tends to the steady-state profile, corresponding to the new value of
the averaged velocity; in the meantime the velocity gradient decreases. During time, when the
transient profile is tending to the steady-state profile, the friction effects can be very
significant even if the velocity averaged in cross-section is equal to zero. The difference
between the values of the steady and the transient shear stresses may reach two orders of
magnitude.
2-25

The modelling of the second step is based on the theory of Extended Irreversible
Thermodynamics. Extended Irreversible Thermodynamics has already been used by other
researchers to determine closure laws for the class of phenomena where the hypothesis of
local equilibrium is questionable (e.g. Jou et al 2001, Bilicki et al 2002). Fast transient flows
belong to this class due to the strong gradients and fast changes. The derivation of the
relaxation equation, which describes the second step of the shear stress evolution, is based on
the introduction of the wall shear stress into the thermodynamic space:
s = s (u , , 2 ) ,

(2.3-15)

where the thermodynamic variables, like entropy s, are assumed to be functions of three
parameters. This introduction leads to a first order differential equation for the wall shear
stress:
d s
=
dt

(2.3-16)

According to this equation the transient wall shear stress evolves exponentially in time,
tending to the steady state value.
The Friction Relaxation Model integrates both steps of the shear stress evolution:
w
d s
=
+ kT c
t

dt

(2.3-17)

It contains two coefficients that need to be evaluated on the basis of experimental data. One is
the transient friction coefficient kT responsible for the first step of the shear stress evolution;
the other is the relaxation time responsible for the second step. By comparison with the
transient shear stress results obtained with FLUENT for air flow kT was found to be different
for acceleration and deceleration; the value for deceleration is about 50% of the value for
acceleration. The value of kT for water transient flows was evaluated on the basis of
experimental data of Holmboe and Rouleau (1967). The value of was retained the same for
water flow as for air flow and the results were satisfactory. It seems that the relaxation time
has always the order of milliseconds. Totally, the effect of the transient shear stress is much
more important for a liquid flow than for a gas flow.
The Friction Relaxation Model, being the differential equation for shear stress, can be
problematic to introduce in the codes, as it implies increasing the number of differential
equations in the system. Therefore an approximation of Friction Relaxation Model was
developed. The approximated Friction Relaxation Model is a kind of a numerical solution of
the exact model expressed by a differential equation. It is based on the shear stress value at
the previous time step:
(t ) = s (t ) + un (t )

un(t) = un (t t )e

(2.3-18)
t

+ k T cv

(2.3-19)

where t is a time step and v is a difference between velocity values at two last time steps.

2-26

Total shear stress at every time step is a sum of the steady shear stress s and un unsteady
contribution un based on its value from the last time step. Initially: un(0)=0 .
The unsteady contribution contains an exponential decrease responsible for the relaxation and
the difference between velocity values at the last two time steps, which allows detecting the
presence of the wave and determining the shear stress jump during the first phase. This
difference is the equivalent of the time derivative of the velocity in the original Friction
Relaxation Model in Eq. (2.3-17). The coefficients and kT have exactly the same meaning
as in the equation Eq. (2.3-17).
The approximated model based on the last time step gives almost identical results as the exact
Friction Relaxation Model and is very easy to introduce in the codes. Therefore it was
introduced into WAHA code.
The unsteady shear stress contribution is first calculated for the mixture and then splitted
between both phases. The unsteady term for the mixture is equivalent to Eq.(2.3-19) for
single-phase flows. The coefficients and kT for mixture must be evaluated on the basis of
experimental data for two-phase flows. They are close to the values of and kT for singlephase liquid flow, as the transient friction effect is much more significant in a liquid than in a
gas. The values of these coefficients evaluated on the basis on Holmboe and Rouleau (1967)
experimental data for transient water flow caused by a fast closure of a valve are: =1.4ms,
kT = 0.0002 for acceleration and kT = 0.0001 for deceleration. The same values of and kT
used for the Simpson experiment for two-phase flows (see chapter 8) gave good results.
The splitting of the transient mixture shear stress between shear stresses for each phase in the
WAHA code is the same for all flow regimes:
un, f = un ,m

un, g = un , m

f
m
g
m

(1 )

(2.3-20)

(2.3-21)

Sonic velocity c in two-phase flow is calculated without virtual mass term:


f + (1 ) g
c

f
c g2

(1 ) g
c 2f

(2.3-22)

Unsteady friction is activated in WAHA code by choosing word W5=3 on the "geometry card
1" of the pipe component (see also chapter 7 on input file preparation, section on component
cards - pipe).
Example of results calculated with unsteady friction is shown in section 8.3.3 (Simpsons
valve closure experiment).

2-27

2.4 REFERENCES
2-1. D.H. Axworthy, M.S. Ghidaoui, D.A. McInnis, Extended thermodynamics derivation
of energy dissipation in unsteady pipe flow. Journal of Hydraulic Engineering 126,
276-286 (2000).
2-2. D. Bestion, The Physical closure laws in the CATHARE code, Nuclear Engineering
and Design, 124, 229-245 (1990)
2-3. Z. Bilicki, M.Giot, R.Kwidzynski, Fundamentals of two-phase flow by the method of
irreversible thermodynamics. Int. J. Multiphase Flow 28, 1983-2005 (2002)
2-4. I.N. Bronstejn, K.A. Semendjajev, G. Musiol, H. Muhlig, Taschenbuch der
mathematik, Verlag Harri Deutsch, Frankfurt (1995).
2-5. B. Brunone, B. W. Karney, M. Mecarelli, M. Ferrante, 2000. Velocity profiles and
unsteady pipe friction in transient flow. Journal of Water Resources Planning and
Management 126(4), 236-244.
2-6. K.E. Carlson, R.A. Riemke, S.Z. Rouhani, R.W. Shumway, W.L. Weaver,
RELAP5/MOD3 Code Manual, Vol. 1-7, NUREG/CR-5535, EG&G Idaho, Idaho
Falls (1990).
2-7. D.A. Drew, L. Cheng, R.T. Lahey Jr., "The Analysis of Virtual Mass Effects in TwoPhase Flow", International Journal of Multiphase Flow 5, 232-242, (1979).
2-8. P. Downar-Zapolski, Z. Bilicki, L. Bolle, J. Franco, The non-equilibrium relaxation
model for one-dimensional flashing liquid flow, International Journal of Multiphase
Flow, 22 (3), 473-483 (1996).
2-9. P. Eichinger, G. Lein, The influence of friction on unsteady pipe flow. Unsteady
flow and fluid transients, R. Bettes and J.Watts, Eds., Balkema, Rotterdam, The
Netherlands, 41-50 (1992).
2-10. E.L. Holmboe, W.T. Rouleau, The effect of viscous shear on transients in liquid
lines. Transactions of ASME, Journal of Basic Engineering, 174-180 (1967).
2-11. D. Jou, J. Casas-Vazquez, G. Lebon, Extended Irreversible Thermodynamics.
Springer-Verlag Berlin Heidelberg (2001).
2-12. B. Kucienska, Friction Relaxation Model for Fast Transient Flows, Ph.D. thesis
(2004).
2-13. H. Lemmonier, An attempt to apply the homogeneous relaxation model to the
wahaloads benchmark tests with interaction with the machanical structure, CEAT3.3-D61-200302, WAHALoads project deliverable D61 (2002).
2-14. A. F. Mills, Heat Transfer, 2nd Edition, Prentice Hall (1999).
2-15. J. H. Mahaffy, Numerics of Codes: Stability, Diffusion, and Convergence, Nuclear
Engineering and Design 145, (1993)
2-16. G. Pezzinga, Quasi-2D Model for Unsteady Flow in pipe networks. Journal of
Hydraulic Engineering 125(7), 676-685 (1999).
2-17. I. Tiselj, S. Petelin, Modelling of Two-Phase Flow with Second-Order Accurate
Scheme. Journal of Computational Physics, 136, 503-521 (1997).
2-18. W. Zielke, Frequency-dependent friction in transient pipe flow. Journal of basic
engineering 90, 109-115, (1968).
2-19. E.B. Wylie, V.L. Streeter, Fluid Transients, McGraw-Hill (1978).
2-28

3 NUMERICAL SCHEME IN THE WAHA CODE

3.1 INTRODUCTION
This chapter describes the numerical scheme used in the WAHA code. It presents updated
version of a deliverable D62 "Numerical Method of WAHA code" (Oct. 2001). Experience of
"Joef Stefan" Institute with numerical schemes for two-phase flow modelling are based on
simple and user-unfriendly test codes, which were developed for simulations of different twophase flow transients in the past years (Tiselj, Petelin, 1997, 1998). These test programs are
not useful for potential users of the WAHA code; however, they were suitable for testing of
different numerical approaches. The numerical scheme described in this document is,
according to our knowledge and expertise, the optimal scheme for the simulation of the fast
transients in two-phase flow. However, we try to remain open for further improvements of the
scheme.

3.2 NUMERICAL SCHEME


Some of the previous JSI experience with numerical schemes for two-phase flows are
summarised in references (Tiselj, Petelin, 1997) and (Tiselj, Petelin 1998). The test programs in
these works were developed for solving the RELAP5 six-equation single-pressure two-fluid
model (Carlson et. al., 1990).
Numerical scheme applied in WAHA code is based on the Godunov methods i.e. highresolution shock-capturing methods, which are widely used in aerodynamics (Hirsch, 1988 and
LeVeque, 1992). The system of WAHA equations can be written in the following form
(Equation (2.1-29) in Chapter 2):
r
r
r

A
+B
= S ,
t
x

(3.2-1)
r

where represents the vector of independent variables = ( p, , v f ,vg , u f , u g ) , A and B are


r

matrices of the system, and S is a vector with non-differential terms in the equations.
r
Complete matrices A and B and vector S can be found in the Chapter 2 "Two-fluid model
six-equation model in the WAHA code".
The numerical scheme of the WAHA code is non-conservative due to the choice of the basic
variables. However, according to the present experience, this does not seem to be a big
deficiency for short transients like water hammer events.
r

The source term vector S in Equation (2.1-42)


is further split into two parts, first part of the
r
source term are "non-relaxation" sources S N R :

3-1

r
SN R

f
Gf

v f F f , wall
u f f (1 a) (v w)
f
f
f

v
w
(
)
g
g Gg
g
g

v g Fg , wall
0
0 w
u g g a
dA( x)

p
+

=
0
0 x
(
)
A
x
dx
F f , wall /(1 ) + f g cos

(
)
p
v
w
p
f
Fg , wall / + g g cos
p(vg w)
p
v F
/(1 )
f

(3.2-2)

f , wall

vg Fg , wall /

This part contains wall friction and volumetric forces that are collected in the first column of
Equation (3.2-2). Sources due to the variable pipe cross-section are in the second column, and
sources due to the pipe motion are in the third column. Non-relaxation source terms are
closely related with convection terms and are treated together with the convection terms in the
WAHA code.
r

The second part of the source term contains relaxation sources S R , which tend to establish
thermal and mechanical equilibrium between both phases:

G

f
g (Qif g (h*f u f )) f 1
u f f (1 a)

1
g (Qig + g (hg* u g )) g
g
r
u g g a

SR =

(Ci | vr | vr g (vi v f )) /(1 )

(3.2-3)

(Ci | vr | vr + g (vi v g )) /
(Qif g (h*f u f )) /(1 )
(Qig + g (hg* u g )) /

Relaxation source terms are often stiff, i.e. their characteristic times are much shorter than the
characteristic times of other phenomena in two-phase flow, even shorter than the
characteristic times of the acoustic waves.
3.2.1 Operator splitting
Stiffness of the relaxation source terms is the reason for the use of the operator splitting in the
numerical scheme ofr the WAHA code. Splitting means that the convection term with the nonrelaxation sources S N R in Equation (3.2-1) are treated separately from the relaxation sources
r
SR :
r
r
r

A
+B
= SN R ,
t
x
r
T
AT
t

(3.2-4)

r
= SR ,

(3.2-5)

where T = ( p, , v f ,vg , T f , Tg ) and matrices AT , A , B are given in Section 2.1. A single time
step includes the following two sub-steps (superscripts n , n + 1 denote time levels, * denotes
intermediate time level and subscript j denotes spatial position):

3-2

1) The convection terms and the non-relaxation sources - Equation (3.2-4):


r

*j = nj - t A-1 S N R + (A1B )

r
n
.
x j

(3.2-6)

2) Intermediate values in the vector *j are initial conditions for integration of the relaxation
sources - Equation (3.2-5):
r

n +1
T j

*
T j

t *+t

) (

r r *
r *
A T -1 T j (t ) S R T j (t ) dt .

(3.2-7)

The operator splitting given by Eqs. (3.2-6) and (3.2-7) is formally first-order accurate.
However, the numerical tests have shown, that despite the formally lower order of accuracy,
the results are practically the same as with the second-order accurate Strang splitting
(LeVeque, 1992). A detailed scheme for each sub-step of the operator splitting (3.2-6), (3.2-7)
is given in the next sub-sections.
The operator splitting as shown in Equations (3.2-4)-(3.2-5) is a very simple and "easy-touse" tool. However, it is also a source of a specific non-accuracy, which was discussed by
Burman, Sainsaulieu (1995), Bereux (1996), and Tiselj, Horvat (2002). Papers of Burman,
Sainsaulieu (1995), and Bereux (1996) are from the area of particle-gas two-phase flow
during rocket fuel combustion. They discuss a problem of solving a system of hyperbolic
equations of the same form as Equation (3.2-1) written as:

*
+C
=
t
x

(3.2-8)

where superscript * denotes the equilibrium (thermal or mechanical) value and denotes the
characteristic time of relaxation. A relaxation time is a time period in which the relaxation
quantity approaches to its equilibrium value. Numerical solution of the Equation (3.2-8),
obtained with operator splitting method, converges toward the solution of the differential
Equation (3.2-8) as x 0, t 0 and when condition t 0 is fulfilled. This is often not

respected in two-fluid codes. It is clear that the problems appear for small values of the
relaxation time .

Up to four types of non-equilibrium (relaxation variables) can be present in the two-phase


water system; each of them has different characteristic relaxation time:
1) Different phasic pressures: exact relaxation time unknown - known to be very short.
2) Vapor temperature not in saturation - relaxation times short in most of the flowregimes,
but not always negligible.
3) Liquid temperature not in equilibrium - relaxation time not negligible.
4) Mechanical non-equilibrium: different phase velocities - relaxation time not negligible.
The six-equation model of the WAHA code describes the non-equilibrium no. 2, 3, 4. The
five-equation model would be sufficient to describe the non-equilibrium no. 3 and 4, the
seven-equation model of Saurel, Abgrall (1999) can describe all four types of nonequilibrium, whereas the simplest three-equation homogeneous-equilibrium model (HEM)
cannot describe any kind of non-equilibrium. From the physical point of view more equations
describe the system more accurately. However, each type of non-equilibrium combined with

3-3

operator splitting method causes a numerical error, which behaves like numerical diffusion
when the relaxation time is very short.
Because of the numerical non-accuracy of the operator splitting method, it is better to use
two-fluid model with less equations for very short relaxation times (i.e. if all relaxation times
are very short, the three-equation HEM model will be the optimal one). On the other hand,
relaxation times must be estimated from the existing physical models for different types of
non-equilibrium. Short and long relaxation times for the non-equilibrium types no. 2, 3, and 4
are encountered in two-phase flows of water. Therefore, it was decided to use six-equation
two-fluid model in the WAHA code.
A user of the WAHA code should be aware of the deficiency of the applied operator splitting
method, which is seen as an additional numerical diffusion when very short relaxation times
appear in the equations. With a special transformation of the equations and with appropriate
numerical schemes described by Burman, Sainsaulieu (1995), and Bereux (1996), this
deficiency of the operator splitting method can be avoided. However, due to their complexity,
and due to the fact that these models would not perform well for non-stiff relaxation terms,
these approaches are not applied in the WAHA code.

3.2.2 Convection terms with the non-relaxation source terms


Equation (3.2-4) multiplied by A 1 from the left gives
r
r
r

+C
= A 1 S N R .
t
x
C = A 1B

(3.2-9)

is the Jacobian matrix, which can be diagonalised as

C = L L1

(3.2-10)

where the diagonal matrix is the matrix of eigenvalues and L is the matrix of eigenvectors of
the matrix C . Eigenvalues, eigenvectors, and inverse matrix of eigenvectors are explicitly
calculated between the grid points in the WAHA code. In order to use the numerical schemes
described in this report, the system of equations (3.2-9) must be hyperbolic. This is not always
the case for six-equation two-fluid models. However, as mentioned in Section 2.1.3, where
diagonalisation is discussed, the hyperbolicity can usually be ensured with appropriate form
of the additional differential terms for virtual mass and/or interfacial pressure. The calculation
in the WAHA code is interrupted if complex eigenvalues are found and equations become nonhyperbolic.
r

The non-relaxation source term A 1 S N R in Equation (3.2-9) is written in three parts as


r
r dA( x) r
r dw
,
RF RW
A 1S N R = RA
dx
dx

(3.2-11)

where the newly introduced variables are obtained from Equation (3.2-2):

3-4

f
Gf

v f F f , wall
u f f (1 a)

p
g Gg

vg Fg , wall
r
u g g a

p
RF = A 1
F f , wall /(1 ) + f g cos
Fg , wall / + g g cos

f (v f w)
g (v g w)
0
0

r
RA = A 1

1
A( x)

p(v f w)
p(v g w)

v f F f , wall /(1 )

f
g
r
0
RW = A 1
0

(3.2-12)

p
p

vg Fg , wall /

The first part with the vector R A contains source terms due to the variable pipe cross-section
r
with derivatives of the pipe cross-section, the second part R F contains wall friction and
r
volumetric forces (no derivatives), and the third part with the vector RW contains source terms
r
due to the pipe motion (derivatives of structure velocity w). The source term with RW does not
exist in the current version of the WAHA code, as the code is not ready yet for the FluidStructure Interaction (FSI) simulations. Thus, it is not discussed further in this document, but
can be easily added in the same manner than the other non-relaxation terms.
With Eqs. (3.2-10) and (3.2-11) Eq. (3.2-9) is written as:
r
r
r A r

+ L L1
+ RA
+ RF = 0 .
t
x
x

(3.2-13)

The total derivative of cross-section A can be replaced with a partial derivative, as A is only a
function of x. The term with structure velocity w is omitted, as it is not implemented yet. This
equation is multiplied by L-1 from the left and modified with identities 1 = I and x = 1
x

into:
L1

r
r
r A
r x

+ L1
+ 1 L1 RA
+ 1 L1 RF
=0 .
t
x
x
x

(3.2-14)

Modified characteristic variables are then introduced in Equation (3.2-14) as


r

(3.2-15)

= L1 + 1 L1 RA A + 1 L1 RF x .
r

where represents an arbitrary variation: /t or /x . Note that cross-section A and stream


wise component x are not functions of time (cross-section variations due to the pipe elasticity
are expressed with pressure variations - see previous section). Introduction of modified
characteristic variables (3.2-15) gives the characteristic-like form of Equation (3.2-13):
r
r

+
=0 .
t
x

(3.2-16)

This equation represents the basis for the second-order accurate numerical scheme in the
WAHA code.
Problems of the pure second-order accurate discretisation, Lax-Wendroff for example, are
oscillations, which appear in the vicinity of the non-smooth solutions. The problem is solved if
a combination of the first- and the second-order accurate discretisation is used (LeVeque, 1992).
A part of the second-order discretisation is determined by the limiters, which "measure" the
3-5

smoothness of the solutions. If the solutions are smooth, larger part of the second-order
discretisation is used, otherwise larger part of the first-order discretisation is used. An improved
characteristic upwind discretisation of the Equation (3.2-16) was used for the first-order
discretisation (Hirsch, 1988).
The combination of the first- and the second-order accurate discretisation of the Equation
(3.2-16) is:
r n+1 r n
- j
j

rn

( ++ )nj -1/2

rn

j -
x

j -1

rn

( -- )nj+1/2

j+1

rn
-j

=0

(3.2-17)

where subscripts j, j 1 denote grid points of the spatial discretisation, subscripts j 1 / 2


denote values between the grid points, x denotes distance between the two neighbouring grid
points j and j+1, superscripts n, n+1 denote time, and t time step i.e. an interval between time
levels n and n+1.
Elements of the diagonal matrices + + , in Equation (3.2-17) are calculated as:
+k + = k f k+ +

k = 1,6

k = k f k

k = 1,6

(3.2-18)

with factors f k+ + , f k - elements of diagonal matrices F++, F-

t
++
- 1
f k = max 0 , k + k k
2
x
| k |
f

-k

t

= min 0 , k - k k
- 1
2
x
| k |

k = 1,6

(3.2-19)
k = 1,6

The first term of the factors f k+ + , f k is the first-order upwind discretisation, and the second
term with limiters k is the second-order correction. The flux limiter k is calculated using one
of the following expressions (LeVeque, 1992):
MINMOD:

k = max(0 , min(1 , k )) , k = 1,6 ,

(3.2-20)

Van Leer:

k = ( k + k ) /( k + 1) ,

(3.2-21)

Superbee:

k = max( 0, min( 2 k ,1), min( k , 2))

(3.2-22)

where k usually measures the ratio of the left and the right gradients of the corresponding
characteristic variable in the point j + 1/2 :
k, j+1/2 =

k, j+1- m - k, j - m
k, j+1 - k, j

k, j+1 / 2- m
k, j+1 / 2

m=

k, j+1/2
, k = 1,6
| k, j+1/2 |

(3.2-23)

Evaluation of k is the only place in the WAHA code where the derivatives of the characteristic
variables are computed and used. The non-standard definition of the characteristic variables in
Equation (3.2-15) requires multiplication with the inverse matrix of the eigenvalues 1 .

3-6

Computation of this matrix is not possible when any of the eigenvalues is equal to zero. To
avoid this problem, the WAHA code calculates a new set of variables as a product of the matrix
and the characteristic variables defined in Equation (3.2-15):
r

= = L1 + L1 R A A + L1 R F x ,

(3.2-24)

or in discrete form used in WAHA code:

r
r
r
r
j +1 / 2 = L1 + L1 R A A + L1 R F x

(3.2-25)

j +1 / 2

These new variables are then used to measure the ratio of the gradients instead of Equation
(3.2-23):

k, j+1/2 =

k, j+1- m - k, j - m
k, j+1 - k, j

k, j+1 / 2- m
k, j+1 / 2

m=

k, j+1/2
, k = 1,6
| k, j+1/2 |

(3.2-26)

The steepest waves are obtained with the Superbee limiter (Equation 3.2-22), while the most
smeared waves (but still second-order accurate) are obtained with the MINMOD limiter
(Equation 3.2-20). Solutions obtained with the Van Leer limiter (Equation 3.2-21) lie between
the solutions obtained with the MINMOD and the Superbee limiters (see LeVeque, 1992 for
details on limiters). The first-order accurate characteristic upwind scheme is obtained if the
values of the limiters (3.2-20) - (3.2-22) are set to zero.
Equation (3.2-17) is transformed back into the basic variables, and the difference scheme that is
used in the WAHA code for the convective part of the Equation (3.2-1) is obtained:
r
r
r
r A j 1 / 2
j 1 / 2
j +1 / 2

+ + 1 + +
1
L
= L
+ L
+ + + 1 L1 R A
+
t
x
x
x
r A j +1 / 2
r
r
+ 1 L1 R A
+ + + 1 L1 R F j 1 / 2 + 1 L1 R F j +1 / 2
x

nj+1 - nj
t

++
j -1/2

+C

nj - nj -1
x

-j+1/2

+C

nj+1 - nj
x

r ++
r -A j+1 - A j
A j - A j -1
+ ( R A )nj -1/2
+ ( R A )nj+1/2
x
x

r ++
r -+ ( R F )nj -1/2 + ( R F )nj+1/2 = 0

(3.2-27)

(3.2-28)

with
C +j +1 / 2 = L j 1 / 2 +j +1 / 2 Lj11 / 2

C j +1 / 2 = L j +1 / 2 j +1 / 2 Lj1+1 / 2

(3.2-29)

and with elements of the diagonal matrices + + and given by Equation (3.2-18). The
source term vectors in Equation (3.2-28) are calculated as:
r
r -( RA ) nj +1 / 2 = (L F L1 RA ) nj +1 / 2
r
r ++
( RA ) nj +1 / 2 = (L F + + L1 RA ) nj +1 / 2

3-7

r -( RF ) nj +1 / 2 = (L F L1
r ++
( RF ) nj +1 / 2 = (L F + + L1

r
RF ) nj +1 / 2
r
RF ) nj +1 / 2

.
(3.2-30)

The diagonal matrices F++ and F-- contain the elements f k+ + and f k calculated by Eqs.
(3.2-19) at the grid point j + 1/2 and the time step n. They are obtained as products
(F++)nj+1/2= ( + + 1 ) nj +1 / 2 and
(F--)nj+1/2= ( 1 ) nj +1 / 2 .
The stability domain for the integration with the Equation (3.2-28) is limited by the CFL
(Courant-Friedrichs-Levy) condition:
(3.2-31)

t x/ max(| k |) , k = 1,6 .

A specific problem of the six-equation two-fluid models of two-phase flow is degeneration of a


pair of eigenvectors when relative inter-phase velocity is zero. In this case only five linearly
independent eigenvectors exist. The problem remains solvable, if a small artificial relative
velocity is maintained; the value | v r |= 10 -7 m/s is used in the WAHA code.
3.2.2.1 Averaging of the Jacobian matrix
A simple average of the non-conservative variables is used for evaluation of the Jacobian matrix
in Equation (3.2-9) at the point j + 1/2 :
r
r
C j+1/2 = C[( j + j+1 )/2] .

(3.2-32)

A similar approach has been taken by Gallouet and Masella (1996), who showed that this type
of averaging gives very accurate results for Euler equations. They emphasized that the
averaging (3.2-32) must be performed with primitive variables (pressures, velocities, densities).
Another more complicated and possibly more accurate alternative proposed by Toumi and
Kumbaro (1996) was not adopted in the present work. They attempted to evaluate the Roe's
approximate Riemann solver (Roe, 1981) for the six-equation Jacobian matrix C j+1/2 and
proposed a rather complicated procedure for evaluation of the Jacobian matrix between the grid
points from the left and the right state j and j + 1 .
The same averaged variable
r

j +1 / 2 = ( j + j+1 )/2 ,

(3.2-33)

is used to evaluate the non-relaxation source terms in the point j + 1/2 . The same type of
averaging is used to evaluate the geometrical properties of the pipe (pipe cross-section and pipe
inclination) at the point j + 1/2 .
3.2.2.2 Basic variables
This section gives a brief discussion on the choice of the basic variables, i.e. components of the
r
vector in Equation (3.2-1). Numerous tests were performed with the six-equation model
(described by Tiselj, Petelin, 1997) with different basic variables and the most successful set of
3-8

variables turned out to be = ( p, , v f ,vg , u f , u g ) . This set of variables is very close to the socalled primitive variables, where the phase internal energies u f , u g are replaced with the phase
densities f , g . However, internal energies were retained due to the applied water property
subroutines. The preferred set of variables would be a conservative form:
r

= [(1 - ) f , g ,(1 - ) f v f , g v g , (1 - ) f e f , g e g ] ,

(3.2-34)

with specific total energy e = u + v 2 / 2 . The conservative form of equations usually means also
numerical conservation of mass, momentum and energy, however there are some specific
problems with the conservative formulation of multi-fluid two-phase flows:
1) The continuity and energy equations can be written in the conservative form, while the
conservative fluxes for the momentum equations do not exist due to the pressure gradient
terms, virtual mass terms, interfacial pressure terms, and possibly other correlations that
contain derivatives. Thus, the momentum equations cannot be written in the conservative
form.
2) If complex systems of equations are solved with the conservative variables (Tiselj,
Petelin, 1997), oscillations appear in the vicinity of particular discontinuities. Abgrall
(1996) explained such oscillations for the four-equation model (two continuity, one
momentum and one energy equation). The oscillations do not depend on accuracy of the
used numerical scheme and can be observed in the results of first- and the second-order
schemes.
3) "Non-standard" water property subroutines are required to calculate two-phase properties
( p , , f , g ) from the conservative variables ( (1 - ) f , g , (1 - ) f u f , g u g ).
According to our experiences, the non-conservative variables present an acceptable
approximation for fast transients, while for long transients, where conservation of mass and
energy is more important; this might be a serious drawback. In the test calculations presented by
Tiselj, Petelin (1997, 1998) negligible fluctuations of the overall mass and energy have been
observed despite the non-conservative scheme.
3.2.3 Integration of the relaxation source terms
The second equation of the operator splitting scheme (3.2-7)):
r

n +1
T j

*
T j

t *+t

) (

r r *
r *
A T -1 T j (t ) S R T j (t ) dt ,

(3.2-35)

is integrated over t (the convective time step) with the first-order explicit method at each
grid point. Time steps of the integration depend on the stiffness of the relaxations and can be
much shorter that the main time step t . First-order accuracy of this sub-step is compensated
by the shorter time steps in integration of Equation (3.2-35).
Another option, which is available in the WAHA code, is instantaneous relaxation of the
source terms in Equation (3.2-35). It was assumed in this case, that the inter-phase exchange
processes are infinitely fast. Integration of Equation (3.2-5) with infinite values of inter-phase

3-9

friction (Ci), and liquid-interface and gas-interface volumetric heat transfer coefficients (Hif,
Hig) is not possible. However, the relaxed state can be found directly as the both phase
velocities become equal to the mixture velocity and the phase properties (densities, internal
energies) become equal to the equilibrium properties. The properties of the thermal
equilibrium are calculated from the given mixture density and the mixture internal energy.
The Relaxation source terms of the two-fluid model do not affect the properties of the mixture
at a given point; mixture density m , mixture momentum v m m , and mixture total energy
e m m should remain unchanged after the integration of the relaxation source terms. In
r
principle it is possible to choose a set of basic variables M = ( m ,vm m ,em m ,vg v f , T f , Tg ) ,
r
that enables simplified integration of the relaxation source terms. If M is chosen as a vector of
basic variables, only a system of three differential equations is solved instead of the system of
six differential equations, because there are no relaxation source terms for the first three
r
components of the vector M . This reduction of the system is only partially taken into account
in the WAHA numerical scheme. only one relaxation equation for inter-phase friction is solved
for the relative velocity vr = vg v f . Subsequently the phase velocities are calculated from the
relaxed relative velocity vr and known mixture velocity vm , which remained unchanged.
Similar reduction of the thermal relaxation source terms is not used, because it is difficult to
calculate the fluid state (pressure p and vapor volume fraction ) from the variables that are
result of such relaxation: ( m ,em m , T f , Tg ) . The problem is similar as in the case of the
conservative variables, which are also not very convenient input for the water properties.
Thus, thermal relaxation in the current version of the WAHA code is calculated with variables
( p, , T f , Tg ) .
The equation solved for thermal relaxation source terms is a part of the Equation (2.1-47):
r
T
AT
t

r
= S RH &M

(3.2-36)
r

Basic variables for the heat and mass relaxation source terms T are T = ( p, , T f , T g ) . The
matrix AT and the heat and mass transfer part of the relaxation source term are defined as:

f
f
(1) + f K f (1)
0
Tf
p T

p
f


0
g + g K
g
g
Tg
p T

p
g

AT =

uf
uf
(1) pK+ f p (1)f
0
Tf
p T

p
f

u
u
pK+ g g
0
g g
p
Tg

p Tg
p

3-10

(3.2-37)

r
S RELAX H &M

G

f
g (Qif g (h*f u f )) f 1
u f f (1 a)

= g (Qig + g (hg* u g )) g 1 g
u g g a

(Qif g (h *f u f )) /(1 )

Gk =

1
p
1 2 k
k u k

(3.2-38)

(Qig + g (hg* u g )) /

This source term is multiplied with inverse matrix A T in the subroutine relaxterm.
Thermodynamic derivatives are obtained from tabulated steam tables (see Chapter 5 on water
properties) in the subroutines getliquidall_p_t and getvaporall_p_t.
A relaxation equation for the inter-phase friction is treated separately in a single differential
equation:
v r
= vr S v
t

Sv

C i v r m + g g

(1 )( f g + C vm m )
=
C i v r m (1 ) f g
(1 )( f g + C vm m )

g < 0

(3.2-39)
g > 0

Stiffness of the source terms for the inter-phase exchange of mass, momentum and energy in the
system of equations for steam-water mixture means that their characteristic time scale is much
smaller than the time step from the CFL condition (3.2-31). Thus, integration of the sources in
Equation (3.2-38) is performed with the explicit first-order accurate Euler method, which
allows variations of the time step:
r

T m +1 = T m + A T 1 ( T m ) S R H & M ( T m )t S .

(3.2-40)

The time step for the integration of the source terms t S is not constant and is controlled by the
relative change of the basic variables. Currently, the maximal relative change of the basic
variables in a single step of the integration is limited to 0.01 to obtain results that are "numerics"
independent:

t s = 0.01 min
r
1
max , AT S RELAX H & M

max( T f Ts )
max(0.01, min( ,1 )
,
r
r
1
1
max , AT S RELAX H & M
max , AT S RELAX H & M

max( Tg Ts )
r
1
max , AT S RELAX H & M

(3.2-41)
When it is necessary, the time step t S is further reduced to prevent the sign change of
temperature differences T f Ts and T g Ts ( Ts is saturation temperature at given pressure). If
sign change is encountered, the new values are discarded, the time step is halved and new
values are calculated again with the halved time step. If the time step t S drops below 10-19 s,
the integration is interrupted and the code stops issuing a failure message. A constant is set to
= 10 12 . If steam or liquid volume fraction drops below = 10 12 , the relaxation is also stopped
as one of both phases disappeares.

3-11

Momentum relaxation source (inter-phase friction source term) in Equation (3.2-39) is solved
together with Equation (3.2-40) for the thermal relaxation, using the same time steps. However,
the time advancement scheme for the relative velocity is slightly different in WAHA code:
vr

m +1

vr
1 t S S v

(3.2-42)

This is derived from the partially implicit discretization of Equation (3.2-39), where S v is
assumed to be a constant and vr on the right hand side of Eq. is taken at time step n+1. An
advantage of such approach is that the relative velocity cannot change the direction during the
relaxation. The same approach as for thermal relaxation source terms (Equation 3.2-40) was
also tested and was proved that it does not influence the results. Therefore, the scheme (3.2-42)
was adopted as a simpler scheme.
r

Source terms describing inter-phase exchange are weak when the two-phase mixture is close to
the thermal and the mechanical equilibrium. In that case the time step for their integration t S
is equal to the convection time step t . When the mixture is far from equilibrium, the source
term integration time step t S can be a few orders of magnitude shorter that t . As a
consequence a few hundred sub-steps can be required to integrate the sources over a single
convection time step t . The integration is stopped (and the code ends with failure), if more
that 190.000 sub-steps is required to integrate the relaxation source terms over a single
convection time step t in a particular volume.
As long as vapor volume fraction is smaller than 10 6 , the WAHA code uses instantaneous
thermal and mechanical relaxation. In other words, homogeneous-equilibrium mixture is
assumed in such conditions. As the vapor volume fraction grows over that limit, the WAHA
code starts with application of the relaxation process described above, which can cause
thermal and mechanical non-equilibrium.
Similarly, for liquid volume fraction smaller than 10 6 , the WAHA code uses instantaneous
thermal and mechanical relaxation - homogeneous-equilibrium. When the liquid volume
fraction grows over that limit, WAHA code starts with application of the relaxation procedure
and realistic correlations, which can cause thermal and mechanical non-equilibrium.
Possible further work in the field of the relaxation source terms integration is the
implementation of the implicit time advancement, which would be faster than the current
explicit procedure.

3.2.4 Single-phase to two-phase and two-phase to single-phase transition.


Single-phase flow in the WAHA code is modelled as two-phase flow with a residual volume
fraction of the non-existing phase, which is set to RESIDUAL = = 10 12 . As six eigenvalues and
eigenvectors are defined also in single-phase volumes, this approach automatically saves the
problem with convection of two-phase flow into the volume previously filled with singlephase flow.

3-12

The problem of transition from single to two-phase flow (or reverse) during the convective
sub-step of the operator-splitting scheme (Equation 3.2-6) is the negative vapor volume
fraction or the vapor volume fraction larger than 1.0 that can appear within the applied
numerical scheme. The problem of < 0 or > 1 is solved with the following patch:
vapor volume fraction is calculated at new time step from Equation (3.2-28) at each
grid point,
if
< RESIDUAL or > 1 RESIDUAL , then the second rows of the matrices
r -r ++
C +j +1 / 2 , C j +1 / 2 and the second components of the vectors ( RA ) nj +1 / 2 , ( RA ) nj +1 / 2 ,
r -( RF )nj +1 / 2 ,

r ++
( RF ) nj +1 / 2 , which contribute to the vapor volume fraction are multiplied

with such a constant that the repeated use of the Equation (3.2-28) results in
= RESIDUAL or = 1 RESIDUAL , respectively,
this procedure can change the "fluxes" of vapor volume fraction into the volume.
Thus, eliminating the problem in one volume may produce a similar problem
(however, smaller in magnitude) in the neighbouring volume. Therefore, the whole
procedure is repeated twice for all cells in the system.
Treatment of the negative vapor or liquid volume fractions in the WAHA code is decreasing
the accuracy of the numerical scheme, and it is a source of certain mass and energy nonconservation. Therefore, further more accurate solutions of this problem may be applied in the
next versions of the WAHA code.
Steam appearance due to the flashing:
Flashing starts when pressure of the single-phase liquid drops below the saturation pressure.
Procedure flash is called just before the relaxation source term sub-step if the flow in the cell
is a single-phase liquid and pressure is lower than the saturation pressure at current liquid
temperature. The process starts as a homogeneous-equilibrium process. Possible improvement
of the flashing model is use of flashing delay models.
Liquid appearance due to the onset of the condensation:
Condensation starts in the pure vapor when pressure of the vapor increases above the
saturation pressure at current vapor temperature. The process starts as a homogeneousequilibrium process.
Disappearance of the liquid/steam due to the vaporization/condensation:
Disappearance of a particular phase is similar to the generation. When vapor volume fraction
drops below the value 10 6 , or liquid volume fraction drops below the value 10 6 , the
homogeneous-equilibrium assumption is used instead of the relaxation correlations.
Instantaneous equilibrium can automatically change the flow from two-phase into singlephase.

3.3 REFERENCES
3-1. R. Abgrall, How to prevent pressure oscillations in multicomponent flow
calculations: a quasi conservative approach, Journal of Computational Physics 125,
150-160, (1996).
3-2. J. D. Anderson, Computational Fluid Dynamics, McGraw-Hill, New York, (1995).

3-13

3-3. F. Bereux, Zero-relaxation limit versus operator splitting for two-phase fluid flow
computations, Computer Methods in Applied Mechanics and Engineering 133, 93124, (1996).
3-4. E. Burman, L Sainsaulieu, Numerical analysis of two operator splitting methods for
an hyperbolic system of conservation laws with stiff relaxation terms, Computer
Methods in Applied Mechanics and Engineering 128, pp. 291-314, (1995).
3-5. K.E. Carlson, R.A. Riemke, S.Z. Rouhani, R.W. Shumway, W.L. Weaver,
RELAP5/MOD3 Code Manual, Vol. 1-7, NUREG/CR-5535, EG&G Idaho, Idaho
Falls, 1990.
3-6. S. Evje, K. K. Fjelde, Hybrid Flux-Splitting Schemes for a Two-Phase Flow Model,
Journal of Computational Physics, 175(2), 674-701 (2002).
3-7. T. Gallouet, J. M. Massela, A rough Godunov scheme, C.R.A.S. Paris, 323, 77-84,
(1996).
3-8. C. Hirsch, Numerical computation of internal and external flow, Vol. 1-2, John
Wiley & Sons, (1988).
3-9. R. J. LeVeque, Numerical Methods for Conservation Laws, Lectures in
Mathematics, ETH, Zurich, (1992).
3-10. R. B. Pember, Numerical Methods for Hyperbolic Conservation Laws with Stiff
Relaxation I. Spurious Solutions", SIAM J. Appl. Math. 53, No. 5, 1293 (1993)
3-11. P. L. Roe, Approximate Riemann solvers, parameter vectors and difference
schemes, Journal of Computational Physics 43, 357-372, (1981).
3-12. R. Saurel, R. Abgrall, A Multiphase Godunov method for compressible multifluid
and multiphase flows, Journal of Computational Physics 150, 425-467, (1999).
3-13. A. R. Simpson, Large water hammer pressures for column separation in pipelines,
Journal of Hydraulic Engineering 117 (10), 1310-1316, (1989).
3-14. I. Tiselj, S. Petelin, Modelling of two-phase flow with second-order accurate
scheme, Journal of Computational Physics 136 (2) 503-521, (1997).
3-15. I. Tiselj, S. Petelin, First and Second-order accurate schemes for two-fluid models,
Journal of Fluids Engineering - ASME 120 (2), 363-368, (1998).
3-16. I. Tiselj, G. erne, I. Parzer, A. Horvat, WAHA code development interim report,
WAHALoads project, Deliverable D63 version Oct.2001, (2001).
3-17. I. Tiselj, G. erne, I. Parzer, A. Horvat, Numerical method of WAHA code,
WAHALoads project, Deliverable D62 version Oct.2001, (2001).
3-18. I. Tiselj, A. Horvat, Accuracy of the operator splitting technique for two-phase flow
with stiff source terms, Proceedings of ASME Joint U.S.-European Fluids
Engineering Conference, Montreal, (2002).
3-19. I. Toumi, A. Kumbaro, An Approximate Linearized Riemann Solver for a TwoFluid Model", Journal of Computational Physics, 124, 286 (1996).

3-14

4 MODELS OF TWO-PHASE FLOW THROUGH


EXPANSION, CONTRACTION, OR BRANCH

SUDDEN

4.1 INTRODUCTION
This chapter gives a description of models implemented in WAHA code to simulate single
and two-phase flow through an abrupt area change in a pipe in section 4.2. Therefore, the
expression "abrupt area change models" is most often used in the text. Second part of the
chapter - section 4.3 - describes model of the branch, or junction model, which is built on the
abrupt area change model.
Section 4.2 of this chapter is modified version of the JSI report no. 8726, prepared by Horvat
et. al. January, 2003.
Section 4.3 of this chapter contains part of the Deliverable D63 of the WAHALoads project,
October. 2001, prepared by Tiselj et. al.
As the WAHA code is based on the two-fluid model of two-phase flow, the abrupt area
change models were built in the same manner. All together three models with different levels
of complexity were constructed using the principles of mass, momentum and energy
conservation. No generation or loss of mass, momentum and energy, where flow passes the
abrupt area change, was also postulated.
The models were tested for the flow through pipe expansion and contraction. The results were
compared with data obtained by the RELAP5 mod3.2.2Gamma and RELAP5 mod3.3
program and included in the report. The WAHA code input files for these tests are placed in
appendices.

4.2 ABRUPT AREA CHANGE MODEL


4.2.1 Form of two-phase flow equations in the WAHA code
The one-dimensional two-phase flow in WAHA code is described with 6 transport equations
for pressure p, void fraction , liquid velocity vf, gas velocity vg, liquid specific internal
energy uf and gas specific internal energy ug (see chapter 2). Written in the vector form:
r
r
r

(4.2-1)
A
+B
= S ,
t
x
r
where = ( p, , v f , v g , u f , u g ) is a vector of primitive variables. If the Equation (4.2-1) is

multiplied with inverse of matrix A:


r
r
r

+ A 1 B
= A 1 S
t
x

(4.2-2)

the vector transport equation (4.2-1) takes the following form :


r
r
r

+C
=Q .
t
x

(4.2-3)

4-1

Characteristic form of transport equations described in the chapter 3 on numerical scheme in


WAHA code is not a standard characteristic form of the equations, which is used in abrupt area
change models. The standard transformation between primitive and characteristic variables is
written as:
r

(4.2-4)

= L1 ,

where L1 represents the inverse matrix of the eigenvectors of matrix C . Applying the
transformation (4.2-4) to Equation (4.2-3), the characteristic form of the transport equation
(4.2-3) is obtained;
r
r
r

+
= G .,
t
x

(4.2-5)

where is a diagonal matrix of eigenvalues j.

4.2.2 Models of flow through an abrupt area change


The abrupt area change model is needed, when flow passes through a sudden expansion or
contraction area in a channel as shown in Fig. 4.2-1. In that case, the transport equations
cannot correctly model the physical situation, despite the variable pipe cross-section model
used in the WAHA equations (see chapter 2). Variable pipe cross-section model of WAHA
code is suitable if the contraction or expansion over the pair of neighbouring grid points of the
pipe represents a small fraction (~10%) of the pipe cross-section. When the cross-section of
the pipe is suddenly increased or decreased for a factor larger than approximately 2, it is more
reliable to use abrupt area change model.

A1

p, uf , ug

p, u f , ug

A2

Figure 4.2-1: Scheme of the abrupt area change set-up.


The implemented abrupt area change models are built on 3 basic assumptions:
steady-state balance conditions for conservative variables j across the area change
(marked with k n),
no generation (or loss) of mass, momentum and energy,
r

(4.2-6)

= 0 .
k n

preservation of characteristics in each pipe,

4-2

r
d
dt

=0
k

and

r
d
dt

=0

(4.2-7)

Figure 4.2-2 shows the numerical grid used for the calculations. The numerical algorithm
checks all pipes and calculates the junction relations between the pipe k and the neighbouring
pipe n.

i2

A1
i1-2

i2+1

i2+2

A2

i1

i1-1

k n

Figure 4.2-2: Numerical grid set-up for the abrupt area change model.
Three different abrupt area change models were built and tested: simplified, conservative and
conservative-characteristic model. They differ by the level of complexity that was
implemented using relations (4.2-6) and (4.2-7).

4.2.3 Simplified model


The simplified model uses the simplified version of the conservation relations (4.2-6) between
a regular grid point kB and a ghost grid point nA. The same relations also connect a regular
grid point kA and a ghost grid point nB (Fig. 4.2-3).

i1-1

i1

kA

kB

i1+1

i1+2

i1+3

A1

i2-3

i2-2

i2-1

nB

nA

i2

i2+1

A2

Figure 4.2-3: Grid point arrangement for the simplified abrupt area change model.
The relations between values in the grid points kA and nB:

4-3

( p )kA = ( p )nB
( )kA = ( )nB

(v )
f

kA

(v )
(u )
(u )

g kA
f

kA

g kA

( )

AnB
AkA

( )
= (u )
= (u )

AnB
AkA

= or v f

= or v g
f

nB

nB

(4.2-8)

nB

g nB

and the relations between values in the grid points nA and kB:

( p )nA = ( p )kB
( )nA = ( )kB

(v )
f

nA

(v )
(u )
(u )

g nA
f

nA

g nA

( )

AkB
AnA

( )
= (u )
= (u )

AkB
AnA

= or v f

= or v g
f

kB

kB

(4.2-9)

kB

g kB

The orientation variable or takes the value of 1 or -1 that depends on orientation of both pipes.
As the values of all variables in the regular grid points nB and kB are known, the values in the
ghost grid points kA and nA can be calculated explicitly.

4.2.4 Conservative model


The conservative model is based on the rigorous implementation of the conservation relations
(4.2-6) between the regular grid point kB and the ghost grid point nA. The same relations are
also implemented between the regular grid point kA and the ghost grid point nB (Fig. 4.2-4).

i1-1

i1

kA

kB

i1+1

i1+2

i1+3

A1

i2-3

i2-2

i2-1

nB

nA

i2

i2+1

A2

Figure 4.2-4: Grid point arrangement for the conservative abrupt area change model.
As the model implements the steady state balance conditions for the conservative variables
across the boundary k n, the discrepancy vector F can be defined.
The discrepancy vector F between the values in the grid points kA and nB:

4-4

or f f v f

or g g v g

( (
f

( (
g

A nB
A nB

nB

AkA

2
f

))

2
g

))

v +p

it

it

AnB

AkA

nB

nB

))

))

or g v g g wg + p

nB

nB

gvg
f

it

fvf

( (

it

AnB

AkA

or f v f f w f + p

AkA

nB

v +p

( (
g

AnB

AkA
S nB

S kA

it

it

,
= F2

kA

= F1

kA

2
f

v +p
2
g

v +p

))

))

~ ~p AnB 1 = F

f
3
A

kA

kA

kA

~ ~p AnB 1 = F

g
4
A

kA

vf fwf + p

vg gwg + p

))

))

kA

kA

(4.2-10)
,

= F5

= F6

and the discrepancy vector F between the values in the grid points nA and kB :
f

f vf

g v g ) kB o r it ( g g v g ) nA

( (
f

( (
g

it

or

kB

v 2f + p

v g2 + p

))

))

it

it

kB

kB

vf f ef + p

vg g eg + p

))

))

fvf

( (
f

nA

= F8

AkB

v 2f + p

= F7

AkB
A nA

))

nA

AnA
~ ~p 1 AnA = F

f
9

AkB
AkB

A
~ ~p 1 AnA = F
g g v g2 + p nA nA
g
10

AkB
AkB

A
it
o r f v f f e f + p nA nA = F11 ,
AkB

( (

))

kB

kB

A nA

or

it

(4.2-11)

))

vg geg + p

))

nA

AnA
= F12
AkB

where denotes an average between the locations kA and nB, and between the locations nA
and kB, respectively. Next, the discrepancy vector was minimized using the Newton-Raphson
method.
it

( )
j

it

( )
j

kA

nA

it 1

it 1

( )
j

( )
j

it 1
kA

it 1
nA

Fj

F j i

Fj

F j i

kA, nA

kA, nA

j = 1,..,6 and i = 1,...,6


(4.2-12)

where = ( p, , v f , vg , u f , u g ) is a vector of primitive variables. The iteration procedure is stopped


when
r

err =

j =1

( (
it

kA

it 1

( )
j

)+ ( (
it

kA

nA

it 1

( )
j

nA

)<

10 5 .

(4.2-13)

It is important to note that the momentum balance in the conservative abrupt area change
model is not the same as the momentum balance of the basic two-fluid model of WAHA
code: special terms like virtual mass term and interfacial pressure term are not taken into
account in the momentum equations used in abrupt area change model.

4-5

4.2.5 Conservative-characteristic model


The conservative-characteristic model implements the conservation relations (4.2-6) between
the ghost grid point kA and the ghost grid point nA. It also used the relations (4.2-7), which
extrapolate characteristic from the regular grid point kB or nB in the flow direction, if is
positive, and in the opposite direction, if is negative (Fig. 4.2-5).

i1-1

i1

kA

kB

i1+1

i1+2

i1+3

A1

nB

nA

i2

i2+1

A2
i2-3

i2-2

i2-1

Figure 4.2-5: Grid point arrangement for the conservative-characteristic abrupt area change
model.
Using extrapolation of the positive characteristics from the grid point nB to nA and of the
negative characteristics from the grid point kB to kA, the discrepancy vector F is defined as:

~
F j = L ji1
~
F j = L ji1

if j 0
else

( i )kA ( i )kB )
( it ( i )nA ( i )nB )

(4.2-14)

j = 1,...,6

it

The discrepancy vector F also has to include the orientation of the pipe in a system.
Therefore, the velocity differences ( j = 3 and 4) are corrected as:

(
(

( 3 )kA ( 3 )kB ) o r ( it ( 3 )kA ( 3 )kB ) or ( it ( 3 )nA ( 3 )nB )


it
( 4 )kA ( 4 )kB ) o r ( it ( 4 )kA ( 4 )kB ) or ( it ( 4 )nA ( 4 )nB )
it

(
o (
or

it
it

( 3 )nA ( 3 )nB )
( 4 )nA ( 4 )nB ) ,

(4.2-15)

The steady-state balance conditions for the conservative variables j are then written between
the grid points kA and nA as:
f

f vf

g v g ) kA o r it ( g g v g ) nA

( (
f

( (
g

kA

or

v 2f + p
v g2 + p

))

))

kA

kA

vf f ef + p

it

it

it

))

kA

A nA

fvf

( (
f

nA

AkA
A nA
AkA

v 2f + p

))

= F7
= F8

nA

AnA
~ ~p 1 AnA = F

f
9

AkA
AkA

A
~ ~p 1 AnA = F
g g v g2 + p nA nA
g
10

AkA
AkA

A
it
o r f v f f e f + p nA nA = F11 ,
AkA

( (

))

))

4-6

,
,

(4.2-16)

vg g eg + p

))

kA

or

it

vg geg + p

))

nA

AnA
= F12
AkA

where denotes an average between the locations kA and nA. This discrepancy vector was
again minimized using the Newton-Raphson method:
it

( )
j

it

( )
j

kA

nA

it 1

it 1

( )
j

( )
j

it 1
kA

it 1
nA

Fj

F j i

Fj

F j i

kA, nA

j = 1,...,6 and i = 1,...,6


(4.2-17)

kA, nA

The iteration procedure is stopped when


6

err =

j =1

( (
it

kA

it 1

( )
j

)+ ( (
it

kA

nA

it 1

( )
j

nA

)<

10 5

(4.2-18)

It is important to note that the momentum balance in the conservative-characteristic abrupt


area change model is not the same as the momentum balance of the basic two-fluid model of
WAHA code: special terms like virtual mass term and interfacial pressure term are not taken
into account in the momentum equations used in abrupt area change model. On the other side,
the characteristic variables are obtained from the basic two-fluid model of WAHA code.

4.2.6 Time marching algorithm


The algorithm of the WAHA code is presented in Fig. 4.2-6. As it is marked, the junction
relations are called in the initial conditions section and in each time step. The call in the initial
conditions section always requires the conservative model (WAHA code switch sw(3) = 2),
whereas in later calls, all three junction models are an option:
WAHA code switch sw(3)=1, simplified model
WAHA code switch sw(3)=2, conservative model
WAHA code switch sw(3)=3, conservative-characteristic model
It is worth mentioning that the time integration of the transport equation (4.2-3) is performed
in 2 stages of the operator splitting scheme. At the end of each time step, the junction models
are introduced to calculate values of the primitive variables p, , vl, vg, ul, ug in the ghost grid
points kA and nA.

4-7

initial conditions

junction relations,
conservative model (2)

update of primitive
variables

flow-structure
interaction

gravity, wall fric.,


varable cross-sect.

eigenvalues
calculation

convection

relaxation sources

update of primitive
variables

junction relations,
choose the model (1,2,3)

Figure 4.2-6: WAHA code algorithm.

4-8

4.2.7 Test cases of the abrupt area change model


Test calculations were performed for two-phase flow through a contraction with a crosssection ratio A1/A2 = 20. The flow is initiated with a pressure shock at L = 2 m. The rest of
initial conditions are summarized in Table 4.2-1.

cross-section A
pressure p
liquid velocity vf
gas velocity vg
liquid spec. int. energy uf
gas spec. int. energy ug

left side

right side

0.4
1.5E+7
0.0
0.0
1.586141E+6
1.393516E+6

0.02
1.0E+7
0.0
0.0
2.459924E+6
2.547317E+6

m
Pa
m/s
m/s
J/kg
J/kg

Table 4.2-1: Initial conditions for testing the abrupt area change model of two-phase flow
through a contraction.
For described initial conditions, the simplified, conservative and conservative-characteristic
models were tested. Obtained pressure and void fraction distributions were compared with the
RELAP5 mod 3.2.2 Gamma calculations (Figs. 4.2-7 and 4.2-8).

1.7E+07

RELAP5 Mod 3.2.2g


WAHA code, simplified model
WAHA code, conservative model
WAHA code, conservative-characte

1.6E+07

p [Pa]

1.5E+07

1.4E+07

1.3E+07

1.2E+07

1.1E+07

1.0E+07
0

L [m]

Figure 4.2-7: Pressure distribution along the pipe at t = 0.009s, contraction.

4-9

1.1E+00

RELAP5 Mod 3.2.2g


WAHA code, simplified model
WAHA code, conservative model
WAHA code, conservative-characte

1.0E+00

void

9.0E-01

8.0E-01

7.0E-01

6.0E-01

5.0E-01

4.0E-01
0

L [m]

Figure 4.2-8: Void distribution along the pipe at t = 0.009s, contraction.


The test calculations were also performed for two-phase flow through an expansion with a
cross-section ratio A2/A1 = 20. The flow is initiated with a pressure shock at L = 2 m and the
rest of initial conditions are summarized in Table 4.2-2.

cross-section A
pressure p
liquid velocity vf
gas velocity vg
liquid spec. int. energy uf
gas spec. int. energy ug

left side

right side

0.02
1.5E+7
0.0
0.0
1.586141E+6
1.393516E+6

0.4
1.0E+7
0.0
0.0
2.459924E+6
2.547317E+6

m
Pa
m/s
m/s
J/kg
J/kg

Table 4.2-2: Initial conditions for testing the abrupt area change model of two-phase flow
through an expansion.
For described initial conditions, the simplified, conservative and conservative-characteristic
models were tested. Figures 4.2-9 and 4.2-10 present comparison between the obtained
pressure and void fraction distributions and the RELAP5 mod 3.2.2 Gamma calculations.

4-10

1.5E+07

RELAP5 Mod 3.2.2g


WAHA code, simplified model
WAHA code, conservative model
WAHA code, conservative-characte

1.4E+07

p [Pa]

1.3E+07

1.2E+07

1.1E+07

1.0E+07

9.0E+06
0

L [m]

Figure 4.2-9: Pressure distribution along the pipe at t = 0.009s, expansion.

1.1E+00

RELAP5 Mod 3.2.2g


WAHA code, simplified model
WAHA code, conservative model
WAHA code, conservative-characte

1.0E+00

void

9.0E-01

8.0E-01

7.0E-01

6.0E-01

5.0E-01

4.0E-01
0

L [m]

Figure 4.2-10: Void distribution along the pipe at t = 0.009s, expansion.


The input files for the WAHA code (details in (Tiselj, 2001, D62)) as well as for the RELAP5
mod 3.2.2 Gamma code (details in (Tiselj, 2001, D63)) can be found in appendices.

4-11

4.2.8 Conclusions on the abrupt area change models


The preformed test cases showed that all three models (simplified, conservative and
conservative-characteristic model) are capable to simulate two-phase flow through an abrupt
area change.
There is almost no difference between the results obtained with the conservative model and
the conservative-characteristic model. Nevertheless, the conservative-characteristic model is
much more stable, enabling us to obtain results at higher Courant number and for higher
cross-section ratio A1/A2 and is thus recommended for use in WAHA code simulations.
Current abrupt area change models do not contain the generation or loss of momentum and
energy, where flow passes the abrupt area change. These models - especially momentum
losses - must be included in abrupt area change model to obtain more realistic behaviour of
flow on the abrupt area change.
Important:
1) Abrupt area change model was tested and verified for the single-phase flows, but has
not been thoroughly tested in the various two-phase situations. Thus, the model is to be
used with caution in two-phase systems.
2) Reduced CFL number (Word W5 on Time step card) is recommended with values
~0.5, if problems with abrupt area change model appear.
3) Minor losses are not included in the abrupt area change model. They can be applied
by the user with modification of the wall friction in the nodes connected into the
junction.

4-12

4.3 BRANCH MODEL


4.3.1 Model of flow through the branch
A branch model is applied when three pipes are connected in a single point (Fig. 4.3-1).
Junction of more than three pipes in a single point is not allowed in the WAHA code. Branch
does not have a volume; it is only a point that connects three pipes. Special components
"tank" and "pump", which are used in WAHA to describe various types of boundary
conditions, cannot be connected directly into the branch. Of course, a short "pipe" section can
be inserted between such component and branch.
Treatment of the branch connection is discussed by Martin, Wiggert (1996) and by Wylie,
Streeter in the section 3-5 of their book (1978).
pipe 2

2 A2
A1

pipe 1

A3 pipe 3
r

Figure 4.3-1: Branch - geometrical arrangement


WAHA branch model is slightly modified version of the approaches described in (Martin,
Wiggert, 1996 and Wylie, Streeter, 1978). In the branch model the "dominant" pipe is first
defined. The "dominant" pipe is defined as a pipe with the largest mass flow rate:

main = max (1 , 2 , 3 )

(4.3-1)

where fi is the mass flow in the connected pipe. The state in the other two connected pipes is
averaged. In the case when the main pipe is pipe has index i = 1, the averaged state is
(4.3-2)
p A + p 3 A3
p av = 2 2
A2 + A3
2 A2 + 3 A3
(4.3-3)
av =

2 g , 2 v g , 2 A2 + 3 g , 3 v g , 3 A3
2 g , 2 A2 + 3 g ,3 A3

(4.3-4)

(1 2 ) f , 2 v f , 2 A2 + (1 3 ) f , 3 v f ,3 A3

(4.3-5)

v g , av =
v f ,av =

(1 2 ) f , 2 A2 + (1 3 ) f , 3 A3

2 g , 2 u g , 2 A2 + 3 g , 3 u g , 3 A3
2 g , 2 A2 + 3 g , 3 A3

(4.3-6)

(1 2 ) f , 2 u f , 2 A2 + (1 3 ) f , 3 u f , 3 A3

(4.3-7)

u g ,av =
u f ,av =

A2 + A3

(1 2 ) f , 2 A2 + (1 3 ) f , 3 A3

4-13

The boundary values in the pipes are then calculated in the same was as in the abrupt area
r
r
r
r
change model in 4.2-1 with 1 main , 2 av and A2 ( A2+A3 ).
After the abrupt area change calculation is finished the boundary values in the dominant pipe
1 are already prescribed, while the values of the averaged pipe are taken as boundary values
of the pipes 2 and 3, except the phasic velocities, which are not taken as the velocity of the
averaged pipe, but are extrapolated from the pipes 2 and 3.
4.3.2 Branch model pure liquid (teeliq.dat)
This case shows behaviour of the pressure pulse through the branch filled with pure liquid.
The file (see section 4.5.5) contains branch (T) connection model where three different pipes
are connected in the same point as shown in Figure 4.3-2.

GEOMETRY (P1/P6/P2):
Length l = 10/5/3 m
Diameter d = 7.9/7.9/0.7 mm

INITIAL CONDITIONS (P1/P6/P2):


Temperature T = 293/293/293 K
Vapor velocity v = 1/0.769/0.769 m/s
Presure p = 80/80/80 bar
Vapor volume fraction - pure liquid

p= const.

const.

...

Pipe 1

...

.. Pipe 2.. 29 30

97 98 99 100
3

...Pipe 6...

Closed end

47 48 49 50

Figure 4.3-2: Geometry and initial conditions of "teeliq.dat" model.


The left pipe is 10 m long and its left end is connected to a large water tank modelled as a
constant pressure boundary condition. The upper pipe is 3 m and the right pipe is 5 m long.
The left and the right pipe have a same cross-section A = 0.1 m2, while the upper pipe has a
cross-section A2 = 0.03 m2. The following stationary state is applied initially: r1 = r2 = r6 =
1001.9 kg/m3, v1 = 1 m/s, v2 = v6 = 0.769 m/s and p1 = p2 = p6 = 80 bar. Flow direction is from
the tank no. 4 and pipe 1 into the pipes 2 and 3.
At the beginning the liquid flows from the tank no. 4 and pipe 1 into the pipes 2 and 6. At
time t = 0 the right end of the pipe 6 is closed and the pressure pulse expands upward the
piping system. Figure 4.3-3 show the time history of the pressure in the points 1, 2, 3, which
are located 1.05 m from the end of pipe 1 (point p1), 0.15 m from the beginning of pipe 6
(point p2), and 0.95 m from the beginning of the pipe 2 (point p3). The WAHA results are
compared with RELAP5/MOD3.3 simulation and the only differences are due to the less
diffusive numerical scheme in the WAHA code.

4-14

p1 [MPa]

WAHA

p2 [MPa]

WAHA

9.2

RELAP

9.2

RELAP

9.0

9.0

8.8

8.8

8.6

8.6

8.4

8.4

8.2

8.2

8.0

8.0

7.8

7.8

0.000

0.002

0.004

0.006

0.008

[s]

0.010

0.000

0.002

0.004

p3 [MPa]

WAHA

9.4

RELAP

0.006

0.008

[s]

0.010

9.2
9.0
8.8
8.6
8.4
8.2
8.0
7.8
0.000

0.002

0.004

0.006

0.008

[s]

0.010

Figure 4.3-3: Comparison of the WAHA and RELAP5 pressure history in the points 1, 2 and
3 - single-phase liquid case.

4.3.3 Branch model pure vapor (teevap.dat)


This case shows behaviour of the pressure pulse through the branch filled with vapor. The
following stationary state is applied initially (Figure 4.3-4): T1 = T2 = T6 = 593 K,
v1 = v6 = -100 m/s, v2 = 0.0 m/s and p1 = p2 = p6 = 80 bar. Flow direction is from the pipe 2
into the pipe 1 and tank 4.

GEOMETRY (P1/P6/P2):
Length l = 10/5/3 m
Diameter d = 7.9/7.9/0.7 mm

INITIAL CONDITIONS (P1/P6/P2):


Temperature T = 593/593/593 K
Vapor velocity v = -100/-100/0 m/s
Presure p = 80/80/80 bar
Vapor volume fraction - pure vapor

p=const.

p= const.

...

Pipe 1

...

...Pipe 2... 29 30

97 98 99 100
3

...Pipe 6...

Closed end

47 48 49 50

Figure 4.3-4: Geometry and initial conditions of "teevap.dat" model.

At the beginning the vapor flows from the tank no. 2 and pipe 6 into the pipes 1 and 2. At
time t = 0 s the right end of the pipe 6 is closed and the pressure pulse expands upward the
piping system. The results in Figure 4.3-5 are showed at the same points as in the Section
4-15

4.3.2 . Differences between RELAP5 and WAHA are larger than in the single-phase liquid
branch mainly because the initial state does not represent a steady-state solution and due to
the slightly treatment of the boundary conditions in the RELAP5 and WAHA. However, the
solutions are very similar.
p1 [MPa]

WAHA

p2 [MPa]

WAHA

8.5

RELAP

8.5

RELAP

8.0

8.0

7.5

7.5

7.0
7.0

6.5

6.5

6.0

6.0
0.000

0.005

0.010

0.015

0.020

0.025

[s] 0.030

5.5
0.000

0.005

0.010

p3 [MPa]

WAHA

8.5

RELAP

0.015

0.020

0.025

[s]

0.030

8.0
7.5
7.0
6.5
6.0
0.000

0.005

0.010

0.015

0.020

0.025

[s]

0.030

Figure 4.3-5: Comparison of the WAHA and RELAP5 pressure history in the points 1, 2 and 3
- single-phase vapor case.

4.3.4 Conclusions and Guidelines on the use of the branch model:


1) Branch model was tested and verified for the single-phase flows, but has not been
tested in the two-phase flow. Thus, the model is to be used with caution in two-phase
systems.
2) Reduced CFL number (Word W5 on Time step card) is recommended with values
~0.5, if problems with branch model appear.
3) The conservative-characteristic model of the abrupt area change is recommended for use
also in WAHA code simulations of branches.
4) Minor losses are not included in the branch model. They can be applied by the user
with modification of the wall friction in the nodes connected into the branch.

4-16

4.4 REFERENCES
4-1. K.E. Carlson, R.A. Riemke, S.Z. Rouhani, R.W. Shumway, W.L. Weaver,
RELAP5/MOD3 Code Manual, Vol. 1-7, NUREG/CR-5535, EG&G Idaho, Idaho
Falls, 1990.
4-2. A. Horvat, I. Tiselj, J. Gale, WAHA code models of two-phase flow through sudden
expansion and contraction, JSI report IJS-DP-8726, January, 2003.
4-3. C.S. Martin, D. Wiggert, Waterhammer and Fluid Structure Interaction in Piping
System, ASME Professional Development Programs, April 4.-5., p. 1-8, 1996.
4-4. I. Tiselj, G. erne, I. Parzer, A. Horvat, Numerical method of WAHA code,
WAHALoads project, Deliverable D62 version Oct. 2001.
4-5. I. Tiselj, G. erne, I. Parzer, A. Horvat, WAHA code development interim report,
WAHALoads project, Deliverable D63 version Oct. 2001.
4-6. E.B. Wylie, V. L. Streeter, Fluid Transients, McGraw-Hill, 1978.

4-17

4.5 APPENDIX
4.5.1 WAHA code input file for flow through the contraction
title abrupt area change model test - contraction- two-phase mixture
* works for cross.sect-ratios 20:1 to 1:5
*--------time constants---------------------------------*
beg
end
maj_out
min_out
diff
restart
time00 0
1.0e-2 2.0e-4
1.0e-4
0.80
2.
*
fluid
order
abr_model eig_val_out extend_out maj_results
switch 1
2
3
0
0
1
*-------------pipes
-------------------------------*
type
name
comp001ty pipe
cev_01
*
length
elast
thick
rough
w.fr.f p.fr.f
h.m.tr.
comp001g0 3.0
0.0
1.588e-3 0.0
9
0
0
*
cross
incl
azim
f_coeff node
comp001g1 0.4
0.0
0.0
1.0
75
*
type
press
alpha_g
velf
velg
uf
ug
comp001s0 agpvu
1.5e7
0.5
0.0
0.0
1.5853e6 2.4556e6
+
agpvu
1.0e7
0.9
0.0
0.0
1.3935e6 2.5452e6
*
from
to
comp001c0 000-00
005-01
*------------------------------------------------------*
type
name
comp005ty pipe
cev_05
*
length
elast
thick
rough
w.fr.f p.fr.f
h.m.tr.
comp005g0 2.0
0.0
1.588e-3 0.0
9
0
0
*
cross
incl
azim
f_coeff node
comp005g1 0.02
0.0
0.0
1.0
50
*
type
press
alpha_g
velf
velg
uf
ug
comp005s0 agpvu
1.0e7
0.9
0.0
0.0
1.3935e6 2.5452e6
*
from
to
comp005c0 001-99
000-00
***************************************************************
end

nods
75

wch_nods
50
75

nods
50

wch_nods
50

4.5.2 WAHA code input file for flow through the expansion
title abrupt area change model test -expansion - two-phase mixture
* works for surface ration 1:20
*--------time constants---------------------------------*
beg
end
maj_out
min_out
diff
restart
time00 0
1.5e-2 3.0e-4
1.0e-4
0.80
1.0
*
fluid
order
abr_model eig_val_out extend_out maj_results
switch 1
2
3
0
0
1
*-------------pipes
-------------------------------*
type
name
comp001ty pipe
cev_01
*
length
elast
thick
rough
w.fr.f p.fr.f
h.m.tr.
comp001g0 3.0
0.0
1.588e-3 0.0
9
0
0
*
cross
incl
azim
f_coeff node
comp001g1 0.02
0.0
0.0
1.0
75
*
type
press
alpha_g
velf
velg
uf
ug
comp001s0 agpvu
1.5e7
0.5
0.0
0.0
1.5853e6 2.4556e6
+
agpvu
1.0e7
0.9
0.0
0.0
1.3935e6 2.5452e6
*
from
to
comp001c0 000-00
005-01
*------------------------------------------------------*
type
name
comp005ty pipe
cev_05
*
length
elast
thick
rough
w.fr.f p.fr.f
h.m.tr.
comp005g0 2.0
0.0
1.588e-3 0.0
9
0
0
*
cross
incl
azim
f_coeff node
comp005g1 0.4
0.0
0.0
1.0
50
*
type
press
alpha_g
velf
velg
uf
ug
comp005s0 agpvu
1.0e7
0.9
0.0
0.0
1.3935e6 2.5452e6
*
from
to
comp005c0 001-99
000-00
***************************************************************
end

4-18

nods
75

wch_nods
50
75

nods
50

wch_nods
50

4.5.3 RELAP5 code input file for flow through the contraction
=shock tube
100 new transnt
201 1.2-2 1.-8 1.-5 7 10 30 30
*
10000 tube1 pipe
10001 75
10101 0.4 75
10301 0.04 75
10601 0 75
10801 0 0 75
11001 1011 75
11101 20 74
11201 0 1.5+7 1586141. 2459924.
11202 0 1.+7 1393516. 2547317.
11301 0 0 0 74
*
30000 jun1 sngljun
30101 1010000 5000000 0 0 0 120
30201 0 0 0 0
*
50000 tube2 pipe
50001 50
50101 0.02 50
50301 0.04 50
50601 0 50
50801 0 0 50
51001 1011 50
51101 20 49
51201 0 1.+7 1393516. 2547317.
51301 0 0 0 49
*
. end of case

0.5
0.9

0 50
0 75

0.9

0 50

4.5.4 RELAP5 code input file for flow through an expansion


=shock tube
100 new transnt
201 1.2-2 1.-8 1.-5 7 10 30 30
*
10000 tube1 pipe
10001 75
10101 0.02 75
10301 0.04 75
10601 0 75
10801 0 0 75
11001 1011 75
11101 20 74
11201 0 1.5+7 1586141. 2459924.
11202 0 1.+7 1393516. 2547317.
11301 0 0 0 74
*
30000 jun1 sngljun
30101 1010000 5000000 0 0 0 120
30201 0 0 0 0
*
50000 tube2 pipe
50001 50
50101 0.4 50
50301 0.04 50
50601 0 50
50801 0 0 50
51001 1011 50
51101 20 49
51201 0 1.+7 1393516. 2547317.
51301 0 0 0 49
*
. end of case

0.5
0.9

0 50
0 75

0.9

0 50

4-19

4.5.5 WAHA code input file for liquid flow through the branch
title teeliq.dat: wave passing through the branch - single phase liquid
*--------time constants---------------------------------*
beg
end
maj_out min_out diff restart
time00 0
1.0e-2
2.0e-4
1.0e-4
0.83
0.05
*
fluid
order abr_model eigval ext_out gnuplt
switch
1
2
3
1
0
1
*
ambient_p
force_out
force
1.e+5
0.001
* minor edit
print01
1
90
1
print01
6
10
1
print01
2
2
1
print01
1
90
3
print01
6
10
3
print01
2
2
3
*-------------pipes
-------------------------------*
type
name
comp001ty pipe
*
length
elast
thick
rough
w.fr.f p.fr.f h.m.tr. nods
comp001g0 10.0
0.0
0.0
0.0
9
0
0
100
*
area
incl
azim
w.fr
which
nods
comp001g1 1.e-1
0.
0.0
1.0
100
*
type
press
alpha_g velf
velg
tf
tg
wch_nods
comp001s0 agpvt
8.0e6
0.0
1.0
0.0
293.0
293.0
100
*
from
to
from2
to2
comp001c0 004-01
002-01
000-00
006-01
*------------------------------------------------------*
type
name
comp002ty pipe
*
length
elast
thick
rough
w.fr.f p.fr.f h.m.tr. nods
comp002g0 3.0-0
0.0
0.0
0.0
9
0
0
30
*
area
incl
azim
w.fr.
which
nods
comp002g1 3.e-2
0.
0.0
1.0
30
*
type
press
alpha_g velf
velg
tf
tg
wch_nods
comp002s0 agpvt
8.0e6
0.0
0.7692 0.0
293.0
293.0
30
*
from
to
from2
to2
comp002c0 001-99
005-01
006-01
000-00
*------------------------------------------------------*
*
type
name
comp006ty pipe
*
length
elast
thick
rough
w.fr.f p.fr.f h.m.tr. nods
comp006g0 5.0
0.0
0.0
0.0
9
0
0
50
*
area
incl
azim
w.fr.
which nods
comp006g1 1.e-1
0.
0.0
1.0
50
*
type
press
alpha_g
velf
velg
tf
tg
wch_nods
comp006s0 agpvt
8.0e6
0.0
0.7692 0.0
293.0
293.0
50
*
from
to
from2
to2
comp006c0 001-99
000-00 002-01
000-00
*------------------------------------------------------*
type
name
comp004ty tank
tank_03
*
length
elast
thick
rough
w.fr.f p.fr.f h.m.tr. nods
comp004g0 0.0-0
0.0
0.0
0.0
9
8
8
0
*
crossct inclin
azim
f_coeff which_nodes
comp004g1 1.E-1
0.0
0.0
1.0
0
*
type
press
alpha_g
velf
velg
tf
tg
wch_nods
comp004s0 agpvt
8.000e6
0.0
1.0
0.0
293.0 293.0
0
*
from
to
comp004c0 001-01
000-00
*------------------------------------------------------*
type
name
comp005ty tank
tank_04
*
length
elast
thick
rough
w.fr.f p.fr.f h.m.tr. nods
comp005g0 0.0-0
0.0
0.0
0.0
9
8
8
0
*
crossct inclin
azim
f_coeff which_nodes
comp005g1 3.E-2
0.0
0.0
1.0
0
*
type
press
alpha_g
velf
velg
tf
tg
wch_nods
comp005s0 agpvt
8.000e6
0.0
0.7692 0.0
293.0 293.0
0
*
from
to
comp005c0 002-99
000-00
*end

4-20

4.5.6 RELAP5/MOD3.3 input file for flow through the branch


Note: RELAP5 needs a short steady state calculation to avoid pressure waves that otherwise
appear at certain junctions
=branch
* pressure wave passing through the branch , RELAP5/MOD3.3
* 1.0 s steady-state calculation needed before transient starts
100 new transnt
*
t-end min.dt max.dt option
minor major restart
201 -1.0
1.-6
1.-4
3
100
10000
10000
202 -1.01
1.-6
1.-5
3
10
1000
10000
*
t r i p
i n p u t
d a t a
501 time 0 lt null 0 1. n * valve closure
*
*
h y d r o d y n a m i c
c o m p o n e n t s
0040000 tank_04
tmdpvol
0040101 10. 10. 0 0 0 0 0 0 0000010
0040200 3
0040201 0 8.e+6 293.
*
0410000 jun41 sngljun
0410101 004010000 001000000 0.0 0 0 0001000
0410201 0 1. 0 0
*
0010000 pipe_1
pipe
0010001 99
0010101 0.1 99
0010301 0.1 99
0010601 0
99
0010801 0 0 99
0011001 0000010 99
0011101 0001000 98
0011201 3 8.+6 293. 0 0 0 99
0011301 1. 0 0 98
*
0030000 pipe_1e
branch
0030001 3
0030101 0.1 0.1 0 0 0 0 0 0 0000010
0030200 3 8.e+6 293.
0031101 001010000 003000000 0 0 0 0001000
0032101 003010000 002000000 0 0 0 0001000
0033101 003010000 006000000 0 0 0 0001000
0031201 1.
0 0
0032201 .7692 0 0
0033201 .7692 0 0
*
0020000 pipe_2
pipe
0020001 30
0020101 .03 30
0020301 0.1 30
0020601 0
30
0020801 0 0 30
0021001 0000010 30
0021101 0001000 29
0021201 3 8.+6 293. 0 0 0 30
0021301 .7692 0 0 29
*
0250000 jun25 sngljun
0250101 002010000 005000000 0.0 0 0 0001000
0250201 0 .7692 0 0
*
0050000 tank_05
tmdpvol
0050101 10. .03 0 0 0 0 0 0 10
0050200 3
0050201 0 8.e+6 293.
*
0060000 pipe_6
pipe
0060001 50
0060101 0.1 50
0060301 0.1 50

4-21

0060601
0060801
0061001
0061101
0061201
0061301
*

0
50
0 0 50
0000010 50
0001000 49
3 8.+6 293. 0 0 0 50
.7692 0 0 49

* valve 068 and tank 008 needed to establish


* steady state connected to pipe 6
0680000 vlv
valve
0680101 006010000 008000000 0 0 0 0001000
0680201 0 .7692 0 0
0680300 trpvlv
0680301 501
*
0080000 tank_08
tmdpvol
0080101 10. .1 0 0 0 0 0 0 10
0080200 3
0080201 0 8.e+6 293.
*
20530000 trtime sum 1. 0 0
20530001 -1.0 1.0 time 0
. ***** end of input *****

4-22

5 CALCULATION OF WATER PROPERTIES IN THE WAHA CODE


This chapter describes the water property subroutines used in the WAHA code. Water
properties are tabulated with a separate program (listing enclosed) and stored in a table. The
WAHA subroutines determine the properties with interpolation from that table. Dynamic
viscosities, thermal conductivities and surface tension are obtained directly from interpolating
functions in separate subroutines.
5.1 CREATION OF "h2o_prop" FILE WITH TABULATED WATER PROPERTIES
The table with water properties was created with software from UCL (Seynhaeve et al. 1992).
This software contains a set of subroutines and functions. Three functions from that package
were used to prepare the tables:
1) opst(t)
function returns saturation pressure at temperature t.
2) oupt(p,t,x)
function returns specific internal energy as a function of pressure p and
temperature t. For x = 2.0 function returns specific internal energy of
vapor and for x = -1.0 function returns specific internal energy of
liquid.
3) orho(p,t,x)
Function returns density as a function of pressure p and temperature t.
For x = 2.0 function returns density of vapor and for x = -1.0 function
returns density of liquid.
Functions orho and oupt obtain values also for metastable states (superheated liquid and
subcooled vapor). The metastable states do not exist beyond the corresponding spinodal lines
of liquid and vapor (see Figure 1.). The spinodal lines in Fig. 1 are obtained with the UCL
steam tables (Seynhaeve et al. 1992) and might be slightly different if other steam tables are
used.
Specific feature of the applied package from UCL is that when the input pressure and
temperature lie beyond the corresponding spinodal line, the output of the orho and the oupt
function are properties of the "other" phase. For example, if the liquid properties are requested
at the low input pressure p = 10 bar and high temperature T = 630 K where the superheated
liquid cannot exist (see Fig. 1), the functions will return the properties of the vapor. The
program that creates the table with water properties recognizes such situations from the values
of internal energy; liquid internal energy cannot exceed the value of uf = 2.109.900 J/kg,
while the vapor internal energy ug cannot fall below this value. If different package is used for
the preparation of the water properties table some other limitations and specific features may
apply.
A program "create.f" tabulates the water properties at given pressures and temperatures. A
listing of "create.f", which prepares the table with water properties and stores the table into
the file, is given at the end of chaper. The program "create.f" works in six stages:
Stage 1:
Defines temperatures and pressures at which the properties are tabulated:
Temperatures:

5-1

Pressures:
-

T1 = 273.15 K,....., TNTP = 647.15 K, increment 1.0K, i.e. NTP=375 - twophase area
TNTP+1 = 648.15 K ,....., TNT = 1638.15 K, increment 10.0 K, i.e., NT = 475
p0=-95.0 bar,
p1 = 0.00611 bar,..., pNTP = 220.55 bar, two-phase area: each pressure is
evaluated as a saturation pressure at the corresponding temperature:
pj = psat(Tj),
pNTP+1=221.0bar, ..., pNTP+8=291.0bar, increment 10.0 bar,
pNTP+9=350.0 bar,
pNTP+10=400.0 bar, ... pNTP+16=1000.0 bar, increment 100.0 bar.

There are 375 temperatures in two-phase area and Ti+1 - Ti = 1.0 K. The number of pressures
pj in two-phase area is exactly the same as the number of temperatures NTP. Each pressure is
evaluated as a saturation pressure at the corresponding temperature: pj = psat(Tj), with p1 =
0.00611 bar and pNTP = 220.55 bar. Practical side of this choice is calculation of saturation
properties with exactly the same subroutines as single-phase properties. Namely, arbitrary
property can be calculated for point (Ti,pj) and the saturation conditions can be stored at i = j.
There is one negative pressure value at which the metastable liquid properties are defined at
temperatures from 273.15 to 647.15 K. However, they are not calculated from the basic
subroutines but with a linear extrapolation from the lowest pressures p1 and p2. Liquid
properties at negative pressure are only a rough approximation of the actual properties at such
conditions. As negative pressures occur very rarely, but might be still reached for a very short
time during some water hammer transients, this simple extension of the water property tables
prevents the calculation to crash if negative pressure is encountered in single phase liquid.
Stage 2:
For each pair (Ti,pj) from the two-phase area
i = 1, NTP
j = 1, NTP

( 273.15K < T < 647.15 K ),


(0.00611 bar < p < 220.55 bar),

the specific internal energy and density of vapor and liquid are calculated. If certain phase
does not exist in a given point, the program puts -1.0 for density and internal energy. All
data are stored in the table.
Stage 3:
For each pair (Ti,pj) from the single-phase liquid area above the critical pressure
i = 1, NTP
( 273.15K < T < 647.15 K ),
j = NTP + 1, NTP + 16
(p > 220.55 bar),
the specific internal energy of the liquid is calculated. Data are stored in the "liquid" part of
the table, while the "vapor" part of the table is set to -1.0. In order to minimise possible
problems near the critical point, a minor modification of the tables is made at the critical
temperature 647.15 K and in the first pressure above the critical value. The vapor properties
equal to the liquid properties are assumed for this condition and written into the table.

5-2

Stage 4:
The metastable properties are extrapolated into undefined regions. This step is necessary in
order to avoid the cases where the code requires the properties of the specific phase in a point,
where this phase cannot exist i.e. beyond the spinodal lines. Especially at high pressures the
liquid overheating or vapor subcooling cannot be very high (see Fig. 5.1-1). Therefore, the
metastable properties are linearly extrapolated inside the following range:
200

kg
3

< f < 1200

kg

m
m3
J
J
0.0
< u f < 2.0 10 6
kg
kg
kg
kg
0 3 < g < 500 3
m
m
J
J
1.7 10 6
< u g < 8.0 10 6
kg
kg

Outside this range, values of -1.0 are preserved for density and internal energy.
Stage 5:
Extrapolation of liquid properties is made at negative pressure p0 = -95.0 bar and at
temperatures 273.15K < T < 647.15 K. Vapor properties at negative pressure are set to -1.0 as
vapor cannot exist at such conditions.
Stage 6:
For each pair (Ti,pj) from the single-phase vapor area at temperatures above the critical
temperature:
i = NTP + 1, NT
j =1, NTP

( 647.15K < T 1638.15 K ),


(0.00611 bar < p < 220.55 bar),

properties of the superheated vapor are calculated. Liquid properties are set to -1.0.
For each pair (Ti,pj) at temperatures higher than critical temperature and at pressures
higher than the critical pressure
i = NTP + 1, NT
j = NTP + 1, NTP + 16

( 647.15K < T 1638.15 K ),


(220.55 bar < T 1000 bar),

properties of the fluid (this fluid is neither liquid nor vapor) are calculated. These properties
are written into the liquid and the vapor part of the table.
Sections of the final table stored in a file"h2o_prop" are shown below. The beginning of the
table):
T (K)
p (Pa)
rho_vap (kg/m3)
u_g (J/kg)
0.27314999E+03 -0.95000000E+07 -0.10000000E+01 -0.10000000E+01
0.27314999E+03 0.61146023E+03 0.48526989E-02 0.23745149E+07
0.27314999E+03 0.65733708E+03 0.52169772E-02 0.23744911E+07
0.27314999E+03 0.70623751E+03 0.56052929E-02 0.23744657E+07
0.27314999E+03 0.75833163E+03 0.60190025E-02 0.23744386E+07
0.27314999E+03 0.81379731E+03 0.64595248E-02 0.23744098E+07
0.27314999E+03 0.87282044E+03 0.69283437E-02 0.23743792E+07
0.27314999E+03 0.93559520E+03 0.74270097E-02 0.23743466E+07
0.27314999E+03 0.10023244E+04 0.79571424E-02 0.23743119E+07

....

5-3

rho_liq (kg/m3)
0.99490403E+03
0.99975018E+03
0.99975020E+03
0.99975022E+03
0.99975025E+03
0.99975028E+03
0.99975031E+03
0.99975034E+03
0.99975037E+03

u_f (J/kg)
0.78147334E+00
0.21321595E+03
0.21321698E+03
0.21321807E+03
0.21321924E+03
0.21322048E+03
0.21322179E+03
0.21322320E+03
0.21322469E+03

The end of the table, where temperatures are beyond 647.15 K and the liquid is equal to the
vapour:
...
0.16381500E+04
0.16381500E+04
0.16381500E+04
0.16381500E+04
0.16381500E+04
...
0.16381500E+04
0.16381500E+04
0.16381500E+04
...
0.16381500E+04
0.16381500E+04

0.21539157E+08
0.21798891E+08
0.22055000E+08
0.22100000E+08
0.23100000E+08

0.28336162E+02
0.28675576E+02
0.29010195E+02
0.29068984E+02
0.30374926E+02

0.47957516E+07 -0.10000000E+01 -0.10000000E+01


0.47953384E+07 -0.10000000E+01 -0.10000000E+01
0.47949312E+07 -0.10000000E+01 -0.10000000E+01
0.47948596E+07 0.29068984E+02 0.47948596E+07
0.47932706E+07 0.30374926E+02 0.47932706E+07

0.29100000E+08 0.38191452E+02 0.47837766E+07 0.38191452E+02 0.47837766E+07


0.35000000E+08 0.45845224E+02 0.47745086E+07 0.45845224E+02 0.47745086E+07
0.40000000E+08 0.52305989E+02 0.47667081E+07 0.52305989E+02 0.47667081E+07
0.90000000E+08 0.11558200E+03 0.46916424E+07 0.11558200E+03 0.46916424E+07
0.10000000E+09 0.12791892E+03 0.46773368E+07 0.12791892E+03 0.46773368E+07

This table is written in ASCII format and requires approx. 18 MB of hard drive space. It could
as well be written as an unformatted file. In this case the file would require 2 or 3 times less
space, but it would bring problems with portability. Namely, the unformatted file 'h2o_prop"
would have to be prepared for each compiler and platform separately.
It should also be noted that approx. one third of the table contains values "-1.0". Different data
structures could be applied to avoid large number of "-1.0" values and to further decrease the
table size. However, the price for that would be much more complicated handling of the data,
which (in our opinion) does not outweigh the saved memory (hard drive and RAM).

2.E+07

SATURATION LINE
SUBCOOLED
LIQUID

LIQUID
SPINODAL
LINE

VAPOR SPINODAL LINE

VAPOR SPINODAL LINE


EXTENDED BY "CREATE"

SUPERHEATED
VAPOR

p (Pa)

1.E+07

LIQUID
SPINODAL
LINE
EXTENDED
BY "CREATE"

SUPERHEATED
LIQUID

SUBCOOLED
VAPOR

0.E+00
270

320

370

420

470

520

570

620

670

T (K)
Figure 5.1-1: p-T diagram for water properties.

The spinodal lines in Fig. 5.1-1 of liquid and vapor were calculated by UCL steam tables
(Seynhaeve et all., 1992) and the extended spinodal lines were obtained with extrapolation in
the program "create.f". Above the saturation line is the area of subcooled liquid, below the
saturation line is the area of superheated vapor. Between the liquid spinodal line and the
saturation line is the area of the superheated (metastable) liquid, and between the vapor
spinodal line and the saturation line is the area of subcooled (metastable) vapor.
5-4

5.2 HOW TO USE THE WATER PROPERTIES FROM FILE "H2O_PROP"

The following procedure is used to find the water properties in the WAHA code.
5.2.1 Initialization
At the beginning the whole file "h2o_prop" is read and written into five different arrays
(subroutine initwp):

1) Array wt(NT)

Array contains:
temperature wt(i)

2) Array wp(NP)

Array contains:
pressure wp(j).

3) Array wgru(NV,NT,NTP)

Array contains:
vapor density - wgru(1,i,j)
vapor specific internal energy - wgru(2,i,j).

4) Array wfru(NV,NTP,NTP)

Array contains:
liquid density - wfru(1,i,j)
liquid specific internal energy - wfru(2,i,j)
NV is currently set to NV = 2 (NV should be increased if
other properties are tabulated)

5) Array w2f(NV2,NTP)

Array contains the following NV2 = 6 properties in


saturation:
temperature - w2f(1,i)
pressure - w2f(2,i)
vapor density - w2f(3,i)
vapor spec. int. energy - w2f(4,i)
liquid density - w2f(5,i)
liquid spec. int. energy - w2f(6,i).
There is actually no need to create this array since all the
data from w2f array are contained also in the other
arrays wt, wp, wgru, wfru. However, an important part
of the code is based on evaluation of the saturation
properties and calculation of the equilibrium is much
faster if the water property calculation is based on the
array w2f, which is much smaller than the other three
arrays.

5.2.2 Calculation of water properties


Currently four different types of subroutines are used:

1) getvapor_p_u, getliquid_p_u(t,p,r,u,drdp,drdu,cp )
Input: pressure p and specific internal energy u.

5-5

Output: temperature t, density r, derivative of density r over p at constant u - drdp,


derivative of density over u at constant p - drdu, and specific heat capacity at constant
pressure - cp.
2) getvapor_p_t, getliquid_p_t(t,p,r,u )
Input: pressure p and temperature t.
Output: density r, specific internal energy u.
3) getvaporall_p_t, getliquidall_p_t(t,p,r,u,drdp,drdt,dudp,dudt)
Input: pressure p and temperature t.
Output: density r, specific internal energy u, derivative of density r over p at constant t
- drdp, derivative of density over t at constant p - drdt, derivative of specific internal
energy u over p at constant t - dudp, derivative of specific internal energy u over t at
constant p - dudt.
4) get2f(p,t,rf,uf,rg,ug)
Input: pressure p.
Output: saturation properties at given p.
get2ft(p,t,rf,uf,rg,ug)
Input: temperature t.
Output: saturation properties at given t.

Subroutines getvapor_p_u, getliquid_p_u, getvapor_p_t, getliquid_p_t, getvaporall_p_t,


getliquidall_p_t work the following way: for the input (p,u) or (p,t) the three tabulated
neighbours (p1,t1), (p2,t2), (p3,t3) that define the triangle, which surrounds the point (p,u) or
(p,t) are found in the tables. Equation of plane is found for the given three points as a function
of pressure and temperature: for example for internal energy: u = k p + m t + n, where the
values of derivatives dudp = k, and dudt = m have to be found. Similar linear equation is
determined for density r (in getliquid_p_t, getvapor_p_t, getliquidall_p_t, vaporall_p_t).
When internal energy is given as input instead of temperature ( getliquid_p_u, getvapor_p_u),
the equation of plane is still formed as u = k p + m t + n and temperature t calculated from
it. This approach ensures that the temperature t1, which is result of the two consecutive calls:
getvapor_p_t(p0, t0, dummy, u0, dummy,dummy)
getvapor_p_u(p0, t1, dummy, u0 , dummy,dummy)
is exactly the same as the temperature t0, which was input for the first call.
The values of derivatives could also be tabulated and later calculated with interpolation,
however such water property subroutines are not consistent and cause non-conservation of
mass and energy. Thus, this approach is not recommended.
The described type of water property interpolation means that the main variables r, u are
continuous, piecewise linear functions of t and p (and reverse: p ,t are piecewise linear
functions of t and u), with discontinuous first derivatives at the boundaries of the triangles
specified by the points (ti, pi). Derivatives of the main parameters t, p, r, u, are piecewise
constant inside each triangle and discontinuous at the triangle boundaries. Sonic velocity,
which is calculated from the derivatives, is also discontinuous at the boundaries of the
triangles. However, as the density of the (ti, pi) points is rather fine, this does not present a
problem for the WAHA code.

5-6

5.3 TEST OF THE WAHA WATER PROPERTY SUBROUTINES

The calculation results obtained with the WAHA code (version WAHA0, 2002) with the
WAHA steam tables (presented in this chapter), and the WAHA code with the steam tables of
RELAP5/MOD3.2.2 Gamma (internal version of WAHA code available at "Jozef Stefan"
Institute) are shown in Figs.5.3-1, 5.3-2, 5.3-3, 5.3-4. All calculations were performed with
the first available version of the WAHA code (see Tiselj et. al, 2002). Propagation of the
pressure waves in a single-phase liquid and in a single-phase vapor shock tube is shown in
Figs. 5.3-1 and 5.3-2. Differences are more due to the slightly different time steps than due to
the different water properties.
2100000
1900000

p(Pa)

1700000
1500000
1300000
RELAP5 steam tables t=0.60514ms

1100000

WAHA steam tables t=0.60008ms

900000
0

0.5

1.5

length (m)

Figure 5.3-1: Comparison of the WAHA calculations with the WAHA steam tables and the
RELAP5 steam tables: Single-phase liquid wave.

2100000
1900000

p(Pa)

1700000
1500000
1300000
RELAP5 steam tables t=1.0008ms

1100000

WAHA steam tables t=1.0065ms

900000
0

0.5

1.5

length (m)

Figure 5.3-2: Comparison of the WAHA calculations with the WAHA steam tables and the
RELAP5 steam tables: Single-phase vapor wave - pressure.

5-7

Results of the Edwards pipe problem - rapid depressurization of the hot liquid in a horizontal
pipe (Edwards, O'Brien, 1970) simulated with the WAHA0 version of the WAHA code
(Tiselj et. al. 2002) are shown in Figs. 5.3-3 and 5.3-4. Both calculations were performed with
instantaneous relaxation of inter-phase heat, mass and momentum transfer. Differences are
obviously negligible.
7.E+06
RELAP5 steam tables

6.E+06

WAHA steam tables

p (Pa)

5.E+06
4.E+06
3.E+06
2.E+06
1.E+06
0.E+00
0

0.1

0.2

0.3

0.4

0.5

0.6

time (s)

Figure 5.3-3: Comparison of the WAHA calculations with the WAHA steam tables and the
RELAP5 steam tables: Edwards pipe problem - pressure.

1.E+00

vapor volume fraction

1.E+00
8.E-01
6.E-01
RELAP5 steam tables

4.E-01
WAHA steam tables

2.E-01
0.E+00
-2.E-01

0.1

0.2

0.3

0.4

0.5

0.6

time (s)

Figure 5.3-4: Comparison of the WAHA calculations with the WAHA steam tables and the
RELAP5 steam tables: Edwards pipe problem - vapor volume fraction.

5-8

5.4 VISCOSITY, THERMAL CONDUCTIVITIY, AND SURFACE TENSION

Dynamic viscosities, thermal conductivities and surface tension are obtained directly from
interpolating equations proposed in the ASME Steam Tables, 6th Edition, 1993. A single
subroutine is used for liquid and vapor viscosity:
visc(t,tsat,rho,visc).

Subroutine checks the density rho and determines the phase of the fluid: liquid or vapor. If
metastable state is encountered (for example: rho is found to be a density of the liquid and
temperature t is higher than saturation temperature tsat), viscosity in the saturation is
calculated.
A single subroutine is used for liquid and vapor thermal conductivity:
conductivity(t,tsat,rho,conductivity).

Again, the subroutine returns saturation values for input data of metastable states.
Surface tension is obtained as a function of temperature in a subroutine:
surftension(t,sigma).

Due to the minor importance of these properties and rather large CPU consumption, simpler
(and less accurate) subroutines might be used in the future versions of the WAHA code.

5.5 REFERENCES

5-1. K.E. Carlson, R.A. Riemke, S.Z. Rouhani, R.W. Shumway, W.L. Weaver,
RELAP5/MOD3 Code Manual, Vol. 1-7, NUREG/CR-5535, EG&G Idaho, Idaho
Falls, 1990.
5-2. A.R. Edwards, F.P. O'Brien, Studies of phenomena connected with the
depressurization of water reactors, Journal of the British Nuclear Society 9, 125135, 1970.
5-3. C.A. Meyer, R.B. McClintock, G.J. Silvestri, R.C. Spencer Jr., ASME Steam tables,
sixth edition, ASME Press (1993).
5-4. J.M. Seynhaeve, Water properties package, Catholic University of Louvain, (1992),
built with IAPS from Lestler, Gallaher and Kell, Mc Graw-Hill 1984 - NBS
reference.
5-5. I. Tiselj et. al. , WAHA0 code, available on internet to partners of WAHALoads
project, October 2002.

5-9

APPENDIX: LISTING OF THE PROGRAM "CREATE.F":


program create
C this program creates single phase p-T tables for
C T=273.15 .. 1638. K every 1 K
C p=-95 bar to 1000 bar
C tabulated properties: T,p,rhog (vapor density), ug (int. energ),rhof,uf
C
C Two phase area: T=273.15 to 647.15 and p=611 Pa to 220.55 bar
C properties are tabulated at every 1K and at pressures that
C correspond to the saturation pressures at given 375 temperatures.
C That is 375 temperatures and pressures in two-phase area.
C
C Single phase liquid area: T=273.15 to 646.15 and p>220.55 bar
C properties are tabulated at given 375 temperatures
C at pressures p=221..291 bar every 10 bar and at p=350,400,500,600,700,800,900,1000 bar
C (additional 16 pressures) - these properties are stored as liquid properties
C
C negative pressure: liquid properties at 1 negative pressure -95 bar
C At T=273.15 K properties at -95 bar are extrapolated from
C properties at 611 Pa and at next higher pressure.
C At higher temperatures properties are obtained with three point
C extrapolation
C
C Single phase vapor area at T>647.15
C vapor properties at p=611 Pa to 220.55 bar are tabulated
C from T=647..1638 K every 10K (additional 100 temperatures)
C
C At T>=647.15 K and p>220.55 bar:
C liquid and vapor properties are equal
C
C Saturation properties are hidden in points (T_i, p_j) where i=j
C and i=1,375
C
C metastable properties are also tabulated
C
C if certain phase in a given point does not exist: r=-1., u=-1.
C
C water properties are created with UCL subroutines and functions
C from table.f file. Compile : f95 create.f table.f
parameter(ntp2f=375) !ntp2f - number of temperatures and pressure in two-phase area
parameter(nphigh=16) !nphigh - number of pressures above critical pressure 220.55 bar
parameter(nthigh=100) !nthigh - number of temperatures above T_critical 647.15 K
implicit real*8 (a-h,o-z)
real*8 pmp(0:ntp2f+nphigh) !pressures
real*8 aa(6,ntp2f+nthigh,0:ntp2f+nphigh) ! table for final storage of 6
! different properties: T,P,rhog,ug,rhof,uf
C NAME OF THE OUTPUT FILE
open(21,file='h2o_prop')
write(21,*) ' T (K)
p (Pa)',
* '
rho_vap (kg/m3) u_g (J/kg)
* 'u_f (J/kg)'

rho_liq (kg/m3) ',

C STAGE 1
C DEFINE THE temperatures and pressures
pmp(0)=-0.95d+7
do i=1,ntp2f
t=i-1.d0
!temperature in C
pmp(i)=opst(t)
! obtain saturation p at given t
enddo
ii=ntp2f
do i=221,291,10
! obtain pressures at p> p_critical
ii=ii+1
pmp(ii)=i*1.d+5
enddo
ii=ii+1
pmp(ii)=350.d0*1.d+5
do i=400,1000,100
ii=ii+1
pmp(ii)=i*1.d+5

5-10

enddo
C STAGE 2
C START BUILDING A TABLE - TWO-PHASE AREA FIRST T=<647.073 p=<220.55 bar
do i=1,ntp2f
! temperature index
t=i-1.d0
! temperature in C
write(*,*) i+272.15
do j=1,ntp2f
! Pressure index
p=pmp(j)
aa(1,i,j)=t+273.15 !save t in K
aa(2,i,j)=p
!save p
C CALCULATE LIQUID PROPERTIES
xx=-1.d0
!xx=-1.d0 - liquid properties
u=oupt(p,t,xx)
!get u at p and t
aa(6,i,j)=u
!save u
if (u.gt.2.1099d+6) then
r=-1.0
! UNDEFINED
u=-1.0
aa(5,i,j)=r
aa(6,i,j)=u
else
r=orho(p,t,xx)
!get rho at p and t
aa(5,i,j)=r
!save rho
endif
C CALCULATE VAPOR PROPERTIES
xx= 2.d0
!xx=2.d0 - vapor properties
u=oupt(p,t,xx)
!get u at p and t
aa(4,i,j)=u
!save u
if (u.lt.2.1098d+6) then
r=-1.0
! UNDEFINED
u=-1.0
aa(3,i,j)=r
aa(4,i,j)=u
else
r=orho(p,t,xx)
!get rho at p and t
aa(3,i,j)=r
!save rho
endif
enddo
enddo
C STAGE 3
do i=1,ntp2f
! temperature index
t=i-1.d0
! temperature in C
C CALCULATE FLUID PROPERTIES AT p> p_critical=220.5 bar
C SAVE PROPERTIES IN THE LIQUID TABLE
do j=ntp2f+1,ntp2f+nphigh ! pressure index
p=pmp(j)
aa(1,i,j)=t+273.15 !save t
aa(2,i,j)=p
!save p
xx=-1.d0
!xx=-1.d0 - use liquid tables
u=oupt(p,t,xx)
!get u at p and t
aa(6,i,j)=u
!save u
r=orho(p,t,xx)
!get rho at p and t
aa(5,i,j)=r
!save rho
aa(3,i,j)=-1.d0
aa(4,i,j)=-1.d0
C AT CRITICAL TEMPERATURE 647.15 K AND p=221 bar (SLIGHLY ABOVE CRITICAL)
C COPY LIQUID PROPERTIES INTO VAPOR PROPERTIES (SMALL CHEATING)
if (i.eq.ntp2f .and. j.eq.ntp2f+1) then
aa(3,i,j)=aa(5,i,j)
aa(4,i,j)=aa(6,i,j)
endif
enddo
enddo
C STAGE 4
C EXTRAPOLATE BEYOND THE SPINODAL LINES (NOT REALISTIC BUT NECESSARY)
C EXTRAPOLATE LIQUID
do i=1,ntp2f
do j=ntp2f-1,1,-1
i1=i-1

5-11

j1=j
i2=i-1
j2=j+1
i3=i
j3=j+1
if (aa(5,i1,j1).lt.1200.0 .and.
*
aa(5,i1,j1).gt.200.0 .and.
*
aa(5,i2,j2).lt.1200.0 .and.
*
aa(5,i2,j2).gt.200.0 .and.
*
aa(5,i3,j3).lt.1200.0 .and.
*
aa(5,i3,j3).gt.200.0 .and.
*
aa(6,i1,j1).lt.2.0d+6 .and.
*
aa(6,i1,j1).gt. 0.0 .and.
*
aa(6,i2,j2).lt.2.0d+6 .and.
*
aa(6,i2,j2).gt. 0.0 .and.
*
aa(6,i3,j3).lt.2.0d+6 .and.
*
aa(6,i3,j3).gt. 0.0 .and.
*
aa(5,i,j).lt.0.0
) then
call extrapolate(aa,ntp2f,nthigh,nphigh,
*
i1,j1,i2,j2,i3,j3,i,j,5,6)
aa(5,i,j)=min(1200.,aa(5,i,j))
aa(5,i,j)=max( 200.0,aa(5,i,j))
endif
enddo
enddo
C EXTRAPOLATE VAPOR
do i=ntp2f-1,1,-1
do j=2,ntp2f
i1=i+1
j1=j
i2=i+1
j2=j-1
i3=i
j3=j-1
if (aa(3,i1,j1).lt. 500.0 .and.
*
aa(3,i1,j1).gt. 0.0 .and.
*
aa(3,i2,j2).lt. 500.0 .and.
*
aa(3,i2,j2).gt. 0.0 .and.
*
aa(3,i3,j3).lt. 500.0 .and.
*
aa(3,i3,j3).gt. 0.0 .and.
*
aa(4,i1,j1).lt.8.0d+6 .and.
*
aa(4,i1,j1).gt.1.7d+6 .and.
*
aa(4,i2,j2).lt.8.0d+6 .and.
*
aa(4,i2,j2).gt.1.7d+6 .and.
*
aa(4,i3,j3).lt.8.0d+6 .and.
*
aa(4,i3,j3).gt.1.7d+6 .and.
*
aa(3,i,j).lt.0.0
) then
call extrapolate(aa,ntp2f,nthigh,nphigh,
*
i1,j1,i2,j2,i3,j3,i,j,3,4)
aa(3,i,j)=min( 400.,aa(3,i,j))
aa(3,i,j)=max( 0.0,aa(3,i,j))
endif
enddo
enddo
C STAGE 5
C Extrapolate to negative pressure
! first point at p=-95 bar, T=273.15:
aa(1,1,0)=aa(1,1,1)
aa(2,1,0)=pmp(0)
aa(3,1,0)=-1.d0
aa(4,1,0)=-1.d0
aa(5,1,0)=(aa(5,1,2)-aa(5,1,1))/(aa(2,1,2)-aa(2,1,1))*
*
(aa(2,1,0)-aa(2,1,1))+aa(5,1,1)
aa(6,1,0)=(aa(6,1,2)-aa(6,1,1))/(aa(2,1,2)-aa(2,1,1))*
*
(aa(2,1,0)-aa(2,1,1))+aa(6,1,1)
do i=2,ntp2f
aa(1,i,0)=aa(1,i,1)
aa(2,i,0)=pmp(0)
aa(3,i,0)=-1.d0 !initialization
aa(4,i,0)=-1.d0
aa(5,i,0)=-1.d0
aa(6,i,0)=-1.d0
i1=i-1

5-12

j1=1
i2=i-1
j2=0
i3=i
j3=1
if (aa(5,i1,j1).lt.1200.0 .and.
*
aa(5,i1,j1).gt.200.0 .and.
*
aa(5,i2,j2).lt.1200.0 .and.
*
aa(5,i2,j2).gt.200.0 .and.
*
aa(5,i3,j3).lt.1200.0 .and.
*
aa(5,i3,j3).gt.200.0 .and.
*
aa(6,i1,j1).lt.2.0d+6 .and.
*
aa(6,i1,j1).gt. 0.0 .and.
*
aa(6,i2,j2).lt.2.0d+6 .and.
*
aa(6,i2,j2).gt. 0.0 .and.
*
aa(6,i3,j3).lt.2.0d+6 .and.
*
aa(6,i3,j3).gt. 0.0 ) then
call extrapolate(aa,ntp2f,nthigh,nphigh,
*
i1,j1,i2,j2,i3,j3,i,0,5,6)
aa(5,i,0)=min(1200.,aa(5,i,0))
aa(5,i,0)=max( 200.0,aa(5,i,0))
endif
enddo
C DUMP TO THE FILE
do i=1,ntp2f
do j=0,ntp2f
write(21,'(8e16.8)') (aa(k,i,j),k=1,6)
enddo
do j=ntp2f+1,ntp2f+nphigh
write(21,'(8e16.8)') (aa(k,i,j),k=1,6)
enddo
write(21,*)
enddo
C STAGE 6
C Temperatures above critical
one=-1.d0
do i=648,1638,10
t=i-273.
write(*,*) i
write(21,'(8e16.8)') t+273.15,pmp(0),one,one,one,one ! print -1 for negative press.
do j=1,ntp2f+nphigh
p=pmp(j)
C SUPERHEATED VAPOR PROPERTIES AT T>647 K
C AND FLUID PROPERTIES AT T>647K and p>220.5 bar
xx= 2.d0
u=oupt(p,t,xx)
r=orho(p,t,xx)
if (j.le.ntp2f) then ! liquid
write(21,'(8e16.8)') t+273.15,p,r,u,one,one
else
! fluid (neither liquid neither steam)
write(21,'(8e16.8)') t+273.15,p,r,u,r,u
endif
enddo
write(21,*)
enddo
end

C
C
C
C
C

subroutine extrapolate(aa,ntp2f,nthigh,nphigh,
*
i1,j1,i2,j2,i3,j3,i,j,k1,k2)
i1,i2,i3, temperatures of three points from which the extrapolation will be made
j1,j2,j3, pressures of three points from which the extrapolation will be made
i,j temp. and pressure of the point in which the extrapolation will be performed
k1 =3 - vapor density, k1=5 liquid density
k2 =4 - vapor nt. energy, k2=6 liquid int. energy
implicit real*8 (a-h,o-z)
real*8 aa(6,ntp2f+nthigh,0:ntp2f+nphigh)
t1=aa(1,i1,j1)
p1=aa(2,i1,j1)
t2=aa(1,i2,j2)
p2=aa(2,i2,j2)
t3=aa(1,i3,j3)

5-13

p3=aa(2,i3,j3)
det=p3*(t2-t1)+p2*(t1-t3)+p1*(t3-t2)
k=k1
akr=((p2-p3)*aa(k,i1,j1)+(p3-p1)*aa(k,i2,j2)
*
+(p1-p2)*aa(k,i3,j3))/det
alr=((t3-t2)*aa(k,i1,j1)+(t1-t3)*aa(k,i2,j2)
*
+(t2-t1)*aa(k,i3,j3))/det
an=((t2*p3-t3*p2)*aa(k,i1,j1)
*
+(t3*p1-t1*p3)*aa(k,i2,j2)
*
+(t1*p2-t2*p1)*aa(k,i3,j3))/det
aa(k,i,j)=akr*aa(1,i,j)+alr*aa(2,i,j)+an
k=k2
akr=((p2-p3)*aa(k,i1,j1)+(p3-p1)*aa(k,i2,j2)
*
+(p1-p2)*aa(k,i3,j3))/det
alr=((t3-t2)*aa(k,i1,j1)+(t1-t3)*aa(k,i2,j2)
*
+(t2-t1)*aa(k,i3,j3))/det
an=((t2*p3-t3*p2)*aa(k,i1,j1)
*
+(t3*p1-t1*p3)*aa(k,i2,j2)
*
+(t1*p2-t2*p1)*aa(k,i3,j3))/det
aa(k,i,j)=akr*aa(1,i,j)+alr*aa(2,i,j)+an
return
end

5-14

6 FORCES ON THE PIPES


Calculation of the forces on the pipes is performed with assumption of rigid piping system in
the WAHA code. The present chapter describes currently available model, that is derived
from detailed model of Lemonnier (2004), which gives theoretical background for possible
future Fluid-Structure-Interaction module of the WAHA code.
6.1 INTRODUCTION
The WAHA code can calculate forces on the 3D piping system, if the card "force" is found in
the input file. Forces are not calculated if the "force" card is missing. Forces are not calculated
in the center of the volumes used for the thermal-hydraulic calculation, but on the edges of the
volumes. Figure 6.1-1 shows a pipe discretized into n volumes, with positions of the thermalr
hydraulic volumes ( j = ( p, , v f , v g , u f , u g ) j , j = 1, n ) and positions of the points where the
r

forces are calculated: F j , j = 1, n + 1 .

v v
1 2

..

v v
n1 n

Pipe 1

v v v
T0 T1 T2

..
v v v
Tn 2 Tn 1 Tn

Figure 6.1-1: Pipe with positions of the thermal-hydraulic volumes and positions of the
points, where the forces are calculated.
Output is written into the file "output.force", if the name of the output file is not specified, or
into the file "out_file_name.force", if the output file name is set to be "out_file_name".
Structure of the force-output file for one time steps is the following: time is written in the first
line, while each of the following lines contains pipe number, volume number, and x,y,z
components of the force in 3D space. An example of the "output.force" file is shown in Fig.
6.1-1.
Since the forces are calculated in the junctions, the coordinate of the junction appears in the
output file twice or three times if the junction is also a branch. In that case the force is printed
out only for one pipe in the junction, while for the other pipe(s) in the junction the force is
printed out as zero and a warning that points to the pipe where the actual force is written (see
data in Fig. 6.1-2).
Coordinates of the points, where the forces are calculated are not given in the "output.force"
file but only once in the general output file "output" in the block that starts with the word
"geometry". Figure 6.1-3 shows a part of the "teeliq" output file with geometry description for
the model of branch in section 4.3.2.

6-1

time 5.542160940689097E-5
001-000 0.0000000E+00 0.0000000E+00 0.0000000E+00
001-001 0.0000000E+00 0.0000000E+00 0.0000000E+00
...
001-099 0.2318562E+01 0.0000000E+00 0.0000000E+00
001-100 -0.2370036E+06 0.0000000E+00 0.0000000E+00
002-000 0.0000000E+00 0.0000000E+00 0.0000000E+00
002-001 0.9957728E+00 0.0000000E+00 0.0000000E+00
..........
002-029 0.0000000E+00 0.0000000E+00 0.0000000E+00
002-030 0.0000000E+00 0.0000000E+00 0.0000000E+00
006-000 0.0000000E+00 0.0000000E+00 0.0000000E+00
006-001 0.3319243E+01 0.0000000E+00 0.0000000E+00
........
006-049 -0.3470581E+05 0.0000000E+00 0.0000000E+00
006-050 0.9038770E+06 0.0000000E+00 0.0000000E+00
004-000 0.0000000E+00 0.0000000E+00 0.0000000E+00
005-000 0.0000000E+00 0.0000000E+00 0.0000000E+00
total-force(x,y,z) 632174.20614733 0.0E+0 0.0E+0
time 1.051834401650712E-3
001-000 0.0000000E+00 0.0000000E+00 0.0000000E+00
..........

connection with

tank

004

branch with pipes 002 006


force on branch of pipes 002 001 006 calculated at pipe 001

connection with

tank

005

force on branch of pipes 006 001 002 calculated at pipe 001

force on connection calculated at beginning of pipe 001


force on connection calculated at end of pipe 002

connection with

tank

004

Figure 6.1-2: Part of the "teeliq.force" file for the model of the branch "teeliq.dat" in
section 4.3.2.

Piping system geometry - force measuring points


Coordinates bellow refer to the volume ends
not to the centers of the hydrodynamic volumes
cmp-vol. node-no.
x-end
pipe
*noname*
001-000
0
0.00000
001-001
1
0.100000
..................
001-099
99
9.90000
001-100
100
10.00000
pipe
*noname*
002-000
0
10.00000
002-001
1
10.1000
..............
002-029
29
12.9000
002-030
30
13.0000
pipe
*noname*
006-000
0
10.00000
006-001
1
10.1000
...........
006-049
49
14.9000
006-050
50
15.0000
tank
tank_03
004-000
0
0.00000
tank
tank_04
005-000
0
0.00000

y-end

z-end

1D-coordinate

0.00000
0.00000

0.00000
0.00000

0.00000
0.100000

0.00000
0.00000

0.00000
0.00000

9.90000
10.00000

0.00000
0.00000

0.00000
0.00000

10.00000
10.1000

0.00000
0.00000

0.00000
0.00000

12.9000
13.0000

0.00000
0.00000

0.00000
0.00000

10.00000
10.1000

0.00000
0.00000

0.00000
0.00000

14.9000
15.0000

0.00000

0.00000

0.00000

0.00000

0.00000

0.00000

Figure 6.1-3: Parts of the "teeliq" file with 3D geometry of the branch model "teeliq.dat"
from section 4.3.2.

6.2 DERIVATION OF FLUID FORCE EQUATIONS


The fluid forces on a pipe segment are determined according to the Appendix A "Derivation
of Fluid Force Equations" of ANSI/ANS-58.2-1988 standard [6-1]. Forces can be determined
employing Newtons second law of motion written for a segment of, where external forces
acting on a fixed control volume are equated to the systems momentum time rate change:
r
r
d (mv )
,
F =
dt

(6.2-1)

6-2

where F is vector sum of all external forces acting on the control volume, m is fluid mass
r
in control volume and v is fluid velocity vector.
The momentum time rate of change of the system can be expressed as the rate of change of
momentum within the control volume plus the difference between outgoing and incoming
flux across its surfaces by the equation:
r
r
d (m v )
d ( v )dV
rr r
=
+ v v dA ,

dt
dt
c.v.
c. s .

(6.2-2)

where c.v. is control volume, c.s. is control surface (see Fig. 6.2-1), V is Volume, A is surface
area and is density.
The sum of external forces is simply the local pressure integrated over the external surface of
the control volume. With the control volume inlet and outlet pressure known, the sum of
external forces can be conveniently represented by the equation:
r

F = T dS + gdV = R p dAin p dAout + gdV ,


c.s .

c.v.

Ain

Aout

(6.2-3)

c.v.

where R is pipe reaction forcer acting on fluid, p is local pressure at center of elemental area
r
(dA or dS), T is stress tensor, Ain is vector area of the inlet section of the control volume, Aout
is vector area of ther outlet section of the control volume, both are pointing outwards the
control volume and S is the surface limiting the control volume and is pointing outside the
control volume. Volume forces (gravity) are not taken into account in of ANSI/ANS-58.21988 standard [6-1], however, detailed derivation (described in appendix of WAHALoads
deliverable D31 [6-2]) takes into account these forces too and they are taken into account in
r
WAHA too. Gravitational acceleration vector is g = (0, 0, 9.81m / s 2 ) .
r

The pipe reaction force acting on the fluid, R minus the ambient pressure force is equal to the
reaction thrustr force acting on the pipe, but in the opposite direction. The pipe reaction force
on the fluid, R , can then be determined by combining equations (6.2-2) and (6.2-3), resulting
in the pipe reaction force equation:
d ( vr )dV
r
r
r
r
rr r
r
+ v v dA + pdAin + pdAout + p ambient dA pipe gdV ,
T =
(6.2-4)
dt
c.v.

c.s.
A
A
A
c .v .
v
where T is dynamic fluid thrust force vector
on pipe, pambient is ambient pressure around pipe,
r
Apipe is pipe external surface area, and dA pipe vector points outward.

in

out

pipe

v
Fi

v
ri

i +1

v
ri +1

Ai
pi vi

Ai+1
pi+1 vi+1

6-3

Figure 6.2-1: Calculation of the thrust force between the neighbouring volumes in WAHA
code. Control volume is marked with dashed
lines. Plotted
vectors denote unit direction
r
r
r r
r
r
vectors ri , ri +1 . Ain = Ai ri , Aout = Ai +1 ri +1 .
Equation (6.2-4) is the generalized equation describing the dynamic fluid thrust force acting
on the pipe. This equation can be simplified with appropriate assumptions.
Terms of the Eq. (6.2-4) written for a segment of the pipe shown in Fig. 6.2-1 are in WAHA
code calculated as:
r
d ( v )dV d i v i x i r d i +1 v i +1 x i +1
r
=
Ai ri +
Ai +1 ri +1

2
2
dt
dt
dt
c .v .

(6.2-5)

v (v dA) = i v i

r
r
Ai ri + i +1 v i2+1 Ai +1 ri +1

(6.2-6)

r
r
= p i Ai ri + p i +1 Ai +1 ri +1

(6.2-7)

rr

c.s .

p dAin + p dAout

Ain

Aout

with unit direction vector:


r
ri = (cos i cos i , cos i sin i , sin i )

(6.2-8)

where angles i , i represent inclination and azimuth of the pipe volume i, respectively.
Force of the ambient pressure, with assumption of the zero pipe thickness, is calculated from
equation:
r

p ambient dA pipe

c.s .

p ambient dA pipe + p ambient dAin + p ambient dAout ,

A pipe

Ain

(6.2-9)

Aout

The integral of a constant pressure over a closed control surface on the left hand side of Eq.
(6.2-9) is zero:
r

p ambient dA pipe

=0.

(6.2-10)

c.s .

Thus, the total thrust force in the point i is calculated as:


r
r
d v x i
r d v x i +1

i v i2 ( p i p ambient ) Ai ri i +1 i +1
+ i +1 v i2+1 + ( p i +1 p ambient ) Ai +1 ri +1
Ti = i i
2
2
dt

dt

x i
x r

+ i Ai
+ i +1 Ai +1 i +1 g
2
2

(6.2-11)
Mixture density m = a g + (1 a) f and mixture velocity v m = (a g v m + (1 a) f v m ) / m are taken
as densities and velocities in Eqs. (6.2-5) to (6.2-11). Warning, the inertial term i vi2 is
calculated as:

v vv2 + (1 ) l vl2

(6.2-12)

6-4

The same formula (6.2-11) is used to calculate the forces at the abrupt area change points and
in the branch points.
Modified version of the Eq. (6.2-11) is needed at the boundaries: closed ends, tanks and
pumps.

At closed end:
r
x i r
d ( i v i / 2) x i
r
Ti =
g
m i v i2 m ( p i p ambient ) Ai ri + i Ai
dt
2
2

(6.2-13)

Temporal derivative of momentum is divided by 2 as the average velocity in the control


volume is half of the velocity in the last hydrodynamic volume. Index i=n and sign "-" is
valid if for closed end at the end of the pipe (see Fig. 6.1-1 for the position of indeces), and
index i=0 and sign "+" for closed end at the beginning of the pipe.
Tank - flow into the tank:
r
d v x i r
Ti = i i
Ai ri
2
dt

(6.2-14)

with point i that denotes pipe hydrodynamic volume connected to the tank, i.e. i=n when tank
is connected to the end of the pipe and i=0 when tank is connected to the beginning of the
pipe (see Fig. 6.1-1 for the position of indeces). Velocity and pressure at the outlet are
assumed to be extrapolated from the interior of the pipe. For subcritical flow into the tank the
pressure at the outlet would be better aproximated as an average of the tank pressure and the
pipe volume pressure. However, as the criticality of the flow is not easy to define, the
extrapolation of the pressure is used instead.
Tank - flow from the tank:
r
d v x i
r
Ti = i i
m 0.5( p i p tank ) Ai ri
2
dt

(6.2-15)

with point i that denotes pipe hydrodynamic volume connected to the tank, i.e. i=n when tank
is connected to the end of the pipe and i=0 when tank is connected to the beginning of the
pipe (see Fig. 6.1-1 for the position of indeces). Velocity in the tank is assumed to be
extrapolated from the interior of the pipe, and the inlet pressure is assumed to be average of
the tank pressure and pipe volume pressure. Sign "-" is valid if for tank connected at the end
of the pipe and sign "+" for tank at the beginning of the pipe. See also appendix of
WAHALoads deliverable D31 [6-2] on accuracy of the applied approximation.
Pump - inflow/outflow:
r
d v x i
Ti = i i
m i v i2 pump v 2pump
2
dt

) A rr

(6.2-16)

i i

6-5

with point i that denotes pipe hydrodynamic volume connected to the pump, i.e. i=n when
pump is connected to the end of the pipe and i=0 when pump is connected to the beginning of
the pipe (see Fig. 6.1-1 for the position of indeces). Pressure at the inlet/outlet is assumed to
be extrapolated from the interior of the pipe. Sign "-" is valid if for pump connected at the end
of the pipe and sign "+" for pump at the beginning of the pipe. See also appendix of
WAHALoads deliverable D31 [6-2] on accuracy of the applied approximation for the pump
boundary condition.
6.3 REFERENCES

6-1. American National Standard, Design basis for protection of light water nuclear
power plant against the effects of postulated pipe rupture, ANSI/ANS-58.2-1988,
Revision of ANSI/ANS-58.2-1980, Appendix A: Derivation of fluid force
equations.
6-2. H. Lemonnier, Two-fluid 1D-averaged model equations for a pipe undergoing
arbitrary motions, WAHALoads deliverable D61, CEA-T3.3-D61-300304-rev2 and
CEA technical report DTP/SMTH/LDTA-2002-043, Revision 2, CEA/Grenoble,
2004.

6-6

7 INPUT FILE PREPARATION FOR THE WAHA3 CODE

7.1 INTRODUCTION AND GENERAL INFORMATIONS


This Chapter of the WAHA code Users Manual includes all information about input data
organization to successfully create a new input file.
Differences between the input files for WAHA2 and WAHA3 code:
1) New card is introduced: Force card
2) Additional option for unsteady friction is available in W5 in Geometry card 1
3) It is possible to define branch connection in Connection card
Note: All new features are optional. The WAHA2 input files are valid also in the
WAHA3.

7.1.1 Data cards


The basic element of the input file and input process is a card. There are several cards
available: Title card, Time step card, Print cards, Force card, Comment card, set of Pipe,
Tank or Pump data cards and Termination card. Sections from 7.2 to 7.13 of this manual
contain detailed description of all data cards with precise determination of order, type, and
description of data. According to importance for calculation, they can be generally divided
into next two groups:

Required cards: Title card (title), Time step card (time), Switch card (switch),
set of Pipe, Tank or Pump data component cards (comp) and Termination card
(end). The calculation without these cards is not possible!

Optional cards: Print card (print) is necessary only if minor output is desired.
Other possible card is Comment card (*). These cards have no influence on
calculation results but they can simplify the input file creation and can made an input
file more reviewable. Comment card is every card that starts with asterix * or dollar
sign $ in the first column. Comment cards can be inserted anywhere in the input file
except between the consecutive Continuation cards. Force card (force) is necessary
only if calculation of the forces on the piping system is desired.

Cards may contain varying number of fields (words) that may have integer, real or
alphanumeric value. Each word in the card in the User's Manual is indicated with symbol W,
following with an additive number. The symbol in brackets is a type of value that denotes
alphanumeric (A), integer (I), or real (R) value.
The first field in the data card is a card identification alphanumerical word. If the first field
has an error, next expression appears under error in general output file: Unrecognisable
card detected above. Consequently, data in the card are not used and the program is
terminated.

7-1

One set of Pipe, Tank or Pump component cards is composed of five cards:
Type card
First geometry card
Second geometry card
Physical state card
Connection card
Every pipe is divided into user's defined number of volumes, i.e. nodalization. All these cards
are describing properties of one selected pipe or, if needed, volume.
7.1.2 Data deck organization
New WAHA computer code problem input file must contain at least one Time step card, at
least one set of Pipe (Tank or Pump) data component cards and exactly one Termination
card. It is recommended to put Title card at the beginning of input file.
The order of data cards is not important except that the Termination card is required at the
end of file. However, the following data card order is recommended: Title card, Time step
card, Print card, set of Pipe (Tank or Pump) data cards, and Termination card. Comment
cards can be used anywhere to comment input data, except between the consecutive
continuation cards.
It is highly recommended to use existing examples of input files as writing pad.
Comments in example input files shall be helpful and will simplify the input data preparation.

7.1.3 Input file


Input data file contains all geometrical, physical, computational and temporal characteristics
of a modelled piping system.
Input data file for the WAHA computer program must be an ASCII file. Name and extension
of new input problem are not important, although it is recommended to use next input file
name form input_filename.dat.
Input file shall be created with ordinary (plain) text editors like Notepad (Windows 2000, NT,
ME), Text Editor, Vi (Sun), etc. File must be located in the same folder as WAHA executable
program.
Further information on format and order of cards' data are described in Sections from 7.2 to
7.13 . A working example of an input file for the Simpsons pipe (simpson.dat) experiment is
given in Section 7.13 .

7.1.4 Output files


There are five different types of output file. Their detailed description is stated in further
chapters. Brief description can be found in Table 7-1.

7-2

Table 7-1: Different types of output files


Name of
output file(s)

General

Number
of files

Frequency

Time step
card, W3

Location
folder

same as
input file

Applied

How to
apply?

always

auto

optional
optional

Major

0 - 999

Minor

Force

Restart

1 - 999

Time step
card, W3
Time step
card, W4
Force card,
W2
Time step
card, W6

results

optional

results

optional

same as
input file
results

Switch
card, W4
Switch
card, W5

Contents
- input error detection
- Major output
- eigenvalues
- additional parameters

Switch
- complete physical picture
card, W6 at certain time step

- temporal development of
the choosen parameter
- forces on the 3D piping
optional Force card
system
- input file with current state
always
auto
of the system
Print card

7.1.4.1 General output file


General output file is an ASCII file located in the same folder as an input file. If the name of
the output file is not specified in the command line, which starts the program, the name of the
output file is output. This file contains brief error detection report and all Major output
reports. Eigenvalues and additional parameters are written only if switches W4 and W5 are
set to 1 (Switch card).
Caution: If the file with the chosen name already exists, it will be overwritten.
The first step of the WAHA calculation is reading data from an input file and detection of
possible errors in the input file. During this process the WAHA program creates a general
output file where all initial state and geometrical properties of pipe components are collected
and detected errors are pointed. If the detected error is not fatal, the calculation continues,
otherwise the program is terminated. Even when the program terminates successfully it is
recommended to check the general output file.
An example of the general output file for the Simpsons pipe experiment is in Section 7.13.2 .
Extended output file is written if switches no. 4 and 5 on the Switch card are set to 1: six
eigenvalues between each pair of the volumes, and inter-phase exchange coefficients in each
volume are written in addition to the standard output.
7.1.4.2 Major output files
Major output files are optional written in files in results subfolder if switch no. 6 is set to 1
on the Switch card. One Major output file contains complete physical picture at certain time
step and is written periodically as defined with the frequency of recording in Time step card.
The same data always exist in the general output file, however, the Major output files
represent a useful input for the plotting of the profiles at various time steps (gnuplot). Each

7-3

major output file is written into a separate output file named output_filename.xxx in
subfolder results. The name output_filename is specified by user as third word in
command row when the WAHA program is started (see Section 7.1.5 ). If the user does not
define the third word then the program automatically applies name output.xxx. The
extension xxx is an Id. number of the output file and is an integer number between 000 and
999. The format of output file is suited for presenting the results with Gnuplot or MS Excel
program.
Important: Location of the major output files is in subfolder results. The user must
create this subfolder before the WAHA program has been executed. Old output file with the
same name like new file is overwritten.
The fluid state of the whole piping system is written in columns. The first column is always
additive x position of the center of the volume in the pipe. Next columns follow as listed
below:
Columns in the major output file:
C1(R)
C2(R)
C3(R)
C4(R)
C5(R)
C6(R)
C7(R)
C8(R)
C9(R)
C10(R)
C11(R)
C12(R)
C13(R)
C14(R)

Additive x position
Pressure
Vapor volume fraction
Velocity of the fluid
Velocity of the gas
Specific internal energy of the fluid
Specific internal energy of the gas
Density of the fluid
Density of the gas
Temperature of the fluid
Temperature of the gas
Saturation temperature
Area of the pipe cross-section
Mass flow

[m]
[Pa, N/m2]
[m/s]
[m/s]
[J/kg]
[J/kg]
[kg/m3]
[kg/m3]
[K]
[K]
[K]
[m2]
[kg/s]

7.1.4.3 Minor output file


The minor output file is useful because it allows tracking of the temporal development of the
chosen variable at the desired point in the piping system.
The minor output file is written only if Print card is included in the input data file. The
resulting file includes time history of variables in volumes, which are specified in the input
file in Print card. All results are written in the same file, which takes an automatically
generated
name
in
the
form
output_filename.out.
The
name
output_filename is specified by a user as the third word in the command row when
the WAHA program is started (see Section 7.1.5 ). If the user does not define the third word,
the program automatically applies name output.out.
It is possible to specify up to 10 variables. If the number of printed variables is greater than
10, further input variables are ignored. This error is noted in the output detection file, but the
program is not terminated. The recording frequency is defined in Time step card.

7-4

Important: Location of Minor output files is in subfolder results. The user must create
this subfolder before the WAHA program has been executed. Old output file with the same
name like new file is overwritten.
The minor output file is written in ASCII format and has several columns. The first column is
time, whereas the other columns (up to 10) are values of the specified variables. The format of
the output file is suited for presenting with Gnuplot or MS Excel program.
Columns in the minor output file:
C1(R)
C2(R)
C3(R)
C4(R)
C5(R)

Additive x position
First specified variable
Second specified variable
Third specified variable
etc.

[m]
[variable unit]
[variable unit]
[variable unit]

7.1.4.4 Restart file


The restart file(s) files are written periodically as defined with the frequency of recording in
Time step card. If the frequency of the restart files is larger than the problem end time, one
restart file is written at the end of the calculation. Restart files are written the form of input
files with initial conditions taken from the requested time step. Time step card in the restart
file is disabled with "$" sign in the first column so the restart file must be manually opened
by the user and time step cards suitably modified (see example in Time step card
description). The names restart.xxx, with xxx as a consecutive number are used.
Header of each restart file contains the time of the output.
Important: Location of Restart files is in subfolder results. The user must create this
subfolder before the WAHA program has been executed. Old output file with the same name
as new file is overwritten.
It is recommended to erase all old restart.xxx files at the beginning of new calculation
to avoid mistakes due to the use of the old files (made by earlier runs). Otherwise calculate
the last written file and use only files with smaller consecutive number.

7.1.4.5 Force file


Format of the force file is described in section 6.1.

7.1.5 Executing the WAHA program


The WAHA program was tested on Sun-Solaris and MS Windows operating systems. To run
the WAHA program in MS Windows the MS-DOS prompt window has to be open and in
Sun-Solaris one terminal has to be open. Then move to the desired folder and in both cases
one of the next two command rows can be used:
waha.exe

input_filename.dat

7-5

or
waha.exe input_filename.dat output_filename
or
waha.exe inp_filename.dat out_filename rst_filename
where .dat is the recommended user defined file extension for an input file. Do not use
the file extension for an output file, because the WAHA program will create it automatically.
When the command row does not contain an output filename, the WAHA computer code will
automatically generate output files output, output.out and output.xxx,
where xxx is an integer number between 000 and 999. Output files with numbers higher than
999 are not created, although the program will continue to run without output. The user can
explicitly define restart file name, othervise default restart filename is restart.xxx.

7-6

7.2 CARDS
This section of User's Manual presents detail information and data formats of all available
cards. Card descriptions are divided into paragraphs and their content is described below.
General description:
This paragraph contains general description of each card. First it is stated if card is optional or
required, then important notes, warnings and recommendations are listed.
Card symbol:
This paragraph contains only card symbol.
Card scheme:
This paragraph contains schematic organization of the card (symbol, words, format).
Words:
Each word used on a card is described here. First word/symbol is always card name, then
other words of the card follows. Symbol W is used for words in card and following number is
word position in card in additive order. Note that the word with number 1 is actually the
second word in the row. First word W0 is a card symbol. The sign in brackets is value type
and it indicates alphanumeric (A), integer (I), or real (R) value.
Example:
There is an example of use of the current card symbol, extracted from well-defined test input
file.

7-7

7.3 TITLE CARD


General description:
Title card is required card and it is usually located at the beginning of an input file. If Title
card is missing, the following expression appears in a general output file: TITLE card
not detected. If more than one Title cards exist, the last Title card is used in the output
file.
Card symbol:
title
Card scheme:
title
W1(A)
Words:
W1(A)

User defined title.

Example:
*--------- Title card ---------------title Simpson's pipe test - stiff pipe
The first symbol in the first row is an asterisk, which is a symbol for Comment card. All text
in the rows that start with * is a commentary. The second row is Title card with the first
word title. The rest of the text is a user defined title W1(A).

7-8

7.4 TIME STEP CARD


General description:
At least one card of this series is required and it is used to determine all time dependent
components of calculation. If the Time step card is missing, the program fails. It is possible to
specify more than one card in consecutive order.
Card symbol:
time00
where time is the name of the card and 00 is the increasing Id. number of a Time step
card. Up to ten Time step cards can be used in calculation with different frequencies of
output.
Card scheme:
time00 W1(R) W2(R) W3(R) W4(R) W5(R) W6(R)
Words:
W1(R)

Time at the beginning of the current part of the calculation. This value is set
equal to zero for first Time step card and is equal to W2 in previous Time step
card for further Time step cards. This quantity must increase with increasing
card number.

W2(R)

End time of the current part the simulation. This quantity must increase with
increasing card number.

W3(R)

Major outputs time interval.

W4(R)

Minor outputs time interval.

W5(R)

Time step limitation. It is written in units of Courant number (CFL condition).


Values larger than 1.0 are not allowed as the calculation becomes unstable. An
optimal value to achieve minimal numerical dissipation is 0.8-0.9.

W6(R)

Time interval for restart files. Each restart file is actually an input file with
current state in the piping system taken as initial conditions. This restart-input
file needs manual modification of the Time step card by the user, before it can
be used as an input file for a new run. If W6 is larger than W2 on the last Time
step card, one restart file is written at the end of calculation.

Example 1:
*--------- Time step card --------------------------------------------*
beg
end
maj_out
min_out
diff
restart
time00 0
2.0e-1
4.e-3
2.e-3
0.80
0.1
time01 0.2
3.0e-1
2.e-3
1.e-3
0.80
0.1

7-9

The first symbol in the first and the second row is an asterisk, which is a symbol for Comment
card. The text behind is commentary. In the third and the fourth row the first word
timeXX denotes the Time step card symbol. The words that follow are described below.
The calculation will begin at 0.00 sec and end at 0.3 sec. In the first part of the calculation the
Major output frequency is 0.004 sec and minor output frequency is 0.002 sec. A time step is
limited with the CFL condition 0.80, and restart files will be written every 0.1 seconds. After
the time 0.2 sec to the end of the calculation the Major output frequency is reduced to 0.002
sec and minor output frequency is 0.001 sec. CFL condition and restart files frequency are
unchanged.
Example 2 - restart-input file format:
Below is a header of the restart file produced at time t = 0.3 s for the input file from Example
1 on the previous page:
********************************************************************************
*
WAHALoads restart file at time = 0.300068
sec.
*
*
WARNING: TIME cards not in function, alter before restart calculation !
*
********************************************************************************
*--------- Title card -------------------------------------------------------title Simpson's pipe test - stiff pipe
*--------- Time step card ---------------------------------------------------*
beg end
maj_out
min_out
diff
restart
$time00 0
2.0e-1
4.e-3
2.e-3
0.80
0.1
$time01 0.2 3.0e-1
2.e-3
1.e-3
0.80
0.1

...
Restart files are actually input files with initial conditions taken from the requested time. Time
step card in the restart file is disabled with "$" sign in the first column so the restart file must
be manually opened by the user and time step cards suitably modified. Short header of the
restart-input file gives the time at which the restart file was written. Restart file above could
be for example changed into:
********************************************************************************
*
WAHALoads restart file at time = 0.300068
sec.
*
********************************************************************************
*--------- Title card -------------------------------------------------------title Simpson's pipe test - stiff pipe
*--------- Time step card ---------------------------------------------------*
beg
end
maj_out
min_out
diff
restart
time00 0.3 0.4
6.e-3
2.e-9
0.80
0.1

...
Such restart run would start from time t = 0.3 s, which was the final time of the original run.

7-10

7.5 SWITCH CARD


General description:
Exactly one card of this series is required and it is used to set various parameters, which
remain constant during the simulation and are valid for the whole input: type of fluid, order of
accuracy of the scheme, and abrupt area change model. If Switch card is missing, the program
fails.
Card symbol:
switch
Card scheme:
switch W1(I) W2(I) W3(I) W4(I) W5(I) W6(I)
Words:
W1(I)

Type of two-phase flow in a piping system:


1
Mixture of liquid water and vapor
2
Mixture of liquid water and ideal gas (limited number of correlations is
available for this option)

W2(I)

Order of accuracy of a calculation:


0
First-order upwind characteristic scheme,
1
"pure" second-order Lax-Wendroff scheme (not recommended, useful
only for test purposes),
2
Second order scheme with MINMOD limiter,
3
Second order scheme with Van Leer limiter,
4
Second order scheme with Super Bee limiter (not recommended).

W3(I)

Model of abrupt area change and T connection:


1
Simplified model,
2
Conservative model,
3
Conservative-characteristic model (recommended)

W4(I)

Output of eigenvalues into the general output file


0
Eigenvalues will not be written
1
Eigenvalues between each pair of the volumes will be written with
"major output frequency" (W3 on the Time step card).

W5(I)

Output of additional parameters into the general output file


0
Additional parameters will not be written
1
The following block (columns) of data will be written into the general
output file with "major output frequency" (W3 in the Time step card):
1) volume number
2) stratification factor (0 dispersed flow, 1 horizontally stratified flow,
between 0 and 1 - transitional flow)
3) Qif liquid-to-interface volumetric heat flux
4) Qig vapor-to-interface volumetric heat flux
5) Hif liquid-to-interface volumetric heat transfer coefficient

7-11

6) Hig vapor-to-interface volumetric heat transfer coefficient


7) vapor generation rate
8) Ci interfacial friction coefficient
W6(I)

Output of Major output files in results subfolder


0
Major output files will not be written
1
Major output files will be written

Example:
*--------- Switch card --------------------------------------------*
fluid
order abr_model eig_val_out extend_out
gnuplot
switch
1
2
3
1
1
1

Liquid water and vapor are chosen as a mixture in the system. The second-order scheme with
the MINMOD limiter is selected. For calculation of the abrupt area change, the WAHA
program will use the conservative-characteristic model. Eigenvalues (W4) and extended
output (W5) will be written in general output file at Major output frequency. Separate
Major output files will be written at "major output frequency" into files in the subfolder
results.

7-12

7.6 FORCE CARD


General description:
This card is not mandatory and is only needed when user wants to calculate forces on the
piping system. Exactly one card of this series is needed in such case and it is used to set two
parameters relevant for the calculation of the forces: ambient pressure and time interval for
the force calculation. If Force card is missing, the program will calculate the transient without
calculating the forces.
Card symbol:
force
Card scheme:
force
W1(R) W2(I)
Words:
W1(R)
W2(I)

ambient pressure in (Pa)


Force calculation and output time interval in seconds

Example:
*--------- forces card --------------------------------------------*
ambient_press
force_out
force 1.e+5
0.001

Forces will be calculated with ambient pressure 1 bar and printed out every 0.001 seconds.
All results will be written in file "output_filename.force".

7-13

7.7 PRINT CARD


General description:
This card is optional and it determines the contents of Minor output file. This file contains
time series of specified variables. It is possible to define up to 10 variables in one calculation.
Card symbol:
print00
where print is the name of Print card and 00 is the additive Id. number of Print card.
Card scheme:
print00 W1(I) W2(I) W3(I)
Words:
W1(I)

Id. number of the pipe.

W2(I)

Id. number of the pipe volume.

W3(I)

Traced variable. Options:


1
Pressure,
2
Vapor volume fraction,
3
Velocity of the fluid,
4
Velocity of the gas,
5
Specific internal energy of the fluid,
6
Specific internal energy of the gas,
7
Density of the fluid,
8
Density of the gas,
9
Temperature of the fluid,
10
Temperature of the gas,
11
Saturation temperature,
12
Pipe cross-section area
13
Mass flow rate
14
Total mass of the system (W1 and W2 are ignored, but must be present)
15
Total energy of the system (W1 and W2 are ignored, but must be
present)
16
Dynamic (unsteady) wall shear stress

Example:
*--------*
print01
print02
print07
print08

Print cards --------------pipe


volume
variable
1
100
1
1
100
2
1
20
3
1
20
4

The first symbol in the first and the second row is an asterisk, which symbolize Comment
card. All the following rows start with print0x, which is the Print card symbol. The
words that follow are described below.
7-14

In our example, the WAHA computer program will generate Minor output file with the first
column being the current simulation time and the next columns containing pressure time
history in the volume 100 of the pipe 2 (column 2), vapor volume fraction in the volume 100
of the pipe 1 (column 3) and liquid velocity in the volume 20 of the pipe 1 (column 4).

7-15

7.8 COMPONENT CARDS - PIPE


At least one set of Component cards is required. It is a set of five cards and each card of the
set is required. This set of cards includes geometrical and initial physical characteristics of a
pipe element in the modeled system.
7.8.1 Type card
General description:
The first card is Type card. This card defines the type of a component.
Card symbol:
comp001ty
where comp is the name of Component cards, 001 is the Id. number of the element and
ty is the identification of the Type card.
Card scheme:
comp001ty
Words:
W1(A)

W1(A) W2(A)

pipe
tank
pump

for the pipe element


for the boundary condition element with constant pressure
for the boundary condition element with constant velocity

Warning: For modeling a pipe element it is necessary to assign pipe to W1. If tank
or pump is chosen, see Sections 7.9 and 7.10 , respectively.
W2(A)

User's defined name of the element.

Example:
*--------- Pipe data cards -------*
type
name
comp001ty pipe
cev_01

The first two rows are the Comment cards. In the third row, the first word is comp001ty,
which is the symbol for Type card. The words that follow are described below.
The example presents a case where pipe element is used. The user defined name for this
component is cev_01.

7.8.2 Geometry card 1


General description:
The second card is Geometry card 1. This card defines basic properties of the chosen element:
length, friction, elasticity modulus, number of volumes, wall thickness, roughness, etc. These
properties are constant along the whole component.
7-16

Card symbol:
comp001g0
where comp is the name of Component cards, 001 is the Id. number of the element and
g0 is the identification of the Geometry card 1.
Card scheme:
comp001g0
Words:
W1(R)

W1(R) W2(R) W3(R) W4(R) W5(I) W6(I) W7(I) W8(I)

Length of the pipe [m].

W2(R)

Elasticity of the pipe [N/m2]; if is set to zero, pipe elasticity is not considered.

W3(R)

Thickness of the pipe [m]; if is set to zero, pipe elasticity is not considered.

W4(R)

Roughness of the pipe wall [m].

W5(I)

Wall friction flag:


0
steady wall friction will be computed
1
only steady dispersed flow correlations are used for wall friction
2
only steady horizontally stratified flow correlations are used for wall
friction
3
steady and dynamic wall friction will be computed
9
wall friction will not be computed

W6(I)

Inter-phase friction flag:


0
inter-phase friction coefficient Ci is obtained from the WAHA
correlations (see Section 2.2.2).
1
only dispersed flow correlations are used for inter-phase friction,
"whole" virtual mass term is taken into account, interfacial pressure
term is neglected
2
only horizontally stratified flow correlations are used for inter-phase
friction, virtual mass is zero, "whole" interfacial pressure term is taken
into account (warning: such equations become non-hyperbolic very
quickly)
8
homogeneous model, Ci = infinite
9
no inter-phase friction, Ci = 0

W7(I)

Heat and mass transfer flag:


0
inter-phase heat transfer coefficients H if , H ig are obtained from the
WAHA correlations (see Section 2.2.3). Correlations are not
available for water-ideal gas mixture.
1
only dispersed flow correlations are used for inter-phase heat and mass
transfer
2
only horizontally stratified flow correlations are used for inter-phase
heat and mass transfer
8
equilibrium model (available for liquid water and not for ideal gas)
9
heat and mass transfer will not be computed

7-17

W8(I)

Number of nodalization volumes of the pipe. Value must be greater than 1.

Example:
*--------- Pipe data cards -----------------------------------------------*
length
elast
thick
rough w.fr.f p.fr.f h.m.tr. nods
comp001g0 36.0-0
0.0
1.588e-3 0.0e0 9
8
8
100

The first two rows are the Comment cards. The third row starts with the first word
comp001g0 which is Geometry card 1 symbol. The words that follow are explained
below.
The example presents case where the pipe is 36 meters long; elasticity and wall friction are
not calculated (thickness and roughness are zero). The pipe is divided into 100 volumes.
Instantaneous relaxation is used for inter-phase mass, momentum, and energy transfer.

7.8.3 Geometry card 2


General description:
The third card, geometry card 2, defines additional properties of the pipe, which can vary
along the pipe. These are a cross section area, inclination, azimuth of the pipe, and wall
friction coefficient.
If the first sign in the next row is symbol +, one can define different values for Second
geometry card that describes the next section of the same pipe. These cards are then
continuation of Geometry card 2.
Card symbol:
comp001g1
where comp is the name of Component cards, 001 is the Id. number of the element and
g1 is the identification the Geometry card 2.
Card scheme:
comp001g1
+
+
+
etc.
Words:
W1(R)

W1(R)
W1(R)
W1(R)
W1(R)

W2(R)
W2(R)
W2(R)
W2(R)

W3(R)
W3(R)
W3(R)
W3(R)

W4(R)
W4(R)
W4(R)
W4(R)

W5(I)
W5(I)
W5(I)
W5(I)

Cross section area of the pipe [m2].

W2(R)

Inclination of the pipe [deg].

W3(R)

Azimuth of the pipe [deg]. Important only for calculation of the forces.

W4(R)

Wall friction multiplier. Default value of 1.0 is assumed if this parameter is


missing. If the parameter is present in the input file, the calculated wall friction
forces on gas and liquid are multiplied with this factor. I.e. Equations (2.3-1)

7-18

and (2.3-2) are multiplied with factor W4. User can tune the minor losses,
which are not explicitly modeled in the input through this factor.
W5(I)

Upper limit of volumes, for which values are applied. This value must be in
increasing order.

Example:
*--------*
comp001g1
+

Pipe data cards --------------area


incl
azim
frict.fac
2.85e-4 0.
0.0
30
4.85e-4 90.
0.0
1.0

wch_nods
100

The first two rows are the Comment cards. The third row starts with the word
comp001g1, which is the Geometry card 2 symbol. Following words are described below.
The last row, with the symbol + at the beginning, is the Continuation card of the card
comp001g1.
The above example presents a case where the first 30 volumes of the pipe have different
inclination and cross-section than the last 70 volumes. The first section of the pipe is
horizontal, whereas the last section is vertical. No wall fricition multiplier is defined for the
first 30 volumes, thus default value of 1.0 is used. The last 70 volumes have defined value of
wall friction multiplier (which is equal to the default value 1.0).

7.8.4 State card


General description:
The fourth card, State card defines the initial physical state in the pipe component.
If the first sign in the next row is symbol +, then one can define different values for State
card that describes the next section of the pipe. These cards are continuation to State card.
Card symbol:
comp001s0
where comp is the name of Component cards, 001 is the Id. number of the element and
s0 is the identification of the State card.
Card scheme:
comp001s0
+
+
etc.
Words:
W1(A)

W1(A) W2(R) W3(R) W4(R) W5(R) W6(R) W7(R) W8(I)


W1(A) W2(R) W3(R) W4(R) W5(R) W6(R) W7(R) W8(I)
W1(A) W2(R) W3(R) W4(R) W5(R) W6(R) W7(R) W8(I)

Initial condition data format. Two options are available at the moment:
agpvu
Initial state is defined with pressure, vapor volume fraction,
velocity and specific internal energy,

7-19

agpvt

Initial state is defined with pressure, vapor volume fraction,


velocity and temperature,

W2(R)

Pressure of the fluid in the pipe [Pa = N/m2]. Valid for both formats of W1.

W3(R)

Vapor volume fraction. Valid for both formats of W1.

W4(R)

Velocity of the fluid in the pipe [m/s]. Valid for both formats of W1.

W5(R)

Velocity of the gas in the pipe [m/s]. Valid for both formats of W1.

W6(R)

If W1 is agpvu:
If W1 is agpvt:

specific internal energy of the fluid in the pipe [J/kg],


temperature of the fluid in the pipe [K].

W7(R)

If W1 is agpvu:
If W1 is agpvt:

specific internal energy of the gas in the pipe [J/kg],


temperature of the gas in the pipe [K].

W8(I)

Upper limit of volumes, for which values are applied. This value must be in
increasing order.

If vapor volume fraction is set equal to zero (W3 = 0.0), velocity of the gas (W5) and specific
internal energy (W7) are neglected as initial condition. Similar treatment is used if vapor
volume fraction is set equal to one (W3 = 1.0). In this case, liquid velocity and liquid internal
energy are ignored.
Example 1:
*--------*
comp001s0
+

Pipe data cards -----------------------------------------------type


press
alpha_g
velf
velg uf
ug
wch_nods
agpvu
3.419e5 0.0
0.4
0.0
97670. 0.0
50
agpvu
3.419e5 0.0
0.4
0.0
97671. 0.0
100

Example 2:
*--------*
comp001s0
+

Pipe data cards ------------------------------------------------type


press
alpha_g
velf
velg uf
ug
wch_nods
agpvt
3.419e5 0.0
0.4
0.0
296.3
0.
50
agpvt
3.419e5 0.0
0.4
0.0
296.4
0.
100

The first two rows in the examples above are the Comment cards. In the third row of the
example 1, the first word is comp001s0, which is the State card symbol. Following words
are described below. Last row in the examples 1 and 2 has symbol + at the beginning,
therefore this cards are supplementary cards to card comp001s0.
The example 1 presents a pipe with initial pressure 3.419 bar. It is filled with pure liquid
water. Velocity of fluid is 0.4 m/s and specific internal energy in the first 50 volumes is
slightly different than in the last 50 volumes.
The example 2 presents similar initial state than the example 1, except that specific internal
energy is replaced with temperature.

7-20

7.8.5 Connection card


General description:
The last card (the fifth) in the set is Connection card. This card defines pipe's connections
with other components. Note that every connection has to be defined twice (from to and
again to from). It is possible to define branch connection, but note that the maximum
number of pipes connected together is 3.
Card symbol:
comp001c0
where comp is the name of Component cards, 001 is the Id. number of the pipe element
and c0 is the identification of the Connection card.
Card scheme:
comp001c0
Words:
W1(I-I)

W1(I-I) W2(I-I) W3(I-I) W4(I-I)

This word is composed of two integer values separated with dash and it
describes the connection at the beginning of the pipe.
The first value is the number of the attached pipe, the second value is
orientation of the connection. Options for the pipe number:
000
Current pipe's beginning is a closed end, or
00X Id. number of the attached pipe (the beginning of the current pipe is
connected to the pipe 00X).
The second value is orientation of the connection:
01
Current pipe's beginning is connected to the beginning of the other
pipe,
99
Current pipe's beginning is connected to the end of the other pipe,
if the other pipe is tank or pump, option 01 is identical to 99,
00
if the first part of W1 is 000 (closed end), the second part must be 00

W2(I-I)

This word is composed of two integer values separated with dash and it
describes the connection at the end of the pipe.
The first value is a number of the attached pipe, the second value is orientation
of the connection. Options for the pipe number:
000
Current pipe's end is a closed end, or
00X Id. number of the attached pipe (the beginning of the current pipe is
connected to the pipe 00X).
The second value is orientation of the connection:
01
Current pipe's end is connected to the beginning of the other pipe,
99
Current pipe's end is connected to the end of the other pipe,
if the other pipe is tank or pump, option 01 is identical to 99,
00
If the first part of W2 is 000 (closed end), the second part must be 00

W3(I-I)

This word is optional and is used only for branch connection W3 = W1.

W4(I-I)

This word is optional and is used only for branch connection W4 = W2.

7-21

Example 1:
*--------- Pipe data cards ------*
from
to
comp001c0 002-99
000-00
.....
*
comp002c0

from
000-00

to
001-99

The first two lines are the Comment cards. The third row starts with the word
comp001c0, which is the Connection card symbol. The beginning of the pipe 001 in
Example 1 is connected to the end of the pipe 002, and the end of the pipe 001 is a closed end.
Note that the connection from end of the pipe 002 must match this connection, as shown in
the last line of the Example 1.
Example 2:
*--------- Pipe data cards ------*
from1
to1
from2
comp001c0 xxx-xx
003-01
xxx-xx

to2
004-01

.....
*
comp003c0

from1
001-99

to1
xxx-xx

from2
004-01

to2
xxx-xx

from1
001-99

to1
xxx-xx

from2
003-01

to2
xxx-xx

.....
*
comp004c0

The second example presents branch connection case where the end of the current pipe 001 is
connected to the beginning of the pipe 003 and to the beginning of the pipe 004. Each
connection must be defined in both connected pipes or the code stops with error.

7-22

7.9 COMPONENT CARDS - TANK


7.9.1 Type card
General description:
A tank serves only as a constant pressure boundary condition and is not required in the input
file. The same set of five cards used to describe the pipe is used to describe the tank, although
several parameters are ignored in the tank component. The first card is Type card, which
defines the type of the component
Card symbol:
comp001ty
where comp is the name of Component cards, 001 is the Id. number of the element and
ty is the identification of the Type card.
Card scheme:
comp001ty
Words:
W1(A)

W2(A)

W1(A) W2(A)

tank

for boundary volume with the constant pressure boundary


condition;
if the fluid flows into the tank, only the tank pressure is taken as
a boundary condition,
if the fluid flows from the tank, all fluid properties in the tank,
except velocities, are taken as boundary conditions. The tank
component cannot be discretized.

User's defined name of the element.

Example:
*--------- Pipe data cards -------*
type
name
comp001ty tank
tank_01

The first two rows are the Comment cards. In the third row the first word is comp001ty,
which is Type card symbol. Following words W1 and W2 are described below.
The example presents a case where the tank component is used. The user defined name for the
element is tank_01.

7.9.2 Geometry card 1


General description:
The Geometry card 1 for a tank is equal to Geometry card 1 for a pipe. However, all values in
this card, except the last one, are ignored.
7-23

Card symbol:
comp001g0
where comp is the name of Component cards, 001 is the Id. number of the element and
g0 is the identification of the Geometry card 1.
Card scheme:
comp001g0

W1(R) W2(R) W3(R) W4(R) W5(I) W6(I) W7(I) W8(I)

Words:
W1(R)

Ignored for the tank component.

W2(R)

Ignored for the tank component.

W3(R)

Ignored for the tank component.

W4(R)

Ignored for the tank component.

W5(I)

Ignored for the tank component.

W6(I)

Ignored for the tank component.

W7(I)

Ignored for the tank component.

W8(I)

Number of volumes must be zero; tank cannot be discretized

Example:
*--------- Tank data cards -----------------------------------------------*
length
elast
thick
rough w.fr.f p.fr.f h.m.tr. nods
comp001g0 0.0-0
0.0
1.588e-3 0.0e0 9
8
8
0

The first two rows are the Comment cards. The third row starts with the first word
comp001g0, which is the Geometry card 1 symbol. The words that follow are W1-W8
described below.
The example presents one case of Geometry card 1 for a tank. Words W1-W7 are defined but
they are ignored by the program. Only the last word W8 is 0.
7.9.3 Geometry card 2
General description:
The format of Geometry card 2 for a tank is equal to Geometry card 2 for a pipe.
Card symbol:
comp001g1

7-24

where comp is the name of the Component cards, 001 is the Id. number of the element
and g1 is the identification of the Geometry card 2.
Card scheme:
comp001g1
Words:
W1(R)

W1(R) W2(R) W3(R) W4(R) W5(I)

Cross section area of the tank connection [m2].

W2(R)

Ignored for the tank component.

W3(R)

Ignored for the tank component.

W4(R)

Ignored for the tank component (this word is optional)

W5(I)

Number of volumes must be zero; tank cannot be discretized

Examples:
*--------- Tank data cards --------------*
area
incl
azim
wch_nods
comp001g1 2.85e-4 0.
0.0
0

.......
*--------- Tank data cards --------------*
area
incl
azim
wall.fr.
comp001g1 2.85e-4 0.
0.0
1.0

wch_nods
0

Both examples are equivalent - W4 is skipped in the first example, however this word is not
relevant for the tank component. The first two rows are the Comment cards. The third row
starts with the first word comp001g1, which is the Geometry card 2 symbol. Following
words W1-W5 are described below.
The example presents an arrangement of Geometry card 2 for the tank component. The crosssection of the tank connection is defined in W1, words W2-W4 are ignored and the last word
W5 must be 0.

7.9.4 State card


General description:
The format of State card for a tank is equal to State card for a pipe.
Card symbol:
comp001s0
where comp is the name of the Component cards, 001 is the Id. number of the element
and s0 is identification of the State card.

7-25

Card scheme:
comp001s0
Words:
W1(A)

W1(A) W2(R) W3(R) W4(R) W5(R) W6(R) W7(R) W8(I)

Initial condition data format.


Two cards are available at the moment:
agpvu
Initial state is defined with pressure, vapor volume fraction,
velocity and specific internal energy,
agpvt

Initial state is defined with pressure, vapor volume fraction,


velocity and temperature,

W2(R)

Pressure of the fluid in the pipe [Pa = N/m2]. Valid for both formats.

W3(R)

Vapor volume fraction. Valid for both formats.

W4(R)

Ignored for a tank - velocity of the liquid in the pipe [m/s].

W5(R)

Ignored for a tank - velocity of the liquid in the pipe [m/s].

W6(R)

If W1 is agpvu:
If W1 is agpvt:

specific internal energy of the fluid in a tank [J/kg],


temperature of the fluid in a tank [K].

W7(R)

If W1 is agpvu:
If W1 is agpvt:

specific internal energy of the gas in a tank [J/kg],


temperature of the gas in a tank [K].

W8(I)

Number of volumes must be zero; tank cannot be discretized.

If vapor volume fraction is set to zero (W3 = 0.0), the specific internal energy of the gas (W7)
is neglected as the initial condition.
If vapor volume fraction is set equal to one (W3 = 1.0), the specific internal energy of the
fluid (W6) is neglected as the initial condition.
Example:
*--------- Tank data cards -----------------------------------------------*
type
press
alpha_g
velf
velg uf
ug
wch_nods
comp001s0 agpvu
3.419e5 0.0
0.4
0.0
97113.0 0.0
0

The first two rows are the Comment cards. The third row starts with the first word
comp001s0, which is the State card symbol. Following words W1-W8 are described below.
Example present a tank with constant pressure 3.419 bar filled with liquid water of given
specific internal energy. Velocities in the tank are ignored. If the fluid in the pipe, which is
connected to the tank, flows:
- into the tank, only the pressure (W2) is taken as a boundary condition,

7-26

- out from the tank, the pressure (W2), vapor volume fraction (W3), and specific internal
energies of gas and liquid (W6, W7) are taken as boundary conditions. Tank in the example
is filled with liquid only, therefore only W6 is relevant.

7.9.5 Connection card


General description:
The format of Connection card for a tank is equal to Connection card for a pipe. However,
the tank can have only one connection to one single pipe (tank cannot be connected into a
branch).
Card symbol:
comp001c0
where comp is the name of the Component cards, 001 is the Id. number of the element
and c0 is the identification of the Connection card.
Card scheme:
comp001c0
Words:
W1(I-I)

W1(I-I) W2(I-I)

This word is composed of two integer values separated with dash and it
describes tank's connections.
The first value is a pipe number; the second value is orientation of the
connection. Options for the pipe number:
000
W1 does not define the connection of the tank, thus W2 must define it,
00X Id. number of the pipe that is connected to the tank.
The second value is orientation of the connection:
01
tank is connected to the beginning of the other pipe,
99
tank is connected to the end of the other pipe.
00
If the first part of the W1 is 000, the second part must be 00.

W2(I-I)

This word is composed of two integer values separated with dash and it
describes the connection of the tank.
The first value is the pipe number; the second value is orientation of the
connection. Options for the pipe number:
000
W2 does not define the connection of the tank, thus W1 must define it,
00X Id. number of the pipe connected to the tank.
The second value is orientation of the connection:
01
tank is connected to the beginning of the other pipe,
99
tank is connected to the end of the other pipe.
00
If the first part of W2 is 000, the second part must be 00
Important: Tank must be connected with exactly one pipe. Connection can
be described with W1 or W2, but not with both. Thus one of the words
W1, W2 must be 000-00

7-27

Tank cannot be connected directly into the branch.


Example 1:
*--------- Tank data cards ------*
from
to
comp001c0 002-99
000-00
Example 2:
*--------- Tank data cards ------*
from
to
comp001c0 000-00
002-99
These two examples present an identical case. A tank numbered 001 is connected to the end
of the pipe 002. The connection is described with the word W1 in the example 1 and with the
word W2 in the example 2.

7-28

7.10 COMPONENT CARDS - PUMP


7.10.1 Type card
General description:
A pump serves only as a constant velocity boundary condition and is not required in the input
file. The same set of five cards used to describe a pipe is used to describe a pump, although
several parameters are ignored in the pump component. The first card is Type card which
defines the type of the element.
Card symbol:
comp001ty
where comp is the name of the Component cards, 001 is the Id. number of the element
and ty is the identification of the Type card.
Card scheme:
comp001ty
Words:
W1(A)

W1(A) W2(A)

pump

for boundary volume with constant velocity boundary


condition;
if the fluid flows from the pump, all fluid properties in the
pump, except pressure, are taken as boundary condition,
if the fluid flows into the pump, only the pump liquid and gas
velocities are taken as boundary conditions.
The pump component cannot be discretized.

W2(A)

User's defined name of the element.

Example:
*--------- Pipe data cards -------*
type
name
comp001ty pump
pump_01

The first two rows are the Comment cards. In the third row the first word is comp001ty,
which is Type card symbol. Following words W1 and W2 are described below.
The example presents a case where the pump is used. The user defined name for the element
is pump_01.

7.10.2 Geometry card 1


General description:

7-29

Geometry card 1 for a pump is equal to Geometry card 1 for a pipe. However, all values in
this card are ignored, except the last value.
Card symbol:
comp001g0
where comp is the name of the Component cards, 001 is the Id. number of the element
and g0 is the identification of the Geometry card 1.
Card scheme:
comp001g0

W1(R) W2(R) W3(R) W4(R) W5(I) W6(I) W7(I) W8(I)

Words:
W1(R)

Ignored for the pump component.

W2(R)

Ignored for the pump component.

W3(R)

Ignored for the pump component.

W4(R)

Ignored for the pump component.

W5(I)

Ignored for the pump component.

W6(I)

Ignored for the pump component.

W7(I)

Ignored for the pump component.

W8(I)

Number of volumes must be zero; a pump cannot be discretized

Example:
*--------- Pump data cards -----------------------------------------------*
length
elast
thick
rough w.fr.f p.fr.f h.m.tr. nods
comp001g0 0.1-0
0.0
0.0
0.0e0 0
8
8
0

The first two rows are the Comment cards. The third row starts with the first word
comp001g0, which is the Geometry card 1 symbol. Following words W1-W8 are
described below.
The example presents an arrangement of Geometry card 1 for a pump. Words W1-W7 are
defined but the program ignores them. The last word W8 must be set to 0.

7.10.3 Geometry card 2


General description:
The format of Geometry card 2 for a pump is equal to Geometry card 2 for a pipe.
Card symbol:
comp001g1

7-30

where comp is the name of the Component cards, 001 is the Id. number of the element
and g1 is the identification of the Geometry card 2.
Card scheme:
comp001g1
Words:
W1(R)

W1(R) W2(R) W3(R) W4(R) W5(I)

Cross section area of the pump connection [m2].

W2(R)

Ignored for the pump component.

W3(R)

Ignored for the pump component.

W4(R)

Ignored for the pump component (this word is optional)

W4(I)

Number of volumes must be zero; a pump cannot be discretized

Examples:
*--------- Pump data cards --------------*
area
incl
azim
wch_nods
comp001g1 0.01
0.
0.0
0
.....
*--------- Pump data cards --------------*
area
incl
azim
wall.fr.
comp001g1 0.01
0.
0.0
1.0

wch_nods
0

Both examples are equivalent - W4 is skipped in the first example, however this word is not
relevant for the pump component. The first two rows are the Comment cards. The third row
starts with the first word comp001g1, which is the Geometry card 2 symbol. Following
words W1-W5 are described below.
The example presents an arrangement of Geometry card 2 for a pump. The cross-section of
the pump connection is defined in W1, words W2-W5 are ignored and the last word W5 must
be set equal to 0.

7.10.4 State card


General description:
The format of State card for a pump is equal to State card of a pipe.
Card symbol:
comp001s0
where comp is the name of the Component cards, 001 is the Id. number of the element
and s0 is the identification of the State card.

7-31

Card scheme:
comp001s0
Words:
W1(A)

W1(A) W2(R) W3(R) W4(R) W5(R) W6(R) W7(R) W8(I)

Initial condition data format.


Two cards are available at the moment:
agpvu
Initial state is defined with pressure, vapor volume fraction,
velocity and specific internal energy.
agpvt

Initial state is defined with pressure, vapor volume fraction,


velocity and temperature.

W2(R)

Ignored for a pump.

W3(R)

Vapor volume fraction. Valid for both formats.

W4(R)

Velocity of the liquid in the pump [m/s].

W5(R)

Velocity of the gas in the pump [m/s].

W6(R)

If W1 is agpvu:
If W1 is agpvt:

specific internal energy of the fluid in the pipe [J/kg],


temperature of the fluid in the pipe [K].

W7(R)

If W1 is agpvu:
If W1 is agpvt:

specific internal energy of the gas in the pipe [J/kg],


temperature of the gas in the pipe [K].

W8(I)

Number of volumes must be zero; a pump cannot be discretized.

If vapor volume fraction is set equal to zero (W3 = 0.0), the specific internal energy of the gas
(W7) is neglected as the initial condition.
If vapor volume fraction (W3) is 1.0, the specific internal energy of the fluid (W6) are
neglected as the initial condition.
Example:
*--------- Pump data cards -----------------------------------------------*
type
press
alpha_g
velf
velg uf
ug
wch_nods
comp001s0 agpvu
3.419e5 0.0
0.4
0.0
97113.0 0.0
0

The first two rows are the Comment cards. The third row starts with the first word
comp001s0, which is the State card symbol. The words that follow are W1-W8 described
below.
The example presents a pump with constant velocity 0.4 m/s, which delivers liquid water of
given specific internal energy. Pressure in the pump is ignored. If the fluid in the pipe, which
is connected to the pump, flows:
- into the pump, only the velocities (W4, W5) are taken as boundary conditions,

7-32

- out from the pump, the velocities (W4, W5), vapor volume fraction (W3), and specific
internal energies of gas and liquid (W6, W7) are taken as boundary conditions. The pump in
the example is filled with liquid only, thus only W6 is relevant.

7.10.5 Connection card


General description:
The format of Connection card for a pump is equal to Connection card for a pipe. However,
the pump can have only one connection to one single pipe (pump cannot be connected into a
branch).
Card symbol:
comp001c0
where comp is the name of the Component cards, 001 is the Id. number of the element
and c0 is the identification of the Connection card.
Card scheme:
comp001c0
Words:
W1(I-I)

W1(I-I) W2(I-I)

This word is composed of two integer values separated with dash and it
describes the connection of the pump.
The first value is a pipe number; the second value is orientation of the
connection. Options for the pipe number:
000
W1 does not define the connection of the pump, thus W2 must define
it,
00X Id. number of the pipe connected to the pump.
The second value is orientation of the connection:
01
pump is connected to the beginning of the other pipe,
99
pump is connected to the end of the other pipe.
00
If the first part of the W1 is 000, the second part must be 00

W2(I-I)

This word is composed of two integer values separated with dash and it
describes the connection of the pump.
The first value is the pipe number; the second value is orientation of the
connection. Options for pipe number:
000
W2 does not define the connection of the pump, thus W1 must define
it,
00X Id. number of the pipe connected to the pump.
The second value is orientation of the connection:
01
pump is connected to the beginning of the other pipe,
99
pump is connected to the end of the other pipe.
00
If the first part of the W2 is 000, the second part must be 00

7-33

Important: Pump must be connected with exactly one pipe. The


connection can be described with W1 or W2, but not with both. Thus, one
of the words W1 or W2 must be 000-00.
Pump cannot be connected directly into the branch.
Example 1:
*--------- Pump data cards ------*
from
to
comp001c0 002-99
000-00
Example 2:
*--------- Pump data cards ------*
from
to
comp001c0 000-00
002-99
These two examples present an identical case. A pump numbered 001 is connected to the end
of the pipe 002. The connection is described with the word W1 in the example 1 and with the
word W2 in the example 2.

7-34

7.11 COMMENT CARD


General description:
An asterisk (*) or a dollar sign ($), appearing as the first character in a row, identify the card
as Comment card.
Card symbol:
* or $
Card scheme:
*
W1(A)
Words:
W1(A)

User defined text - commentary.

Example:
*
This row is comment row
$
Commentary
*
We can type here comments, descriptions, help
*
information, describe input steps, etc
The first symbols in the rows above are asterisk or dollar signs, which are symbols for
Comment card. Text behind is commentary and the program ignores it.
Caution: Comment card cannot be placed between two consecutive continuation cards.

7-35

7.12 TERMINATION CARD


General description:
This card is required at the end of each input file.
Card symbol:
end
Card scheme:
end
Words:
/
Example:
*--------- Termination card ----end

7-36

7.13 EXAMPLES OF INPUT AND OUTPUT FILES


7.13.1 Input file for the Simpson's pipe problem simpsonel.dat
This example is one of the basic benchmarks for the WAHA code due to its simple geometry
and wide range of phenomena that it covers. A pipe is divided into 100 volumes and
connected to a tank (constant pressure boundary condition) at the beginning and to a valve in
the opposite side. The pipe is filled with liquid water in steady state condition with initial
velocity of 0.4 m/s.
Simulation starts at time t = 0.0 s, when valve is suddenly closed. The valve closure creates a
pressure wave, which travels along the pipe and reflects from the tank and returns to the
valve. After another reflection from the valve the flashing near the valve appears. After that
moment rather complicated behavior is present due to flashing and condensation, which can
appear along the pipe. Each condensation creates new traveling pressure jump which has a
potential in a total sum of all pressure jumps, to cause high pressure peaks (damage to the
pipe) or low pressure peaks (flashing and finally creation of new pressure jump).
title simpson test - elastic pipe
*--------time constants---------------------------------*
beg
end
maj_out
min_out
diff
restart
time00 0
2.0e-1 4.e-3
2.e-3
0.80
0.01
time01 0.2
3.0e-1 2.e-3
1.e-3
0.80
0.01
*
fluid
order
abr_model eig_val_out extend_out maj_results
switch 1
2
3
1
1
1
*
ambient_press
force_out
force 1.e+5
0.001
*-------------minor output
-------------------------------*
pipe
volume
variable
print00
1
100
1
print02
1
100
2
print03
1
100
3
print04
1
100
5
print05
1
100
7
print06
1
100
9
print07
1
20
1
print08
1
20
2
print09
1
20
3
*-------------pipes
-------------------------------*
type
name
comp001ty pipe
cev_01
*
length
elast
thick
rough
w.fr.f p.fr.f h.m.tr.
comp001g0 36.0-0
1.2e11
1.588e-3 0.0e0
3
0
0
*
area
incl
azim
f_coeff which
comp001g1 2.85e-4 0.
0.0
1.0
30
+
2.85e-4 0.
0.0
1.0
100
*
type
press
alpha_g
velf
velg
uf
ug
comp001s0 agpvu
3.419e5
0.0
0.4
0.0
97.67e3 0.0
*
from
to
comp001c0 002-99
000-00
*------------------------------------------------------*
type
name
comp002ty tank
tank_01
*
length
elast
thick
rough
w.fr.f p.fr.f h.m.tr.
comp002g0 0.0-0
0.0
0.0
0.0e0
0
0
0
*
area
incl
azim
f_coeff which
comp002g1 2.85e-4 0.
0.0
1.0
0
*
type
press
alpha_g
velf
velg
uf
ug
comp002s0 agpvu
3.419e5
0.0
0.0
0.0
97.67e3 0.0
*
from
to
comp002c0 000-00
001-01
***************************************************************
end

7-37

nods
100

wch_nods
100

nods
0

wch_nods
0

7.13.2 General output file simpsonel


************************************************************************************************************************************
************************************************************************************************************************************
**
**
**
**
** WW
WW
AAA
HH
HH
AAA
LL
OOOO
AAA
DDDDD
SSSSSS
**
** WW
WW
AA AA
HH
HH
AA AA
LL
OOO OOO
AA AA
DDD DDD
SSS SSS **
**
WW
WW
AA
AA
HH
HH
AA
AA
LL
OO
OO
AA
AA
DD
DD
SSS
**
**
WW
WW WW
AAAAAAA
HHHHHHHHH
AAAAAAA
LL
OO
OO
AAAAAAA
DD
DD
SSSS
**
**
WW WWWW WW
AAAAAAAAA
HHHHHHHHH
AAAAAAAAA
LL
OO
OO
AAAAAAAAA
DD
DD
SSSS
**
**
WWW WWW
AA
AA
HH
HH
AA
AA
LL
OO
OO
AA
AA
DD
DD
SSS
**
**
WWW WWW
AA
AA
HH
HH
AA
AA
LL
OOO OOO
AA
AA
DDD DDD
SSS
SSS **
**
W
W
AA
AA
HH
HH
AA
AA
LLLLLLLLL
OOOO
AA
AA
DDDDD
SSSSSSS
**
**
**
**
**
** (C) IJS-Reactor Engineering Division
**
**
**
**
**
************************************************************************************************************************************
************************************************************************************************************************************
Input file listing:
------------------>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>

title simpson test - elastic pipe


*--------time constants---------------------------------*
beg
end
maj_out
min_out
diff
restart
time00 0
2.0e-1 4.e-3
2.e-3
0.80
0.01
time01 0.2
3.0e-1 2.e-3
1.e-3
0.80
0.01
*
fluid
order
abr_model eig_val_out extend_out maj_results
switch 1
2
3
1
1
1
*
ambient_press
force_out
forces 1.e+5
0.001
*-------------minor output
-------------------------------*
pipe
volume
variable
print00
1
100
1
print02
1
100
2
print03
1
100
3
print04
1
100
5
print05
1
100
7
print06
1
100
9
print07
1
20
1
print08
1
20
2
print09
1
20
3
*-------------pipes
-------------------------------*
type
name
comp001ty pipe
cev_01
*
length
elast
thick
rough
w.fr.f p.fr.f h.m.tr.
comp001g0 36.0-0
1.2e11
1.588e-3 0.0e0
3
0
0
*
area
incl
azim
f_coeff which
comp001g1 2.85e-4 0.
0.0
1.0
30
+
2.85e-4 0.
0.0
1.0
100
*
type
press
alpha_g
velf
velg
uf
ug
comp001s0 agpvu
3.419e5
0.0
0.4
0.0
97.67e3 0.0
*
from
to
comp001c0 002-99
000-00
*------------------------------------------------------*
type
name
comp002ty tank
tank_01
*
length
elast
thick
rough
w.fr.f p.fr.f h.m.tr.
comp002g0 0.0-0
0.0
0.0
0.0e0
0
0
0
*
area
incl
azim
f_coeff which
comp002g1 2.85e-4 0.
0.0
1.0
0
*
type
press
alpha_g
velf
velg
uf
ug
comp002s0 agpvu
3.419e5
0.0
0.0
0.0
97.67e3 0.0
*
from
to
comp002c0 000-00
001-01
***************************************************************
$
end

nods
100

wch_nods
100

nods
0

wch_nods
0

Input data analysis for the case: "simpson test - elastic pipe

"

Summary of input data

time-beg
[s]
0.0000
0.20000

time-end
[s]
0.20000
0.30000

Fluid
type
1 = H2O

Interpolation
scheme
2 = MINMOD

Environment pressure
[Pa]
100000.

Time step control data


major edit
minor edit
interval
interval
4.00000E-03
2.00000E-03
2.00000E-03
1.00000E-03

deviat. from
Courant dt
0.80000
0.80000

Model switches
Area change
Eigenvalues
model
output
3
1 = yes

Expanded major
output
1 = yes

Separate major
output
1 = yes

Forces calculation data


Printout time step
(s)
1.000000E-03

Type = pipe
Total length
[m]
36.0000

Data for component no.


1
Name = cev_01
Wall rough. Wall fr. Wall thick. Elasticity Ph.fr. H/M tr. No.of
[m]
flag
[m]
[N/m2]
flag
flag
nodes
0.00000
3
1.588000E-03 1.200000E+11 0
0
100

Segment len.
[m]
0.360000

Beg.
node
2

End
node
101

Pipe b.c.
Beg. End
2
0

Tee b.c.
Beg. End
0
0

Type = tank
Total length
[m]
0.00000

Data for component no.


2
Name = tank_01
Wall rough. Wall fr. Wall thick. Elasticity Ph.fr. H/M tr. No.of
[m]
flag
[m]
[N/m2]
flag
flag
nodes
0.00000
0
0.00000
0.00000
0
0
0

Segment len.
[m]
1.00000

Beg.
node
103

End
node
102

Pipe b.c.
Beg. End
0
1

Tee b.c.
Beg. End
0
0

Piping system geometry - force measuring points


Coordinates bellow refer to the volume ends
not to the centers of the hydrodynamic volumes
cmp-vol.
pipe
001-000
001-001
001-002
001-003
001-004
001-005
001-006
001-007
001-008

node-no.
x-end
cev_01
0
0.00000
1
0.360000
2
0.720000
3
1.08000
4
1.44000
5
1.80000
6
2.16000
7
2.52000
8
2.88000

y-end

z-end

0.00000
0.00000
0.00000
0.00000
0.00000
0.00000
0.00000
0.00000
0.00000

0.00000
0.00000
0.00000
0.00000
0.00000
0.00000
0.00000
0.00000
0.00000

1D-coordinate
0.00000
0.360000
0.720000
1.08000
1.44000
1.80000
2.16000
2.52000
2.88000

7-38

............
Summary of initial fluid state data
cmp-vol.

node
no.

pressure
[Pa]

pipe
b.cond.
001-001
001-002
001-003
001-004
001-005
001-006
001-007
001-008
001-009
001-010
001-011
001-012
001-013
001-014

cev_01
1
-1.00000
2
341900.
3
341900.
4
341900.
5
341900.
6
341900.
7
341900.
8
341900.
9
341900.
10
341900.
11
341900.
12
341900.
13
341900.
14
341900.
15
341900.

void frac.
vapor
[ ]

velocity
liquid
[m/s]

velocity
vapor
[m/s]

-1.00000
1.000000E-12
1.000000E-12
1.000000E-12
1.000000E-12
1.000000E-12
1.000000E-12
1.000000E-12
1.000000E-12
1.000000E-12
1.000000E-12
1.000000E-12
1.000000E-12
1.000000E-12
1.000000E-12

3.000000E+08
0.400000
0.400000
0.400000
0.400000
0.400000
0.400000
0.400000
0.400000
0.400000
0.400000
0.400000
0.400000
0.400000
0.400000

3.000000E+08
0.00000
0.00000
0.00000
0.00000
0.00000
0.00000
0.00000
0.00000
0.00000
0.00000
0.00000
0.00000
0.00000
0.00000

spec.int.en.
liquid
[J/kg]

spec.int.en.
vapor
[J/kg]

-1.00000
97670.0
97670.0
97670.0
97670.0
97670.0
97670.0
97670.0
97670.0
97670.0
97670.0
97670.0
97670.0
97670.0
97670.0

-1.00000
2.548079E+06
2.548079E+06
2.548079E+06
2.548079E+06
2.548079E+06
2.548079E+06
2.548079E+06
2.548079E+06
2.548079E+06
2.548079E+06
2.548079E+06
2.548079E+06
2.548079E+06
2.548079E+06

............
N E X T
T I M E
S T E P
EXTENDED OUTPUT: 6 EIGENVALUES
time= 0.2681008124703358
1.00000
1349.34260 -1348.69537
2.00000
1349.34309 -1348.69510
3.00000
1350.56541 -1349.91590
4.00000
1350.56596 -1349.91554
5.00000
1352.11021 -1351.46002
6.00000
1350.74404 -1350.09498
7.00000
1350.74325 -1350.09590
8.00000
1352.36294 -1351.71767
9.00000
1349.78964 -1349.14675
10.00000
1349.78847 -1349.14809
11.00000
1350.42262 -1349.78420
12.00000
1352.03837 -1351.40042
13.00000
1349.89014 -1349.25098
14.00000
1351.58604 -1350.94512
15.00000
1351.04186 -1350.39989

0.32361
0.32400
0.32476
0.32521
0.32509
0.32453
0.32367
0.32264
0.32145
0.32019
0.31921
0.31897
0.31958
0.32046
0.32098

0.00000
0.00000
0.00000
0.00000
0.00000
0.00000
0.00000
0.00000
0.00000
0.00000
0.00000
0.00000
0.00000
0.00000
0.00000

0.32361
0.32400
0.32476
0.32521
0.32510
0.32453
0.32367
0.32264
0.32145
0.32019
0.31921
0.31897
0.31958
0.32046
0.32098

0.00000
0.00000
0.00000
0.00000
0.00000
0.00000
0.00000
0.00000
0.00000
0.00000
0.00000
0.00000
0.00000
0.00000
0.00000

............
EXTENDED OUTPUT
time= 0.2681008124703358
vol.no. strat.factor
qif
2 0 0 0 0 0 0 0 0 single-phase-flow
3 0 0 0 0 0 0 0 0 single-phase-flow
4 0 0 0 0 0 0 0 0 single-phase-flow
5 0 0 0 0 0 0 0 0 single-phase-flow
6 0 0 0 0 0 0 0 0 single-phase-flow
7 0 0 0 0 0 0 0 0 single-phase-flow
8 0 0 0 0 0 0 0 0 single-phase-flow

qig

hif

hig

gamma

Ci

............
90 0 0 0 0 0 0 0 0 single-phase-flow
91 0 0 0 0 0 0 0 0 instantaneous-relaxation-no-output
92
0.00000E+00
0.49974E+01 -0.49960E+01
0.37837E-01
93 0 0 0 0 0 0 0 0 instantaneous-relaxation-no-output
94
0.00000E+00
0.24543E+02 -0.24542E+02
0.18562E+00
95 0 0 0 0 0 0 0 0 instantaneous-relaxation-no-output
96
0.00000E+00
0.24702E+02 -0.24701E+02
0.18666E+00
97 0 0 0 0 0 0 0 0 instantaneous-relaxation-no-output
98
0.00000E+00
0.42991E+00 -0.42846E+00
0.32468E-02
99
0.00000E+00
0.18985E+02 -0.18985E+02
0.14334E+00
100 0 0 0 0 0 0 0 0 single-phase-flow
101 0 0 0 0 0 0 0 0 single-phase-flow

0.10000E+01

-0.64303E-09

0.71510E+04

0.10000E+01

-0.10787E-09

0.28269E+05

0.10000E+01

-0.14302E-09

0.22512E+05

0.10000E+01
0.10000E+01

-0.69069E-09
-0.10639E-09

0.67669E+04
0.28745E+05

1---------1---------1---------1---------1---------1---------1---------1---------1---------1---------1---------1---------1---------1Program WAHALoads

Date: Mon Mar 29 2004


Time: 10:28:55
Case title: simpson test - elastic pipe

MAJOR EDIT printout at transient time =


Total CPU time =

72.7200

cmp-vol.

coordinate
center
[m]

pipe
001-001
001-002
001-003
001-004
001-005
001-006
001-007
001-008
001-009
001-010
001-011
001-012
001-013
001-014
001-015
001-016

node
no.

cev_01
2
0.1800
3
0.5400
4
0.9000
5
1.260
6
1.620
7
1.980
8
2.340
9
2.700
10
3.060
11
3.420
12
3.780
13
4.140
14
4.500
15
4.860
16
5.220
17
5.580

sec

0.268101

sec,

User CPU time =

pressure
[Pa]
3.37218E+05
3.31815E+05
3.27533E+05
3.24143E+05
3.21293E+05
3.18639E+05
3.15947E+05
3.13051E+05
3.09625E+05
3.05300E+05
2.99855E+05
2.93851E+05
2.88414E+05
2.84064E+05
2.80364E+05
2.76953E+05

with last dt =

72.0800

void frac.
vapor
[ ]
0.000000000001
0.000000000001
0.000000000001
0.000000000001
0.000000000001
0.000000000001
0.000000000001
0.000000000001
0.000000000001
0.000000000001
0.000000000001
0.000000000001
0.000000000001
0.000000000001
0.000000000001
0.000000000001

sec

2.128603E-04 sec.

System CPU time = 0.640000

velocity
liquid
[m/s]

velocity
vapor
[m/s]

0.32660
0.32721
0.32735
0.32703
0.32638
0.32556
0.32468
0.32376
0.32288
0.32219
0.32188
0.32232
0.32289
0.32310
0.32305
0.32283

0.32660
0.32721
0.32735
0.32703
0.32638
0.32556
0.32468
0.32376
0.32288
0.32219
0.32188
0.32232
0.32289
0.32310
0.32305
0.32283

............
---------------------------------------------------------%%%%%%%% WAHALOADS-I-Execution completed successfully.

7-39

spec.int.en.
liquid
[J/kg]
97670.
97670.
97670.
97670.
97670.
97670.
97670.
97670.
97670.
97670.
97670.
97670.
97670.
97670.
97670.
97670.

sec

spec.int.en.
vapor
[J/kg]
2.54760E+06
2.54704E+06
2.54658E+06
2.54622E+06
2.54591E+06
2.54562E+06
2.54532E+06
2.54501E+06
2.54462E+06
2.54413E+06
2.54350E+06
2.54279E+06
2.54214E+06
2.54161E+06
2.54115E+06
2.54072E+06

7.13.3 Minor output file results/simpsonel.out


time
***
[s]
0.0000
2.12976E-03
4.04644E-03
6.17536E-03
8.09136E-03
1.00075E-02
1.21364E-02
1.40525E-02
1.61813E-02
1.80973E-02
2.00133E-02
2.21423E-02
2.40584E-02
2.61873E-02
2.81034E-02
3.00194E-02
3.21483E-02
3.40641E-02
3.61929E-02
3.81087E-02
4.00245E-02
4.21532E-02
4.40690E-02
4.61977E-02
4.81135E-02
5.00293E-02
5.21579E-02
5.40737E-02
5.62023E-02
5.81174E-02
6.00269E-02
6.21168E-02
6.41923E-02
6.60518E-02
6.81072E-02
7.01563E-02
7.20022E-02
7.40513E-02
7.61004E-02
7.81495E-02
8.01987E-02
8.20429E-02
8.40920E-02
8.61411E-02
8.81903E-02
9.00345E-02
9.20836E-02
9.41327E-02
9.61913E-02
9.80638E-02
0.10016
0.10207
0.10419
0.10611
0.10803
0.11016
0.11207
0.11420
0.11612
0.11803

pres
001-100
[Pa]
3.41900E+05
8.88378E+05
8.89738E+05
8.89822E+05
8.89549E+05
8.89479E+05
8.89388E+05
8.89125E+05
8.89045E+05
8.88642E+05
8.88533E+05
8.88367E+05
8.88156E+05
8.87980E+05
8.87779E+05
8.87654E+05
8.87448E+05
8.87235E+05
8.87071E+05
8.86941E+05
8.86689E+05
8.86540E+05
8.86412E+05
8.86141E+05
8.85992E+05
8.85774E+05
8.58545E+05
4.80211E+05
31923.
2857.6
2857.5
2857.5
2857.5
2857.5
2857.5
2857.5
2857.5
2857.4
2857.4
2772.6
2724.6
2685.2
2671.5
2696.9
2732.7
2742.3
2759.6
2857.4
2710.5
2834.0
2714.2
2748.5
2839.1
2728.3
2646.3
2767.3
2841.7
2856.6
3448.7
5266.7

void
001-100
[ ]
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00815E-04
2.16519E-04
3.42925E-04
4.68181E-04
5.80338E-04
7.04103E-04
8.27092E-04
9.37707E-04
1.06887E-03
1.19917E-03
1.32391E-03
1.44759E-03
1.55805E-03
1.68026E-03
1.80259E-03
1.92465E-03
2.03513E-03
2.15725E-03
2.27922E-03
2.40096E-03
2.51135E-03
2.63331E-03
2.74577E-03
2.87100E-03
2.98242E-03
3.09450E-03
3.21823E-03
3.32873E-03
3.44980E-03
3.54691E-03
3.65919E-03

vliq
001-100
[m/s]
0.40000
1.81610E-04
1.51783E-05
-8.90152E-06
-4.05801E-05
-3.33714E-07
-4.06173E-06
-2.62161E-05
-3.23762E-05
-1.76905E-06
-1.12055E-05
-4.35723E-06
-1.31967E-05
-1.19348E-06
-2.15671E-05
-8.40434E-06
-1.34628E-05
-9.55728E-06
-6.81283E-06
-1.82261E-05
-8.61392E-06
-1.02654E-06
-1.58180E-05
-6.53616E-06
-5.12909E-06
-3.99801E-05
-5.19759E-03
-3.25917E-02
-1.25528E-02
-1.09727E-02
-1.10967E-02
-1.11232E-02
-1.11577E-02
-1.11935E-02
-1.12443E-02
-1.13047E-02
-1.13660E-02
-1.14142E-02
-1.13444E-02
-1.13121E-02
-1.12488E-02
-1.12440E-02
-1.12160E-02
-1.12143E-02
-1.11114E-02
-1.11237E-02
-1.10732E-02
-1.09861E-02
-1.10359E-02
-1.09673E-02
-1.09482E-02
-1.09937E-02
-1.09178E-02
-1.09560E-02
-1.09568E-02
-1.09518E-02
-1.08772E-02
-1.08214E-02
-8.98561E-03
-3.49451E-03

uliq
001-100
[J/kg]
97670.
97670.
97670.
97670.
97670.
97670.
97670.
97670.
97670.
97670.
97670.
97670.
97670.
97670.
97670.
97670.
97670.
97670.
97670.
97670.
97670.
97670.
97670.
97670.
97670.
97670.
97670.
97670.
97670.
97670.
97670.
97669.
97669.
97669.
97668.
97668.
97668.
97667.
97667.
97667.
97667.
97667.
97667.
97667.
97667.
97667.
97667.
97667.
97667.
97667.
97667.
97667.
97667.
97667.
97667.
97667.
97667.
97667.
97667.
97667.

rliq
001-100
[kg/m3]
997.59
997.84
997.84
997.84
997.84
997.84
997.84
997.84
997.84
997.84
997.84
997.84
997.84
997.84
997.84
997.84
997.84
997.84
997.84
997.84
997.84
997.84
997.84
997.84
997.84
997.84
997.82
997.65
997.45
997.44
997.44
997.44
997.44
997.44
997.44
997.44
997.44
997.44
997.44
997.44
997.44
997.44
997.44
997.44
997.44
997.44
997.44
997.44
997.44
997.44
997.44
997.44
997.44
997.44
997.44
997.44
997.44
997.44
997.44
997.44

tliq
001-100
[K]
296.42
296.43
296.43
296.43
296.43
296.43
296.43
296.43
296.43
296.43
296.43
296.43
296.43
296.43
296.43
296.43
296.43
296.43
296.43
296.43
296.43
296.43
296.43
296.43
296.43
296.43
296.43
296.43
296.42
296.42
296.42
296.42
296.42
296.42
296.42
296.42
296.42
296.42
296.42
296.42
296.42
296.42
296.42
296.42
296.42
296.42
296.42
296.42
296.42
296.42
296.42
296.42
296.42
296.42
296.42
296.42
296.42
296.42
296.42
296.42

pres
001-020
[Pa]
3.41900E+05
3.41900E+05
3.41899E+05
3.41895E+05
3.41894E+05
3.41894E+05
3.41894E+05
3.41894E+05
3.41894E+05
3.41894E+05
3.45755E+05
7.38040E+05
8.63064E+05
8.83704E+05
8.86899E+05
8.85941E+05
6.91248E+05
4.21526E+05
3.58569E+05
3.45977E+05
3.42892E+05
3.42072E+05
3.41940E+05
3.41875E+05
3.41848E+05
3.41909E+05
3.41927E+05
3.41917E+05
3.41870E+05
3.41925E+05
3.41916E+05
3.41858E+05
3.41890E+05
3.41917E+05
3.41891E+05
3.41899E+05
3.41425E+05
3.13912E+05
99296.
14926.
5835.1
4611.0
16415.
1.54876E+05
3.05597E+05
3.32970E+05
3.39676E+05
3.41083E+05
3.41349E+05
3.41435E+05
3.41445E+05
3.41373E+05
3.41405E+05
3.41503E+05
3.41481E+05
3.41395E+05
3.41385E+05
3.41431E+05
3.41325E+05
3.40129E+05

void
001-020
[ ]
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12

vliq
001-020
[m/s]
0.40000
0.39971
0.39946
0.39918
0.39892
0.39867
0.39839
0.39814
0.39786
0.39761
0.39450
0.10533
1.58363E-02
1.42424E-03
-7.82951E-04
-2.37429E-03
-0.14533
-0.33841
-0.38123
-0.38950
-0.39120
-0.39150
-0.39136
-0.39111
-0.39089
-0.39061
-0.39037
-0.39011
-0.38981
-0.38959
-0.38935
-0.38908
-0.38884
-0.38857
-0.38830
-0.38808
-0.38748
-0.36690
-0.20879
-0.14800
-0.14171
-0.14050
-0.13124
-2.90217E-02
8.00521E-02
9.88263E-02
0.10354
0.10460
0.10493
0.10500
0.10505
0.10522
0.10534
0.10543
0.10552
0.10562
0.10575
0.10590
0.10603
0.10693

296.42
296.42
296.42
296.42
296.42
296.42
296.42
296.42
296.42
296.42
296.43
296.43
296.43
296.43
296.43
296.43
296.43
296.43
296.43
296.43
296.43
296.43
296.43
296.43
296.43
296.43
296.43
296.43

2.69474E+05
2.72919E+05
2.65268E+05
2.66333E+05
2.85581E+05
4.51219E+05
6.26370E+05
6.71348E+05
7.02103E+05
7.25285E+05
7.38748E+05
7.50957E+05
7.62720E+05
7.72766E+05
7.70607E+05
7.14853E+05
5.34743E+05
4.44697E+05
3.84711E+05
3.49077E+05
3.30170E+05
3.12586E+05
3.01105E+05
2.95075E+05
2.93020E+05
2.93009E+05
2.96084E+05
3.00968E+05

1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12

0.37342
0.38203
0.39504
0.40228
0.39872
0.28666
0.17098
0.14783
0.13360
0.12913
0.12767
0.12516
0.12852
0.13493
0.13438
9.74055E-02
-2.71112E-02
-8.23226E-02
-0.11269
-0.12700
-0.13271
-0.13717
-0.13951
-0.13998
-0.13936
-0.13805
-0.13534
-0.13210

....................
0.27321
0.27406
0.27512
0.27619
0.27704
0.27810
0.27917
0.28002
0.28108
0.28215
0.28300
0.28407
0.28513
0.28619
0.28705
0.28811
0.28917
0.29003
0.29109
0.29216
0.29301
0.29407
0.29514
0.29620
0.29705
0.29812
0.29918
0.30003

4.88680E+05
4.84461E+05
4.81457E+05
4.80058E+05
4.79982E+05
4.80725E+05
4.83212E+05
4.86739E+05
4.93684E+05
5.04500E+05
5.15824E+05
5.36294E+05
5.65534E+05
5.93732E+05
6.16599E+05
6.44614E+05
6.71971E+05
6.91026E+05
7.10457E+05
7.29571E+05
7.44291E+05
7.61221E+05
7.79106E+05
7.93516E+05
8.03307E+05
8.17255E+05
8.32737E+05
8.45011E+05

1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12
1.00000E-12

-6.13405E-04
-3.75169E-04
-2.24465E-04
-5.03777E-05
1.56075E-05
1.34309E-04
3.33949E-04
4.89062E-04
8.27532E-04
1.16675E-03
1.49701E-03
2.37015E-03
2.75904E-03
2.60154E-03
2.72882E-03
2.53118E-03
2.49316E-03
1.96947E-03
1.74072E-03
1.80972E-03
1.61176E-03
1.57520E-03
1.64219E-03
1.15465E-03
1.14898E-03
1.47362E-03
1.39869E-03
1.47811E-03

97664.
97664.
97664.
97664.
97664.
97664.
97664.
97664.
97664.
97664.
97664.
97664.
97664.
97664.
97664.
97664.
97664.
97664.
97664.
97664.
97664.
97664.
97664.
97664.
97664.
97664.
97664.
97664.

997.66
997.66
997.66
997.66
997.66
997.66
997.66
997.66
997.66
997.67
997.67
997.68
997.69
997.71
997.72
997.73
997.74
997.75
997.76
997.77
997.77
997.78
997.79
997.80
997.80
997.81
997.81
997.82

7-40

7.13.4 Major output file results/simpsonel.036


# Thermodynamic state at time t = 0.1442
center
Pressure
void frac.
Liq.vel.
Vap.vel.
Liq.int.en. Vap.int.en.
Rho liq.
[m]
[MPa]
[ ]
[m/s]
[m/s]
[J/kg]
[J/kg]
[kg/m3]
0.1800
3.3955E+05 0.000000000001 0.5235241
0.5235240
97670.04
2547838.
0.5400
3.3728E+05 0.000000000001 0.5226888
0.5226887
97670.04
2547603.
0.9000
3.3495E+05 0.000000000001 0.5213358
0.5213357
97670.03
2547361.
1.260
3.3251E+05 0.000000000001 0.5196133
0.5196132
97670.03
2547109.
1.620
3.3041E+05 0.000000000001 0.5176313
0.5176312
97670.04
2546887.
1.980
3.2903E+05 0.000000000001 0.5155833
0.5155832
97670.04
2546740.
2.340
3.2764E+05 0.000000000001 0.5140300
0.5140299
97670.04
2546592.
2.700
3.2603E+05 0.000000000001 0.5129461
0.5129460
97670.04
2546420.
3.060
3.2420E+05 0.000000000001 0.5121232
0.5121231
97670.03
2546225.
3.420
3.2177E+05 0.000000000001 0.5117080
0.5117079
97670.04
2545965.
3.780
3.1834E+05 0.000000000001 0.5117992
0.5117991
97670.04
2545588.
4.140
3.1368E+05 0.000000000001 0.5123607
0.5123606
97670.03
2545075.
4.500
3.0848E+05 0.000000000001 0.5126538
0.5126537
97670.03
2544489.
4.860
3.0370E+05 0.000000000001 0.5117780
0.5117779
97670.03
2543948.
5.220
2.9943E+05 0.000000000001 0.5100703
0.5100702
97670.03
2543449.
5.580
2.9622E+05 0.000000000001 0.5083003
0.5083002
97670.03
2543075.
5.940
2.9382E+05 0.000000000001 0.5066448
0.5066447
97670.03
2542790.
6.300
2.9223E+05 0.000000000001 0.5048589
0.5048588
97670.03
2542599.
6.660
2.9173E+05 0.000000000001 0.5024611
0.5024610
97670.03
2542539.
7.020
2.9251E+05 0.000000000001 0.4991367
0.4991366
97670.03
2542633.
7.380
2.9403E+05 0.000000000001 0.4950528
0.4950527
97670.03
2542816.
7.740
2.9381E+05 0.000000000001 0.4917407
0.4917406
97670.03
2542789.
8.100
2.9151E+05 0.000000000001 0.4890064
0.4890063
97670.03
2542513.
8.460
2.8762E+05 0.000000000001 0.4862302
0.4862301
97670.03
2542045.
8.820
2.8242E+05 0.000000000001 0.4832627
0.4832626
97670.03
2541406.
9.180
2.7651E+05 0.000000000001 0.4811483
0.4811482
97670.03
2540668.
9.540
2.6996E+05 0.000000000001 0.4801575
0.4801574
97670.02
2539833.
9.900
2.6289E+05 0.000000000001 0.4799024
0.4799023
97670.02
2538904.
10.26
2.5632E+05 0.000000000001 0.4793293
0.4793292
97670.02
2538019.
10.62
2.5033E+05 0.000000000001 0.4782401
0.4782400
97670.02
2537192.
10.98
2.4458E+05 0.000000000001 0.4765594
0.4765593
97670.02
2536381.
11.34
2.3878E+05 0.000000000001 0.4741040
0.4741039
97670.02
2535546.
11.70
2.3268E+05 0.000000000001 0.4707459
0.4707458
97670.02
2534642.
12.06
2.2692E+05 0.000000000001 0.4671596
0.4671595
97670.05
2533766.
12.42
2.2196E+05 0.000000000001 0.4638254
0.4638253
97670.02
2532996.
12.78
2.1775E+05 0.000000000001 0.4606815
0.4606814
97670.04
2532331.
13.14
2.1447E+05 0.000000000001 0.4572872
0.4572871
97670.02
2531799.
13.50
2.1274E+05 0.000000000001 0.4529132
0.4529131
97670.02
2531518.
13.86
2.1420E+05 0.000000000001 0.4462493
0.4462492
97670.02
2531755.
14.22
2.2214E+05 0.000000000001 0.4347166
0.4347165
97670.02
2533024.
14.58
2.4198E+05 0.000000000001 0.4141287
0.4141286
97670.02
2536007.
14.94
2.8062E+05 0.000000000001 0.3791378
0.3791377
97670.03
2541183.
15.30
3.4438E+05 0.000000000001 0.3250745
0.3250744
97670.03
2548329.
15.66
4.2911E+05 0.000000000001 0.2548534
0.2548533
97670.04
2555952.
16.02
4.9325E+05 0.000000000001 0.1988770
0.1988769
97670.06
2560721.
16.38
5.2982E+05 0.000000000001 0.1622380
0.1622379
97670.06
2563148.
16.74
5.4901E+05 0.000000000001 0.1373565
0.1373564
97670.09
2564343.
17.10
5.5744E+05 0.000000000001 0.1192543
0.1192542
97670.07
2564858.
17.46
5.6056E+05 0.000000000001 0.1055263
0.1055262
97670.09
2565043.
17.82
5.6097E+05 0.000000000001 9.4706797E-02 9.4706697E-02
97670.07
2565067.
18.18
5.5957E+05 0.000000000001 8.5645526E-02 8.5645426E-02
97670.07
2564984.
18.54
5.5690E+05 0.000000000001 7.7783187E-02 7.7783087E-02
97670.07
2564825.
18.90
5.5342E+05 0.000000000001 7.0755683E-02 7.0755583E-02
97670.07
2564612.
19.26
5.4937E+05 0.000000000001 6.4298074E-02 6.4297974E-02
97670.07
2564365.
19.62
5.4484E+05 0.000000000001 5.8169319E-02 5.8169219E-02
97670.07
2564088.
19.98
5.3995E+05 0.000000000001 5.2349322E-02 5.2349222E-02
97670.07
2563784.
20.34
5.3483E+05 0.000000000001 4.6886752E-02 4.6886652E-02
97670.06
2563462.
20.70
5.2958E+05 0.000000000001 4.1798603E-02 4.1798503E-02
97670.06
2563133.
21.06
5.2441E+05 0.000000000001 3.7105146E-02 3.7105046E-02
97670.06
2562799.
21.42
5.1938E+05 0.000000000001 3.2758770E-02 3.2758670E-02
97670.06
2562473.
21.78
5.1455E+05 0.000000000001 2.8703593E-02 2.8703493E-02
97670.06
2562159.
22.14
5.1009E+05 0.000000000001 2.4968340E-02 2.4968240E-02
97670.06
2561861.
22.50
5.0601E+05 0.000000000001 2.1529232E-02 2.1529132E-02
97670.06
2561589.
22.86
5.0233E+05 0.000000000001 1.8368388E-02 1.8368288E-02
97670.06
2561344.
23.22
4.9904E+05 0.000000000001 1.5554497E-02 1.5554397E-02
97670.06
2561119.
23.58
4.9609E+05 0.000000000001 1.3093560E-02 1.3093460E-02
97670.05
2560917.
23.94
4.9348E+05 0.000000000001 1.0971875E-02 1.0971775E-02
97670.05
2560737.
24.30
4.9120E+05 0.000000000001 9.1618950E-03 9.1617950E-03
97670.06
2560580.
24.66
4.8921E+05 0.000000000001 7.6126076E-03 7.6125076E-03
97670.05
2560444.
25.02
4.8751E+05 0.000000000001 6.2868662E-03 6.2867662E-03
97670.06
2560325.
25.38
4.8605E+05 0.000000000001 5.1554726E-03 5.1553726E-03
97670.06
2560222.
25.74
4.8482E+05 0.000000000001 4.1887062E-03 4.1886062E-03
97670.10
2560135.
26.10
4.8380E+05 0.000000000001 3.3760443E-03 3.3759443E-03
97670.05
2560063.
26.46
4.8298E+05 0.000000000001 2.7182313E-03 2.7181313E-03
97670.11
2560005.
26.82
4.8233E+05 0.000000000001 2.2042425E-03 2.2041425E-03
97670.06
2559959.
27.18
4.8183E+05 0.000000000001 1.8056393E-03 1.8055393E-03
97670.06
2559923.
27.54
4.8143E+05 0.000000000001 1.4943827E-03 1.4942827E-03
97670.07
2559895.
27.90
4.8113E+05 0.000000000001 1.2538713E-03 1.2537713E-03
97670.06
2559874.
28.26
4.8090E+05 0.000000000001 1.0687586E-03 1.0686586E-03
97670.08
2559858.
28.62
4.8072E+05 0.000000000001 9.1391500E-04 9.1381500E-04
97670.06
2559845.
28.98
4.8056E+05 0.000000000001 7.6783179E-04 7.6773179E-04
97670.07
2559833.
29.34
4.8038E+05 0.000000000001 6.2697377E-04 6.2687377E-04
97670.07
2559821.
29.70
4.8022E+05 0.000000000001 5.0698502E-04 5.0688502E-04
97670.06
2559809.
30.06
4.8012E+05 0.000000000001 4.2917158E-04 4.2907158E-04
97669.43
2559802.
30.42
4.8008E+05 0.000000000001 3.9440190E-04 3.9430190E-04
97669.18
2559799.
30.78
4.8009E+05 0.000000000001 3.8016831E-04 3.8006831E-04
97670.44
2559800.
31.14
4.8013E+05 0.000000000001 3.6984079E-04 3.6974079E-04
97668.49
2559803.
31.50
4.8020E+05 0.000000000001 3.3777424E-04 3.3767424E-04
97665.42
2559808.
31.86
4.8025E+05 0.000000000001 2.8830132E-04 2.8820132E-04
97664.03
2559812.
32.22
4.8025E+05 0.000000000001 2.3378157E-04 2.3368157E-04
97663.11
2559811.
32.58
4.8021E+05 0.000000000001 1.7793560E-04 1.7783560E-04
97662.56
2559809.
32.94
4.8019E+05 0.000000000001 1.3506045E-04 1.3496045E-04
97662.76
2559807.
33.30
4.8016E+05 0.000000000001 1.0033628E-04 1.0023628E-04
97662.72
2559805.
33.66
4.8013E+05 0.000000000001 7.4332230E-05 7.4232230E-05
97663.73
2559803.
34.02
4.8010E+05 0.000000000001 5.7390896E-05 5.7290896E-05
97665.65
2559801.
34.38
4.8008E+05 0.000000000001 5.0174829E-05 5.0074829E-05
97665.98
2559800.
34.74
4.8008E+05 0.000000000001 4.6515983E-05 4.6415983E-05
97666.87
2559799.
35.10
4.8009E+05 0.000000000001 4.0396380E-05 4.0296380E-05
97667.03
2559800.
35.46
4.8013E+05 0.000000000001 2.6528876E-05 2.6428876E-05
97667.03
2559803.
35.82
4.8016E+05 0.000000000001 6.8806950E-06 6.7806950E-06
97669.83
2559805.
0.000

3.4190E+05

0.000000000001

0.000000

-1.0000000E-07

97670.00

2548079.

Rho vap.
[kg/m3]
997.5918
997.5908
997.5898
997.5887
997.5877
997.5871
997.5865
997.5858
997.5849
997.5838
997.5823
997.5802
997.5779
997.5757
997.5738
997.5724
997.5713
997.5706
997.5704
997.5707
997.5714
997.5713
997.5703
997.5685
997.5662
997.5635
997.5606
997.5574
997.5545
997.5518
997.5492
997.5466
997.5439
997.5413
997.5391
997.5372
997.5357
997.5349
997.5356
997.5391
997.5480
997.5654
997.5940
997.6320
997.6608
997.6772
997.6858
997.6895
997.6909
997.6911
997.6905
997.6893
997.6877
997.6859
997.6839
997.6817
997.6794
997.6770
997.6747
997.6725
997.6703
997.6683
997.6665
997.6648
997.6634
997.6620
997.6609
997.6598
997.6589
997.6582
997.6575
997.6570
997.6565
997.6561
997.6559
997.6556
997.6555
997.6553
997.6552
997.6551
997.6551
997.6550
997.6549
997.6549
997.6549
997.6548
997.6550
997.6552
997.6553
997.6553
997.6553
997.6553
997.6553
997.6552
997.6551
997.6551
997.6550
997.6550
997.6550
997.6549
997.5929

7-41

Temp.liq.
Temp.vap.
Temp.Sat.
[K]
[K]
[K]
1.853914
296.4235
1.842257
296.4235
1.830304
296.4234
1.817830
296.4234
1.807004
296.4233
1.799932
296.4233
1.792816
296.4233
1.784545
296.4233
1.775150
296.4232
1.762667
296.4232
1.745023
296.4231
1.721025
296.4231
1.694264
296.4230
1.669634
296.4229
1.647589
296.4228
1.631038
296.4228
1.618620
296.4227
1.610392
296.4227
1.607794
296.4227
1.611827
296.4227
1.619724
296.4227
1.618550
296.4227
1.606676
296.4227
1.586555
296.4226
1.559643
296.4225
1.529033
296.4224
1.495055
296.4223
1.458313
296.4222
1.424172
296.4221
1.392950
296.4220
1.362944
296.4219
1.332641
296.4218
1.300704
296.4217
1.270550
296.4216
1.244533
296.4215
1.222405
296.4214
1.205135
296.4214
1.196023
296.4213
1.203719
296.4213
1.245469
296.4215
1.349350
296.4218
1.550340
296.4225
1.878636
296.4236
2.310010
296.4250
2.633690
296.4262
2.817373
296.4268
2.913519
296.4271
2.955706
296.4273
2.971303
296.4273
2.973379
296.4273
2.966356
296.4273
2.953013
296.4273
2.935559
296.4272
2.915331
296.4271
2.892615
296.4270
2.868126
296.4270
2.842459
296.4269
2.816178
296.4268
2.790218
296.4267
2.764969
296.4266
2.740764
296.4265
2.718349
296.4264
2.697857
296.4264
2.679378
296.4263
2.662847
296.4263
2.647999
296.4262
2.634844
296.4262
2.623373
296.4261
2.613399
296.4261
2.604809
296.4261
2.597491
296.4260
2.591297
296.4260
2.586156
296.4260
2.582012
296.4260
2.578758
296.4260
2.576211
296.4260
2.574215
296.4260
2.572689
296.4259
2.571547
296.4259
2.570647
296.4259
2.569809
296.4259
2.568918
296.4259
2.568121
296.4259
2.567607
296.4258
2.567413
296.4257
2.567448
296.4260
2.567684
296.4256
2.568013
296.4248
2.568279
296.4245
2.568252
296.4243
2.568089
296.4241
2.567955
296.4242
2.567806
296.4242
2.567649
296.4244
2.567518
296.4249
2.567429
296.4250
2.567414
296.4252
2.567475
296.4252
2.567661
296.4252
2.567826
296.4259
1.865953

296.4235

Area
[m2]
410.9775
410.7419
410.5003
410.2482
410.0268
409.8808
409.7338
409.5629
409.3689
409.1102
408.7378
408.2313
407.6557
407.1237
406.6374
406.2723
405.9950
405.8095
405.7509
405.8419
406.0199
405.9935
405.7257
405.2719
404.6541
403.9436
403.1421
402.2558
401.4158
400.6338
399.8699
399.0857
398.2414
397.4277
396.7137
396.0997
395.6100
395.3516
395.5698
396.7396
399.5188
404.4396
411.4701
419.3408
424.5025
427.2112
428.5704
429.1585
429.3718
429.4002
429.3041
429.1211
428.8777
428.5956
428.2789
427.9331
427.5680
427.1942
426.8185
426.4522
426.1000
425.7683
425.4650
425.1915
424.9428
424.7186
424.5199
424.3467
424.1961
424.0647
423.9520
423.8566
423.7774
423.7135
423.6634
423.6242
423.5934
423.5699
423.5523
423.5384
423.5255
423.5118
423.4995
423.4916
423.4886
423.4892
423.4928
423.4979
423.5020
423.5015
423.4990
423.4970
423.4947
423.4923
423.4902
423.4889
423.4886
423.4896
423.4924
423.4950
411.2193

Mass flow
[kg/s]
410.9775
410.7419
410.5003
410.2482
410.0268
409.8808
409.7338
409.5629
409.3689
409.1102
408.7378
408.2313
407.6557
407.1237
406.6374
406.2723
405.9950
405.8095
405.7509
405.8419
406.0199
405.9935
405.7257
405.2719
404.6541
403.9436
403.1421
402.2558
401.4158
400.6338
399.8699
399.0857
398.2414
397.4277
396.7137
396.0997
395.6100
395.3516
395.5698
396.7396
399.5188
404.4396
411.4701
419.3408
424.5025
427.2112
428.5704
429.1585
429.3718
429.4002
429.3041
429.1211
428.8777
428.5956
428.2789
427.9331
427.5680
427.1942
426.8185
426.4522
426.1000
425.7683
425.4650
425.1915
424.9428
424.7186
424.5199
424.3467
424.1961
424.0647
423.9520
423.8566
423.7774
423.7135
423.6634
423.6242
423.5934
423.5699
423.5523
423.5384
423.5255
423.5118
423.4995
423.4916
423.4886
423.4892
423.4928
423.4979
423.5020
423.5015
423.4990
423.4970
423.4947
423.4923
423.4902
423.4889
423.4886
423.4896
423.4924
423.4950
411.2193

2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04
2.8500000E-04

0.1488451
0.1486074
0.1482226
0.1477327
0.1471690
0.1465867
0.1461450
0.1458367
0.1456026
0.1454844
0.1455101
0.1456695
0.1457525
0.1455031
0.1450173
0.1445139
0.1440431
0.1435352
0.1428535
0.1419084
0.1407474
0.1398057
0.1390282
0.1382387
0.1373947
0.1367932
0.1365111
0.1364381
0.1362748
0.1359647
0.1354866
0.1347881
0.1338331
0.1328131
0.1318649
0.1309709
0.1300057
0.1287621
0.1268676
0.1235893
0.1177373
0.1077912
9.2423336E-02
7.2461222E-02
5.6547348E-02
4.6130415E-02
3.9055998E-02
3.3908936E-02
3.0005560E-02
2.6929117E-02
2.4352602E-02
2.2116984E-02
2.0118742E-02
1.8282546E-02
1.6539859E-02
1.4884969E-02
1.3331715E-02
1.1884929E-02
1.0550377E-02
9.3145191E-03
8.1614659E-03
7.0993847E-03
6.1215131E-03
5.2227659E-03
4.4226732E-03
3.7229400E-03
3.1196698E-03
2.6050296E-03
2.1645140E-03
1.7875609E-03
1.4658679E-03
1.1909842E-03
9.5991778E-04
7.7288015E-04
6.2673650E-04
5.1340078E-04
4.2490052E-04
3.5651543E-04
3.0388198E-04
2.5985502E-04
2.1831891E-04
1.7826850E-04
1.4415189E-04
1.2202706E-04
1.1214094E-04
1.0809387E-04
1.0515745E-04
9.6039931E-05
8.1973220E-05
6.6471528E-05
5.0592744E-05
3.8401976E-05
2.8528792E-05
2.1135013E-05
1.6318051E-05
1.4266294E-05
1.3225968E-05
1.1485971E-05
7.5430002E-06
1.9563993E-06

2.8500000E-04 -5.3179650E-23

7.13.5 Restart file results/restart.002


********************************************************************************
*
WAHALoads restart file at time = 3.001944E-02 sec.
*
*
WARNING: TIME cards not in function, alter before restart calculation !
*
********************************************************************************
title simpson test - elastic pipe
*--------time constants---------------------------------*
beg
end
maj_out
min_out
diff
restart
$time00 0
2.0e-1 4.e-3
2.e-3
0.80
0.01
$time01 0.2
3.0e-1 2.e-3
1.e-3
0.80
0.01
*
fluid
order
abr_model eig_val_out extend_out maj_results
switch 1
2
3
1
1
1
*
ambient_press
force_out
forces 1.e+5
0.001
*-------------minor output
-------------------------------*
pipe
volume
variable
print00
1
100
1
print02
1
100
2
print03
1
100
3
print04
1
100
5
print05
1
100
7
print06
1
100
9
print07
1
20
1
print08
1
20
2
print09
1
20
3
*-------------pipes
-------------------------------*
type
name
comp001ty pipe
cev_01
*
length
elast
thick
rough
w.fr.f p.fr.f h.m.tr. nods
comp001g0 36.0-0
1.2e11
1.588e-3 0.0e0
3
0
0
100
*
area
incl
azim
f_coeff which
comp001g1 2.85e-4 0.
0.0
1.0
30
+
2.85e-4 0.
0.0
1.0
100
*
type
press
alpha_g
velf
velg
uf
ug
wch_nods
comp001s0 agpvu
351996.
1.000000E-12 -0.365102
-0.365102
97670.0
+
agpvu
362060.
1.000000E-12 -0.362745
-0.362745
97670.0
+
agpvu
373176.
1.000000E-12 -0.358763
-0.358763
97670.0
+
agpvu
385932.
1.000000E-12 -0.352886
-0.352886
97670.0
+
agpvu
401019.
1.000000E-12 -0.344843
-0.344844
97670.0
+
agpvu
419406.
1.000000E-12 -0.333960
-0.333960
97670.0
+
agpvu
442068.
1.000000E-12 -0.319462
-0.319462
97670.0
+
agpvu
470672.
1.000000E-12 -0.300457
-0.300457
97670.0
+
agpvu
506969.
1.000000E-12 -0.275674
-0.275674
97670.0
+
agpvu
552864.
1.000000E-12 -0.243537
-0.243537
97670.0
+
agpvu
609905.
1.000000E-12 -0.202808
-0.202808
97670.1
+
agpvu
679504.
1.000000E-12 -0.152461
-0.152461
97670.1
+
agpvu
745485.
1.000000E-12 -0.104516
-0.104516
97670.1
+
agpvu
797197.
1.000000E-12 -6.687524E-02 -6.687534E-02
97670.1
+
agpvu
833847.
1.000000E-12 -4.016622E-02 -4.016632E-02
97670.1
+
agpvu
857635.
1.000000E-12 -2.283180E-02 -2.283190E-02
97670.1
+
agpvu
871832.
1.000000E-12 -1.251197E-02 -1.251207E-02
97670.1
+
agpvu
879778.
1.000000E-12 -6.769593E-03 -6.769693E-03
97670.1
+
agpvu
883914.
1.000000E-12 -3.804099E-03 -3.804199E-03
97670.1
+
agpvu
885941.
1.000000E-12 -2.374294E-03 -2.374394E-03
97670.2
+
agpvu
886887.
1.000000E-12 -1.726705E-03 -1.726805E-03
97670.2
+
agpvu
887305.
1.000000E-12 -1.455676E-03 -1.455776E-03
97670.2
+
agpvu
887475.
1.000000E-12 -1.356773E-03 -1.356873E-03
97670.2
+
agpvu
887538.
1.000000E-12 -1.327087E-03 -1.327187E-03
97670.2
+
agpvu
887567.
1.000000E-12 -1.315276E-03 -1.315376E-03
97670.2
+
agpvu
887591.
1.000000E-12 -1.301036E-03 -1.301136E-03
97670.2

2.549092E+06
2.550073E+06
2.551122E+06
2.552287E+06
2.553615E+06
2.555163E+06
2.556975E+06
2.559123E+06
2.561653E+06
2.564578E+06
2.567851E+06
2.571394E+06
2.574370E+06
2.576485E+06
2.577882E+06
2.578745E+06
2.579248E+06
2.579522E+06
2.579664E+06
2.579734E+06
2.579767E+06
2.579781E+06
2.579787E+06
2.579789E+06
2.579790E+06
2.579791E+06

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

....................
+
agpvu
887620.
1.000000E-12 -2.588630E-04 -2.589630E-04
+
agpvu
887629.
1.000000E-12 -2.460372E-04 -2.461372E-04
+
agpvu
887639.
1.000000E-12 -2.288885E-04 -2.289885E-04
+
agpvu
887645.
1.000000E-12 -2.088693E-04 -2.089693E-04
+
agpvu
887645.
1.000000E-12 -1.858458E-04 -1.859458E-04
+
agpvu
887639.
1.000000E-12 -1.582264E-04 -1.583264E-04
+
agpvu
887628.
1.000000E-12 -1.240782E-04 -1.241782E-04
+
agpvu
887626.
1.000000E-12 -8.902253E-05 -8.912253E-05
+
agpvu
887631.
1.000000E-12 -6.384532E-05 -6.394532E-05
+
agpvu
887638.
1.000000E-12 -4.861237E-05 -4.871237E-05
+
agpvu
887643.
1.000000E-12 -3.892412E-05 -3.902412E-05
+
agpvu
887647.
1.000000E-12 -3.072156E-05 -3.082156E-05
+
agpvu
887651.
1.000000E-12 -2.166924E-05 -2.176924E-05
+
agpvu
887654.
1.000000E-12 -8.404337E-06 -8.504337E-06
*
from
to
comp001c0 002-99
000-00
*------------------------------------------------------*
type
name
comp002ty tank
tank_01
*
length
elast
thick
rough
w.fr.f p.fr.f h.m.tr.
comp002g0 0.0-0
0.0
0.0
0.0e0
0
0
0
*
area
incl
azim
f_coeff which
comp002g1 2.85e-4 0.
0.0
1.0
0
*
type
press
alpha_g
velf
velg
uf
ug
comp002s0 agpvu
3.419e5
0.0
0.0
0.0
97.67e3 0.0
*
from
to
comp002c0 000-00
001-01
***************************************************************
$
end

7-42

97670.2
97670.2
97670.2
97670.2
97670.2
97670.2
97670.2
97670.2
97670.2
97670.2
97670.2
97670.2
97670.2
97670.1

nods
0

wch_nods
0

2.579792E+06 87
2.579792E+06 88
2.579793E+06 89
2.579793E+06 90
2.579793E+06 91
2.579793E+06 92
2.579792E+06 93
2.579792E+06 94
2.579792E+06 95
2.579793E+06 96
2.579793E+06 97
2.579793E+06 98
2.579793E+06 99
2.579793E+06 100

8 WAHA TEST CASES AND RESULTS


This section covers test cases, which were used during the WAHA code development process.
A brief description of each test case with geometry, boundary and initial conditions is given.
Some of the results with comments and figures are added. Titles of the sub-sections in chapter
8 contain also names of the input files. In most of the cases second-order numerical scheme
with MINMOD limiter was used, while in a few cases VanLeer or Superbee limiters were
used too. Conservative-characteristic abrupt area change model was applied in all cases.
Single-phase test cases are presented in Section 8.1. Two-phase test cases, which do not
represent existing two-phase flows, but are important as a test for certain features of
numerical scheme and mathematical models, are presented in Section 8.2. Test cases
representing the two-phase flow experiments are presented in Section 8.3.

8.1 SINGLE-PHASE TEST CASES


Test cases of single-phase liquid, vapor or ideal gas are collected in this section. These cases
were useful to test the non-conservative WAHA code with conservative version of the same
numerical scheme. Most of the cases justify the use of non-conservative scheme.
8.1.1 Ideal gas shock tube - Sod's problem (shockgas.dat)
Description:
This case is ideal gas Riemann problem model with pure single-phase gas. The modelled pipe
has constant diameter and length of 10 meters. Closed ends are taken as boundary condition
on both sides, however the results are compared before the waves reach the closed ends. The
wall friction, the inter-phase friction and the heat and mass transfer correlations are excluded
from the calculation (even if inter-phase exchange is switched on, the results do not change
due to the single-phase nature of the transient). Beside WAHA calculations, calculations with
model with conservative high-resolution shock-capturing scheme with Roe's approximate
Riemann solver were also performed.
Initial conditions:
The experiment starts at time t = 0.0 s, when the membrane, which separates two different
states in the pipe, is ruptured. The initial thermo-dynamical state is defined with three
parameters: pressure, temperature and velocity. Initial conditions are taken from the Sod's
work (1978):
Left: pL=105 Pa, L=1 kg/m3, vL=0 m/s
Right: pR=104 Pa, R =0.125 kg/m3, vR=0 m/s

8-1

Results:
There are four different curves plotted at various times in Figure 8.1-1. The first line shows
initial conditions, all the other curves show the transition of the initial shock wave after the
rupture of the membrane. Our concern in Figure 8.1-1. is behaviour of the shock and
rarefaction wave after the rupture of the membrane while time t < 0.008 s. Comparison with
conservative scheme at time t = 0.0061 s is shown in Figure 8.1-2. The solution obtained with
conservative variables is practically equal to the analytical solutions, which are thus not
shown in Figure 8.1-2. Numerical scheme of WAHA code is non-conservative (see vector of
r
the independent variables ). Non-conservative schemes are known to converge to the wrong
solutions when shocks are present in the flow field. However, in typical single-phase water
hammer transients, these "wrong" solutions are very close to the exact solutions.
According to the results shown in Figure 8.1-2, non-conservative scheme does not seem to
represent a big deficiency for most of the transients with shock waves in the gas phase, as
long as the maximum to minimum pressure ratio is lower than approximately 10.
Nevertheless, tracking of the total system mass and mass flow rates that leave the system is
strongly recommended in WAHA code.

t = 0.00000 s
t = 0.00203 s
t = 0.00388 s
t = 0.00573 s

[kPa]
100

t = 0.00000 s
t = 0.00203 s
t = 0.00388 s
t = 0.00573 s

[m/s]

350
300

80

250

60

200
150

40

100

20

50

0.0

2.0

4.0

6.0

8.0

[m]

10.0

0.0

2.0

4.0

6.0

t = 0.00000 s
t = 0.00203 s
t = 0.00388 s
t = 0.00573 s

[kg/m ]

1.2
1.0
0.8
0.6
0.4
0.2
0.0

0.0

2.0

4.0

6.0

8.0

[m]

10.0

Figure 8.1-1: Pressure, velocity and density profiles at different time.

8-2

8.0

[m]

10.0

WAHA
Conservative

[m/s]

350

WAHA
Conservative

[kPa]

120

300

100

250

80

200

60

150

40

100

20

50
0

0
0.0

2.0

4.0

6.0

8.0

[m]

10.0

0.0

2.0

4.0

6.0

8.0

[m]

10.0

WAHA
Conservative

[kg/m ]

1.2
1.0
0.8
0.6
0.4
0.2
0.0

0.0

2.0

4.0

6.0

8.0

[m]

10.0

Figure 8.1-2: Pressure, velocity and density profiles, comparison of WAHA with conservative
scheme at time t = 0.0061 s.

8.1.2 Shock tube with vapor (shockvap1.dat)


Description:
Shock tube model with initial pressure and temperature jump in single-phase vapor is
modelled. The modelled pipe has constant diameter, total length of 2 meters, and has closed
end as boundary condition on both sides of the system. The wall friction is excluded from the
calculation.
Initial conditions:
The experiment starts at time t = 0.0 s when the membrane which separates two different
states in the pipe is ruptured. The initial thermo-dynamical state is defined with pressure,
temperature, velocity and vapor volume fraction. A discontinuity is present in the pipe at time
t = 0 s at position 1 meter: pressure drop from 200 to 100 bar, and temperature drop from 485
to 452 K. The initial velocity is set to zero and the vapor volume fraction is set to 1.0 (vapor
only).
Results:
There are three different curves in every graph performed at different time in Figure 8.1-3.
The first line shows initial state (condition), all the other curves show the development of the
initial discontinuity after the rupture of the membrane.

8-3

t = 0.0000 s
t = 0.0006 s
t = 0.0012 s

[MPa]
2.1

t = 0.0000 s

[m/s]

t = 0.0006 s

180

t = 0.0012 s

160

1.9

140
120

1.7

100

1.5

80
60

1.3

40

1.1

20

0.9
0.0

0.5

1.0

[m]

1.5

t = 0.0000 s

[kg/m ]

t = 0.0006 s

890

630
620
610
600
590
580
570
560
550
540
530

t = 0.0012 s

885
880
875
870
865
860
855
850
845
0.0

0.0

2.0

0.5

1.0

1.5

[m]

0.5

1.5

[m]

2.0

t = 0.0000 s

[K]

t = 0.0006 s
t = 0.0012 s

0.0

2.0

1.0

0.5

1.0

1.5

[m]

2.0

t = 0.0000 s

[kg/s]

t = 0.0006 s

0.30

t = 0.0012 s

0.25
0.20
0.15
0.10
0.05
0.00
0.0

0.5

1.0

1.5

[m]

2.0

Figure 8.1-3: Pressure, vapor velocity, vapor density, vapor temperature and mass flow rate
profiles at different times.
8.1.3 Shock tube with liquid (shockliq.dat)
Description:
Shock tube pipe with pure single-phase liquid is modelled. The modelled pipe has constant
diameter, length of 10 meters and closed ends as boundary condition on both sides. The wall
friction, the inter-phase friction and the heat and mass transfer correlations are excluded from
the calculation. Beside WAHA calculations, calculations with conservative scheme were also
performed. Such comparison is another test of (non)conservative properties of the WAHA
scheme.
Initial conditions:
The experiment starts at time t = 0.0 s when the membrane which separates two different
states in the pipe is ruptured. The initial thermo-dynamical state is defined with three
parameters: pressure, temperature and velocity. There is a single discontinuity present in the
8-4

pipe at the beginning at position 5 meters: pressure drop from 100 to 1 bar. The initial
velocity is set to zero and initial temperature is set to 300 K.
Results:
There are five different curves in each graph performed at different time. The first line shows
initial conditions, all the other curves show the transition of the initial shock wave after the
rupture of the membrane. We are focused on behaviour of the shocks and rarefaction waves
after the rupture of the membrane while time t < 0.003 s (Figure 8.1-4).
t = 0.00000 s
t = 0.00060 s
t = 0.00145 s
t = 0.00230 s
t = 0.00285 s

[MPa]
10.0

t
t
t
t
t

[m/s]

4.0
3.5

= 0.00000 s
= 0.00060 s
= 0.00145 s
= 0.00230 s
= 0.00285 s

3.0

8.0

2.5
6.0

2.0
1.5

4.0

1.0

2.0

0.5

0.0

0.0
0.0

2.0

4.0

6.0

8.0

[m]

0.0

10.0

2.0

4.0

6.0

8.0

[m]

10.0

Figure 8.1-4: Pressure and velocity profiles at different times.


Comparison with conservative scheme at time t = 0.00285 s is shown in Figure 8.1-5. There
is practically no difference between the non-conservative WAHA code and results of the test
code with conservative variables, despite very strong initial pressure discontinuity. Thus, the
influence of the non-conservation approach is negligible in the case of single-phase liquid
shock waves for all practical pressure drops.
WAHA
Conservative

[MPa]

WAHA
Conservative

[m/s]

3.5

10.0

3.0

8.0

2.5

6.0

2.0
1.5

4.0

1.0
2.0

0.5

0.0

0.0
0.0

2.0

4.0

6.0

8.0

[m]

10.0

0.0

2.0

4.0

6.0

8.0

[m]

10.0

Figure 8.1-5: Pressure and velocity profiles calculated with WAHA and conservative scheme
at time t=0.00285s.

8.1.4 Critical flow of ideal gas in convergent-divergent nozzle (sobagas.dat)


Description:
The file contains model of a single phase critical flow of the ideal gas in the nozzle. The
modelled pipe (nozzle) has variable cross-section (Figure 8.1-6), has length of 3.226 meters
(convergent-divergent part - 3 m) and constant pressure as boundary condition on both sides.
8-5

Geometry and boundary conditions are taken from the book of Anderson (1995). The wall
friction and the heat, mass, and momentum inter-phase transfer correlations are not used in
the calculation. Beside WAHA calculations, calculations with test code using the same
numerical scheme as WAHA code but with conservative variables were performed.
2

7.0

[m ]

6.0
5.0
4.0
3.0
2.0
1.0

[m]

0.0
0.0

0.5

1.0

1.5

2.0

2.5

3.0

Figure 8.1-6: Cross-section area change along the pipe nozzle.


Initial conditions:
Boundary conditions are defined with constant pressure. Pressure on the left side is pL = 1
bar and on the right side is pR = 0.6784 bar. The calculation seeks steady state flow. The
initial velocity is set to zero, initial temperature is set to T = 300 K and initial pressure in the
nozzle is p = 1 bar.
WAHA
Conservative

[kPa]

120

WAHA
Conservative

[m/s]

700
600

100

500

80

400

60

300

40

200

20

100

0
0.0

0.5

1.0

1.5

2.0

2.5

[m]

0
3.0

0.0

0.5

1.0

1.5

2.0

2.5

[m]

3.0

WAHA
Conservative

[kg/s]
246
244
242
240
238
236
234
232
230
228
0.0

0.5

1.0

1.5

2.0

2.5

[m]

3.0

Figure 8.1-7: Steady-state flow in convergent-divergent nozzle: comparison of WAHA and


conservative scheme.

8-6

Results:
Steady state is established after approximately 0.1 s and the pressure, velocity, and mass flow
rate profiles at that time are shown in Figure 8.1-7. Results of the conservative scheme are
practically the same as the analytical solutions of the steady-state problem (0.1% difference in
mass flow rates). The conservative profile of the mass flow rate shows a spike in a single
volume, which lies in the shock wave in the divergent part of the nozzle. This error is due to
the fact that the conservative scheme with discretized nozzle cannot predict the position of the
shock with accuracy greater than the length of a single volume. This error (which probably
should not be called an error) becomes zero only when the shock position is exactly between
the two discrete points.
As seen in Figure 8.1-7, WAHA predicts the correct critical mass flow rate, however, it does
not predict the stationary shock where super-sonic to sub-sonic transition takes place in the
divergent section of the nozzle. The conservation of mass (energy, momentum) is thus not
questionable, as long as there are no stationary shocks in the solutions. As such shocks do not
appear in two-phase critical flows (see test cases on two-phase critical flow), this deficiency
does not seem to present a large limitation.

8.1.5 Development of the hydrostatic pressure field in a vertical pipe - liquid


(gravliq.dat)
Description and initial conditions:
Establishment of the hydrostatic pressure field in two inter-connected vertical pipes with the
total length of 200 meter, constant diameter, and filled with pure liquid. Hydrostatic pressure
field is established due to the gravity. Initial pressure p = 39 bar, velocity v = 0.0 m/s and
temperature T = 284 K are uniform.
Results:
The first graph in Figure 8.1-8 shows pressure history in a point 50 m above the bottom of the
pipe. The second graph represents steady-state pressure distribution. The oscillations are
decreasing toward zero due to the wall friction. After approximately 50 s the velocity is very
close to zero and the hydrostatic pressure profile is established.
[MPa]

[MPa]

5.0

5.0

4.8

4.6

4.6

4.2

4.4
3.8

4.2

3.4

4.0
3.8
0.0

10.0

20.0

30.0

40.0

[s]

3.0
50.0

50

100

150

[m]

200

Figure 8.1-8: History of the pressure in the point 50m below the top of the pipe and steadstate profile of the pressure.
8-7

8.1.6 Development of the hydrostatic pressure field in a vertical pipe - vapor


(gravvap.dat)
Description and initial conditions:
Establishment of the hydrostatic pressure field in two independent vertical pipes of equal
length of 100 meter (i.e. two independent systems in one input file), filled with pure vapor.
Hydrostatic pressure field is being established due to the gravity. Initial pressure p = 0.9 bar,
velocity v = 0.0 m/s and temperature T = 370 K are uniform. The WAHA correlations are
applied.
Results:
First graph in Figure 8.1-9 shows velocity history in the middle of the first pipe. The second
graph shows steady state pressure distribution in both pipes.
[kPa]

[m/s]

0.8

90.75
90.70
90.65
90.60
90.55
90.50
90.45
90.40
90.35
90.30
90.25

0.6
0.4
0.2
0.0
-0.2
-0.4
-0.6
-0.8
-1.0
0.0

1.0

2.0

3.0

4.0

[s]

5.0

50

100

150

[m]

200

Figure 8.1-9: Velocity history in the middle of the pipe and longitudinal steady-state pressure
distribution.
8.1.7 Abrupt area change model - contraction - liquid (abruptliqcont.dat)
Description:
The file contains contraction abrupt area change model with pure liquid phase (geometry in
Figure 8.1-10). The modelled pipe has length of 5 meters, closed end as boundary condition
on both sides (boundary conditions are irrelevant as the results are being taken before the
waves reach the pipe ends) and area change contraction factor A1/A2 = 20, at distance 3
meters from the beginning. The wall friction and momentum losses at the contraction are
excluded. Although the case is not very realistic, such results can be compared with analytical
results derived for the low velocities.
2

0.45

[m ]

0.40
0.35
0.30
0.25
0.20
0.15
0.10
0.05
0.00
0.0

1.0

2.0

3.0

4.0

[m]

5.0

Figure 8.1-10: Cross-section area change along the pipe.


8-8

Initial conditions:
The experiment starts at time t = 0.0 s when the membrane which separates two different
states in the pipe is ruptured. The initial thermo-dynamical state is defined with three
parameters: pressure, temperature and velocity. Initial discontinuity is present at position 2
meters. Pressure drops from 100 to 50 bar and minor temperature drops from 413.2 to 412.7
K (Figure 8.1-11). The initial velocity is set to zero.
Results:
There are three different curves in each graph shown at different times. The first line shows
initial conditions, the second curve at t = 0.0004 s shows the shock wave travelling toward the
contraction, and the third curve shows the behaviour of the transmitted and reflected waves.
Our concern is behaviour of the waves after the rupture of the membrane and after the
entrance into the contraction. Reflected and transmitted waves are clearly seen in both
Figures. Their magnitude is in agreement with equations derived from Joukovsky theory
(Martin, Wiggert, 1996), which predicts the "transmittance" factor:
p // p0
s= /
=
p p0 A1

2 A1
c1

c1
+ A2

(8.1-1)

c2

Where p0 presents initial pressure at the contraction, p/ is pressure of the incident wave, p//
pressure of the transmitted wave, and c1= c2 - sonic velocities, which are equal in the case
shown in Figure 8.1-11. The theoretical pressure p// after the contraction obtained from the
equation is:

A1 = 20 A2

c1 = c2


/
p = 74.9 bar
p0 = 50.0 bar

p // = p0 +

t = 0.00000 s
t = 0.00040 s
t = 0.00100 s

3.5

40 /
p p0 = 97.4 bar .
21

(8.1-2)

WAHA calculates p//WAHA = 97.6 bar.


[MPa]
11.0

//

10.0
9.0

3.0
2.5

8.0

t = 0.00000 s
t = 0.00040 s
t = 0.00100 s

[m/s]

2.0

7.0

1.5

p0

6.0

1.0
0.5

5.0

0.0

4.0
0.0

1.0

2.0

3.0

4.0

[m]

5.0

0.0

1.0

2.0

3.0

Figure 8.1-11: Pressure and velocity profiles at different time.

8-9

4.0

[m]

5.0

8.1.8 Abrupt area change model - expansion - liquid (abruptliqexpa.dat)


Description:
The file contains model of expansion abrupt area change with pure liquid phase (geometry in
Figure 8.1-12). The modelled pipe has length of 5 meters, has closed end as boundary
condition on both sides (boundary conditions are irrelevant as the results are being taken
before the waves reach the pipe ends) and has area change, expansion factor A2/A1 = 20, at
distance 3 meters from the beginning. The wall friction and momentum losses at the
expansion are excluded in order to allow comparison with analytical results.
2

0.45

[m ]

0.40
0.35
0.30
0.25
0.20
0.15
0.10
0.05
0.00
0.0

1.0

2.0

3.0

4.0

[m]

5.0

Figure 8.1-12: Cross-section area change along the pipe.


Initial conditions:
The experiment starts at time t = 0.0 s when the membrane which separates two different
states in the pipe is ruptured. Discontinuity is present in the pipe at the beginning and at
position 2 meters. Pressure drops from 100 to 50 bar and minor temperature drops from 413.4
to 412.9 K (Figure 8.1-13). The initial velocity is set to zero.
Results:
There are three different curves in each graph shown at different times. The first line shows
initial condition, the second curve at t = 0.0004 s shows the shock wave before it reaches the
abrupt area change, and the third curve shows the behaviour of the shock after the entrance
into the expansion. Our concern is behaviour of the shocks after the rupture of the membrane
and after the entrance into the contraction. Reflected and transmitted waves are clearly seen in
both graphs. Their magnitude is in agreement with results obtained with Joukovsky Equation
(8.1-1) - the theoretical value of the transmitted pressure wave p// is:

A2 = 20 A1

c1 = c2


/
p = 74.9 bar
p0 = 50.0 bar

p // = p0 +

2 /
p p0 = 52.37 bar .
21

WAHA calculates p//WAHA = 52.36 bar.

8-10

(8.1-3)

t = 0.0000 s
t = 0.0004 s
t = 0.0010 s

[MPa]
11.0

t = 0.0000 s
t = 0.0004 s
t = 0.0010 s

[m/s]
3.5
3.0

10.0
9.0

2.5

8.0

2.0
1.5

7.0
//

6.0

p0

1.0
0.5

5.0

0.0

4.0
0.0

1.0

2.0

3.0

4.0

[m]

5.0

0.0

1.0

2.0

3.0

4.0

[m]

5.0

Figure 8.1-13: Pressure and velocity profiles at different times.

8.1.9 Abrupt area change model - contraction - vapor (abruptvapcont.dat)


Description:
The file contains contraction abrupt area change model with pure vapor phase (geometry in
Figure 8.1-10). The modelled pipe has length of 5 meters, has closed end as boundary
condition on both sides (boundary conditions are irrelevant) and has area change, contraction
factor A1/A2 = 20, at distance 3 meters from the beginning. The wall friction and momentum
losses are excluded in order to allow comparison with analytical results.
Initial conditions:
The experiment starts at time t = 0.0 s when the membrane which separates two different
states in the pipe is ruptured. Initially a single discontinuity is present in the pipe at position 2
meters. Pressure drops from 100 to 50 bar and minor temperature drops from 413.4 to 412.9
K (Figure 8.1-14). The initial velocity is set to zero.
Results:
There are three different curves in each graph shown at different times. The first line shows
initial conditions, the second curve at t = 0.0008 s shows the shock wave travelling toward the
contraction, and the third curve shows the behaviour of the transmitted and reflected waves.
Our concern is behaviour of the waves after the rupture of the membrane and after the
entrance into the contraction. Reflected and transmitted waves are clearly seen in both
Figures. Results obtained with Joukovsky Equation (8.1-1) gives pressure p// :

A1 = 20 A2

a1 = a2


/
p = 122.1 bar
p0 = 100.0 bar

p // = p0 +

40 /
p p0 = 142.1 bar .
21

(8.1-4)

WAHA calculates p//WAHA = 144.4 bar. Due to the large vapor velocities, the agreement of
WAHA result with the Joukovsky equation prediction is not as good as in the liquid case. The
reason in assumptions used for derivation of Joukovsky equation: fluid velocity is assumed to
be much smaller than the local speed of sound, and the density is assumed to be constant.
8-11

These two effects are responsible for a small pressure jump that exists at the discontinuity
after the reflection of the wave.
t = 0.00000 s
t = 0.00080 s
t = 0.00253 s

[MPa]
16.0

//

15.0

t = 0.00000 s
t = 0.00080 s
t = 0.00253 s

[m/s]

180
160
140

14.0

120

13.0

100
80

12.0

60

p0

11.0

40

10.0

20
0

9.0
0.0

1.0

2.0

3.0

4.0

[m]

5.0

0.0

1.0

2.0

3.0

4.0

[m]

5.0

Figure 8.1-14: Pressure and velocity profiles at different time.

8.1.10 Abrupt area change model - expansion - vapor (abruptvapexpa.dat)


Description:
The file contains expansion abrupt area change model with pure vapor phase (geometry in
Figure 8.1-12). The modelled pipe has length of 5 meters, has closed end as boundary
condition on both sides (boundary conditions are irrelevant) and has area change, expansion
factor A2/A1 = 20, at distance 3 meters from the beginning. The wall friction is excluded in
order to allow comparison with analytical results.
Initial conditions:
The experiment starts at time t = 0.0 s when the membrane, which separates two different
states in the pipe is ruptured. At the beginning there is a discontinuity present in the pipe at
position 2 meters. Pressure drops from 150 to 100 bar and minor temperature drops from
413.4 to 412.9 K (Figure 8.1-15). The initial velocity is set to zero.
Results:
There are three different curves in each graph shown at different times. The first line shows
initial conditions, the second curve at t = 0.0008 s shows the shock wave travelling toward the
contraction, and the third curve shows the behaviour of the transmitted and reflected waves.
Our concern is behaviour of the waves after the rupture of the membrane and after the
entrance into the contraction. Reflected and transmitted waves are clearly seen in both
Figures. Results obtained with Joukovsky Equation (8.1-1) gives pressure p// :

A2 = 20 A1

c1 = c2


/
p = 122.1 bar
p0 = 100.0 bar

p // = p0 +

2 /
p p0 = 102.1 bar .
21

(8.1-5)

WAHA calculates p//W = 102.0 bar. Small pressure jump that exists at the discontinuity after
the reflection of the wave is seen again (see previous section for comment).
8-12

t = 0.00000 s
t = 0.00080 s
t = 0.00252 s

[MPa]
16.0

t = 0.00000 s
t = 0.00080 s
t = 0.00252 s

[m/s]

180
160

15.0

140

14.0

120

13.0

100
80

12.0
//

11.0

60

p0

40

10.0

20
0

9.0
0.0

1.0

2.0

3.0

4.0

[m]

5.0

0.0

1.0

2.0

3.0

Figure 8.1-15: Pressure and velocity profiles at different time.

8-13

4.0

[m]

5.0

8.2 TWO-PHASE TEST CASES

This section contains results of certain two-phase flow test cases, which are important as tests
of the properties of the numerical scheme and some of the mathematical models, but often
present situations, that cannot be realized with experiments.
8.2.1 Two-phase shock tube (sr.dat)
Description:
Part of the results of this section can be reproduced only with modification of the WAHA
source, where the fixed values are chosen for the coefficients Ci, Hif, Hig of the inter-phase
heat, mass, and momentum exchange source terms. Results without relaxation source terms
and with infinitely fast relaxation can be obtained without modification of the WAHA source.
Detailed discussion and more results can be found in Tiselj et. all. (2003).
Initial conditions:
Two-phase shock-tube is Riemann problem for the two-fluid model: a single discontinuity in
1D. Results in Figure 8.2-1 and Figure 8.2-2 are for the following initial conditions:

x < 50 m: p = 15 MPa, = 0.1, vf = vg = 0.0, Tf = Tg = 615.3 K


x > 50 m: p = 10 MPa, = 0.5, vf = vg = 0.0, Tf = Tg = 584.2 K
As can be noticed, the phasic temperatures and phasic velocities on both sides are equal, thus
the initial state can be used as an input for the six-equation WAHA model and also for the
three-equation Homogeneous Equilibrium Model (HEM). HEM results in this section are
obtained with similar numerical scheme as WAHA results, but with conservative variables
("home-made" code).
Results:
Figure 8.2-1 presents a series of five simulations with the two-fluid model (WAHA code) and
one simulation with the HEM model, on a grid with coarse 100 nodes. Results are presented
at time t = 0.081 s. Calculations with two-fluid model were performed with different various
coefficients Ci, Hif, Hig - values of the coefficients are written in each graph of the Figure
8.2-1. Stratification factor was set to S = 0, i.e., the virtual mass term was used in equations,
while the interfacial pressure was zero. It is important to stress that virtual mass presents
significant inter-phase friction, which is present in all simulations. Results present phasic
velocities in the left and phasic temperatures in the right column. No inter-phase exchange
was allowed in the first simulation (Figure 8.2-1 first row) and one can see a significant
difference between the solutions of the two-fluid model and the solutions of the HEM model.
Shocks traveling right and rarefaction waves traveling left are much faster in two-fluid model
than in the HEM model. Discontinuity in the middle of the tube that exists in two-fluid model
solutions does not exist in HEM solutions. Larger coefficients are used in the next simulation
(second row in Figure 8.2-1):
one can see that the phasic velocities are closer now, while the phasic temperatures are still far
away. In the third simulation (third row in Figure 8.2-1) the phasic velocities are quite close,

8-14

Vhem (m/s)

60

Vf

50

Vg
Ci=0
Hif=Hig=0

40

Them (K)

620
615

Tf

Tg

610
605
600
595

30
20

590
585
580

10
0
0

20

40

60

80

100

20

40

60

80

100

620

60
Ci=10^2
Hif=Hig=10^6

50
40

615
610
605

30

600
595

20

590
585

10
0

580

20

40

60

80

100

20

40

60

80

100

620

60
50

Ci=10^4
Hif=Hig=10^7

40
30

615
610
605
600
595
590

20
10

585
580

0
0

20

40

60

80

100

60
50

Ci=10^5
Hif =Hig=10^8

40

20

40

60

80

100

20

40

60

80

100

20

40 (m)

60

80

100

620
615
610
605
600
595
590

30
20
10

585
580

0
0

20

40

60

80

100
620

60
Ci=10^6
Hif=Hig=10^9

50

615
610

40

605

30

600
595

20

590

10

585

580

20

40 (m)

60

80

100

Figure 8.2-1: Phasic velocities vf, vg and phasic temperatures Tf, Tg of two-fluid models
converge toward the values predicted by HEM model, as the inter-phase drag coefficient (Ci)
and heat transfer coefficients (Hif , Hig) are increased. Propagation velocities of two-fluid
model strongly depend on the strength of the relaxation source terms.
8-15

WAHA - HEM
no relaxation

[MPa]
15.5

WAHA - HEM
no relaxation

[VVF]

0.6

14.5

0.5

13.5

0.4

12.5

0.3

11.5

0.2

10.5

0.1

9.5

0.0
0

20

40

60

80

[m]

100

20

40

60

80

[m]

100

Figure 8.2-2: Pressure and vapor volume fraction profiles at t = 0.081 s. Results are obtained
with instantaneous relaxation (HEM - grey line) and without any relaxation (no relaxation black line).
while the close temperatures are still quite different. Here it can be seen that discontinuities of
the two-fluid model become very smeared: instead of the sharp shocks, rarefaction waves and
contact discontinuities, the waves are interlaced. The phasic velocities and temperatures are
very close together in the fourth simulation (fourth rows in Figure 8.2-1) and also close to the
solutions of the HEM model. When the coefficients are increased further (bottom row in
Figure 8.2-1) - a two-fluid model with extremely high inter-phase mass, momentum and
energy transfer is obtained, which is practically equal to the three-equation HEM model.
Results obtained with Ci = 106 and Hif = Hig = 109 are practically the same as results obtained
with infinite values of the coefficients.
The only WAHA results that can be obtained by the user are present in Figure 8.2-2. Pressure
and vapor volume fraction are presented for the two limiting cases:
infinitely fast relaxation (WAHA HEM),
no relaxation.
It can be noticed in the bottom row of Figure 8.2-1 that solution of the WAHA code with very
large values of coefficients (infinite) is more "diffusive" than the HEM solution. This is due to
the non-accuracy of the operator splitting technique (see Section 3.2.1 for additional comments).
Results obtained on refined grid (2500 nodes) show that computations on 100 and 2500 nodes
are practically "grid independent" with the same intermediate states on coarse and fine grids.
8.2.2 Abrupt area change model - contraction - two-phase (abrupt2fcont.dat)
Description:
The file contains contraction abrupt area change model with two-phase mixture (geometry in
Figure 8.1-10). The modelled pipe has length of 5 meters, has closed end as boundary
condition on both sides (boundary conditions are not relevant as the results are taken before
any of the waves reach the end) and has area change (contraction factor A1/A2 = 20) at
distance 3 meters from the beginning. The wall friction is excluded while WAHA basic interphase friction and heat and mass transfer correlations are used.

8-16

Initial conditions:
Experiment starts at time t = 0.0 s when the membrane which separates two different states in
the pipe is ruptured. The initial thermo-dynamical state is defined with four parameters:
pressure, temperature, vapor volume fraction and velocity. Initial discontinuity is at position 2
meters. Pressure drops from 150 to 100 bar, vapor volume fraction () jumps from 0.5 to 0.9,
and temperature drops from 615 to 585 K (Figure 8.2-3). The initial velocity is equal to zero.
t = 0.00000 s
t = 0.00164 s
t = 0.00563 s

[MPa]
16.0

160

15.0

140

14.0

120
100

13.0

80

12.0

60

11.0

40

10.0

20

9.0

0
0.0

620

t = 0.00000 s
t = 0.00164 s
t = 0.00563 s

[m/s]

1.0

2.0

3.0

4.0

[m]

t = 0.00000 s
t = 0.00164 s
t = 0.00563 s

[K]

0.0

5.0

615

1.0

2.0

3.0

4.0

[m]

5.0

t = 0.00000 s
t = 0.00164 s
t = 0.00563 s

[]
1.0
0.9

610
0.8

605
600

0.7

595

0.6

590
0.5

585
580

0.4
0.0

1.0

2.0

3.0

4.0

[m]

5.0

0.0

1.0

2.0

3.0

4.0

[m]

5.0

Figure 8.2-3: Pressure, velocity, temperature and vapor volume fraction profiles at different
time.
Results:
Each graph in Figure 8.2-3 represents profile of the pipe. There are three different curves in
each graph performed at different time. The first line shows initial condition, the second curve
shows the shock wave before the entrance into the contraction, and the third curve shows the
behaviour of the shock after the entrance into the contraction. This results show the existence
of the transmitted and reflected waves, however, this results cannot be verified with analytical
solutions due to the significant inter-phase exchange of mass, momentum and energy, that
modify the shape of the shock waves. Since there is no wall friction in the model and no
momentum losses specified at the abrupt area change, these results cannot be treated as
realistic, however, with inclusion of more realistic momentum losses one can tune the model
of the abrupt area change.

8-17

8.2.3 Abrupt area change model - expansion - two-phase (abrupt2fexpa.dat)


Description:
The file contains expansion abrupt area change model with two-phase mixture (geometry in
Figure 8.1-12). This is similar model like model described in previous section, the only
difference is geometry: instead of contraction there is expansion for the same expansion
factor. The modelled pipe has length of 5 meters, has closed end as boundary condition on
both sides (boundary conditions are not relevant) and has area change (expansion factor A2/A1
= 20) at distance 3 meters from the beginning. The wall friction is excluded while WAHA
basic inter-phase friction and heat and mass transfer correlations are used.
Initial conditions:
The experiment starts at time t = 0.0 s when the membrane which separates two different
states in the pipe is ruptured. The initial thermo-dynamical state is defined with four
parameters: pressure, temperature, vapor volume fraction and velocity. Initial discontinuity is
at position 2 meters. Pressure drops from 150 to 100 bar, vapor volume fraction () jumps
from 0.5 to 0.9, and temperature drops from 615 to 585 K (Figure 8.2-4). The initial velocity
is set equal to zero.
Results:
There are three different curves in each graph performed at different time. Our concern is
behaviour of the shocks after the rupture of the membrane and after the entrance into the
contraction. Existence of the transmitted and reflected waves is seen, however, this results
cannot be verified with analytical solutions. With tuning of the wall friction at the abrupt area
change user can approach to the realistic description of the abrupt area change.
t = 0.00000 s
t = 0.00151 s
t = 0.00724 s

[m/s]

120

15.0

100

14.0

80

13.0

60

12.0

40

11.0

20

10.0

9.0
0.0

620

t = 0.00000 s
t = 0.00151 s
t = 0.00724 s

[MPa]
16.0

1.0

2.0

3.0

4.0

[m]

5.0

t = 0.00000 s
t = 0.00151 s
t = 0.00724 s

[K]

615

0.0

1.0

2.0

3.0

4.0

[m]

5.0

t = 0.00000 s
t = 0.00151 s
t = 0.00724 s

[]
1.0
0.9

610
0.8

605
600

0.7

595

0.6

590
0.5

585
580

0.4
0.0

1.0

2.0

3.0

4.0

[m]

5.0

0.0

1.0

2.0

3.0

4.0

[m]

5.0

Figure 8.2-4: Pressure, velocity, temperature and vapor volume fraction profiles at different
time.
8-18

8.2.4 Separation of liquid and ideal gas (sepliqgas.dat)


Description and initial conditions:
The file describes separation of the liquid and ideal gas in the vertical pipe. The pipe is one
meter long and has two closed ends as boundary condition. Initial vapor volume fraction is
uniform = 0.52, uniform pressure is assumed p = 0.9 bar, velocity v = 0.0 m/s, and
temperature T = 300 K are constant along the pipe. Separation proceeds due to the gravity.
WAHA correlations for ideal gas and equilibrium model are applied.
[kPa]

[VVF]

117.0

1.0
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0.0

116.0
115.0
114.0
113.0
112.0
111.0
110.0
0.0

0.2

0.4

0.6

0.8

[m]

1.0

0.0

0.2

0.4

0.6

0.8

[s]

1.0

Figure 8.2-5: Steady-state pressure and vapor volume fraction distribution after the
separation of liquid and ideal gas mixture.

Results:
Steady state is established after a few seconds as the heavier liquid phase reaches the bottom
and the lighter gas is collected at the top. Graphs in Figure 8.2-5 show the final steady-state
distribution of the pressure and of the vapor volume fraction.

A warning must be mentioned: sensitivity of the transient to the choice of the slope limiter
(see Section 3.2.2 for the meaning of the slope limiter, and Section 6.5 on the parameter that
regulates the slope limiter): separation test does not reach an expected steady-state when VanLeer or Superbee limiters are chosen. Thus it is recommended to use the MINMOD slope
limiter in all the calculations.
8.2.5 Separation of liquid and vapor (sepliqvap.dat)
Description and initial conditions:
The file describes the separation of the liquid and vapor in the vertical pipe. Pipe has length of
one meter and has two closed ends as boundary condition. Initial vapor volume fraction =
0.52, pressure p = 0.9 bar, velocity v = 0.0 m/s, and temperature T = 370 K are constant along
the pipe. Separation proceeds due to the gravity. The WAHA correlations are applied.
Results:
Liquid and vapor are separated in a few seconds. Graphs in Figure 8.2-6 show the final
steady-state distribution of the pressure and of the vapor volume fraction. Warning about the
use of slope limiters is applicable in this section too (see previous section on vapor-ideal gas
separation), while another warning much be mentioned: non-conservation of mass in WAHA
calculation of approx. 2%.

8-19

[VVF]

[kPa]

124

1.0
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0.0

123
122
121
120
119
118
0.0

0.2

0.4

0.6

[m]

0.8

1.0

0.0

0.2

0.4

0.6

0.8

[m]

1.0

Figure 8.2-6: Steady-state pressure and vapor volume fraction distribution after the
separation of liquid and vapor mixture.

8.2.6 Oscillations of the liquid column (utube.dat and ucev.dat)


Description:
These two files contain oscillating water in the U-shaped pipe. The U-shaped pipe is partially
filled with water and ideal gas/vapor. The modelled pipe has constant cross-section and length
of 20 meters. The wall friction is excluded from the calculation, while the basic WAHA interphase friction correlation for thermal equilibrium flow are applied in the first file and basic
WAHA correlation for gas-liquid flow in the second file.
Initial conditions:
The initial conditions are pressure p = 1.0 bar, liquid velocity vl = 2.1 m/s, temperature 373.1
K and slug as can be seen in graph at time t = 0.0 s. The pipe is initially half filled with water
and initial velocity gives disturbance into the system. The gravity descends acceleration until
the flow turns the direction and returns to the initial position with opposite velocity. This is
infinitely repeatable phenomenon due to the absence of the damping.
Results:
The first graph in Figure 8.2-8 shows deformation of the slug due to the initial thermal
instability and due to the transport. It is also comparison between gas-liquid model and vaporliquid model after 30 s of real time. The second and the third graphs show velocity history at
the middle of the pipe (bottom).
initial

[VVF]

gas, t = 30 s
vapor, t = 30 s

1.0
0.8
0.6
0.4
0.2
0.0
0

10

15

[m]

20

Figure 8.2-7: Vapor volume fractions at t = 30 s


8-20

[m/s]

[m/s]

2.5
2.0
1.5
1.0
0.5
0.0
-0.5
-1.0
-1.5
-2.0
-2.5

10

15

20

25

[s]

2.5
2.0
1.5
1.0
0.5
0.0
-0.5
-1.0
-1.5
-2.0
-2.5
30

10

15

20

25

[s]

30

Figure 8.2-8: Vapor (left) and gas (right) velocity history at the bottom of the U-tube.
8.2.7 Water faucet problem (faucet.dat)
Description:
Water Faucet problem was introduced by Ransom (1987) as a test for numerical methods for
the two-fluid models. Problem is non-realistic, and in our opinion not very convenient as a
test for the single-pressure two-fluid model, as the assumption of the equal phasic pressures is
not valid. Complete absence of the inter-phase friction is also rather questionable, thus the
comparison of the results is left to the user. User can run the case and compare WAHA results
with newer results from the literature, for example Evje, Flatten (2003). Note that the interphase friction due to the virtual mass term cannot be excluded from WAHA code, thus
comparison with other two-fluid models without virtual mass term must be done with caution.
8.2.8 Velocity of small surface waves in horizontally stratified flow (surf.dat)
Description:
The described model was developed to check the speed of small surface wave in the
horizontally stratified flow. The modelled horizontal pipe has constant cross-section, has
length of 1.0 meter and closed ends as boundary condition on both sides. Initial wave is
released in the middle of the pipe when membrane breaks at time t = 0.0 s. The wall friction
is excluded from the calculation, while the basic WAHA heat, mass and momentum interphase exchange models are applied.
Initial conditions:
The initial conditions along the pipe are: horizontally stratified liquid-vapor mixture in
thermal and mechanical equilibrium: pressure p = 1.0 bar, velocity v = 0.0 m/s and
temperature T = 373.2 K. Vapor volume fraction at the left side of the membrane (position
0.5 m) is = 0.5 and slightly higher at the right side = 0.501.
Results:
This calculation serves as a test of speed of the small surface waves in horizontally stratified
flow with negligible density of the gas phase. The theoretical speed of the surface waves in
shallow water is

8-21

vt = h g = 0.74m / s

where h presents the liquid depth and g acceleration of gravity. For vapor volume fraction =
0.5, the liquid depth is equal to the pipe radius, which is obtained from the pipe cross-section
A = 0.01 m2 . Rough estimation of the wave speed from WAHA results in Figure 8.2-9, where
the left and the right waves wave passed a distance of 0.37 (0.01) m in 0.5 s, is 0.74 m/s,
which is equal to the theoretical prediction. The applied model of stratified flow thus gives
correct results in the limit of single-phase shallow water equations.
[VVF]

t = 0.0 s

0.5012

t = 0.5 s

0.5010
0.5008
0.5006
0.5004
0.5002
0.5000
0.4998
0.0

0.2

0.4

0.6

0.8

[m]

1.0

Figure 8.2-9: Vapor volume fraction profile of a small surface wave.

8.2.9 Slug propagation (slug.dat)


Description:
The file contains moving slug in horizontal circular pipe, which one can imagine as travelling
of the slug in the infinitely long pipe. The modelled pipe has constant cross-section and length
of 20 meters. The end of the pipe is connected to the beginning of the same pipe. The wall
friction is excluded from the calculation, while only the inter-phase friction and heat transfer
correlations for dispersed flow are applied. Such slug should run infinitely without changing
the shape and velocity.
Initial conditions:
The initial conditions are pressure p = 1.0 bar, temperature T = 373.1 K (saturation
conditions) velocity v = 2.1 m/s and the length of the slug as can be seen in Figure 8.2-10 at
time t = 0.0 s.
Results:
The first Figure 8.2-10 shows deformation of the slug due to the numerical diffusion, which
exists despite the use of the highly compressive Superbee slope limiter. It is important to note
that the pipe is discretized into 46 only. The second graph of Figure 8.2-10 shows history of
the vapor volume fraction at one point in the pipe (the march-past of the slug).

8-22

t = 0.00 s

[VVF]

[VVF]

t = 9.60 s
t = 28.8 s

1.0

1.0

0.8

0.8

0.6

0.6

0.4

0.4

0.2

0.2

0.0
0

10

[m]

15

0.0
0

20

10

15

20

25

[s]

30

Figure 8.2-10: Slug position at three different times and vapor volume fraction time history in
a point in the pipe.

8.2.10 "Dam-break" problem in the horizontal pipe (strat.dat)


Description:
Horizontal stratification dam break problem in a horizontal pipe is modelled. The
modelled pipe has constant cross-section, length of 2.0 meters and closed ends as boundary
condition on both sides. Liquid and gas phase are initially separated with a dam (membrane),
which breaks at time t = 0.0 s. The inter-phase heat and mass transfer are excluded from the
calculation (ideal gas option is applied).
Initial conditions:
The initial conditions along the pipe are constant: pressure p = 1.0 bar, velocity v = 0.0 m/s
and temperature T = 300 K. Vapor volume fraction at the left side of the dam (position 1.0
m) is = 1.0 and at the right side is = 0.0.
Results:
Figure 8.3-2 shows that after the dam break, water in the pipe starts to oscillate - i.e. waves
reflect from the closed ends. The horizontally stratified stagnant state would be achieved after
sufficiently long time, due to the dissipation of the momentum through the wall friction.
[VVF]

[MPa]

0.12

0.9
0.8

0.12

0.7

0.11

0.6
0.5

0.11

0.4

0.10

0.3
0.2

0.10

0.1

0.09
0.0

1.0

2.0

3.0

4.0

[s]

0.0
5.0

8-23

0.0

1.0

2.0

3.0

4.0

[s]

5.0

[m/s]

t = 0.0 s

[VVF]

0.50

1.2

0.40

1.0

0.30

0.8

0.20

0.6

0.10

0.4

0.00

0.2

t = 0.3 s
t = 0.9 s
t = 4.4 s

-0.10

0.0
0.0

1.0

2.0

3.0

4.0

[s]

5.0

0.0

0.5

1.0

1.5

[m]

2.0

Figure 8.2-11: Pressure, vapor volume fraction and liquid velocity history in the middle of the
pipe and vapor volume fraction profiles at different times.

8-24

8.3 MODELS OF TWO-PHASE FLOW EXPERIMENTS

8.3.1 Edwards pipe - discharge of a hot liquid from a horizontal pipe (edwards.dat)
Description:
Edwards pipe (Edwards, O'Brien, 1970) was experiment where the rapid depressurisation of
the hot liquid from the horizontal pipe was observed. Transient is initiate with a break of the
rupture disc on one end of the pipe. The modelled pipe has constant diameter 0.07315 m,
length of 4.097 m and has closed end as boundary condition on one side and constant pressure
at the other side (surrounding air pressure). This transient is realistic and can be met during
the sudden pipe break (LOCA in NPPs). The WAHA correlations are applied.
Initial conditions:
The initial thermo-dynamical state in the pipe is defined with two parameters: pressure p = 70
bar and temperature T = 515 K. The experiment starts at time t = 0.0 s when the rupture disc,
which separates pipe and tank is broken. In WAHA model the pipe is connected to the tank
where the constant pressure of 1 bar is maintained. Cross-section of the break is 12.5%
smaller than the cross-section of the pipe. The initial velocity is set to zero.

There is one warning for the users, who want to trace the critical mass flow rate through the
break: if the flow rate is traced in minor output, the mass flow rate value in the break volume
is not the actual break flow from the system. There are two ways to solve the problem:
1) Mass flow rate can be traced in the volume before the break (currently the mass flow
rates are traced in two points near the break and in the break).
2) A short strongly divergent section of a few nodes can be added behind the break. This
solution is applied in the enclosed file (edwards1.dat), where pipe is extended for
two nodes with increasing cross-sections. In that case the mass flow rate can be traced
also in the critical flow section.
No matter which approach is taken, the user, who will run and compare both cases, will notice
practically negligible differences. Thus, only results of the first case are presented below.
Mass non-conservation of the Edwards pipe calculation is 2.5% (end mass and break flow
mass are subtracted from the initial mass).
Results:
There are several graphs shown in Figure 8.3-1, where the measured quantities are compared
to the WAHA predictions. Pressures are compared in two points: near the closed end of the
pipe and near the break, vapor volume fraction and temperatures are compared in the point 1.5
m from the closed end.

8-25

WAHA
Experiment

[MPa]

7.0
6.0

6.0

5.0

5.0

4.0

4.0

3.0

3.0

2.0

2.0

1.0

1.0

0.0
0.0

0.1

0.2

0.3

0.4

0.5

[s]

0.0
0.6

0.0

[VVF]
550

1.0
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0.0

WAHA
Experiment

[MPa]

7.0

0.1

0.2

0.3

0.4

0.5

[s]

0.6

WAHA - liquid
WAHA - vapor
Experiment

[K]

500
WAHA
Experiment

450
400
350
300

0.0

0.1

0.2

0.3

0.4

0.5

[s]

250
0.0

0.6

0.1

0.2

0.3

0.4

0.5

[s]

0.6

Figure 8.3-1: Histories of pressure near the closed end of the pipe, pressure near the break,
vapor volume fraction 1.5 m from the closed end, and temperatures 1.5 m from the closed
end.

8.3.2 Critical flashing flow in a nozzle - Super Moby Dick experiment (moby.dat)
Description:
Super Moby Dick experiment is two phase critical flashing flow experiment. Steady-state
critical flow conditions were measured in the nozzle. The nozzle has variable cross-section
(Figure 8.3-2). Only dispersed flow correlations are applied in WAHA model. The nozzle is
initially filled with pure liquid at the inlet pressure and zero velocity. The outlet pressure is
lower and initiates the motion of the fluid in the nozzle. Transient is running until the steadystate critical flow is established.
2

[m ]
0.0045
0.0040
0.0035
0.0030
0.0025
0.0020
0.0015
0.0010
0.0005

[m]

0.0000
0.0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

Figure 8.3-2: Area of the pipe cross-section - nozzle

8-26

Results:
The steady state in the nozzle is established between two constant pressure and temperature
boundary conditions. The inlet boundary conditions are p = 80 bar and T = 549.6 K and the
outlet are p = 47 bar and T = 465.5 K. The pressure is decreasing in the convergent section of
the pipe and increasing in the divergent section where fast rise of the vapor volume fraction is
seen too. Measured quantities are pressure and vapor volume fraction profiles, and mass flow
rate. Due to the Homogeneous-Relaxation Model (HRM, see Section 2.2.3.1), that was
developed from the results of the Moby Dick experiment, and is used in WAHA code, the
agreement of the WAHA code with experiments is very good. Measured mass flow rate for
the case shown in Figure 8.3-3 is 16.99 kg/s, while the WAHA predicts 17.38 kg/s. Mass nonconservation along the nozzle (last graph in Figure 8.3-3) is lower than 1.5 %.

9.0

[MPa]

EXPERIMENT

8.0
7.0
6.0
5.0
4.0
3.0
2.0
0.00

0.15

0.30

0.45

0.60

[m/s]

0.75

WAHA

[]

WAHA

[m]

0.90

1.0
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0.0
0.00

EXPERIMENT

0.15

0.30

0.45

0.60

[kg/s]

WAHA

WAHA

17.6

200

0.75 [m] 0.90

EXPERIMENT

17.5
17.4

150

17.3
100

17.2
17.1

50

17.0

0
0.00

16.9
0.15

0.30

0.45

0.60

0.75

[m]

0.90

0.00

0.15

0.30

0.45

0.60

0.75

[m] 0.90

Figure 8.3-3: Pressure, vapor volume fraction, liquid velocity and mass flow rate profiles
(steady state).

8.3.3 Simpson's valve closure induced water hammer experiment (simpsonel.dat)


Description:
Simpson's water hammer test in elastic pipe is defined in the file. Pipe properties in the input
file can be easily modified into the stiff pipe, if 0.0 value is set for elasticity modulus. The
modelled pipe has constant diameter, total length of 36 meters, closed end as boundary
condition on one side, and constant pressure tank at the other side. The wall friction is
included in the calculation and the WAHA heat, mass and momentum transfer correlations are
used.

8-27

Initial conditions:
The initial thermo-dynamical state in the pipe is defined with constant parameters along the
pipe; pressure p = 3.419 bar, temperature T = 296.3 K, velocity v = 0.4 m/s and vapor volume
fraction = 0.0. The experiment starts at time t = 0.0 s when the valve (closed end) is rapidly
closed.
Results:
All graphs in Figure 8.3-4 represent calculated history of the observed parameter. The first
curve is obtained with elastic pipe, the second with stiff pipe and the third is obtained in
elastic pipe with unsteady wall friction taken into account. Experimental data are available for
the pressure history. Results show that the elasticity of the pipe improves the results of the
simulation, however, some differences between the experiment and calculation remain.
elastic
stiff
unsteady friction
experiment

1.2

Pressure [MPa]

1.0

0.8

0.6

0.4

0.2

0.0
0.00

0.05

0.10

0.15

0.20

0.25

0.30

Time [s]

0.012

elastic
stiff
unsteady friction

Vapor volume fraction

0.010

0.008

0.006

0.004

0.002

0.000
0.00

0.05

0.10

0.15

0.20

0.25

0.30

Time [s]

Figure 8.3-4: Pressure and vapor volume fraction histories near the valve. Comparison with
experiment is available for pressure.
8-28

8.3.4 UMSICHT water-hammer experiment (ppp307t.dat)


Description and initial conditions:
Experiments performed at UMSICHT test loop PPP (Pilot Plant Pipework) are described in
the report of Dudlik (2003). Water is pumped from the pressurized vessel through the
approximately 200 m long pipe back to the vessel. Water hammer transient is initiated by the
rapid valve closure. Section of the pipe behind the valve is schematically shown in Figure
8.3-5, which gives the main characteristics, boundary and initial conditions of the WAHA
model of the PPP device. After the valve closure, the decompression wave travels toward the
vessel, cavitation occurs down-stream the valve and a vapor bubble is formed. Cavitation
induced water hammer occurs after the flow direction is reverted, the vapor bubble condenses,
and the liquid water hits the closed valve.

VALVE

PIPELINE

TANK

13
20

20

INITIAL CONDITIONS
T0 = 392.1 K
pVESSEL = 9.92 bar
v0 = 4.009 m/s

24
4
68

30

93

Total number of volumes:

274

Length of one volume:

0.5 m

Total pipeline length:

137 m

GEOMETRY
Diameter D = 108 mm

Figure 8.3-5: Scheme of the UMSICHT PPP loop - section modelled with WAHA code, with
initial conditions of the case 307 for the WAHA code.
Results:
Only one experiment simulated at the UMSICHT PPP loop is described in the present
document. Other experiments, performed at various initial pressures and temperatures, are
analysed elsewhere. It can be seen that WAHA code successfully captures the first pressure
peak, while the vapor volume fraction is slightly under-estimated. Behaviour after the first
pressure peak exhibits too low damping of the WAHA code, which is probably due to the
insufficient wall friction losses in WAHA. WAHA model assumes smooth pipe and neglects
presence of numerous flanges and other components that increase the wall friction losses.
Non-steady wall friction effects might be also important for the more accurate description of
the transient.

8-29

Experiment

[MPa]
7.0

0.9

WAHA

Experiment

[]

WAHA

0.8

6.0

0.7

5.0

0.6

4.0

0.5

3.0

0.4
0.3

2.0

0.2

1.0

0.1

0.0

0.0
0.0

2.0

4.0

6.0

8.0

[m]

10.0

0.0

1.0

2.0

3.0

4.0

[m]

5.0

Figure 8.3-6: Pressure and vapor volume fraction history near the valve: comparison of
WAHA simulation and measurements.
8.3.5 Cold Water Hammer Test Facility (cwhtf.dat, cwhtf1.dat)
Description and initial conditions:
Rossendorf Cold-Water-Hammer-Test-Facility (Altstadt et. al. 2003) is shown schematically
in Figure 8.3-7. The initial liquid level near the closed end of the pipe is regulated while the
valve at the bottom is open. When desired level is achieved, the valve is closed and the air
under the closed end of the pipe is evacuated with the vacuum pump. When the saturation
pressure is reached under the closed end, experiment starts with rapid opening of the valve.
Pressure difference between the tank and the vacuum is pushing the liquid column toward
the closed end and sever water hammer occurs when the liquid hits the end of the pipe.

Different models are used in the WAHA code. The simplest model in the first input file
assumes constant pressure boundary condition instead of the tank (results of this model are
denoted as tank curves in Figure 8.3-8). In the second input file, the tank and the pipe are
modelled as a single pipe with smooth area change between the pipe and the tank (smooth
area change curve in graphs). Saturated vapor is artificially assumed at the top of the tank
instead of the air that is actually present in the experiment, as WAHA does not allow the
simultaneous use of air and vapor in the system. In order to prevent the condensation of the
vapor in the tank and to prevent pressure changes due to the condensation, a top layer of the
liquid in the tank (a few nodes) is assumed to be at the saturation temperature too. Initial
conditions and geometry are shown in Figure 8.3-7 for experiment number 150601.

8-30

CLOSED
END

Vapor vol.
fract.
= 1.0

TANK
LE

Water only
= 0.0

GEOMETRY
Vapor vol. fract. length LE = 0.155 m
Valve position LV = 0.8 m
Total pipe lenght L = 3.3 m
Diameter D = 207 mm

VALVE
p1

INITIAL CONDITIONS
T = ~ 295 K
p1 = 1 bar
p2 = 29 mbar
v = 0.0 m/s

p2
evacuation
pressure

LV

Figure 8.3-7: Scheme of the cold water hammer test facility and initial conditions for the test
number 150601.
The experiment starts at time t = 0.0 s when the valve, which separates two different states in
the pipe is rapidly open. Due to the pressure difference between the tank and the closed end
the liquid column is accelerated into the closed end of the pipe. When liquid water reaches
closed end, very strong water hammer occurs. After that the velocity in the pipe changes the
direction, pressure is decreased near the closed end, the vapor bubble near the closed end is
formed again, and the phenomenon repeats again, but with lower intensity due to the
dissipation.
Results:
Graphs in Figure 8.3-8 shows pressure, velocity and vapor volume fraction () time-history,
all calculated in a point just near the closed end of the pipe. There are comparisons between
results obtained with different WAHA models, which show that the simplified model captures
the phenomena with the same accuracy as the more detailed model. Calculate pressure is
compared to the measured pressure. The calculated pressure peaks are similar and they both
significantly over-predict the measured pressure peaks and under-predict the damping of the
system. The analysis has shown that the probable reason for discrepancy was the presence of
the dissolved air in the water and in the vapor bubble under the closed end of the pipe. Even a
very small fraction of the non-condensable air significantly reduces the sharpness and the
height of the pressure peak. As WAHA does not contain the option for the simultaneous
presence of the non-condensable gas and vapour, the CWHTF experiment cannot be reliably
simulated with WAHA code. However, the limiting cases of the experiment with
assumption of the pure vapor, or with assumption of the pure non-condensable gas can be
analysed with WAHA. One of the conclusions of WAHA simulations is that initial amount of
air in the steam bubble should be known in order to accurately model the transient. Analyses
of other parameters, which are also important for the transient, among them non-steady wall
friction, and fluid-structure interaction, are beyond the scope of the present document and will
be analysed elsewhere.

8-31

experiment
smooth area change
tank

[MPa]
5.0
4.5
4.0
3.5
3.0
2.5
2.0
1.5
1.0
0.5
0.0
0.0

0.1

0.2

0.3

0.4

[s]

smooth area change

[VVF]

tank

1.0
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0.0

0.5

0.0

0.1

0.2

0.3

0.4

[s]

0.5

Figure 8.3-8: Pressure and vapor volume history near the closed end.

8.3.6 Steam condensation induced water hammer at AEKI (kfki.dat)


Description:
Experiment performed in Hungarian Atomic Energy Research Institute (AEKI) is
condensation induced water hammer in the steam-line of the integral experimental device
PMK-2 (Szabados et. al., 2001). Preliminary results of the measurements are available in FZR
report (Prasser et. al., 2003). Simplified scheme of the experiment with boundary conditions
and initial conditions of the test E33 is shown in Figure 8.3-9. Horizontal pipe is initially
filled with the steam. The transient starts when the subcooled water starts to flow into the pipe
with a constant mass flow rate. As the flooding of the horizontal section is slow, stratified
flow regime with counter-current flow exists during the first phase of the transient. Vapor is
condensing on liquid-steam interface, and new vapor is entering the pipe from the steam tank.
As the flooding continues, the interfacial surface is increasing, the integral vapor
condensation rate is increasing, and the vapor velocity is rising until the Kelvin-Helmholtz
instability occurs and interrupts the stratification at the head of the liquid wave and finally the
water slug is formed (a steam bubble is entrapped within the subcooled liquid). The process
becomes very fast after the appearance of the slug: condensation of the entrapped steam
bubble accelerates columns of liquid on both side of the bubble. Strong water hammer
appears when the whole bubble is condensed and two liquid columns collide.
GEOMETRY:
pipe length l = 2.95 m
pipe diameter d = 73 mm
number of volumes N = 59

Steam

...

59

...

55 56 57 58

Steam tank

INITIAL CONDITIONS:
steam temperature Ts = 470 K
liquid temperature Tl = 295 K
liquid velocity vl = 0.242 m/s
pressure p = 14.5 bar

Cold water
injection

Figure 8.3-9: Geometry and initial conditions


8-32

Results:
Calculations made with WAHA3 code show that the simulations are very sensitive to the
interfacial heat and mass transfer correlations and correlation for transition between the
horizontally stratified and dispersed flow, and even to the initial conditions: initial level of the
liquid in the vertical section of the pipe. If the steam condensation is very strong already in
the beginning of the transient, the dispersed flow regime replaces the stratified flow regime,
only some minor slugs and bubbles are formed and the weak pressure peaks of a p ~10 bar
are predicted. If the condensation in the beginning is slower, the stratified flow regime exists
longer, and when it breaks up, the vapor bubble caught by the liquid slug is larger and the
water hammer that occurs is stronger (~100 bar). If stratified flow regime is maintained until
the complete bottom of the horizontal section is flooded, the slug is formed at the steam end
of the pipe and the slug entraps very large steam bubble. In that case the predicted pressure
peak can reach ~200 bar - this case is predicted by WAHA3 for the E33 test and is shown in
Figure 8.3-10. Vapor volume fraction profile shown in Figure 8.3-10 is taken immediately
after the formation of the slug. Collapse of the entrapped bubble and strong pressure increase
appears a few hundredths of the second later. Comparison of the exact timing of the events in
experiment and in WAHA calculation is not possible from the preliminary results. Only the
pressure peaks can be compared: measured pressure peak in E33 case was 17.3 MPa, while
WAHA3 predicts pressure peak of some 16 MPa.

The present WAHA results are preliminary and should be treated with caution. Results show
that the WAHA code can capture the condensation induced water hammer phenomena,
however, the uncertainty of the predictions is certainly much larger than for the water hammer
transients initiated by the valve closure/opening. Main uncertainty is related to the criteria for
the transition from horizontally stratified-to-dispersed flow. Very small changes of the criteria
can produce large differences in the predicted pressure peak. Further improvement of the
models relevant for the slug induced water hammer can be expected in the future versions of
the WAHA code.

[MPa]

[VVF]
1.0
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0.0

18
16
14
12
10
8
6
4
2
0
4.80

4.85

4.90

4.95

5.00

5.05[s]

5.10

0.0

0.5

1.0

1.5

2.0

2.5

Figure 8.3-10: Pressure history and vapor volume fraction profile at t=4.36 s.

8-33

[m]

3.0

8.4 REFERENCES

8-1. J.D. Anderson, Computational Fluid Dynamics, Mc-Graw-Hill, New York, 1995.
8-2. E. Altstadt, H. Carl, R. Weiss, CWHTF data for code validation, WAHALoads
project report, Deliverable D26, revision 0, Forschungszentrum Rossendorf, 2001.
8-3. A. Dudlik, Data Evaluation Report on PPP water hammer tests, cavitation caused
by rapid valve closing, WAHALoads project report, Deliverable D35, Revision
June, 2003, Fraunhofer Institut Umwelt-, Siecherheits-, Energietechnik UMSICHT,
2003.
8-4. A. R. Edwards, T. P. O'Brien, Studies of phenomena connected with the
depressurization of water reactors, Journal of the British Nuclear Energy Society, 9,
125-135, 1970.
8-5. S. Evje, T. Flatten, Hybrid flux-splitting schemes for a common two-fluid model,
Journal of Computational Physics 192 (1), 175-210, 2003.
8-6. C. S. Martin, D. Wiggert, Waterhammer and fluid structure interaction in piping
system, Materials from ASME Professional Development Programs, 1996.
8-7. H. M. Prasser, A. Bttger, J. Zschau, Test report of advanced two-phase flow
instrumentation, WAHALoads project report, Deliverable D12, revision 0,
Forschungszentrum Rossendorf, 2003.
8-8. V. H. Ransom, Numerical benchmark tests, Multiphase Science and Technology 3,
Hemisphere, Washington DC, 1987.
8-9. A. R. Simpson, Large water-hammer pressures for column separation in pipelines,
Journal of Hydraulic Engineering 117 (10), 1310-1316, 1989.
8-10. G.A. Sod, A Survey of several finite difference methods for systems of nonlinear
hyperbolic conservation laws, Journal of Computational Physics, 27, 1-31, 1978.
8-11. L. Szabados, G. Baranyai, A. Guba, Gy. zsl, L. Perneczky, I. Tth, I. Trosztel,
PMK-2 handbook, technical specification of the hungarian integral test facility for
VVER-440/213 safety analysis and steam line water hammer equipment,
WAHALoads report, Deliverable D46, Draft, Atomic Energy Research Institute,
2001.
8-12. I. Tiselj, J. Gale, A. Horvat, I. Parzer, Characteristic and propagation velocities of
the two-fluid models, Proceedings of the 10th International Topical Meeting on
Nuclear Reactor Thermal Hydraulics (NURETH-10), Seoul, Korea, October 5-9,
2003.

8-34

9 DATA AND CODE STRUCTURE


9.1 DATA STRUCTURE

Table 9.1-1 lists the main parameters that define data structure of the WAHA code. These
parameters are defined in "dim.h" file that is included in most of the WAHA subroutines.

Table 9.1-1: Parameters that define data structure of WAHA code.


PARAMETER
nods=10000
nPipe=100
var=6

addVar = 11

DESCRIPTION
Maximal number of all hydrodynamic volumes in WAHA
Maximal number of components in WAHA input
Number of basic variables in each hydrodynamic volume:
1 - p volume pressure
2 - vapor volume fraction
3 - vf liquid phase velocity
4 - vg gas phase velocity
5 - uf liquid phase specific internal energy
6 - ug gas phase specific internal energy
Number of additional variables in each hydrodynamic volume:
7 - f liquid phase density
8 - g gas phase density
9 - Tf liquid phase temperature
10 - Tg gas phase temperature
11 - f / p u derivative of f over p at constant uf
12 - g / p u derivative of g over p at constant ug
13 - f / u f p derivative of f over uf at constant p
14 - g / u g p derivative of g over ug at constant p
15 - f liquid phase viscosity
16 - g gas phase viscosity
17 - unsteady
unsteady wall shear stress
Number of variables related to the geometry of each hydrodynamic volume:
1 - A volume cross-section
2 - inclination of the volume
3 - azimuth
4 - Ff wall friction factor multiplier
5,6,7 - x, y, z - coordinates of the beginning of the hydrodynamic
volume (not center coordinates)
8 - l one-dimensional coordinate of the beginning of the hydrodynamic
volume - measures axial distance of the volume from the beginning of the first
volume of the first defined pipe
Number of source terms for upwind integration:
1 - gravity and wall friction
2 - variable pipe cross-section
Maximal number of "minor edit" variables (for tracing temporal development of various
parameter)

(
(
(
(

geomvar=8

svar=2
outVar=10

)
)

)
)

9-1

9.1.1 Array or RECORDs "pipe"


Each component of the WAHA input: pipe, pump, or tank is represented by one record of the
array "pipe" declared in struct.f file. Each record contains all properties that are common
to all volumes of the component. Record does not contain detailed arrays that describe
properties of each volume of the component, but contains pointers that show position of the
data in two main data arrays: "state" and "geom". Table 9.1-2 describes one element of the
record "pipe" and it's components.
Table 9.1-2: Variables of the "pipe" record defined in WAHA code as
"RECORD /pipe_prop/ pipe( nPipe )"
INTEGER VARS.
pipe(k).i1
pipe(k).i2
pipe(k).bound1
pipe(k).bound2
pipe(k).bound1a
pipe(k).bound2a
pipe(k).cNum
pipe(k).cNods
pipe(k).wallfr

pipe(k).phasefr
pipe(k).heatmasstr
REAL VARS.
pipe(k).l
pipe(k).dx
pipe(k).elast
pipe(k).thick
pipe(k).rough
LOGICAL VARS.
pipe(k).b1

pipe(k).b2

pipe(k).b1a
pipe(k).b2a
CHARACTER
VARIABLES
pipe(k).cType
pipe(k).cName

pointer to the first physical volume of pipe "k" in arrays "state" and "geom"
pointer to the last physical volume of pipe "k"
(for "tank" and "pump": pipe(k).i1= pipe(k).i2)
number of component connected to the beginning of the component "k"
number of component connected to the end of the component "k"
number of another pipe connected to the beginning of the pipe "k" (if branch is
modelled. "tank" and "pump" cannot be connected in branch)
number of another pipe connected to the end of the pipe "k" (if branch is modelled.
"tank" and "pump" cannot be connected in branch)
component number used by user in the input file
number of nodes of the pipe (pipe(k).cNods =0 if component is "tank" or "pump")
wall friction flag
inter-phase friction flag
inter-phase heat&mass transfer
pipe length
length of hydrodynamic volume
elasticity of the pipe
thickness of the pipe wall
wall roughness (for wall friction)
pipe(k).b1=TRUE if beginning of component "k" connected to end of neighbouring
component
pipe(k).b1=FALSE if beginning of component "k" connected to beginning of
neighbouring component
pipe(k).b2=TRUE if end of component "k" connected to beginning of neighbouring
component
pipe(k).b2=FALSE if end of component "k" connected to end of neighbouring
component
same as pipe(k).b1 but for the second connection (if exists)
same as pipe(k).b2 but for the second connection (if exists)
9 other logical variables is used only in input processing phase and are not given
here

component type: pipe, tank, pump


component name given by the user

9-2

9.1.2 Main arrays


Two main arrays that contain complete description of state and geometry for all volumes of
the defined components are:
"state(var+addVar, nods)"
Contains all relevant physical variables for each volume. 17 physical variables (var+addVar=17)
described in
Table 9.1-1 is used in WAHA to describe each volume. 10 among 11 additional variables (addVar=11)
can be derived from 6 basic variables (var=6) and are stored in array "state" in order to reduce the
number of the calls to the water propertiy subroutines. The 11th variable unsteady is stored in "state"
because it contains information from the previous time steps.

"geom(geomVar, nods)"
Contains geometrical properties of each volume. 8 geometrical properties (geomVar=8) used
in WAHA is stored in "geom" and described in
Table 9.1-1. Table 9.1-3 shows the structure of the "state" and "geom" arrays for the
"teeliq.dat" model of the branch given in section 4.5.5. Outline of the piping system described
in "teeliq.dat" model is shown in Fig. (8.1-16). Main parameters related to each defined
component are also given in Table 9.1-3.
Other important arrays:
avr
( var+addVar,nods ),
dvec
( var+svar,nods ),
eig_val
( var,nods ),
eig_vec
( var,var,nods ),
eig_vec_inv( var,var+svar,nods ),
dvec_char ( var,nods ),
lambda1
( var,nods ),
lambda2
( var,nods ),
cn1
( var,nods ),
cn2
( var,nods ),

! average values of "state" variables


! spatial difference of primitive variables
! eigenvalues
! eigenvector matrix
! inverse eigenvector matrix
! spatial difference of characteristic variables
! corrected eigenvalues in positive direction
! corrected eigenvalues in negative direction
! convection contribution in positive direction
! convection contribution in negative direction

9-3

Table 9.1-3: Structure of the "state" and "geometry" arrays for "teeliq.dat" case from
section 4.5.5.
var + addVar = 17
geomVar = 8

state(var + addVar, cNods)


geom(geomVar,cNods)
Variable
1
p

Volume

Component 3
pipe "third"

Component 2
pipe "second"

Component 1
pipe "first"

BC Volume

Physical
volumes

1
A

geom
...
...

8
l
pipe(1).cname = "first"
pipe(1).cnum = 1
pipe(1).cnods = 100
pipe(1).i1 = 2
pipe(1).i2 = 101
(1)
pipe(1).bound1 = 4
pipe(1).b1 = F
pipe(1).b2 = T
pipe(1).bound2 = 2
(2)
(2)
pipe(1).b1a = T
pipe(1).bound1a = 0
pipe(1).bound2a = 3
pipe(1).b2a = T
pipe(2).cname = "second"
pipe(2).cnum = 2
pipe(2).cnods = 30
pipe(2).i1 = 104
pipe(2).i2 = 133
pipe(2).b1 = T
pipe(2).bound1 = 1
(1)
pipe(2).bound2 = 5
pipe(2).b2 = T
pipe(2).b1a = F
pipe(2).bound1a = 3
(2)
(2)
pipe(2).bound2a = 0
pipe(2).b2a = T
pipe(3).cname = "third"
pipe(3).cnum = 6
pipe(3).cnods = 50
pipe(3).i1 = 136
pipe(3).i2 = 185
pipe(3).b1 = T
pipe(3).bound1 = 1
(2)
(2)
pipe(3).b2 = T
pipe(3).bound2 = 0
pipe(3).bound1a = 2
pipe(3).b1a = F
(2)
(2)
pipe(3).bound2a = 0
pipe(3).b2a = T
pipe(4).cname = "tank1"
pipe(4).cnum = 4
(2)
pipe(4).cnods =0
pipe(4).i1 = 187
(3)
pipe(4).i2 = 186
(1)
pipe(4).bound1 = 1
pipe(4).b1 = F
(4)
pipe(4).bound2, b2
(4)
pipe(4).bound1a, bound2a, b1a, b2a
pipe(5).cname = "tank2"
pipe(5).cnum = 4
(2)
pipe(5).cnods =0
pipe(5).i1 = 188
(3)
pipe(5).i2 = 187
(1)
pipe(5).bound1 = 1
pipe(5).b1 = F
(4)
pipe(5).bound2, b2
(4)
pipe(5).bound1a, bound2a, b1a, b2a

100
101
BC Volume 102
BC Volume 103
104
105
Physical
volumes

...

132
133
BC Volume 134
BC Volume 135
136
137
Physical
volumes

...

184
185
BC Volume 186

Component 5
tank "tank2"

188

(4)

16 17

...

187

(2)
(3)

state
...
...

1
2
3

Component 4
tank "tank1"

(1)

Values of b1, b2 are defined but are not relevant when related to pipetank or pipe-pump connection
Value is not defined and not relevant, default value is shown
value pipe(k).i2 is defined but is not relevant for "tank" or "pump"
component
For correct definition of tank and pump: if bound1 <> 0 then bound2 = 0
if bound2 <> 0 then bound1 = 0
bound1a = 0, bound2a = 0

9-4

9.1.3 COMMON blocks


Although most of the data transfer between the subroutines is done with the arguments of the
subroutine calls, a few common blocks is used anyway:
COMMON /switch/ sw( swNo )
Contains 7 "switches" that are used in various subroutines (see "switch" card section in
Chapter 7 for details).
COMMON /timpar/ maxtpar, tintv
Information on "time" cards:
"maxtpar" - number of "time" cards
"tintv" - counter of the "time" cards
COMMON /forcc/ p_env, fo_freq, tout
Information on force calculation:
"p_env" - ambient pressure,
"fo_freq" - time interval for the force calculation and output,
"tout" - time of the next force calculation and output
COMMON /compno/ npc, npt, npp
Used only in input processing and output subroutines
COMMON /case_param/ case_title
Used only in input processing and output subroutines in "io.f" file
Common block with water property tables
subroutine in "fluid_prop.f" file)
COMMON /h2o_t_p / wt(nt),wp(np)
COMMON /liquid_r_u/ wfru(nv,nt,np)
COMMON /vapor_r_u / wgru(nv,nt,np)
COMMON /h2o_2f/
w2f(nv2,ntp2)

(use in subroutines of "wp.f file" and in "hem"


!tables of temperatures and pressures
!table of liquid densities and int.energies
!table of vapor densities and int.energies
!table of saturation properties

Common block related to the CPU measurement subroutines (used only in 5 subroutines of
"cpu.f" file)
COMMON / TKEEP /..........
COMMON / TKEEPC / ...........
COMMON / DIRACC / ...................

9-5

9.2 CODE STRUCTURE


This section contains algorithms of the main sobroutines of the WAHA code and gives a brief
description of the crucial subroutines. A list os less important subroutines is given at the end.
User defined functions are not used in WAHA code.
Algorithm of the "main" program ("main.f" file):
PROGRAM WAHALoads
CALL inputRead(...)

! Do all input processing

CALL wrt_time(...)
CALL wrt_state(...)

! Minor output printing at t=0.0.


! Minor output printing at t=0.0.

DO tintv = 1, maxtpar
DO WHILE (required)

! Loop over all "time" cards


! Loop over all time steps of each "time" card

CALL t_integr(...)

! Calculate fluid state at new time step

IF (required) THEN
CALL wrt_time(...)
CALL wrt_state(...)
CALL wrt_restart(...)
ENDIF

!
!
!
!

Do the output printing.


Minor output
Major output
Restart output

END DO
END DO
END

9.2.1 Input processing subroutines


Subroutine "InputRead" is the main input processing subroutine and is located in "io.f".
"InputRead" tasks:
- loads the water property arrays (call to "initwp")
- reads the input file,
- does the input data consistency check.
Two larger subroutines called by "InputRead" are:
- " readComp"

- Reads the data for one component of the WAHA input.

- " test_connection" - Test the consistency of connections between various components.


Minor subroutines called by "InputRead" are:
- "wrt_indata"
- "title_page"
- "strloc"

- Writes data from input file into the major output file.
- Writes title page in major output file.
- Locates string in line of input file.

9-6

9.2.2 Output subroutines


Main output subroutines located in "io.f" file are:
- "wrt_state" - Writes calculated data into major output file "output" and into separate files
on directory results ("output.xxx"), if required.
- "wrt_restart" - Writes restart files "restart.xxx" on "results" directory if required.
- "wrt_time"

- Writes temporal development of the parameters specified in "print" cards of


the input file into the "minor edit" file "output.out" on results directory.

Extended output is written directly from "t_integr" subroutine (eigenvalues) and from
subroutine "source" and it's lower subroutines (details of inter-phase relaxation).

9.2.3 Subroutine "t_integr"


Subroutine "t_integr" contains solver of the WAHA code. Subroutine calculates values of all
variables at new time step. Main subroutines called by "t_integr":
- "averaging"

- Calculates values of 6 basic variables at volume boundaries - Eq.


(3.2-33).

- "get_addvar"

- Calculates values of 10 additional variables from 6 basic variables


(all except dynamic wall shear stress).

- "eigen"

- Calculates eigenstructure Eq. (3.2-10) and matrix A-1 in Equation


(3.2-9). Algorithm described in section 9.2.4 .

- "source_g_w"

- Calculates vector R F in Eq. (3.2-12) - calls:

- "wallfr_coeff"

- For calculation of steady wall friction coefficients fwf, fwg in


Eqs. (2.3-1) and (2.3-2). Calls subroutines: "dispersed",
"stratified", "trans", colbrook", "minor_loss_c".
r

- "source_a"

- Calculates vector R A in Eq. (3.2-12).

- "eig_inv_source"

- Calculates product L1 R F or product L1 R A used in Eqs. (3.2-30).

- "limiter"

- Calculates limiters k from one of Eqs. (3.2-20)-(3.2.22).

- "eigenvalues_corr" - Calculates factors in Eq. (3.2-19) (corrections of eigenvalues).


- "bbbb"

- Calculates R.H.S of Eqs. (3.2-29) and (3.2-30).

- "mat_vec_mult"

- Calculates all "++" terms or all "--" terms of Eq. (3.2-28).

- "dynamic_wallfr" - Calculate un-steady wall friction shear stress.


- "force"

- Calculate and write forces using Eqs. of Chapter 6. Calls :"onevol".

- "source"

- Integration of relaxation sources with procedure from section 3.2.3.


Algorithm described in section 9.2.5 .

- "junctions"

- Boundary conditions, junctions, and branches (Chapter 4). Algorithm


described in section 9.2.6 .

9-7

Algorithm of the "t_integr" subroutine


SUBROUTINE t_integr(...)
c

CALL struct_vel(...)

! obtain structure velocity - for possible future FSI

DO (for all volume boundaries of all pipes)


CALL averaging(...)
! averaging of basic variables at volume boundaries
CALL get_addvar(...)
! obtain additional variables between the points
calculate average geometrical properties at volume boundaries
CALL eigen( ...)

! calculate eigenstructure at each boundary and


! inverse of matrix in front of temporal derivatives

CALL source_g_w(...)
CALL eig_inv_source(...)

! gravity and wall fric. source term vector

CALL source_a(...)
CALL eig_inv_source(...)

! variable cross-sect. source term

calculate spatial difference of basic variables


calculate spatial difference of characteristic variables.
ENDDO
t_par(tintv,1) = t_par(tintv,1) + t_par(tintv,5)
if required: write extended output - eigenvalues

!increase time

DO (for all volume boundaries of all pipes)


CALL limiter(...)
! calculate slope limiters for eigenval. corrections
CALL eigenvalues_corr(...)
! calculate second order corrections of eigenvalues
CALL bbbb(...)
CALL mat_vec_mult(...)
CALL mat_vec_mult(...)
ENDDO
! if necessary: "cure" negative alpha
DO (for all volumes of all pipes)
gm(i)=...

! remember old mixture momentum for dynamic friction

DO j=1,var
! Calculates basic variables at next time step.
state(j,i) = state(j,i)-dtdx*(cn1(j,i-1)+cn2(j,i))
ENDDO
CALL get_addvar(...)
CALL dynamic_wallfr(...)

! Get values of additional variables.


!calculate dynamic wall friction stress

ENDDO
DO (for all volumes of all pipes)
CALL source(...)
ENDDO

! calculate relaxation source term

CALL junctions(...)

! calculate junction, branch, boundary conditions.

if (required) call force(...)

!calculate and write forces

RETURN
END

9-8

9.2.4 Calculation of eigenvalues - subroutine "eigen"


Subroutine "eigen" calculates eigenstructure of the WAHA equations - Eq. (3.2-10) and
matrix A-1 in Equation (3.2-9). The following subroutines are called by "eigen":
- "pipe_elast"

- Calculates factor K from Eq. (2.1-18) for correction of sonic velocity


due to the pipe elasticity.

- "stratification" - Calculates stratification factor from Eq. (2.2-1) .


- "virtualmass"

- Calculates virtual mass coefficient from Eq. (2.1-25).

- "ainverse"

- Calculates matrix A-1 in Equation (3.2-9).

- "aib"

- Calculates jacobian matrix C = A 1 B of Eq. (3.2-9).

- "lv2n"

- Calculates eigenvalues, eigenvectors, inverse eigenvectors of matrix C


in Eq. (3.2-10) with numerical procedure. "lv2n" calls three subroutines
taken from EISPACK library:

- "rge"

- Finds eigenvalues of the matrix. Calls: ("balanc", "elmhes",


"hqr", "hqr2", "eltran", "balbak", "cdiv".
- "ludcmp", -Computation of inverse matrix (first part).
- "lubksb" - Computation of inverse matrix (second part).
All EISPACK subroutines are stored in "nr.f" file.

Algorithm of subroutine "eigen"


subroutine eigen(...)
call pipe_elast(...)

! correction of sonic velocity due to the pipe elasticity

call stratification(...) ! find stratification factor for virtual mass and interfacial
! pressure calculation
call virtualmass(...)

! virtual mass coefficient

pint=xx*(rfa....

! interfacial pressure term coefficient

call

ainverse(...)

! inverse matrix in front of temporal derivatives

call

aib(...)

! calculate jacobian matrix

call lv2n(...)

! find eigenvalues, eigenvectors, inverse eigenvectors

return
end

9-9

9.2.5 Relaxation source term subroutines - subroutine "source"


Subroutine "source" is the main subroutine for integration of the relaxation source terms
described in Section 3.2.3.
- "flash"

- Starts flashing in single-phase liquid if pressure drops below saturation.

- "condens"

- Starts condensation in single-phase vapor if pressure high enough.

- "relaxall"

- Integrates relaxation source terms as described in Section 3.2.3, see the


"relaxall" algorithm below. Subroutines called by "relaxall" are:

- "getgamaqfg"

- Calculates inter-phase heat fluxes and vapor generation rate:


Eqs. (2.2-40), (2.2-44), (2.2-45). Calls:

- "thetarelax"
- "gethifgstrat"
- "getcei"

- Obtains relaxation time of the HRM model Eq. (2.2-49).


- Obtains volumetric heat transfer coefficients in
stratified flow - Eq. (2.2-62).

- Calculates inter-phase momentum transfer coefficient Ci


described in section 2.2.2. Calls subroutines:
- "getceistrat" (horizontally stratified flow Ci) and
- "getceidisp" (dispersed flow Ci). Subroutine further calls:
- "getceidrp" (droplet flow Ci) and,
- "getceibub" (bubbly flow Ci).

- " relaxterm"

- "relaxairw"

- Calculates relaxation source terms from Eq. (3.2-38) and


multiplies it with inverse of the matrix AT from Eq. (3.2-37).
Calculates Svr in Eq. (3.2-29).

- Integrates relaxation source term for air-liquid mixture. Only inter-phase


friction is currently calculated, while the integration of inter-phase heat
and mass transfer is not available for air-liquid mixture. Calls the same
subroutines as "relaxall", except "getgamaqfg", which should be prepared
(together with correlations) specially for air-liquid mixture.

9-10

Algorithm of subroutine "source"


Subroutine source(...)
if (single phase liquid) call flash(...)
if (flashing appeared) return

! check for flashing first

if (single phase vapor) call condens(...)


if (condensation appeared) return

! check for condensation

if (single phase) return

! relaxation not needed for 1-phase flow

if (negative pressure) then


call hem(...)
return
endif

! negative pressure in 2-phase flow found


! do instantaneous relaxation

if (pressure>p_crit) return

! relaxation not needed for p> 220.55 bar

if ( <10-6 or (1- )<10-8) then


if (gas=vapor) call hem(...)
if (gas=air)
call hemair(...)
return
endif

! flow with small amount of other phase


! use instantaneous relaxation
! use instantaneous relaxation

test all combinations of flags pipe.phasefr and pipe.heatmasstr


if (no relaxations required) then
"do nothing"
else if (instantaneous thermal equilibrium, no interphase friction) then
if (gas=vapor) call hem(...)
! don't do interphase friction relaxation
if (gas=air)
call hemair(...)
! don't do interphase friction relaxation
else if (instantaneous mechanical equilibrium, no heat&mass transfer) then
vf=vg=vmixture
! phasic velocities become equal
else if (instantaneous mechanical and thermal equilibrium) then
if (gas=vapor) call hem(...)
! instantaneous relaxation
if (gas=air)
call hemair(...)
! instantaneous relaxation
else if (no interphase friction and realistic thermal relaxation) then
if (gas=vapor) call relaxall(...)
! do realistic relaxation of H&M transfer
if (gas=air)
stop 'subroutine does not exist'
else if (instantaneous mechanical and realistic thermal relaxation) then
vf=vg=vmixture
if (gas=vapor) call relaxall(...)
! do realistic relaxation of H&M transfer
if (gas=air)
stop 'subroutine does not exist'
else if (realistic interphase friction and no heat&mass transfer) then
if (gas=vapor) call relaxall(...)
! do realistic interphase friction
if (gas=air)
call relaxairw(...)
! do realistic interphase friction
else if (realistic interphase friction and instantaneous thermal relaxation) then
if (gas=vapor) then
call hem(...)
! instantaneous thermal relaxation
call relaxall(...)
! do realistic interphase friction
else if (gas=air) then
call hemair(...)
! instantaneous thermal relaxation
call relaxairw(...)
! do realistic interphase friction
endif
else if (realistic interphase friction and thermal relaxation) then
if (gas=vapor) call relaxall(...)
! do realistic relaxation
if (gas=air)
stop 'subroutine does not exist'
else
stop 'wrong interphase heat and mass transfer flag or momentum transfer flag'
endif
call get_addvar(...)

! calculate additional variables.

return
end

9-11

Algorithm of subroutine "relaxall"


subroutine relaxall(...)
222

258

continue

! time integration loop

vr=vg-vf

! work with relative velocity

call stratification(...)

! find stratification factor

call getgamaqfg(...)

! calculate interphase heat fluxes and vapor generation rate

call getcei(...)

! calculate interphase momentum transfer coefficients

call pipe_elast(...)

! contribution of pipe elasticity to sonic velocity

call relaxterm(...)

! transform relaxation source term with matrix A^-1

dti=min(max(a....

continue
tfn=tf+stf*dti
tgn=tg+stg*dti
pn=p+sp*dti
agn=ag+sag*dti
vrn=vr/(1.d0-dti*svr)
call get2f(...)

!time step reduction loop


!calculate new p,alfa, tf, tg, vr and
!further decrease the time step if necessary

if (dti.lt.1.d-19) then

limit time step of the relaxation source term integration

! find new saturation temperature


stop 'source term time step too small'

if (tf-ts) or (tg-ts) change sign) then


dti=dti/2.d0
!decrease time step
goto 258
!go back to time step reduction loop
endif
tm=tm+dti

! time step is accepted

if (tf and tg very close)


!end relaxation
if (one phase has dissapeared)
!end relaxation
if (too many source term integration steps) stop
if (final time of source integration not reached yet) goto 222

!go to the main loop

if (required) write extended output


return
end

9.2.6 Boundary conditions, junctions, branches - subroutine "junctions"


Subroutine "junctions" calls appropriate subroutine to set values in the "Boundary Condition
volumes" (BC volumes in Table 9.1-3) .The following subroutines are called by "junctions":
-

"closedEnd"
"tankEnd"
"pumpEnd"
"sameDiameter"

- Closed end boundary condition.


- Tank - constant pressure boundary condition.
- Pump - constant velocity boundary condition.
- Junction of two pipes with equal diameters.

- "areaChange"

- Abrupt area change junction. Calls: "functConst", "dfunctConst",


or "functCharc", "dfunctCharc".

- "branch"

- Branch - connection of three pipes. Calls: "branchave",


"areachange".

9-12

Algorithm of subroutine "junctions"


SUBROUTINE junctions(...)
DO (for all boundaries, junctions, and branches)
IF (closed end) CALL closedEnd(...)
IF (tank) CALL tankEnd(...)
IF (pump) CALL pumpEnd(...)
IF (same diameter pipe) CALL sameDiameter( ...)
IF (different diameter pipe ) CALL areaChange(...)
IF (branch) CALL branch(...)
ENDDO
RETURN
END

9.2.7 Subroutines for calculation of water properties


These subroutines are:
- "initwp"
- "getvapor_p_t"
- "getliquid_p_u"
- "getliquidall_p_t"
- "visc"
- "surftension"

- "getvapor_p_u"
- "getvaporall_p_t"
- "getliquid_p_t"
- "get2ft"
- "conductivity"

Water property subroutines above are described in Chapter 5 and are not discussed here. They
are called by several WAHA subroutines. Another two subroutines are related with water
properties and called from several WAHA subroutines:
- "hem"

- Calculates all equilibrium properties (pressure, vapor volume fraction,


specific internal energies) from given mixture density and mixture
specific internal energy. Calls various water property subroutines and
also reads water property data directly form the water property tables.

- "hemair"

- Calculates approximate equilibrium properties from given air-liquid


mixture density and mixture specific internal energy.

9.2.8 CPU measurement subroutines


Subroutines:
- "arrive", "depart", "tput", "tset", "second",
are used for measurements of CPU consumption in various parts of the WAHA code. Output
is given at the end of the general output file "output".
9-13

You might also like