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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

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

c:/dna/source/<br />

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

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

C Do not include the conservation laws. These are treated automatically<br />

C by DNA.<br />

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

400 CONTINUE<br />

C<br />

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

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

C<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>lity component for setting the massflow based on 2<br />

$ control signals (ZC) − typicly one control signal for a<br />

$ measured massflow and the other a fraction. The component<br />

$ MEASURE_FLOW can be used.’<br />

K_LIG(1) = ’Equal pressures: $p_1 = p_2$’<br />

K_LIG(2) = ’Massflow: $\\dot{m_1} = ZC(1)*ZC(2)$’<br />

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

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

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

KMEDDS(3) = ’Measured massflow’<br />

KMEDDS(4) = ’Fraction’<br />

K_INP=’STRUC Flow SET_FLOW 2 3 900 901\\\\<br />

$MEDIA 2 STEAM\\\\<br />

$addco t Flow 2 50 p 2 1 m Flow 2 10\\\\<br />

$addco ZC 901 2\\\\<br />

$START ZC 901 2’<br />

C<br />

GOTO 9999<br />

C<br />

9999 CONTINUE<br />

RETURN<br />

END<br />

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

SUBROUTINE SET_TEMP(KOMTY,ANTLK,ANTKN,ANTPK,ANTM1,MEDIE,ANTME<br />

$ ,VARME,MDOT,P,H,ZC,PAR,RES,KOMDSC,K_PAR,K_lig,K_bet,KMEDDS<br />

$ ,K_inp)<br />

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

C<br />

C SETFLOW1 is a model of a control valve. The valve controls massflow<br />

C using an error input from a controller.<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 ZC − INPUT − Control variables.<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 MEDIE − IN/OUT − Media of the connected nodes.<br />

60/67<br />

19−03−2007

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

Saved successfully!

Ooh no, something went wrong!