|
fortran嵌入aspen 出现问题求解 望各位马友帮忙
C$ #2 BY: PATNAIK DATE: 14-NOV-1998 INCLUDE COMMONS FOR RADFRAC/RATEFRAC
C$ #1 BY: ANAVI DATE: 1-JUL-1994 NEW FOR USER MODELS
C
C User Kinetics Subroutine for RCSTR, RPLUG, RBATCH, PRES-RELIEF,
C RADFRAC and RATEFRAC (USER type Reactions)
C
SUBROUTINE kin (SOUT, NSUBS, IDXSUB, ITYPE, NINT,
2 INT, NREAL, REAL, IDS, NPO,
3 NBOPST, NIWORK, IWORK, NWORK, WORK,
4 NC, NR, STOIC, RATES, FLUXM,
5 FLUXS, XCURR, NTCAT, RATCAT, NTSSAT,
6 RATSSA, KCALL, KFAIL, KFLASH, NCOMP,
7 IDX, Y, X, X1, X2,
8 NRALL, RATALL, NUSERV, USERV, NINTR,
9 INTR, NREALR, REALR, NIWR, IWR,
* NWR, WR, NRL, RATEL, NRV,
1 RATEV)
C
IMPLICIT NONE
C
C DECLARE VARIABLES USED IN DIMENSIONING
C
INTEGER NSUBS, NINT, NPO, NIWORK,NWORK,
+ NC, NR, NTCAT, NTSSAT,NCOMP,
+ NRALL, NUSERV,NINTR, NREALR,NIWR,
+ NWR
C
#include "ppexec_user.cmn"
EQUIVALENCE (RMISS, USER_RUMISS)
EQUIVALENCE (IMISS, USER_IUMISS)
C
C
#include "rplg_rplugi.cmn"
#include "rplg_rplugr.cmn"
EQUIVALENCE (XLEN, RPLUGR_UXLONG)
EQUIVALENCE (DIAM, RPLUGR_UDIAM)
C
C
C INITIALIZE RATES
C
#include "rxn_rprops.cmn"
EQUIVALENCE (TEMP, RPROPS_UTEMP)
EQUIVALENCE (PRES, RPROPS_UPRES)
EQUIVALENCE (VFRAC, RPROPS_UVFRAC)
EQUIVALENCE (BETA, RPROPS_UBETA)
EQUIVALENCE (VVAP, RPROPS_UVVAP)
EQUIVALENCE (VLIQ, RPROPS_UVLIQ)
EQUIVALENCE (VLIQS, RPROPS_UVLIQS)
C DECLARE ARGUMENTS
C
INTEGER IDXSUB(NSUBS),ITYPE(NSUBS), INT(NINT),
+ IDS(2),NBOPST(6,NPO),IWORK(NIWORK),
+ IDX(NCOMP), INTR(NINTR), IWR(NIWR),
+ NREAL, KCALL, KFAIL, KFLASH,NRL,
+ NRV, I
REAL*8 SOUT(1), WORK(NWORK),
+ STOIC(NC,NSUBS,NR), RATES(ncomp),
+ FLUXM(1), FLUXS(1), RATCAT(NTCAT),
+ RATSSA(NTSSAT), Y(NCOMP),
+ X(NCOMP), X1(NCOMP), X2(NCOMP)
REAL*8 RATALL(NRALL),USERV(NUSERV),
+ REALR(NREALR),WR(NWR), RATEL(1),
+ RATEV(1), XCURR
C
C DECLARE LOCAL VARIABLES
C
INTEGER IMISS
REAL*8 REAL(NREAL), RMISS, XLEN, DIAM, TEMP,
+ PRES, VFRAC, BETA, VVAP, VLIQ,
+ VLIQS
integer kdiag, kphi, ker, n
real*8 phi(ncomp), dphi(ncomp), t, p
c Variables
real*8 k1, k2, k3,
c
+ f1, f2, f3, r1
c 1 2 3 该序号为component列表中各物质的序列号
c N2 H2 NH3
c
parameter (R=8.314)
kdiag=4
t=temp
p=pres
kphi=1 !只计算逸度
n=ncomp
call ppmon_fugv (t, p, y, n, idx, nbopst, kdiag,
+ kphi, phi, dphi, ker)
open(7,file='phi.txt')
write(7,*) phi(1), phi(2), phi(3) !调用以上几种物质的逸度系数并写入该文件
close(7)
C
C BEGIN EXECUTABLE CODE
c 计算逸度
f1=Pres*y(1)*phi(1)/100000
f2=Pres*y(2)*phi(2)/100000
f3=Pres*y(3)*phi(3)/100000
open(7,file='initial.txt')
write(7,*) temp, pres, xlen, diam, nreal, real(1)
close(7)
open(7,file='another.txt')
write(7,*) f1, f2, f3
c 反应速率方程与活性校正系数
k1=exp(-19.1214+9226.52/TEMP--4.2715*LOG(TEMP)+7.5576*10**(-4)*TEMP)
k2=exp(-0.5679+11.004*TEMP-0.0009*LOG(TEMP)-5*10**(-7))
k3=2.995*10**14*EXP(-(171420/R)*(1/TEMP-1/350.13))
write(7,*) k1, k2, k3
close(7)
c r1=real(1)*k1*KCO*(f2*f3**1.5-f7/(KP1*f3**0.5))
c +/(1+KCO*f2+KCO2*f1)/(f3**0.5+f8*K12)*real(3)/xlen
r1=k3*(k1*f1*f2**1.5/f3-k2*f3/f2**1.5)
c 计算各个组分反应速率
rates(1)=-1*r1
rates(2)=-3*r1
rates(3)=2*r1
open(7,file='rate2.txt')
write(7,*) rates(1), rates(2), rates(3)
close(7)
end
|
评分
-
查看全部评分
|