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 Include the common "environment" C INCLUDE ’ENVIRO.INI’ INCLUDE ’REALPROP.DEC’ C C Parameter variables C INTEGER ANTLK, ANTEX, ANTKN, MEDIE(13), ANTPK, & ANTM1, ANTM2, ANTME, VARME(8) DOUBLE PRECISION RES(25), MDOT(8), P(8), H(8), PAR(2), Q,ZA(3) $ ,ZC(4) CHARACTER*80 KOMTY,PARNAM(2),ZANAM(3),ZCNAM(4) C C Local variables C INTEGER K_MED(5),I,I_liq,I_vap DOUBLE PRECISION T, V, X, S, U,P_sat(8),H_sat(8),x_1,x_2,X0,X1 $ ,M_MOL1,M_MOL2,y_1,y_2,P_system,R_u,alpha,tau_1_2,tau_2_1 $ ,b_1_2,b_2_1,gamma_1,gamma_2,y_1_new,y_2_new,T_K,P_sat_1 $ ,P_sat_2,a_2_1,K_1,K_2 CHARACTER*100 K_PAR(2),K_STAT(1) CHARACTER*1000 KOMDSC,K_INP CHARACTER*500 K_LIG(3), K_BET CHARACTER*100 KMEDDS(13) EXTERNAL STATES INCLUDE ’REALPROP.INI’ C======================================================================= GOTO (100,200,1,400,400,200) FKOMP 1 RETURN C−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− C Component name C−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− 100 CONTINUE KOMTY = ’DISTILLATION_STAGE’ GOTO 9999 C−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− C Component characteristics C−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− 200 CONTINUE KOMTY = ’DISTILLATION_STAGE’ ANTKN = 13 ANTPK = 0 ANTLK = 12 ANTEX = 3 ANTM1 = 4 ANTM2 = 4 MEDIE(1) = WATHF$ MEDIE(2) = WATHF$ MEDIE(3) = WATHF$ MEDIE(4) = WATHF$ MEDIE(5) = MEOH$ MEDIE(6) = MEOH$ MEDIE(7) = MEOH$ MEDIE(8) = MEOH$ MEDIE(9) = HEAT$ MEDIE(10) = 999 MEDIE(11) = 999 MEDIE(12) = 999 MEDIE(13) = 999 ANTME = 0 ZANAM(1) = ’x_Methanol’ ZANAM(2) = ’y_Methanol’ ZANAM(3) = ’alpha’ ZCNAM(1) = ’Pressure’ ZCNAM(2) = ’Temperature’ ZCNAM(3) = ’x_Methanol’ ZCNAM(4) = ’y_Methanol’ IF (FKOMP.EQ.6) GOTO 600 ** FKOMP = 3 GOTO 9999 C−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− C Component equations. All in residual form. C Do not include the conservation laws. These are treated automatically C by DNA. C−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− 400 CONTINUE C 39/67 19−03−2007

VEnzin.for c:/dna/source/ c 1 = Water c 2 = Methanol c c Constants c M_MOL1=RM_MOL(MEDIE(1)) M_MOL2=RM_MOL(MEDIE(5)) b_2_1=−1062.945621D0 b_1_2=3538.709318D0 c J/mol alpha=0.2994D0 R_u=8.314D0 c J/(mol*K) P_system=ZC(1) c c Boling temperature of stage mixture c T=ZC(2) c CALL STATES(P(4),H(4),T,V,S,X,U,1,2,MEDIE(4)) X0=0.D0 X1=1.D0 CALL STATES(P_sat(2),H_sat(2),T,V,S,X0,U,3,6,MEDIE(2)) CALL STATES(P_sat(4),H_sat(4),T,V,S,X1,U,3,6,MEDIE(4)) X0=0.D0 X1=1.D0 CALL STATES(P_sat(6),H_sat(6),T,V,S,X0,U,3,6,MEDIE(6)) CALL STATES(P_sat(8),H_sat(8),T,V,S,X1,U,3,6,MEDIE(8)) c RES(1)=P(2)−P_sat(2) RES(2)=P(4)−P_sat(4) RES(3)=P(6)−P_sat(6) RES(4)=P(8)−P_sat(8) RES(5)=H(2)−H_sat(2) RES(6)=H(4)−H_sat(4) RES(7)=H(6)−H_sat(6) RES(8)=H(8)−H_sat(8) c c x_1,x_2,y_1 and y_2 is molar fractions in respectively liquid and c gas phase. c x_2=(MDOT(6)/M_MOL2)/(MDOT(2)/M_MOL1+MDOT(6)/M_MOL2) x_1=1−x_2 y_2=(MDOT(8)/M_MOL2)/(MDOT(4)/M_MOL1+MDOT(8)/M_MOL2) y_1=1−y_2 c K_1=y_1/x_1 K_2=y_2/x_2 a_2_1=K_2/K_1 c c Calculation of y_1_new and y_2_new c T_K=T+273.15D0 tau_2_1=b_2_1/(R_u*T_K) tau_1_2=b_1_2/(R_u*T_K) gamma_2=exp((x_1**2*(tau_1_2*((exp(−(alpha $ *tau_1_2))/(x_2+x_1*exp(−(alpha*tau_1_2)))) $ )**2+(tau_2_1*(exp(−(alpha*tau_2_1))/(x_1+x_2 $ *exp(−(alpha*tau_2_1)))**2))))) gamma_1=exp((x_2**2*(tau_2_1*((exp(−(alpha $ *tau_2_1))/(x_1+x_2*exp(−(alpha*tau_2_1)))) $ )**2+(tau_1_2*(exp(−(alpha*tau_1_2))/(x_2+x_1 $ *exp(−(alpha*tau_1_2)))**2))))) c P_sat_1=P_sat(4) P_sat_2=P_sat(8) c y_2_new=gamma_2*P_sat_2*x_2/P_system y_1_new=gamma_1*P_sat_1*x_1/P_system C RES(9)=y_2−y_2_new RES(10)=y_1−y_1_new c RES(11)=x_2−ZA(1) RES(12)=y_2−ZA(2) RES(13)=a_2_1−ZA(3) RES(14)=x_2−ZC(3) RES(15)=y_2−ZC(4) c 40/67 19−03−2007

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

c:/dna/source/<br />

c 1 = Water<br />

c 2 = Methanol<br />

c<br />

c Constants<br />

c<br />

M_MOL1=RM_MOL(MEDIE(1))<br />

M_MOL2=RM_MOL(MEDIE(5))<br />

b_2_1=−1062.945621D0<br />

b_1_2=3538.709318D0<br />

c J/mol<br />

alpha=0.2994D0<br />

R_u=8.314D0<br />

c J/(mol*K)<br />

P_system=ZC(1)<br />

c<br />

c Boling temperature of stage mixture<br />

c<br />

T=ZC(2)<br />

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

X0=0.D0<br />

X1=1.D0<br />

CALL STATES(P_sat(2),H_sat(2),T,V,S,X0,U,3,6,MEDIE(2))<br />

CALL STATES(P_sat(4),H_sat(4),T,V,S,X1,U,3,6,MEDIE(4))<br />

X0=0.D0<br />

X1=1.D0<br />

CALL STATES(P_sat(6),H_sat(6),T,V,S,X0,U,3,6,MEDIE(6))<br />

CALL STATES(P_sat(8),H_sat(8),T,V,S,X1,U,3,6,MEDIE(8))<br />

c<br />

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

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

RES(3)=P(6)−P_sat(6)<br />

RES(4)=P(8)−P_sat(8)<br />

RES(5)=H(2)−H_sat(2)<br />

RES(6)=H(4)−H_sat(4)<br />

RES(7)=H(6)−H_sat(6)<br />

RES(8)=H(8)−H_sat(8)<br />

c<br />

c x_1,x_2,y_1 and y_2 is molar fractions in respectively liquid and<br />

c gas phase.<br />

c<br />

x_2=(MDOT(6)/M_MOL2)/(MDOT(2)/M_MOL1+MDOT(6)/M_MOL2)<br />

x_1=1−x_2<br />

y_2=(MDOT(8)/M_MOL2)/(MDOT(4)/M_MOL1+MDOT(8)/M_MOL2)<br />

y_1=1−y_2<br />

c<br />

K_1=y_1/x_1<br />

K_2=y_2/x_2<br />

a_2_1=K_2/K_1<br />

c<br />

c Calculation of y_1_new and y_2_new<br />

c<br />

T_K=T+273.15D0<br />

tau_2_1=b_2_1/(R_u*T_K)<br />

tau_1_2=b_1_2/(R_u*T_K)<br />

gamma_2=exp((x_1**2*(tau_1_2*((exp(−(alpha<br />

$ *tau_1_2))/(x_2+x_1*exp(−(alpha*tau_1_2))))<br />

$ )**2+(tau_2_1*(exp(−(alpha*tau_2_1))/(x_1+x_2<br />

$ *exp(−(alpha*tau_2_1)))**2)))))<br />

gamma_1=exp((x_2**2*(tau_2_1*((exp(−(alpha<br />

$ *tau_2_1))/(x_1+x_2*exp(−(alpha*tau_2_1))))<br />

$ )**2+(tau_1_2*(exp(−(alpha*tau_1_2))/(x_2+x_1<br />

$ *exp(−(alpha*tau_1_2)))**2)))))<br />

c<br />

P_sat_1=P_sat(4)<br />

P_sat_2=P_sat(8)<br />

c<br />

y_2_new=gamma_2*P_sat_2*x_2/P_system<br />

y_1_new=gamma_1*P_sat_1*x_1/P_system<br />

C<br />

RES(9)=y_2−y_2_new<br />

RES(10)=y_1−y_1_new<br />

c<br />

RES(11)=x_2−ZA(1)<br />

RES(12)=y_2−ZA(2)<br />

RES(13)=a_2_1−ZA(3)<br />

RES(14)=x_2−ZC(3)<br />

RES(15)=y_2−ZC(4)<br />

c<br />

40/67<br />

19−03−2007

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

Saved successfully!

Ooh no, something went wrong!