## * Program ALPHATEST (FORTRAN 77)

### * Program ALPHATEST (FORTRAN 77)

****************************************************************************
*
* Nine October 2009
* M. Michael Musatov
* Algorithm and Natural Pattern Engineering Section
* Symmetry Engineering Department
* College of Earth
* The State University
* Los Angeles, California
*
* M.S. thesis
* Advisor. Dr. Walter C. Christie
*
* 009 M.Michael Musatov [http://meami.org]
*
*****************************************************************************
*
* Program ALPHATEST (FORTRAN 77)
*
*****************************************************************************
*
* This program calculates values of the vapor fraction,
* given equilibrium ratios, Ki, and feed mole fractions,
* zi. It may be used to reproduce experimental results of
* equilibrium flashes.
*
* ALPHATEST calls ALPHACOEFF, BUDAN, ALPHAPLOT, and
* ALPHAROOT
*
* ALPHACOEFF calls subroutine SYMFUNCTION
* SYMFUNCTION calls subroutine DETERM and function FACTOR
*
* VARIABLES: alpha = calculated system vapor fraction
* beta = experimental system liquid
fraction
* coefficient = coefficient of alpha
polynomial
* Ki = equilibrium ratio for component i
*
* molefrac =feed mole fraction of
component i
* Ncomp = number of components in feed
* Npress = number of data sets to be
evaluated
* Pi = system pressure, psia
* Ti = system temperature, F
* xalpha = experimental system vapor
fraction
*
* It is formatted to input zi, temperature, pressure, liquid
* mole fraction, and Ki
*
*****************************************************************************

IMPLICIT REAL*8(a-h,o-z)
REAL*8 Ki(500,100),molefrac(0:100)
PARAMETER(Npress= 16.Ncomp= l0)
DIMENSION alpha(500), beta(500), coefficien(0:100),
@ Pi(500), Ti(500), tarray(2), xalpha(500)
*
* Data Input
*

* The number of components (Ncomp) and the number of data sets
* to be run (Npress) are specified as PARAMETERs'

*
* Open and Rewind Input and Output Files
*

OPEN(unit= 1 ,file='indata'status= 'old')
OPEN(unit=-7,file='table',status='unknown')
OPEN(unit=8,file= 'plot',status='unknown')

REWIND(unit= 1)
REWIND(unit=-7)
REWIND(unit=-8)

read(1,*) (molefrac(i), i = 1, Ncomp)
do 1000 j = 1, Npress

read(l,*) (Kij,i), i = 1, Ncomp)
xalpha(j) = 1.d0 - beta(j)

1000 continue
*
* Choose between single or multiple runs
*
write(6,*) 'Evaluate one data set? enter 1'
write(6,*) 'Evaluate one data set? enter 2'

if(numsets .EQ. 1) then
write(6,*) 'Enter number of data set for this run'