21 April 2023 (Updated: 24 April 2023)
Readers are encouraged to review the principles of countinous distillation.
Evaluate the feed line with Equation 1.
Specify either a reflux or boilup ratio. Evaluate the enriching line with Equation 2 in the case that reflux is specified. Evaluate the stripping line with Equation 3 in the case that boilup is specified.
Find the intersection between the feed line and one operating line. From the intersection, find the other operating line. Step off from the distillate composition down to the worm composition like what is pictured in Figure 1.
Figure 1. Example McCabe-Thiele Analysis.
First, equilibrium data must be generated for a binary system. To make the algorithm flexible, the equilibrium line will be input as a pair of arrays representing liquid/vapor equilibrium compositions. If an equation describing equilibrium is provided from thermodynamic models or by fitting data, generate an equilibrium array by evaluating the function at many points. Assume that with a large number of points, the array approximates a countinous curve.
For example:
def evaluate_equilibrium_line(equilibrium_relationship):
'''
... Validation ...
'''
x = numpy.linspace(0, 1, 1000)
return VaporLiquidEquilibriumLine(x, equilibrium_relationship(x))
The operating line is constructed as a unified line which is just a pair of arrays representing the x/y values.
Below is an example of finding the intersection between the feed line and enriching line. The intersection is the point (x'', y''). Define a function for the enriching and feed lines, and find x'' for which their difference is 0 using fsolve from scipy. The value for y'' is f_enriching(x''). In the case that q=1, x'' = feed composition.
f_e = lambda x: R / (R + 1) * x + x_D / (R + 1)
if q == 1:
xpp = x_F
else:
# feed line
f_F = lambda x: q / (q - 1) * x - x_F / (q - 1)
# x''
xpp = scipy.optimize.fsolve(lambda x: f_F(x) - f_e(x), x_F)[0]
# y''
ypp = f_e(xpp)
With (x'', y'') found, the enriching line is an array that goes from (x'', y'') to (x_distillate, y_distillate), and the stripping is an array that goes from (x_worm, y_worm) to (x'', y'').
If boilup is specified, follow a similar procedure, but define a function representing the stripping line first, and solve for the intersection between the feed and stripping lines.
The operating line function takes optional arguments for the boilup and reflux ratios, and uses the appropriate procedure to find the operating line by using conditionals. A special case is applied when neither ratio is supplied. In this case, the minimum reflux ratio is calculated, and a rule of thumb of 1.3 times the minimum is used for the reflux.
if R is not None:
return operating_line
elif B is not None:
return operating_line
With operating and equilibrium lines, the trays can be stepped off. Two arrays will be generated which represent the x/y points along stage steps. A loop is run, and, for each iteration, two x/y points are calculated which represent the corners of the stage.
Start from the top:
# x values at each stage
x = [operating_line.x[-1]]
# y values at each stage
y = [operating_line.x[-1]]
Calculate the point on the equilibrium line.
for i in range(1000):
y.append(y[2*i])
x_eq = numpy.interp(y[2*i], equilibrium_line.y, equilibrium_line.x)
Account for Murphree tray efficiency.
x.append(x[2*i-1] - (x[2*i-1] - x_eq) * E)
Append point on the operating line.
x.append(x[2*i+1])
y.append(numpy.interp(x[2*i+1], operating_line.x, operating_line.y))
Check if the step has gone past the worm composition.
if x[2*i+1] < operating_line.x[0]:
break
i+1 is the number of stages. Notice that interpolation is used to find points on the operating and equilibrium lines. For this reason, these lines are input into the algorithm as arrays instead of functions.
An implementation of this algorithm as presented is available on GitHub. Combining these steps into a unified function, it is possible to observe how changing different conditions affects a binary distillation system.
Changing the reflux ratio has the biggest effect on the number of stages required. The number of stages required decreases as the reflux ratio increases as pictured in Figure 2.
Figure 2. Binary distillation with increasing reflux ratio.
Logically, descreasing the Murphree tray efficiency increaes the number of stages needed as demonstrated in Figure 3.
Figure 3. Binary distillation with descreasing Murphree tray efficiency.
The relationship between the feed quality, q, and the number of stages required is not as straightforward as the above relationships. However, the feed quality determines the position of the feed tray. More vapor in the feed requires a lower feed stage, and more liquid demands a higher feed tray. In Figure 4, q is increasing.
Figure 4. Binary distillation with changing feed quality.