Design og modellering af metanolanlæg til VEnzin-visionen Bilag

Design og modellering af metanolanlæg til VEnzin-visionen Bilag Design og modellering af metanolanlæg til VEnzin-visionen Bilag

27.07.2013 Views

VEnzin.for c:/dna/source/ C Component equations. All in residual form. C Do not include the conservation laws, since these are treated C automatically by DNA. C−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− 400 CONTINUE C C Ash characteristics C CP(MEDIE(5)) = 1 HF(MEDIE(5)) = −5083.0D0 HV(MEDIE(5)) = X_J(MEDIE(5),28)*NED_H(28)/M_MOL(28) C CALCOM(1) = −1 CALCOM(2) = −2 CALCOM(3) = −3 CALCOM(4) = −4 CALCOM(5) = −5 CALCOM(6) = −6 CALCOM(7) = −7 CALCOM(8) = −8 CALCOM(9) = −9 CALCOM(10) = −10 CALCOM(11) = −11 CALCOM(12) = −30 CALCOM(13) = −31 CALCOM(14) = −32 CALCOM(15) = −36 DO I=1,ANTPK−5 DO J=1,15 IF (CALCOM(J).EQ.−NINT(PAR(I))) THEN CALCOM(J)=−CALCOM(J) ENDIF ENDDO ENDDO PGAS = PAR(ANTPK−4) TGAS = PAR(ANTPK−3)+273.15 DELP = PAR(ANTPK−2) c DMVC = PAR(ANTPK−2) CC = PAR(ANTPK−1) cbe 20041711 parameter for "non−equilibrium" methane METH = PAR(ANTPK) R = 8.314D0 C C Pressure C RES(1) = P(2) − P(3) RES(2) = P(3) − P(4) − DELP RES(3) = P(4) − PGAS C C Amount of water relative to coal C c RES(4) = MDOT(2) − DMVC*MDOT(1) RES(4) = MDOT(2) − ZC(1)*MDOT(1) C C Ash C RES(5) = MDOT(5) + : MDOT(1)*(X_J(MEDIE(1),38)+X_J(MEDIE(1),28)*(1.0D0−CC)) IF (MDOT(5).EQ.0D0) THEN RES(6) = X_J(MEDIE(5),38) ELSE RES(6) = X_J(MEDIE(5),38) + MDOT(1)*X_J(MEDIE(1),38)/MDOT(5) ENDIF RES(7) = X_J(MEDIE(5),28) − (1.0D0−X_J(MEDIE(5),38)) CALL STATES(P(4),H(4),T4,V,S,X,U,1,2,MEDIE(4)) CALL STATES(P(5),H5,T4,V,S,X,U,1,3,MEDIE(5)) RES(8) = H(5) − H5 C−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− C Find the composition of the equilibrium gas C−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− C C Calculate mole flow of each species in C M_BL(3) = 0D0 DO I=1,ANTST M_BL(3)=M_BL(3)+X_J(MEDIE(3),I)*M_MOL(I) 9/67 19−03−2007

VEnzin.for c:/dna/source/ ENDDO DO I=1,ANTST NIN(I)=MDOT(1)*X_J(MEDIE(1),I)/M_MOL(I) + + MDOT(3)*X_J(MEDIE(3),I)/M_BL(3) ENDDO NIN(37)=NIN(37)+MDOT(2)/M_MOL(37) NIN(28)=NIN(28)*CC C C Calculate mole flow of each species out C M_BL(4) = 0D0 DO I=1,ANTST M_BL(4)=M_BL(4)+X_J(MEDIE(4),I)*M_MOL(I) ENDDO NOUT(ANTST+1) = (−MDOT(4))/M_BL(4) DO I=1,ANTST NOUT(I)=NOUT(ANTST+1)*X_J(MEDIE(4),I) cbe 20041711 molar fractions excluding "non−equilibrium" methane IF (I.EQ.11) THEN XEQ(I)=(X_J(MEDIE(4),i)−METH)/(1.D0−METH) ELSE XEQ(I)=X_J(MEDIE(4),I)/(1.D0−METH) ENDIF ENDDO C C Gibbs’ free energy of each compound C DO I=1,15 IF (CALCOM(I).GT.0) $ CALL GIBBS(CALCOM(I),TGAS,PGAS*(1.D0−METH)*XEQ(CALCOM(I)) $ ,G(I)) ENDDO C C Partial derivatives of the function to be minimized with respect to C each species molar fraction DO I=1,15 IF (CALCOM(I).LT.0) THEN RES(I+8) = X_J(MEDIE(4),−CALCOM(I)) ELSEIF (X_J(MEDIE(4),CALCOM(I)).GT.1.0D−5) THEN RES(I+8) = G(I) c /(R*TGAS) + c : DLOG(PGAS*NOUT(CALCOM(I))/NOUT(ANTST+1)) cbe 041117 part of the fuel is not reaching equilibrium c : DLOG(PGAS*XEQ(CALCOM(I))) DO J=1,6 RES(I+8) = RES(I+8) + ZA(J)*EL(CALCOM(I),J) ENDDO ELSE RES(I+8) = G(I) c /(R*TGAS) + c : DLOG(1.d−5)+ c $ 1.d5*(pgas*NOUT(CALCOM(I))/NOUT(ANTST+1)−1.d−5) c RES(I+8) = X_J(MEDIE(4),CALCOM(I))−1.0D−10 DO J=1,6 RES(I+8) = RES(I+8) + ZA(J)*EL(CALCOM(I),J) ENDDO if (fiter) then write(warnstring,’(a,a,a,a)’) ’Warning: The compound ’, $ COMPNA(CALCOM(I)), $ ’should be removed from the ’, $ ’compound equilibrium calculation.’ call printout(warnstring) endif ENDIF ENDDO C C Molar balance for each atom (H,C,N,O,S,Ar) C DO J=1,ANTEX−1 RES(ANTLK+J) = 0D0 DO I=1,ANTST RES(ANTLK+J)=RES(ANTLK+J)−(NIN(I)−NOUT(I))*EL(I,J) ENDDO ENDDO RES(29) = 1.0D0 DO I=1,ANTST RES(29)= RES(29)−X_J(MEDIE(4),I) 10/67 19−03−2007

<strong>VEnzin</strong>.for<br />

c:/dna/source/<br />

C Component equations. All in residual form.<br />

C Do not include the conservation laws, since these are treated<br />

C automatically by DNA.<br />

C−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−<br />

400 CONTINUE<br />

C<br />

C Ash characteristics<br />

C<br />

CP(MEDIE(5)) = 1<br />

HF(MEDIE(5)) = −5083.0D0<br />

HV(MEDIE(5)) = X_J(MEDIE(5),28)*NED_H(28)/M_MOL(28)<br />

C<br />

CALCOM(1) = −1<br />

CALCOM(2) = −2<br />

CALCOM(3) = −3<br />

CALCOM(4) = −4<br />

CALCOM(5) = −5<br />

CALCOM(6) = −6<br />

CALCOM(7) = −7<br />

CALCOM(8) = −8<br />

CALCOM(9) = −9<br />

CALCOM(10) = −10<br />

CALCOM(11) = −11<br />

CALCOM(12) = −30<br />

CALCOM(13) = −31<br />

CALCOM(14) = −32<br />

CALCOM(15) = −36<br />

DO I=1,ANTPK−5<br />

DO J=1,15<br />

IF (CALCOM(J).EQ.−NINT(PAR(I))) THEN<br />

CALCOM(J)=−CALCOM(J)<br />

ENDIF<br />

ENDDO<br />

ENDDO<br />

PGAS = PAR(ANTPK−4)<br />

TGAS = PAR(ANTPK−3)+273.15<br />

DELP = PAR(ANTPK−2)<br />

c DMVC = PAR(ANTPK−2)<br />

CC = PAR(ANTPK−1)<br />

cbe 20041711 parameter for "non−equilibrium" methane<br />

METH = PAR(ANTPK)<br />

R = 8.314D0<br />

C<br />

C Pressure<br />

C<br />

RES(1) = P(2) − P(3)<br />

RES(2) = P(3) − P(4) − DELP<br />

RES(3) = P(4) − PGAS<br />

C<br />

C Amount of water relative to coal<br />

C<br />

c RES(4) = MDOT(2) − DMVC*MDOT(1)<br />

RES(4) = MDOT(2) − ZC(1)*MDOT(1)<br />

C<br />

C Ash<br />

C<br />

RES(5) = MDOT(5) +<br />

: MDOT(1)*(X_J(MEDIE(1),38)+X_J(MEDIE(1),28)*(1.0D0−CC))<br />

IF (MDOT(5).EQ.0D0) THEN<br />

RES(6) = X_J(MEDIE(5),38)<br />

ELSE<br />

RES(6) = X_J(MEDIE(5),38) + MDOT(1)*X_J(MEDIE(1),38)/MDOT(5)<br />

ENDIF<br />

RES(7) = X_J(MEDIE(5),28) − (1.0D0−X_J(MEDIE(5),38))<br />

CALL STATES(P(4),H(4),T4,V,S,X,U,1,2,MEDIE(4))<br />

CALL STATES(P(5),H5,T4,V,S,X,U,1,3,MEDIE(5))<br />

RES(8) = H(5) − H5<br />

C−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−<br />

C Find the composition of the equilibrium gas<br />

C−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−<br />

C<br />

C Calculate mole flow of each species in<br />

C<br />

M_BL(3) = 0D0<br />

DO I=1,ANTST<br />

M_BL(3)=M_BL(3)+X_J(MEDIE(3),I)*M_MOL(I)<br />

9/67<br />

19−03−2007

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!