?? manual.txt
字號:
USING REFPROP WITH OTHER PROGRAMS
The subroutines are contained in a number of files. The following files
should be compiled and linked with your own main program:
core_anc.for core_bwr.for core_cpp.for core_de.for core_ecs.for
core_feq.for core_mlt.for core_ph0.for core_stn.for flash2.for
flsh_sub.for idealgas.for mix_hmx.for prop_sub.for realgas.for
sat_sub.for setup.for setup2.for trns_ecs.for trns_tcx.for
trns_vis.for trnsp.for utility.for
Any fluids which are used must have a corresponding ".fld" file, e.g.
R134a.fld. The file "HMX.bnc" (containing mixture parameters) must also
be present. It is suggested (but not required) that these be put into a
subdirectory called "fluids" under the directory containing the
subroutines and application program.
The subroutine SETUP must be called to initialize the pure fluid or
mixture components. The call to SETUP will allow the choice of one of
three standard reference states for entropy and enthalpy and will
automatically load the "NIST-recommended" models for the components as
well as mixing rules. The routine SETMOD allows the specification of
other models. The routine SETKTV allows the specification of mixing
rules and parameters. To define another reference state, or to apply one
of the standard states to a mixture of a specified composition, the
subroutine SETREF may be used. These routines should be called only if
the fluids and/or models (or reference state) are changed. The sequence
is:
call SETMOD (optional)
call SETUP (REQUIRED)
call SETKTV (optional)
call SETREF (optional)
Units. The subroutines use the following units for all inputs and outputs:
temperature K
pressure, fugacity kPa
density mol/L
composition mole fraction
quality mole basis (moles vapor/total moles)
enthalpy, internal energy J/mol
Gibbs, Helmholtz free energy J/mol
entropy, heat capacity J/(mol.K)
speed of sound m/s
Joule-Thompson coefficient K/kPa
d(p)/d(rho) kPa.L/mol
d2p)/d(rho)2 kPa.(L/mol)^2
viscosity microPa.s (10^-6 Pa.s)
thermal conductivity W/(m.K)
dipole moment debye
surface tension N/m
Note: The only exceptions to the above are the conversion utilities
XMASS and XMOLE. The interface allows a wide variety of units,
but not the subroutines.
Naming conventions. The variable type of subroutine arguments can
generally be inferred from the first letter of the variable name:
a-g and o-z: double precision
h: double precision (i.e. enthalpy) or character
i-k and m,n: integer
l: logical (within subroutines only, no logicals in
arguments) also used as integer for exponent of FEQ model
The property subroutines are written in ANSI standard Fortran 77 and are
compatible with Fortran 90. We have tested the source code on the
following compilers:
Fortner Research Fortran (Macintosh)
Lahey Fortran77
Lahey Fortran90
Microsoft Fortran 5.1
Microsoft PowerStation Fortran 4.0
DEC Visual Fortran 5.0
We are striving to make these as standard and portable as possible, but
every compiler has its own sensitive points. Please report any compiler
or linker errors or warnings.
Potential pitfalls:
The fluid data files are read using logical unit 12. Use of this unit
in your application program may crash the application program and/or
the subroutines and should be avoided.
The following is a description of the high-level routines that would be
used in stand-alone applications. These routines will give you access
to all features in a model-independent fashion. (There are corresponding
low-level routines for some of these which call specific models. Please
do not incorporate the low-level routines into your applications--if
you do, you may find that future versions may not work the same.)
INITIALIZATION SUBROUTINES
subroutine SETUP (nc,hfiles,hfmix,hrf,ierr,herr)
c
c define models and initialize arrays
c
c A call to this routine is required.
c
c inputs:
c nc--number of components (1 for pure fluid) [integer]
c hfiles--array of file names specifying fluid/mixture components
c [character*255 variable] for each of the nc components;
c e.g., :fluids:R134a.fld (Mac) or fluids\R134a.fld (DOS) or
c [full_path]/fluids/R134a.fld (UNIX)
c hfmix--mixture coefficients [character*255]
c file name containing coefficients for mixture model,
c e.g., :fluids:HMX.bnc
c hrf--reference state for thermodynamic calculations [character*3]
c 'DEF': default reference state as specified in fluid file
c is applied to each pure component
c 'NBP': h,s = 0 at pure component normal boiling point(s)
c 'ASH': h,s = 0 for sat liquid at -40 C (ASHRAE convention)
c 'IIR': h = 200, s = 1.0 for sat liq at 0 C (IIR convention)
c other choices are possible, but these require a separate
c call to SETREF
c outputs:
c ierr--error flag: 0 = successful
c 101 = error in opening file
c 102 = error in file or premature end of file
c -103 = unknown model encountered in file
c 104 = error in setup of model
c 105 = specified model not found
c 111 = error in opening mixture file
c 112 = mixture file of wrong type
c herr--error string (character*255 variable if ierr<>0)
c [fluid parameters, etc. returned via various common blocks]
subroutine SETMOD (nc,htype,hmix,hcomp,ierr,herr)
c
c set model(s) other than the NIST-recommended ('NBS') ones
c
c This subroutine must be called before SETUP; it need not be called
c at all if the default (NIST-recommended) models are desired.
c
c inputs:
c nc--number of components (1 for pure fluid) [integer]
c htype--flag indicating which models are to be set [character*3]
c 'EOS': equation of state for thermodynamic properties
c 'ETA': viscosity
c 'TCX': thermal conductivity
c 'STN': surface tension
c 'NBS': reset all of the above model types and all
c subsidiary component models to 'NBS';
c values of hmix and hcomp are ignored
c hmix--mixture model to use for the property specified in the
c argument htype [character*3];
c this can a pure fluid model if number of components = 1
c 'NBS': use NIST recommendation for specified fluid/mixture
c (valid input for all properties, pure or mix)
c
c some allowable choices for thermodynamic properties:
c pure fluids:
c 'FEQ': Helmholtz free energy model
c 'BWR': pure fluid modified Bennedict-Webb-Rubin (MBWR)
c 'ECS': pure fluid thermo extended corresponding states
c mixture:
c 'HMX': mixture Helmholtz model for thermodynamic properties
c
c some allowable choices for viscosity:
c pure fluids:
c 'ECS': extended corresponding states (all fluids)
c 'VS1': the 'composite' model for R134a, R152a, NH3, etc.
c 'VS2': Younglove-Ely model for hydrocarbons
c mixture:
c 'ECS': extended corresponding states
c
c some allowable choices for thermal conductivity:
c pure fluids:
c 'ECS': extended corresponding states (all fluids)
c 'TC1': the 'composite' model for R134a, R152a, etc.
c 'TC2': Younglove-Ely model for hydrocarbons
c mixture:
c 'ECS': extended corresponding states
c
c some allowable choices for surface tension:
c pure fluids:
c 'ST1': surface tension as f(tau); tau = 1 - T/Tc
c mixture:
c 'STX': surface tension mixture model
c
c hcomp--component model(s) to use for property specified in htype
c [array (1..nc) of character*3]
c 'NBS': NIST recommendation for specified fluid/mixture
c (valid input for all properties, pure or mix)
c other choices are identical to the pure fluid
c choices listed above
c outputs:
c ierr--error flag: 0 = successful
c no errors are returned from this routine,
c ierr and herr included to maintain parallel
c structure and for possible future use
c herr--error string (character*255 variable if ierr<>0)
c [fluid parameters, etc. returned via various common blocks]
subroutine SETKTV (icomp,jcomp,hmodij,fij,hfmix,ierr,herr)
c
c set mixture model and/or parameters
c
c This subroutine must be called after SETUP, but before any call to
c SETREF; it need not be called at all if the default mixture
c parameters (those read in by SETUP) are to be used.
c
c inputs:
c icomp--component i
c jcomp--component j
c hmodij--mixing rule for the binary pair i,j [character*3]
c e.g. 'LJ1' (Lemmon-Jacobsen model) or
c 'LIN' (linear mixing rules)
c 'LM1' (modified Lemmon-Jacobson model)
c 'RST' indicates reset all pairs to values from
c original call to SETUP (i.e. those read from file)
c [all other inputs are ignored]
c fij--binary mixture parameters [array of dimension nmxpar;
c currently nmxpar is set to 6]
c the parameters will vary depending on hmodij;
c for example, for the Lemmon-Jacobsen model (LJ1):
c fij(1) = zeta
c fij(2) = xi
c fij(3) = Fpq
c fij(4) = beta
c fij(5) = gamma
c fij(6) = 'not used'
c hfmix--file name [character*80] containing generalized parameters
c for the binary mixture model; this will usually be the same
c as the corresponding input to SETUP (e.g.,':fluids:HMX.bnc')
c outputs:
c ierr--error flag: 0 = successful
c 111 = error in opening mixture file
c 112 = mixture file of wrong type
c -113 = illegal i,j specification
c (i = j or i > nc or j > nc)
c herr--error string (character*255 variable if ierr<>0)
c [mixture parameters returned via various common blocks]
subroutine SETREF (hrf,ixflag,x0,h0,s0,t0,p0,ierr,herr)
c
c set reference state enthalpy and entropy
c
c This subroutine must be called after SETUP; it need not be called at
c all if the reference state specified in the call to SETUP is to be
c used.
c
c inputs:
c hrf--reference state for thermodynamic calculations [character*3]
c 'NBP': h,s = 0 at normal boiling point(s)
c 'ASH': h,s = 0 for sat liquid at -40 C (ASHRAE convention)
c 'IIR': h = 200, s = 1.0 for sat liq at 0 C (IIR convention)
c 'DEF': default reference state as specified in fluid file
c is applied to each component (ixflag = 1 is used)
c 'OTH': other, as specified by h0, s0, t0, p0
c ixflag--composition flag: 1 = ref state applied to pure components
c 2 = ref state applied to mixture x0
c following input has meaning only if ixflag = 2
c x0--composition for which h0, s0 apply; array(1:nc) [mol frac]
c this is useful for mixtures of a predefined composition,
c e.g. refrigerant blends such as R410A
c following inputs have meaning only if hrf = 'OTH'
c h0--reference state enthalpy at t0,p0 {x0} [J/mol]
c s0--reference state entropy at t0,p0 {x0} [J/mol-K]
c t0--reference state temperature [K]
c t0 = -1 indicates saturated liquid at normal boiling point
c (bubble point for a mixture)
c p0--reference state pressure [kPa]
c p0 = -1 indicates saturated liquid at t0 {and x0}
c p0 = -2 indicates saturated vapor at t0 {and x0}
c outputs:
c ierr--error flag: 0 = successful
c 22 = Tmin > Tref for IIR reference state
c 23 = Tcrit < Tref for IIR reference state
c 24 = Tmin > Tref for ASHRAE reference state
c 25 = Tcrit < Tref for ASHRAE reference state
c 26 = Tmin > Tnbp for NBP reference state
c 27 = Tref, Pref for OTH ref state outside limits
c -28 = can't apply 'DEF' to mixture;
c will apply to pure components
c -29 = unknown reference state specified;
c will use 'DEF'
c herr--error string (character*255 variable if ierr<>0)
c [fluid parameters, etc. returned via various common blocks]
subroutine GETKTV (icomp,jcomp,hmodij,fij,hfmix,hfij,hbinp,hmxrul)
c
c retrieve mixture model and parameter info for a specified binary
c
c This subroutine should not be called until after a call to SETUP.
c
c inputs:
c icomp--component i
c jcomp--component j
c outputs:
c hmodij--mixing rule for the binary pair i,j (e.g. LJ1 or LIN)
c [character*3]
c fij--binary mixture parameters [array of dimension nmxpar;
c currently nmxpar is set to 6]; the parameters will vary
c depending on hmodij;
c hfmix--file name [character*255] containing parameters for the
c binary mixture model
c hfij--description of the binary mixture parameters [character*8
c array of dimension nmxpar]
c for example, for the Lemmon-Jacobsen model (LJ1):
c fij(1) = zeta
c fij(2) = xi
c fij(3) = Fpq
c fij(4) = beta
c fij(5) = gamma
c fij(6) = 'not used'
c hbinp--documentation for the binary parameters [character*255]
c terminated with ASCII null character
c hmxrul--description of the mixing rule [character*255]
SATURATION-STATE SUBROUTINES
subroutine SATT (t,x,kph,p,rhol,rhov,xliq,xvap,ierr,herr)
c
c iterate for saturated liquid and vapor states given temperature
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -