27.07.2013 Views

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

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

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

c:/dna/source/<br />

C<br />

C<br />

400 CONTINUE<br />

temp=PAR(1)<br />

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

RES(2) = X_J(MEDIE(1),temp)−ZC(1)<br />

IF (FKOMP.EQ.5) GOTO 500<br />

GOTO 9999<br />

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

C Solution check<br />

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

500 CONTINUE<br />

IF (MDOT(1).LT.−1D−10) GOTO 550<br />

IF (MDOT(2).GT.1D−10) GOTO 550<br />

GOTO 9999<br />

550 FBETI = .FALSE.<br />

GOTO 9999<br />

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

C Write component information<br />

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

600 CONTINUE<br />

KOMDSC = ’U<strong>til</strong>ity component for setting the molar fraction of a<br />

$ compund in a ideal gas mixture.’<br />

K_BET = ’$\\dot{m_1} \\gt 0 \\\\ \\dot{m_2} \\lt 0 $’<br />

K_PAR(1) = ’Compound number ($H_2$ is 1)’<br />

KMEDDS(1) = ’Gas in’<br />

KMEDDS(2) = ’Gas out’<br />

KMEDDS(3) = ’Molar fraction of compound’<br />

K_INP=’struc set−X_H2 SET_X 611 612 900 1\\\\<br />

$MEDIA 611 gas\\\\<br />

$fluid gas N2 0.6 H2 0.4\\\\<br />

$addco m set−X_H2 611 1 t set−X_H2 611 50 p 611 1’<br />

C<br />

GOTO 9999<br />

C<br />

9999 CONTINUE<br />

RETURN<br />

END<br />

C<br />

C=======================================================================<br />

C***********************************************************************<br />

SUBROUTINE SET_X_REALFLUID(KOMTY,ANTLK,ANTEX,ANTKN,ANTPK,ANTM1,<br />

& ANTM2,MEDIE,ANTME,VARME,<br />

& MDOT,P,H,Q,ZA,ZC,PAR,RES,PARNAM,ZANAM,<br />

$ KOMDSC,KMEDDS,K_PAR,K_LIG,K_STAT,K_BET,k_inp)<br />

C***********************************************************************<br />

C<br />

C HEATEX_1 is a model of a heat exchanger.<br />

C The model does not include equations concerning the heat exchange.<br />

C 1−2 is the heat emitting fluid.<br />

C<br />

C***********************************************************************<br />

C<br />

CA FKOMP − INPUT − Flag with the value:<br />

CA 1: Initialize the component.<br />

CA 2: Initialize with actual system.<br />

CA 3: Fluid composition calculation (constant).<br />

CA 4: Find residuals.<br />

CA 5: Find residuals and check variables.<br />

CA 6: Output information about component.<br />

CA MDOT − INPUT − Massflows from nodes.<br />

CA P − INPUT − Pressure in nodes.<br />

CA H − INPUT − Enthalpy of massflows.<br />

CA PAR − INPUT − Parameters of the component.<br />

CA KOMTY − OUTPUT − Component name.<br />

CA ANTPK − OUTPUT − Number of parameters.<br />

CA ANTLK − OUTPUT − Number of equations.<br />

CA ANTEX − OUTPUT − Number of algebraic independent equations.<br />

CA ANTKN − OUTPUT − Number of nodes connected to the component.<br />

CA ANTM1 − OUTPUT − Number of massflows in the first conservation of<br />

CA mass equation.<br />

CA ANTM2 − OUTPUT − Number of massflows in the second.<br />

CA MEDIE − IN/OUT − Media (fluid) of the connected nodes.<br />

CA The values mean:<br />

CA 99 : Water.<br />

CA ANTME − OUTPUT − Number of fluids with variable composition.<br />

CA RES − OUTPUT − Residuals for the component.<br />

54/67<br />

19−03−2007

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

Saved successfully!

Ooh no, something went wrong!