Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

The plant

This page is the vocabulary the rest of the process chapters use: the eight components, the fifty states, and the thirteen internal streams. All three are recovered from teprob.f rather than from the 1993 paper, because on two of the three the paper and the source disagree.

The flowsheet is the map for all of it. The mixing zone, the reactor, the separator and the stripper are the four vessels that hold state, and the state table below is their contents; the condenser and the compressor hold none. Every solid line is one of the thirteen FTM entries the stream table enumerates, and every tag is an XMEAS or XMV index whose teprob.f line is cited on the instrumentation page. Nothing on the drawing was taken from the paper's figure. Where a stream carries two numbers they are both shown, because that disagreement is the subject of the third section of this page.

Flowsheet of the Tennessee Eastman ProcessFour feeds enter a plant of five unit operations. A mixing zone receives the A, D and E feeds, the compressor recycle and the stripper overhead, and discharges to the reactor. Reactor effluent passes through a condenser into the vapour-liquid separator. Separator vapour is compressed and recycled, with a purge bleeding the inert B. Separator liquid falls to a steam stripper, which is also fed the mixed A and C feed at its base and which makes the liquid product. Each stream carries its Fortran FTM index and the paper stream number, and each unit carries the XMEAS and XMV tags that sit on it. stream 1 · A feed FTM(3), XMV(3), XMEAS(1) stream 2 · D feed FTM(1), XMV(1), XMEAS(2) stream 3 · E feed FTM(2), XMV(2), XMEAS(3) mixing zone stream 6 AT FTM(6), FTM(7) reactor cw FTM(8) · stream 7 condenser cw separator AT FTM(10) · stream 9 purge, XMV(6), XMEAS(10) K FTM(9) · stream 8 · recycle · XMEAS(5) compressor XMEAS(20) work, XMV(5) recycle valve XMEAS(6) reactor feed rate XMEAS(16) pressure published as stripper pressure XMEAS(7) reactor pressure XMEAS(8) reactor level XMEAS(9) reactor temperature XMEAS(21) cooling water out T XMV(10) cooling water flow XMV(12) agitator speed XMEAS(11) separator temperature XMEAS(12) separator level XMEAS(13) separator pressure XMEAS(14) underflow rate XMV(7) underflow valve XMV(11) condenser cooling water XMEAS(22) condenser water out T FTM(11) stream 10 stripper FTM(12) FTM(5) · stream 5 · stripper overhead steam XMEAS(15) stripper level XMEAS(18) stripper temperature XMEAS(19) steam flow XMV(9) steam valve XMEAS(17) product rate XMV(8) product valve AT FTM(13) · stream 11 · product stream 4 · A and C feed FTM(4), XMV(4), XMEAS(4) enters the stripper base, not the mixing zone Composition analysers, mole % XMEAS(23-28) A to F, stream 6 reactor feed, 0.1 h XMEAS(29-36) A to H, stream 9 purge, 0.1 h XMEAS(37-41) D to H, stream 11 product, 0.25 h each reports its previous sample FTM(12), the stripper downflow, has no paper number
The Tennessee Eastman Process as teprob.f wires it. Solid lines are the thirteen internal streams, each labelled with its Fortran FTM index and, where one exists, the stream number of the paper. Dashed lines are utilities: cooling water through the reactor coil and the condenser, and steam to the stripper reboiler. Beside each vessel are the XMEAS instruments and XMV valves that sit on it, and the three AT bubbles mark the streams the composition analysers sample.

Three things on it are worth reading twice, because each is a place the source and the received description of the plant part company. The mixed A and C feed, stream 4, does not reach the mixing zone at all: it enters the stripper base as the stripping gas (teprob.f:614-662). The pressure published as stripper pressure, XMEAS(16), is the mixing zone's PTV (teprob.f:694), because the model carries no separate stripper vapour space. And FTM(12), the liquid that fails to strip out and falls into the stripper sump, has no number in the paper at all.

Components

Eight, A through H. A, B and C are non-condensible and are treated as ideal gases throughout (teprob.f:478). D through H are condensible and get an Antoine vapour pressure (teprob.f:484). B is the inert: it appears in none of the four reactions, arrives with the mixed feed, and leaves only through the purge.

A, B and C have no real liquid density correlation. AD is 1.0 with BD and CD zero for all three (teprob.f:973, 983, 993), so they contribute a flat, temperature-independent term. That is a placeholder keeping the mixing rule finite rather than a fitted number, because the model never puts them in a liquid phase in quantity.

The fifty states

The original carries the state in a bare YY(50) and unpacks it by index arithmetic inside TEFUNC (teprob.f:417-440). Recovering that mapping is the first act of the port, and here it becomes typed structure, pinned by a test that reads the corresponding COMMON/TEPROC/ variables back out of the Fortran rather than trusting a comment.

YY (1-based)FortranMeaningCount
1-3UCVR(1:3)reactor vapour holdup, A, B, C3
4-8UCLR(4:8)reactor liquid holdup, D through H5
9ETRreactor internal energy1
10-12UCVS(1:3)separator vapour holdup, A, B, C3
13-17UCLS(4:8)separator liquid holdup, D through H5
18ETSseparator internal energy1
19-26UCLC(1:8)stripper liquid holdup, all eight8
27ETCstripper internal energy1
28-35UCVV(1:8)mixing zone vapour holdup, all eight8
36ETVmixing zone internal energy1
37TWRreactor cooling water outlet temperature1
38TWScondenser cooling water outlet temperature1
39-50VPOS(1:12)valve positions, one first-order lag each12

The eight slots do not mean the same thing in every vessel, and this is the part that is easy to get wrong. For the reactor and the separator the array is split by phase: slots 1 to 3 are the vapour holdups of A, B and C, and slots 4 to 8 are the liquid holdups of D through H. UCLR(1..3) is set to zero at teprob.f:420-421 because the non-condensibles never form a liquid, and UCVR(4..8) does not come from the state at all: it is derived from the vapour-liquid equilibrium later in the same call (teprob.f:500-501). For the stripper all eight slots are liquid, and for the mixing zone all eight are vapour.

The four temperatures are state, not derived quantities

TESUB2 takes its temperature argument as both the initial guess and the result (teprob.f:1432, 1438), and the four call sites at teprob.f:460-465 pass TCR, TCS, TCC and TCV straight out of COMMON. Every evaluation therefore starts its Newton solves from the previous evaluation's answers, and since the iteration stops on a step below 1e-12 the converged value depends on where it started.

That is not a detail. B-0015 measured the cost of getting it wrong: seeding the solves from a different point on the nominal trajectory moves up to 21 of the 50 derivatives. A port that solved from a fixed guess would be tidier and would not be bit-exact. The warm-start temperatures are carried explicitly here, and B-0034 found the same thing again from the other end, where a trajectory started from the nominal literals instead of from the values TEINIT's own evaluation leaves behind is a different trajectory rather than a rounding of the same one.

vesselafter TEINITnominal literal
reactor120.3999996050374120.4
separator80.109403994558280.109
stripper65.731029771801865.731
mixing zone86.120111977106686.120

Those four values are asserted against the oracle bit for bit; they are from the LOG.org entry for B-0052.

The thirteen internal streams

The Fortran's stream indices are not the stream numbers in the paper. FTM(1) is the D feed, which Downs and Vogel call stream 2. FTM(3) is the A feed, which they call stream 1. Nothing in the source says so, and every reimplementation of TEP has to rediscover it; getting it wrong produces a plant that runs, looks plausible, and is wired up incorrectly.

InternalPaperStream
12D feed
23E feed
31A feed
44A and C feed
55stripper overhead vapour to the mixing zone
66mixing zone outlet to the reactor
76reactor inlet, an alias of 6
87reactor outlet to the condenser and separator
98separator vapour through the compressor, the recycle
109purge
1110separator liquid underflow to the stripper
12nonestripper liquid downflow, internal only
1311product

The mapping was established from the source, not from the paper: teprob.f:565 drives FTM(1) from valve 1 and XMV(1) is documented as "D Feed Flow (stream 2)"; teprob.f:567 gates FTM(3) on IDV(6), documented as "A Feed Loss (Stream 1)"; teprob.f:688 reports FTM(10) as XMEAS(10), "Purge Rate (stream 9)"; teprob.f:683 reports FTM(9) as XMEAS(5), "Recycle Flow (stream 8)"; and so on for the remaining six.

Streams 6 and 7 are the same fluid. teprob.f:656-661 copies flow, enthalpy, temperature, composition and component flows from 6 to 7 wholesale, with no mixing, no pressure drop and no heat loss. Stream 7 exists so that the reactor's balance at teprob.f:763-772 can name its own inlet.

Vessel volumes

Four vessels, four fixed total volumes, all four written in the original as single-precision literals (teprob.f:1118-1121):

VesselFortranValue, cubic feet
reactorVTR1300
separatorVTS3500
stripperVTC156.5
mixing zoneVTV5000

The reactor and the separator hold two phases, so their vapour space is whatever the liquid does not occupy. The stripper is treated as liquid only and the mixing zone as vapour only.

Precision is a property of each literal

The line above is not pedantry. 182 of the assignments in TEINIT are single-precision literals, and a literal written without a D suffix is stored by gfortran as a single-precision value widened to double, which differs from the decimal number by up to about 6e-8 relative. Since the port must reproduce the original's arithmetic bit for bit, every constant has to be transcribed according to the suffix on its own line.

The original is not consistent, so the precision cannot be inferred from elsewhere in the file. teprob.f:1411 writes 273.15 and teprob.f:594 writes 273.15D0. The 1.8 at teprob.f:790 and 792 is single while every other occurrence in the file (1396, 1404, 1464, 1471) is 1.8D0. The gas constant at teprob.f:475 is RG=998.9, single, and it multiplies six of the eight partial pressures in every vessel.

The canary the constants table was built around is XMW(2), which must come out 25.399999618530273 and not 25.4.