GasFlowMeter/User/AGA10/detail.h

124 lines
4.5 KiB
C
Raw Normal View History

/*************************************************************************
* File : detail.h
* Description: Header file for the 'Detail' class
* See 'detail.cpp' for the implementation.
* Version : ver 1.7 2002.11.17
* Author : W.B. Peterson
*Revisions:
*Copyright (c) 2002 American Gas Association
**************************************************************************/
#ifndef _DETAIL_H #define _DETAIL_H
#include "aga10.h"
class Detail
{
private:
// member data
int iNCC ; // number of components
int aiCID[21] ; // component IDs
//five history variables are used to improve efficiency during repeated calculations double dOldMixID ; // mixture ID from previous calc
double dOldPb ; // Pb from previous calc double dOldTb ; // Tb from previous calc double dOldPf ; // Pf from previous calc double dOldTf ; // Tf from previous calc
//EOS parameters from table 4, column 1
double adAn[58] ; double adUn[58] ;
// characterization parameters from table 5
double dMri[21] ; // molecular weight of ith component
double dEi[21] ; // characteristic energy parameter for ith component double dKi[21] ; // size parameter for ith component - m^3/kg-mol ^1/3 double dGi[21] ; // orientation parameter
double dQi[21] ; // quadrupole parameter double dFi[21] ; // high temperature parameter
double dSi[21] ; // dipole parameter
double dWi[21] ; // association parameter
double dEij[21][21] ; // virial coefficient energy binary interaction parm double dUij[21][21] ; // binary interaction parameter for conformal energy double dKij[21][21] ; // binary interaction parameter for size
double dGij[21][21] ; // binary interaction parameter for orientation
double adTable6Eij[21][21] ; // Table 6 constants double adTable6Uij[21][21] ; // Table 6 constants double adTable6Kij[21][21] ; // Table 6 constants double adTable6Gij[21][21] ; // Table 6 constants
double adTable5Qi[21] ; // table 5 constants double adTable5Fi[21] ; // table 5 constants double adTable5Si[21] ; // table 5 constants double adTable5Wi[21] ; // table 5 constants
double dXi[21] ; // mole fraction of component i
double dPCalc ; // pressure calculated by pdetail()
double dT ; // current temperature
double dP ; // current pressure
double dRhoTP ; // molar density at T & P
double dB ; // 2nd virial coefficient, B
double adBcoef[18] ; // 18 coefficients to calculate B
double adFn[58] ; // function for coefficients of density
double fx[58] ; // modified coefficients used for 3 derivs
double dU ; // mixture energy parameter
double dKp3 ; // mixture size parameter ^3
double dW ; // mixture orientation parameter
double dQp2 ; // mixture quadrupole parameter ^2
double dF ; // high temperature parameter
double dRho ; // molar density
double dRhoL ; // low density used in braket function
double dRhoH ; // high density used in braket function
double dPRhoL ; // low pressure used in braket function double dPRhoH ; // high pressure used in braket function
// private class methods
bool compositionchange(AGA10STRUCT *) ; // compares new composition to old
void table() ; // sets up Table 4 and 6 characterization parms
void paramdl() ; // Table 5 and binary interaction parms
void chardl(AGA10STRUCT *) ; // calculates composition dependent quantities
void bvir() ; // calculates the 2nd virial coefficient
void temp() ; // calculates temperature dependent quantities
void braket(AGA10STRUCT *) ; // brackets density solutions
void pdetail(double) ; // calculates pressure as a function of P and T
void ddetail(AGA10STRUCT *) ; // calculates a density, given pressure & temperature
void relativedensity(AGA10STRUCT *) ; // calculates mass density
protected:
public:
Detail(void) ; // default constructor ~Detail() ; // default destructor
//public functions to support advanced fluid property calculations double zdetail(double) ; // calculates compressibility factor
double dZdT(double) ; // calculates 1st partial derivative of Z wrt T double d2ZdT2(double) ; // calculates 2st partial derivative of Z wrt T double dZdD(double) ; // calculates 1st partial derivative of Z wrt D
//public variables also used for advanced fluid property calculations
double dZ ; // current compressibility
double ddZdT ; // first partial derivative of Z wrt T
double dd2ZdT2 ; // second partial derivative of Z wrt T
double ddZdD ; // first partial derivative of Z wrt molar density
double ddBdT ; // first partial derivative of B wrt T
double dd2BdT2 ; // second partial derivative of B wrt T
// the Run() command launches a full calculation sequence void Run(AGA10STRUCT *) ;
} ;
#endif