Gas Dynamics Library User Guide
User-Defined Gas Laws
114
* outputs: dvdpt: partial derivative of V (molar volume) wrt
* static pressure (scalar, m3/mol/Pa)
*
* inputs: gdptot: total pressure (bar)
* Tabs: temperature (K)
* V: molar volume (m3/mol)
* Tr: reduced temperature (dimensionless)
* Pr: reduced pressure (dimensionless)
* omega: accentric factor (dimensionless)
* ng: number of gas species
* y: mole fraction(dimensionless, vector of length ng)
*
real*8 function gduserdvdpt(gdptot,Tabs,V,Tr,Pr,omega,mui,y,ng)
implicit none
integer ng
real*8 gdptot,Tabs,V,Tr,Pr,omega,mui,y(ng)
real*8 B0, B1, B, Z, dZdPr
COMMON /cio/ iread,iwrite,idiag,iaux,iwarn
INTEGER iread,iwrite,idiag,iaux,iwarn
B0 = 0.083d0-0.422d0/Tr**1.6d0
B1 = 0.139d0-0.172d0/Tr**4.2d0
B = (B0 + omega*B1)
Z = 1.0d0 + B*Pr/Tr
dZdPr = B/Tr
gduserdvdpt = -V*(1.0d0-Pr*dZdPr/Z)/gdPtot
RETURN
end
*
* function gduserdh calculates the enthalpy change H2-H1
*
* output: gduserdh (scalar, J/mol)
*
* input: gdptot1: inlet static presssure (Pa)
* gdptot2: exit static pressure (Pa)
* tabs1: inlet temperature (K)
* tabs2: exit temperature (K)
* omega1: inlet accentric factor
* omega2: exit accentric factor
* tr1: inlet reduced temperature
* tr2: exit reduced tempeture
* y1: inlet mole fractions (vector)
* y2: exit mole fractions (vector)
* pr1: inlet reduced pressure
* pr2: exit reduced pressure
* Tc1: inlet critical temperature
* Tc2: exit critical temperature
* ng: number of constituent gas species
* cgf: composition gradient flag
* 0: inlet and exit have the same composition,
* 1: inlet and exit have different composition)
*
real*8 function gduserdh(gdptot1,gdptot2,tabs1,tabs2,
2 omega1,omega2,tr1,tr2,y1,y2,pr1,pr2,Tc1,Tc2,ng,cgf,mui)
implicit none
integer gdngmax, gdnmumax
parameter(gdngmax=15, gdnmumax=5)
INTEGER ng, nui, i
real*8 Tabs1,Tabs2,y1(ng),y2(ng),tr1,tr2,pr1,pr2
real*8 gdptot1, gdptot2, cgf, mui
real*8 omega1,omega2,Tc1,Tc2