C User Kinetics Subroutine for RCSTR.
C$ #1 BY: JERRY CHANG, DATE: 5-MAY-2009.
SUBROUTINE USRKIN (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************************************************************************
C COPYRIGHT (C) 1989 *
C ASPEN TECHNOLOGY, INC. *
C CAMBRIDGE, MA *
C************************************************************************
C-------------------------------------------------------------------------
C The kinetics models of reactions C+O2, C+H2O, C+CO2, C+H2 and CO+H2O
C are based on C.-Y. Wen et al.'s work (C.-Y. Wen, H. Chen, M. Onozaki,
C "User's manual for computer simulation and design of the moving bed
C coal gasifier", Report submitted to Morgantown Energy Technology Center
C and U.S. Department of Energy, Contract DOE/MC/16474-1390, 1982).
C The kinetics model of reaction H2+O2 is from the book (K.-F. Cen,
C M.-J. Ni, Z.-Y. Luo, Theory, Desigh and Operation of Circulating
C Fluidized Bed Boilers, Beijing: Chinese Electric Power Press, 1998).
C-------------------------------------------------------------------------
C%%%%%%%%%%%%H2 + 0.5O2 = H2O%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
C R = 8.83E5*EXP(-9.976E4/8.3145/T)*CH2*CO2
C (UNIT: T = K; CH2, CO2 = MOL/M**3; R = MOL/M**3/S)
C
C%%%%%%%%%%%%CO + H2O = CO2 + H2%%%%%%%%%%%%%%%%%%%%%%%%%%
C R = FW*2.877E5*EXP(-27760/1.987/T)*(XCO*XH2O-XCO2*XH2/KWGS)
C *PT**(0.5-PT/250)*EXP(-8.91+5553/T)
C WHERE:
C FW = ADJUSTABLE PARAMETER, WHICH REPRESENTS THE RELATIVE CATALYTIC
C REACTIVITY OF ASH TO THAT OF IRON-BASE CATALYST.
C XCO, XH2O, XO2, XH2 = MOLE FRACTIONS.
C PT = TOTAL PRESSURE.
C KWGS = EXP(-3.6890+7234/1.8/T)
C (UNIT: T = K; PT = ATM; R = MOL/S/(G OF ASH))
C
C%%%%%%%C + (1/FHI)O2 = 2*(1-1/FHI)CO + (2/FHI-1)CO2%%%%%%
C R = 1/(1/KFILM+1/KASH) * PO2
C WHERE:
C KFILM = 0.292*4.26*(T/1800)**1.75/(DP*T)
C KASH = KFILM*VOID**2.5*Y/(1-Y)
C Y = RCORE/RPARTICLE
C RCORE = RADIUS OF UNREACTED CORE
C RPARTICLE = RADIUS OF FEED COAL PARTICLE
C VOID = VOIDAGE IN THE ASH LAYER
C DP = DIAMETER OF COAL PARTICLE
C PHI = (2*Z+2)/(Z+2)
C Z = 2500*EXP(-6249/T)
C (UNIT: PO2 = ATM; DP = CM; T = K; RCORE, RPARTICLE =CM;
C R = MOL/CM**3/S)
C
C%%%%%%%%%%%%%%%%%%%%C + H2O = CO + H2%%%%%%%%%%%%%%%%%%%%
C R = 930*EXP(-45000/1.987/T) * CCARB * (PH2O-PH2OEQ)
C WHERE:
C PH2OEQ = PH2*PCO/EXP(17.29-16330/T)
C CCARB = CARBON CONCENTRATION
C (UNIT: T = K; PH2O, PH2, PCO = ATM; CCARB = MOL/CM**3; R = MOL/CM**3/S)
C
C%%%%%%%%%%%%%%%%%%%%C + CO2 = 2CO%%%%%%%%%%%%%%%%%%%%%%%%
C R = 930*EXP(-45000/1.987/T) * CCARB * (PCO2-PCO2EQ)
C WHERE:
C PCO2EQ = PCO**2/EXP(20.92-20280/T)
C (UNIT: T = K; PCO2, PCO = ATM; CCARB = MOL/CM**3; R = MOL/CM**3/S)
C
C%%%%%%%%%%%%%%%%%%%%C + 2H2 = CH4%%%%%%%%%%%%%%%%%%%%%%%%
C R = EXP(-7.087-8078/T) * CCARB * (PH2-PH2EQ)
C WHERE:
C PH2EQ = (PCH4/EXP(-13.43+10100/T))**0.5
C (UNIT: T = K; PH2, PCH4 = ATM; CCARB = MOL/CM**3; R = MOL/CM**3/S)
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)
#include "dms_ncomp.cmn"
#include "rxn_rcstrr.cmn"
#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)
EQUIVALENCE (B(1), IB(1) )
C
#include "pputl_ppglob.cmn"
#include "dms_maxwrt.cmn"
#include "dms_plex.cmn"
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,
+ IMISS, KDIAG, KV, KER,
+ DMS_IFCMNC, LMW, LMWI
C
REAL*8 SOUT(1), WORK(NWORK), STOIC(NC,NSUBS,NR),
+ RATES(1), FLUXM(1), FLUXS(1), RATCAT(NTCAT),
+ RATSSA(NTSSAT),Y(NCOMP), X(NCOMP), X1(NCOMP),
+ X2(NCOMP)
C
REAL*8 RATALL(NRALL), USERV(NUSERV), REALR(NREALR),
+ WR(NWR), RATEL(1), RATEV(1), XCURR,
+ XMW(NCOMP_NCC),B(1), TEMP, PRES,
+ RGAS
C
REAL*8 REAL(NREAL), RMISS, XLEN, DIAM,
+ VFRAC, BETA, VVAP, VLIQ,
+ VLIQS, VMXV, DVMX
C
REAL*8 NCARIN, NCARGF, NO2, NCO,
+ NH2, NCO2, NH2O, NCH4,
+ NN2, NH2S, NC6H6, NTOTG,
+ NCARB, NSULF, MASH, YO2,
+ YCO, YH2, YCO2, YH2O,
+ YCH4, YN2, YH2S, YC6H6,
+ YASH
C
REAL*8 CCARB, CO2, CH2, XC,
+ DP, VOID, RHOCOA, VBED
C
REAL*8 PO2, PCO, PH2, PCO2,
+ PH2O, PCH4, PN2, PH2S,
+ PC6H6, PAMBI, PT, T,
+ PH2OEQ, PCO2EQ, PH2EQ
C
REAL*8 RCR, Z, FW, E,
+ KFILM, KASH, KOVER, K,
+ KH2O2, RCARO2, RCARH2O, RCARCO2,
+ RCARH2, RH2O2, RCOH2O
C
C BEGIN EXECUTABLE CODE
C COAL PARTICLE DIAMETER (CM)
DP = 2.0D0
C RETRIEVE OTHER INPUT PARAMETERS, WHICH ARE TRANSFERRED WITH THE HELP OF
C CALCULATOR "CHARDEC".
C ***INLET CARBON FLOW RATE (KMOL/S),
C ***CARBON FLOW RATE LEFT AFTER PYROLYSIS (KMOL/S),
C ***INLET ASH FLOW RATE (KG/S), ASH WEIGHT FRACTION IN ORIGINAL COAL,
C ***DENSITY OF DRY COAL (KG/M**3).
NCARIN = REALR(1)
NCARGF = REALR(2)
MASH = REALR(3)
YASH = REALR(4)
RHOCOA = REALR(5)
C BED VOID FRACTION
VBED = RCSTRR_VFRRC
C DECLARE CONSTANT PARAMETERS: RGAS (CAL/MOL/K), PAMBI (ATM).
RGAS = 1.987D0
PAMBI = 1.01325D5
C RETRIVE MOLECULAR WEIGHT OF EACH COMPONENT (KG/KMOL)
LMW = DMS_IFCMNC('MW')
DO I = 1,NCOMP_NCC
LMWI = LMW+I
XMW(I) = B(LMWI)
END DO
C RETRIEVE TEMPERATURE(K), PRESSURE(ATM), MOLE FLOWS OF COMPONENTS (KMOL/S).
T = SOUT(IDXSUB(1)-1+NCOMP_NCC+2)
PT = RPROPS_UPRES / PAMBI
NO2 = SOUT(IDXSUB(1)-1+1)
NCO = SOUT(IDXSUB(1)-1+2)
NH2 = SOUT(IDXSUB(1)-1+3)
NCO2 = SOUT(IDXSUB(1)-1+4)
NH2O = SOUT(IDXSUB(1)-1+5)
NCH4 = SOUT(IDXSUB(1)-1+6)
NN2 = SOUT(IDXSUB(1)-1+7)
NH2S = SOUT(IDXSUB(1)-1+8)
NC6H6 = SOUT(IDXSUB(1)-1+9)
NCARB = SOUT(IDXSUB(2)-1+10)
NSULF = SOUT(IDXSUB(2)-1+11)
NTOTG = NO2+NCO+NH2+NCO2+NH2O+NCH4+NN2+NH2S+NC6H6
C CALCULATE COMPONENT MOLE FRACTIONS
YO2 = NO2 / NTOTG
YCO = NCO / NTOTG
YH2 = NH2 / NTOTG
YCO2 = NCO2 / NTOTG
YH2O = NH2O / NTOTG
YCH4 = NCH4 / NTOTG
YN2 = NN2 / NTOTG
YH2S = NH2S / NTOTG
YC6H6 = NC6H6/ NTOTG
C CALCULATE COMPONENT PARTIAL PRESSURES(ATM)
PO2 = YO2 * PT
PCO = YCO * PT
PH2 = YH2 * PT
PCO2 = YCO2 * PT
PH2O = YH2O * PT
PCH4 = YCH4 * PT
PN2 = YN2 * PT
PH2S = YH2S * PT
PC6H6 = YC6H6* PT
C CARBON AND COEFFICIENT Y=RC/R
XC = 1.0 - NCARB/NCARIN
RCR = (NCARB/NCARGF)**0.333
C REACTION RATE OF SOLID AND GAS PHASES
C C + O2
C PARAMETER FOR CALCULATING RATIO OF CO TO CO2
Z = 2500.0D0*EXP(-6249.0D0/T)
C REACTION RATE (KMOL/S)
KFILM = 0.292D0*4.26D0*(T/1800.0D0)**1.75/(DP*T)
VOID = 0.75D0
KASH = KFILM * VOID**2.5 * RCR / (1.0D0-RCR)
KOVER = KFILM*KASH / (KFILM+KASH)
RCARO2 = KOVER * PO2 * 1.0D-3 / 1.0D-6 * (1.0D0-VBED)
+ *RCSTRR_VOLRC
C C + H2O
C CALCULATE CONCENTRATION OF CARBON (KMOL/M**3)
CCARB = NCARB / MASH * RHOCOA*YASH * (1.0-VBED)
C REACTION RATE (KMOL/S)
K = 930.0D0
E = 45000.0D0
PH2OEQ = PH2 * PCO / EXP(17.29-16330.0D0 / T)
RCARH2O= K * EXP(-E/RGAS/T) * CCARB * (PH2O - PH2OEQ)
+ * RCSTRR_VOLRC
C C + CO2 (KMOL/S)
K = 930.0D0
E = 45000.0D0
PCO2EQ = PCO * PCO / EXP(20.92-20280.0D0 / T)
RCARCO2= K * EXP(-E/RGAS/T) * CCARB * (PCO2 - PCO2EQ)
+ * RCSTRR_VOLRC
C C + H2 (KMOL/S)
PH2EQ = SQRT(PCH4 / EXP(-13.43+10100.0D0/T))
RCARH2 = EXP(-7.087D0-8078.0D0/T) * CCARB * (PH2-PH2EQ)
+ *RCSTRR_VOLRC
C H2 + O2
C TOTAL MOLAR VOLUME OF GAS PHASE (M**3/KMOL)
KDIAG = 4
KV = 1
CALL PPMON_VOLV(T,RPROPS_UPRES,Y,NCOMP,IDX,NBOPST,KDIAG,
+ KV,VMXV,DVMX,KER)
C MOLE CONCENTRATION (KMOL/M**3)
CO2 = YO2 / VMXV
CH2 = YH2 / VMXV
C REACTION RATE (KMOL/S)
KH2O2 = 8.83D5 * DEXP(-9.976D4/8.3145D0/T)
RH2O2 = KH2O2 * (CH2*1.0D3) * (CO2*1.0D3)
+ *1.0D-3 * VBED * RCSTRR_VOLRC
C CO+H2O (KMOL/S)
FW = 0.0084D0
RCOH2O = FW * 2.877D5 * DEXP(-27760.0D0/RGAS/T)
+ *(YCO*YH2O - YCO2*YH2/EXP(-3.6890+7234/1.8/T))
+ * PT**(0.5D0-PT/250.0D0) * DEXP(-8.91D0+5553.0D0/T)
+ * RHOCOA * YASH * (1.0D0 -VBED) * RCSTRR_VOLRC
C INITIALIZE RATES
DO 100 I = 1, NC
RATES(I) = 0D0
100 CONTINUE
C REACTION RATE OF COMPONENTS (KMOL/S)
RATES(1) = -RCARO2*(2.0+Z)/2.0/(1.0+Z) - RH2O2*0.5D0
RATES(2) = RCARO2*Z/(1.0+Z) + RCARH2O*1.0D0
+ +RCARCO2*2.0D0 - RCOH2O
RATES(3) = RCARH2O*1.0D0 - RCARH2 *2.0D0
+ +RCOH2O - RH2O2
RATES(4) = RCARO2 *1.0/(1.0+Z) - RCARCO2*1.0D0
+ +RCOH2O
RATES(5) = -RCARH2O*1.0D0 + RH2O2
+ -RCOH2O
RATES(6) = RCARH2 *1.0D0
RATES(7) = 0.0D0
RATES(8) = 0.0D0
RATES(9) = 0.0D0
RATES(NCOMP_NCC*2-1) = -RCARO2 *1.0D0 - RCARH2O*1.0D0
+ -RCARCO2*1.0D0 - RCARH2 *1.0D0
RATES(NCOMP_NCC*2) = 0.0D0
RETURN
END
|