CHE-460 · Lesson 12 of 12 · 23 min
Capstone: simulating and optimizing the ester column and decanter
The design review for the ester line's separation section is in three weeks. The contractor will present their heat and material balance and their equipment designs. Ingrid asks Theo to bring the owner's answer to one question that ties the whole course together: at what reflux should the ester column run, given the 24 stages the contractor has chosen, the recycle through the decanter, and the uncertainty in the feed from the reactive column? And what does the answer mean for the vapour recompression unit? To answer it, Theo builds a compact model of the decanter, the ester column and their recycle, converges it with nested loops, meets the purity specification with a design specification, and optimizes the operating reflux under uncertainty.
The model
The capstone model keeps the structure of the full flowsheet but simplifies each unit to what the question needs. The overhead from the reactive column is fixed at its design flow and composition, represented by three pseudo-components: E for ethyl acetate, L for the light ethanol-rich lump that forms the azeotropes, and W for water. The decanter splits each component between organic and aqueous phases with fixed fractions taken from the liquid-liquid equilibrium calculation in lesson 3: 90 % of the water and 32 % of the light lump go to the aqueous phase. The ester column is the 24-stage rating model from lesson 8, treating the organic feed as a pseudo-binary of E against the light material. Its distillate returns to the decanter, closing the recycle.
There are two loops. The inner loop converges the distillate recycle, a tear stream, by the Wegstein method from lesson 7. The outer loop adjusts the reflux ratio by a secant on the logarithm of the light material in the bottoms, the design specification from lesson 8, until the purity is 99.7 %. Each outer iteration needs a converged inner loop. This nesting is how a sequential-modular simulator would handle the same problem with default settings. A simultaneous approach, converging the tear and the specification together by a quasi-Newton method, would usually take fewer total passes.
# Capstone: decanter + ester column with the distillate recycled to the decanter (pseudo-components, illustrative)
# E = ethyl acetate, L = light lump (ethanol-water-ester azeotrope plus dissolved water), W = free water
import math
alpha, N, NF = 2.5, 24, 10
overhead = {"E": 26.0, "L": 13.0, "W": 27.0} # reactive column overhead to the decanter, kmol/h
def column(F, zF, D, R):
"""Rating model from lesson 8, generalized for feed F and distillate D; returns xD, xB."""
B = F - D; L, V = R * D, (R + 1) * D; Ls = L + F
x = [zF] * (N + 1)
for _ in range(400):
K = [alpha / (1 + (alpha - 1) * xi) for xi in x]
a = [0.0] * (N + 1); b = [0.0] * (N + 1); c = [0.0] * (N + 1); d = [0.0] * (N + 1)
for j in range(1, N + 1):
Lj = B if j == N else (L if j < NF else Ls)
a[j] = (L if j - 1 < NF else Ls) if j > 1 else 0.0
b[j] = -(Lj + V * K[j]) + (L * K[1] if j == 1 else 0.0)
c[j] = V * K[j + 1] if j < N else 0.0
d[j] = -F * zF if j == NF else 0.0
cp = [0.0] * (N + 1); dp = [0.0] * (N + 1)
for j in range(1, N + 1):
m = b[j] - a[j] * cp[j - 1]; cp[j] = c[j] / m; dp[j] = (d[j] - a[j] * dp[j - 1]) / m
xn = [0.0] * (N + 1)
for j in range(N, 0, -1): xn[j] = dp[j] - (cp[j] * xn[j + 1] if j < N else 0.0)
xn = [min(1.0, max(0.0, v)) for v in xn]
done = max(abs(p - q) for p, q in zip(x[1:], xn[1:])) < 1e-11; x = xn
if done: break
return K[1] * x[1], x[N]
def flowsheet(tear, R):
"""tear = (distillate flow D, light fraction xD) -> recalculated tear, plus column results."""
Dg, xDg = tear
E = overhead["E"] + Dg * (1 - xDg); Lt = overhead["L"] + Dg * xDg; W = overhead["W"]
aq_W, aq_L = 0.90 * W, 0.32 * Lt # decanter: aqueous phase takes most free water and part of the light lump
F = E + (Lt - aq_L) + (W - aq_W) # organic phase to the column (dissolved water joins L)
zF = ((Lt - aq_L) + (W - aq_W)) / F
D = F * (zF - 0.003) / (0.985 - 0.003) # distillate set to carry the light material
xD, xB = column(F, zF, D, R)
return (D, xD), dict(F=F, zF=zF, D=D, B=F - D, xD=xD, xB=xB, aq=aq_W + aq_L)
def converge(R, tol=1e-7):
x = (35.0, 0.98); gx, _ = flowsheet(x, R); x_old, g_old = x, gx; x = gx
for it in range(2, 100):
gx, res = flowsheet(x, R)
if max(abs(gx[0] - x[0]), abs(gx[1] - x[1])) < tol: return res, it
xn = []
for i in range(2):
dx = x[i] - x_old[i]; s = (gx[i] - g_old[i]) / dx if abs(dx) > 1e-14 else 0.0
q = max(-5.0, min(0.0, s / (s - 1) if abs(s - 1) > 1e-12 else 0.0)); xn.append(q * x[i] + (1 - q) * gx[i])
x_old, g_old, x = x, gx, tuple(xn)
return res, it
# 1. Nested loops: the design spec on purity (outer, secant on log xB) around the recycle (inner, Wegstein)
f = lambda R: math.log(converge(R)[0]["xB"]) - math.log(0.003)
R0, R1 = 1.2, 1.5
for k in range(1, 20):
R2 = R1 - f(R1) * (R1 - R0) / (f(R1) - f(R0))
if abs(R2 - R1) < 1e-5: break
R0, R1 = R1, R2
res, it = converge(R2)
V = (R2 + 1) * res["D"]; duty = V * 32.0 / 3.6
print(f"spec met at R = {R2:.3f} after {k} outer iterations (inner recycle loop: {it} passes)")
print(f"column feed {res['F']:.1f} kmol/h, z_light {res['zF']:.3f}; distillate {res['D']:.1f}; ester product {res['B']:.1f} kmol/h ({res['B'] * 88.11 / 1000:.2f} t/h)")
print(f"purity {100 * (1 - res['xB']):.2f} %; boil-up {V:.1f} kmol/h; reboiler duty about {duty:.0f} kW; decanter aqueous {res['aq']:.1f} kmol/h")
print()
# 2. Choose the operating reflux against feed uncertainty: energy cost + expected off-spec loss
scen = [(0.94, 0.25), (1.00, 0.50), (1.06, 0.25)] # multiplier on the light lump in the overhead, probability
def expected_cost(R):
total = 0.0
for m, p in scen:
saveL = overhead["L"]; overhead["L"] = saveL * m
r, _ = converge(R); overhead["L"] = saveL
Vr = (R + 1) * r["D"]
energy = Vr * 32.0 / 3600 * 3.6 * 8400 * 12.0 / 1e6 # million per year at 12 per GJ
offspec = max(0.0, r["xB"] - 0.003) * 1000 * 0.25 # million per year penalty (illustrative)
total += p * (energy + offspec)
return total
for R in (1.22, 1.26, 1.30, 1.35, 1.40, 1.50):
print(f"R = {R:.2f}: expected cost {expected_cost(R):.4f} M/yr")
g = (math.sqrt(5) - 1) / 2; a, b = 1.2, 1.6; c, d = b - g * (b - a), a + g * (b - a)
for _ in range(25):
if expected_cost(c) < expected_cost(d): b, d = d, c; c = b - g * (b - a)
else: a, c = c, d; d = a + g * (b - a)
Rop = (a + b) / 2
print(f"best operating reflux under feed uncertainty: R = {Rop:.3f} ({100 * (Rop / R2 - 1):.0f} % above the design-spec value)")
r, _ = converge(Rop); Vop = (Rop + 1) * r["D"]; Q = Vop * 32.0 / 3.6
steam = Q / 1000 * 3.6 * 8400 * 12.0 / 1e3
mvr = Q / 8.0 * 8400 * 0.08 / 1e3
print(f"at that reflux: duty {Q:.0f} kW; steam reboiler {steam:.0f} thousand/yr; vapour recompression (COP 8, 0.08 per kWh) {mvr:.0f} thousand/yr")spec met at R = 1.264 after 6 outer iterations (inner recycle loop: 14 passes) column feed 62.4 kmol/h, z_light 0.575; distillate 36.4; ester product 26.1 kmol/h (2.30 t/h) purity 99.70 %; boil-up 82.3 kmol/h; reboiler duty about 732 kW; decanter aqueous 39.9 kmol/h R = 1.22: expected cost 1.1525 M/yr R = 1.26: expected cost 0.4374 M/yr R = 1.30: expected cost 0.2703 M/yr R = 1.35: expected cost 0.2766 M/yr R = 1.40: expected cost 0.2826 M/yr R = 1.50: expected cost 0.2945 M/yr best operating reflux under feed uncertainty: R = 1.293 (2 % above the design-spec value) at that reflux: duty 743 kW; steam reboiler 270 thousand/yr; vapour recompression (COP 8, 0.08 per kWh) 62 thousand/yr
Meeting the specification
The specification is met at a reflux ratio of 1.264 after six outer iterations. The converged recycle gives a column feed of 62.4 kmol/h with 57.5 % light material, a distillate of 36.4 kmol/h and an ester product of 26.1 kmol/h, which is 2.30 tonnes per hour, exactly the design capacity from CHE-446. The reflux is a little higher than the 1.224 found in lesson 8 because the recycle changes the column feed: the distillate returning through the decanter brings back light material, and the feed to the column settles at a composition different from the design value used there.
The duty, about 732 kW, is lower than the 952 kW of the full model in lesson 2. That difference is not an error but a matter of model fidelity, and Theo is careful to explain it in his report. The capstone model lumps components into pseudo-components with a constant relative volatility, assumes constant molar overflow, uses a single latent heat, and leaves out the sensible heat of the feed and the heat losses. Those simplifications are acceptable for choosing a reflux ratio, because they affect all reflux values similarly, but the duty for sizing the reboiler and the recompressor must come from the rigorous model. Knowing which question each model is fit to answer is the first lesson of the course, applied.
Choosing the operating reflux under uncertainty
The design specification gives the reflux at which the column just meets 99.7 % with the design feed. Lesson 8 showed that the purity is very sensitive to reflux there, and that a richer feed pushes it off specification. The reactive column overhead will vary in operation. Theo represents that with three scenarios for the light lump in the overhead: 6 % below design with probability 0.25, at design with 0.50, and 6 % above with 0.25. For each candidate reflux, the model runs all three scenarios, and the expected annual cost is the probability-weighted sum of the energy cost and a penalty for off-specification product, which Nadia estimates from the cost of reprocessing or downgrading.
The results show the asymmetry of the problem. At the design-specification reflux of 1.264, the rich-feed scenario goes off specification and the expected cost is 0.44 million dollars a year, most of it penalty. At 1.30 it falls to 0.27. Beyond that, extra reflux buys only energy cost, and the expected cost rises slowly. The golden section search finds the best operating reflux at 1.293, about 2 % above the design-specification value. The margin is small in reflux, but it removes most of the off-specification risk. It also tells the control engineers where to put the composition controller's set point relative to the specification.
Worked problem
Expected cost of one reflux
At some reflux, the energy cost is 0.26 million dollars a year in every scenario. Only the rich scenario, probability 0.25, is off specification, with a penalty of 0.70 million dollars a year. Find the expected cost.
Show solution
- Energy: \(0.26\) in all scenarios, so its expected value is \(0.26\).
- Penalty: \(0.25 \times 0.70 = 0.175\).
- Expected cost: \(0.26 + 0.175 = 0.435\) million dollars a year.
- Raising reflux slightly to remove the off-specification case would cost a little more energy and save most of the 0.175.
Answer: 0.435 million dollars a year, of which 40 % is the expected penalty: a strong signal to add margin.
What it means for vapour recompression
The last part of the code compares the energy cost of the chosen reflux with a conventional steam reboiler and with vapour recompression. At 743 kW of duty and 12 dollars per gigajoule of steam, the reboiler would cost about 270 thousand dollars a year. With a recompressor of coefficient of performance 8 and electricity at 8 cents per kilowatt hour, the same duty costs about 62 thousand dollars a year. Option D's economics are confirmed at the operating reflux.
The capstone also shows why the optimum reflux depends on the energy price. With steam, the energy term is large, and the optimizer would trim reflux as far as the off-specification risk allows. With vapour recompression, energy costs a quarter as much, the flat region of the cost curve widens, and running at slightly more reflux for extra margin costs very little. Theo recommends designing the recompressor for a reflux ratio of 1.40, about 10 % above the operating point, so that the operators have room to respond to the richest feeds and to the slow decline of tray efficiency with fouling. On the rigorous model, that design point sets the compressor duty that the contractor's rotating equipment specialists will size.
| Quantity | Value | Source |
|---|---|---|
| Stages in ester column | 24 | Contractor design |
| Reflux ratio at design specification | 1.264 | Capstone, nested loops |
| Best operating reflux under uncertainty | 1.293 | Capstone, golden section |
| Recommended design reflux for recompressor | 1.40 | Judgement on flat cost region |
| Ester product | 26.1 kmol/h, 2.30 t/h | Capstone and design basis |
| Energy cost at operating reflux | 270 thousand per year with steam, 62 with recompression | Capstone |
| Duty for equipment sizing | From rigorous model | Lesson 2 model, updated |
Presenting the result
Theo's report for the design review is three pages. It states the question, describes the model and its simplifications, gives the recommended operating and design reflux with the expected cost curve, and lists what would change the answer: a feed more variable than assumed, a lower tray efficiency, or a different off-specification penalty. It attaches the model log entry and the code. It does not present the capstone duty as a sizing number. Ingrid reviews it and adds one line: that the contractor should confirm the recompressor's turndown covers the leanest feed at the lowest reflux, which the dynamic model in lesson 10 can check. The professional engineer who seals the process design, a P.Eng., will rely on that chain of models, each validated for its purpose and each documented, rather than on any single number.
The course ends where it began. A simulator is a tool that does arithmetic on the equations an engineer chooses. The value lies in choosing the right equations for the question, checking them against data, solving them reliably, and saying clearly what the answer means and how far it can be trusted. The ester line will run on models for its whole life, from the contractor's design to the digital twin that Wren's operators consult, and each of those models will be only as good as the judgement of the engineers who build and use them.
Common mistakes
MistakeUsing the capstone duty to size equipment.
InsteadSize from the rigorous model; use simplified models for the questions they suit.
MistakeOperating exactly at the design-specification reflux.
InsteadAdd margin chosen by expected cost under realistic feed variation.
MistakeIgnoring the energy price when choosing reflux.
InsteadRecompute the optimum for the actual energy system.
MistakePresenting a result without its assumptions.
InsteadState what would change the answer.
Summary and key terms
- The capstone combines a recycle tear (inner loop) and a design specification (outer loop), converged by Wegstein and secant methods.
- Purity of 99.7 % with 24 stages and recycle needs R = 1.264, producing 2.30 t/h of ester.
- Under feed uncertainty, the best operating reflux is 1.293, removing most off-specification risk for a small energy cost.
- The simplified model's duty is low by design; equipment duties come from the rigorous model.
- Vapour recompression cuts the energy cost from about 270 to 62 thousand dollars a year and widens the flat region of the cost curve.
- Nested loops
- A convergence structure in which an inner loop is fully converged at each step of an outer loop.
- Pseudo-component
- A lumped component representing several real components with similar behaviour.
- Expected cost
- The probability-weighted average cost over a set of scenarios.
- Off-specification penalty
- The cost of product that fails to meet its specification.
- Model fidelity
- How closely a model represents the real process, chosen to suit its purpose.
- Coefficient of performance
- Heat delivered by a heat pump or recompressor divided by the work it uses.
Practice problems
Work each problem on paper first, then reveal the answer to check.
What are the inner and outer loops in the capstone?
Show answer
Inner: the distillate recycle tear by Wegstein. Outer: reflux by secant to meet purity.
Why is the capstone duty lower than the full model's?
Show answer
Lumped pseudo-components, constant molar overflow and no sensible heat or losses.
What is the best operating reflux under uncertainty?
Show answer
1.293, about 2 % above the design-specification value.
Why is the expected cost high at R = 1.264?
Show answer
The rich-feed scenario goes off specification and carries a large penalty.
What are the annual energy costs with steam and with recompression?
Show answer
About 270 and 62 thousand dollars.
Why design the recompressor for R = 1.40?
Show answer
To give operators margin for rich feeds and efficiency decline, at little cost with cheap energy.
Lesson quiz · 5 questions
Score 60% or more to complete this lesson.
Create a free account to save your progress, take quizzes and earn a certificate.