Distillation

The module fuellib.simulate.distillation.greenfield simulates the ASTM D86 distillation test with the macroscopic model of Greenfield et al.[1]. Given a fuel composition, it predicts the D86 curve (thermometer temperature against the volume fraction recovered) together with the time histories of the liquid temperature, the heating rate, and the liquid composition in the flask.

In the code, each numbered equation \(N\) of Greenfield et al.[1] is implemented by a private function _eq_N, and variable names follow the notation of the paper (see Nomenclature of the D86 model and the corresponding names in the code.). The equation numbers on this page are those of the paper.

Usage

See the Simulating Distillation tutorial for how to run the simulation, change the model variants and apparatus parameters, and plot and compare D86 curves.

Model

In the D86 test, 100 mL of fuel is heated in a flask, and the vapor rises through a vertical tube to a condenser. The heating rate is adjusted so that 4-5 mL/min of condensate is collected, and the thermometer at the top of the tube records the D86 temperature. Greenfield et al.[1] represent the apparatus by three unit operations in series:

  1. Stage 1, the distillation flask: an unsteady-state still pot whose liquid is held at its bubble point (eq. 1-5 and 10).

  2. Stage 2, the mixing stage: an equilibrium partial condensation of the flask vapor, representing the vertical tube. It loses heat to the room by natural convection and returns reflux to the flask (eq. 6-9 and 11).

  3. Stage 3, the air-filled CSTR: a continuous stirred-tank reactor holding the air initially in the apparatus, plus the heat capacity of the glass. Its temperature is reported as the D86 (thermometer) temperature (eq. 12-14).

Table 13 Nomenclature of the D86 model and the corresponding names in the code.

Symbol

Code

Description

\(W\)

W

Moles of liquid in the flask

\(x_i W\)

xW

Moles of compound i in the flask

\(x_i\), \(y_i\)

x, y

Mole fractions of the flask liquid and flask vapor

\(u_i\), \(v_i\)

u, v

Mole fractions of the reflux and the stage-2 vapor

\(v_i^{out}\)

v_out

Mole fractions in the CSTR

\(D_1\), \(D_2\)

D1, D2

Vapor rates leaving stages 1 and 2 (mol/s)

\(R_2\)

R2

Reflux rate from stage 2 to the flask (mol/s)

\(T_1\), \(T_2\), \(T_3\)

T1, T2, T3

Temperatures of stages 1, 2, and 3 (K)

\(\dot{Q}_1\), \(\dot{Q}_2\)

Q1, Q2

Heat rates into stages 1 and 2 (W)

\(C_{p1,\ell}\), \(C_{p2,\ell}\)

Cp1_l, Cp2_l

Liquid heat capacities of the flask liquid and the reflux (J/mol/K)

\(C_{p1,v}\)

Cp1_v

Ideal-gas heat capacity of the flask vapor (J/mol/K)

\(|\Delta H_{vap1}|\), \(|\Delta H_{vap2}|\)

dH_vap1, dH_vap2

Enthalpies of vaporization of the flask vapor and the reflux (J/mol)

\(V C^{tot}\)

VC_tot

Moles held in the CSTR

\(C_{p,cylinder}\)

Cp_cylinder

Effective heat capacity of the glass (J/K)

\(h\), \(A\), \(L\)

h, A, L

Heat transfer coefficient, area, and length of the tube

\(P\), \(P_i^{sat}\)

P, P_sat

Pressure and saturated vapor pressure (Pa)

\(\gamma_i\), \(\phi_i\)

ln_gamma, ln_phi

Activity and fugacity coefficients (natural log in the code)

Apparatus parameters

D86Apparatus holds the apparatus and procedure parameters. The heat transfer area of the vertical tube in equation 9 is its outer surface, \(A = \pi D L\).

Table 14 Default apparatus parameters.

Field

Symbol

Default

Source

pressure

\(P\)

101325 Pa

Greenfield et al.[1]

T_room

\(T_{room}\)

298.15 K

Greenfield et al. (298 K)

charge_volume

100 mL

ASTM D86

air_volume

\(V\)

85 cm3

Greenfield et al.

cylinder_heat_capacity

\(C_{p,cylinder}\)

4.2 J/K

Greenfield et al.

column_length

\(L\)

0.13 m

Greenfield et al.

column_diameter

\(D\)

0.025 m

Greenfield et al. (outer diameter)

collection_rate_min

4 mL/min

ASTM D86

collection_rate_max

5 mL/min

ASTM D86

Pure-compound properties

The temperature-dependent pure-compound properties (\(\ln P^{sat}\), \(C_{p,\ell}\), \(C^0_{p,v}\)) are tabulated once on a 1 K grid and interpolated with cubic splines.

Vapor pressure

The saturated vapor pressure \(P_i^{sat}\) comes from the Lee-Kesler correlation (see Individual component properties (fuellib.correlate.components)).

Heat capacities

Greenfield et al.[1] obtain the liquid heat capacity of nonpolar compounds from the ideal-gas heat capacity with the correlation

\[\frac{C_{p,\ell} - C^0_{p,v}}{R} = (0.5 + 2.2\omega) \Big[ 3.67 + 11.64 (1 - T_r)^4 + 0.634 (1 - T_r)^{-1} \Big]. \tag{19}\]

FuelLib has no per-compound ideal-gas polynomials, so equation 19 is used in reverse: the liquid heat capacity \(C_{p,\ell}\) comes from FuelLib’s group-contribution correlation (see Equations for Constantinou and Gani properties) and equation 19 is solved for \(C^0_{p,v}\). To avoid the singularity at \(T_r = 1\), \(T_r\) is capped at 0.95, and \(C^0_{p,v}\) is floored at \(4R\), the ideal-gas heat capacity of a rigid nonlinear molecule.

Cross critical properties

The vapor fugacity coefficients (see Vapor fugacity coefficients) use second virial coefficients from the corresponding-states correlations given by Greenfield et al.[1]. The cross critical properties of each pair of compounds do not depend on temperature and are computed once,

\[\omega_{ij} = \tfrac{1}{2} (\omega_i + \omega_j) \tag{22}\]
\[T_{c_{ij}} = \sqrt{T_{c_i} T_{c_j}} \tag{23}\]
\[V_{c_{ij}} = \tfrac{1}{8} \Big( V_{c_i}^{1/3} + V_{c_j}^{1/3} \Big)^3 \tag{24}\]
\[Z_{c_{ij}} = \tfrac{1}{2} (Z_{c_i} + Z_{c_j}) \tag{25}\]
\[P_{c_{ij}} = Z_{c_{ij}} R T_{c_{ij}} / V_{c_{ij}} \tag{26}\]

with \(Z_c \equiv P_c V_c / (R T_c)\).

Initial state

Initial charge

The charge volume is converted to moles of each compound, \(x_i W\), with the liquid molar volumes at \(T_{room}\) from the Rackett equation with the Yamada-Gunn compressibility (see Individual component properties (fuellib.correlate.components)), assuming ideal (zero excess volume) mixing. The same molar volumes convert the condensate to a recovered volume fraction at room temperature.

Phase equilibrium

The flask liquid is at its bubble point,

\[\phi_i^{(1)} y_i P = \gamma_i^{(1)} x_i P_i^{sat}. \tag{10}\]

The activity coefficients \(\gamma_i\) come from UNIFAC 2.0 (see UNIFAC). The equilibrium in stage 2 (equation 11) has the same form.

Vapor fugacity coefficients

With the cross critical properties of equations 22-26, the second virial coefficients are

\[B_{ij} = \frac{R T_{c_{ij}}}{P_{c_{ij}}} \Big( B^0 + \omega_{ij} B^1 \Big) \tag{27}\]
\[B^0 = 0.083 - 0.422 \, T_r^{-1.6} \tag{28}\]
\[B^1 = 0.139 - 0.172 \, T_r^{-4.2} \tag{29}\]

with \(T_r = T / T_{c_{ij}}\), and the fugacity coefficients are

\[\ln \phi_k = \frac{P}{RT} \Big[ B_{kk} + \tfrac{1}{2} \sum_i \sum_\ell y_i y_\ell (2 \delta_{ik} - \delta_{i\ell}) \Big] - \frac{B_{kk} P_k^{sat}}{RT} \tag{30}\]
\[\delta_{ij} = 2 B_{ij} - B_{ii} - B_{jj}. \tag{31}\]

Because \(\sum_\ell y_\ell = 1\) and \(\delta\) is symmetric, the code evaluates the double sum in equation 30 as \(2 \sum_i y_i \delta_{ik} - \sum_i \sum_\ell y_i y_\ell \delta_{i\ell}\). The last term of equation 30 is \(\ln \phi_k^{sat}\), so equation 30 gives \(\ln(\phi_k / \phi_k^{sat})\).

Bubble point

The bubble temperature of a liquid \(x_i\) solves \(f(T) = \ln \sum_i K_i x_i = 0\), with \(K_i = y_i / x_i\) from equation 10. The iteration alternates \(y_i = K_i x_i / S\), with \(S = \sum_i K_i x_i\), and the Newton step

\[T \leftarrow T - \frac{\ln S}{\sum_i y_i \, d \ln P_i^{sat} / dT},\]

which neglects the temperature dependence of \(\gamma_i\) and \(\phi_i\). Steps are limited to 20 K.

Initial heating rate

The enthalpy of vaporization follows from the Clausius-Clapeyron equation, treating the vapor as an ideal gas,

\[\Delta H_{vap} = -R \frac{d \ln P^{sat}}{d (1/T)} = R T^2 \frac{d \ln P^{sat}}{dT}, \tag{17}\]

where \(d \ln P^{sat} / dT\) is the derivative of the spline. The initial heating rate \(\dot{Q}_1\) is 1.25 times the rate needed to vaporize the middle of the collection-rate band at the initial bubble point.

Warm-up

The energy balance on the flask is

\[W C_{p1,\ell} \frac{\partial T_1}{\partial t} = R_2 C_{p2,\ell} (T_2 - T_1) - D_1 |\Delta H_{vap1}| + \dot{Q}_1. \tag{5}\]

The charge starts at \(T_{room}\) and is heated to its bubble point with equation 5 at \(D_1 = R_2 = 0\).

Distillation

Time step

Each step advances the state by \(\delta t = \min(\delta t_{max}, 0.02 W / D_1)\), using \(D_1\) from the previous step. The flask vapor composition \(y_i\) and temperature \(T_1\) are known from the bubble point (equation 10).

Stage 1: distillation flask

The overall and component material balances on the flask are

\[\frac{\partial W}{\partial t} = R_2 - D_1 \tag{1}\]
\[\frac{\partial (x_i W)}{\partial t} = u_i R_2 - y_i D_1 \tag{2}\]

with the mole fractions of every stream summing to one,

\[\sum_i x_i = \sum_i y_i = \sum_i u_i = \sum_i v_i = 1. \tag{3}\]

Equation 1 is the sum of equation 2 over all compounds, so the code integrates only equation 2. Together with the energy balance (equation 5) and the bubble point (equation 10), these determine the flask state.

Stage 2: mixing stage

The flask vapor partially condenses in stage 2. The material balances are

\[D_1 = R_2 + D_2 \tag{6}\]
\[y_i D_1 = u_i R_2 + v_i D_2, \tag{7}\]

the energy balance is

\[0 = D_1 C_{p1,v} (T_1 - T_2) + R_2 |\Delta H_{vap2}| + \dot{Q}_2, \tag{8}\]

the heat lost by natural convection to the room is

\[-\dot{Q}_2 = h A (T_2 - T_{room}), \tag{9}\]

and the reflux and vapor leaving stage 2 are in equilibrium,

\[\phi_i^{(2)} v_i P = \gamma_i^{(2)} u_i P_i^{sat}. \tag{11}\]

Natural convection from the vertical tube

The heat transfer coefficient \(h\) in equation 9 comes from the Churchill-Chu correlations for a vertical plate given by Greenfield et al.[1],

\[\mathrm{Nu}_L = 0.68 + \frac{0.670 \, \mathrm{Ra}_L^{1/4}}{\Big[ 1 + (0.492 / \mathrm{Pr})^{9/16} \Big]^{4/9}}, \quad \mathrm{Ra}_L < 10^9, \tag{32}\]
\[\mathrm{Nu}_L = \left\{ 0.825 + \frac{0.387 \, \mathrm{Ra}_L^{1/6}}{\Big[ 1 + (0.492 / \mathrm{Pr})^{9/16} \Big]^{8/27}} \right\}^2, \quad \mathrm{Ra}_L \geq 10^9, \tag{33}\]

with \(\mathrm{Gr} = \beta g \rho^2 L^3 \Delta T / \mu^2\), \(\mathrm{Ra}_L = \mathrm{Gr} \, \mathrm{Pr}\), and \(h = \mathrm{Nu}_L k / L\). The properties of air are evaluated at the film temperature \((T_{wall} + T_{ambient}) / 2\) with the fits of Greenfield et al.[1],

\[k = -5.696 \times 10^{-4} + 1.025 \times 10^{-4} T - 4.764 \times 10^{-8} T^2 + 1.330 \times 10^{-11} T^3 \tag{34}\]
\begin{equation} \begin{aligned} \mathrm{Pr} &= 8.123 \times 10^{-1} - 2.948 \times 10^{-4} T - 9.443 \times 10^{-7} T^2 \\ &\quad + 3.584 \times 10^{-9} T^3 - 3.827 \times 10^{-12} T^4 + 1.373 \times 10^{-15} T^5 \end{aligned} \tag{35} \end{equation}
\[\ln \left( \frac{\beta g \rho^2}{\mu^2} \right) = 43.83 - 4.4065 \ln T \tag{36}\]

with \(k\) in W/m/K and \(\beta g \rho^2 / \mu^2\) in 1/(K m3).

Solution of stages 1 and 2

The lowest possible stage-2 temperature, \(T_{2,min}\), is the bubble point of the flask vapor, reached when all of it condenses. Three cases follow.

  1. Pure or constant-boiling liquid (\(T_1 - T_{2,min} < 10^{-3}\) K): the vapor condenses at \(T_2 = T_1\) with \(u_i = v_i = y_i\). All the heat goes to vaporization, \(D_1 = \dot{Q}_1 / |\Delta H_{vap1}|\), and \(R_2\) is the vapor rate that stage 2 can condense (equation 8 with \(T_2 = T_1\)), capped at \(D_1\).

  2. Total reflux: equation 8 with \(T_2 = T_{2,min}\) and \(R_2 = D_1\) gives the vapor rate that stage 2 can condense completely. If the right-hand side of equation 5 is not positive at that rate, stage 2 condenses everything the heater can boil, so \(D_2 = 0\) and the flask is unchanged. \(D_1 = R_2\) then follows from equation 5 with \(\partial T_1 / \partial t = 0\).

  3. Partial condensation: \(T_2\) is found in \([T_{2,min}, T_1)\) with Brent’s method. For a trial \(T_2\),

    1. an isothermal flash of the flask vapor (equations 7 and 11) gives the fraction condensed \(R_2 / D_1\) and the compositions \(u_i\) and \(v_i\),

    2. equation 8 gives \(D_1\) (and so \(R_2\)),

    3. equation 2, integrated with an explicit Euler step, gives the new flask contents, and equation 10 gives the new \(T_1\), and

    4. the residual is the difference between the right-hand side of equation 5 and \(W C_{p1,\ell} (T_1^{new} - T_1) / \delta t\).

    Trial temperatures for which \(D_1\) exceeds what the heater can supply return the right-hand side of equation 5 alone.

\(D_2\) then follows from equation 6.

Flash

The isothermal flash of stage 2 uses successive substitution on \(K_i\). For fixed \(K_i\), the vapor fraction \(\beta = D_2 / D_1\) solves the Rachford-Rice equation[2]

\[\sum_i \frac{y_i (K_i - 1)}{1 + \beta (K_i - 1)} = 0,\]

clipped to \([0, 1]\). Then \(u_i = y_i / [1 + \beta (K_i - 1)]\) and \(v_i = K_i u_i\), and \(K_i\) is updated from equation 11 until it converges.

Stage 3: air-filled CSTR

The vapor from stage 2 displaces the air initially in the apparatus,

\[V C^{tot} \frac{\partial v_i^{out}}{\partial t} = v_i D_2 - v_i^{out} D_3, \tag{12}\]

with \(D_3 = D_2\), where \(V C^{tot}\) is the ideal-gas moles in the CSTR volume at \(T_{room}\) and \(P\). Equation 12 is integrated exactly over the step, holding \(D_2\) and \(v_i\) constant,

\[v_i^{out}(t + \delta t) = v_i + \Big( v_i^{out}(t) - v_i \Big) \exp \left( -\frac{D_2 \, \delta t}{V C^{tot}} \right),\]

for each fuel compound and for air (with \(v_{air} = 0\)). The condensate collected over the step is the fuel entering the CSTR minus the fuel accumulated in it, \(v_i D_2 \delta t - V C^{tot} \Delta v_i^{out}\).

The heat lost by the entering vapor is gained by the air and the glass,

\[\Big( (n_{N_2} + n_{O_2}) C_{p,air,v} + C_{p,cylinder} \Big) (T_3 - T_3') = \Big( \sum_i n_i C_{p,i,v} \Big) (T_2 - T_3), \tag{13}\]

where \(T_3'\) is the temperature at the previous time step and \(n_i = v_i D_2 \delta t\) are the moles entering during the step. Solving for \(T_3\) gives the D86 temperature,

\[T_3 = \frac{\Big( (n_{N_2} + n_{O_2}) C_{p,air,v} + C_{p,cylinder} \Big) T_3' + \Big( \sum_i n_i C_{p,i,v} \Big) T_2}{(n_{N_2} + n_{O_2}) C_{p,air,v} + C_{p,cylinder} + \sum_i n_i C_{p,i,v}}. \tag{14}\]

The moles of air in equation 14 are \(n_{N_2} + n_{O_2} = V C^{tot} v_{air}^{out}\), and their ideal-gas heat capacity uses the polynomial

\[C^0_{p,v} = a + b T + c T^2 + d T^3 \tag{18}\]

with the N2 and O2 coefficients of Greenfield et al.[1] (Table 3), mixed as 79 mol% N2 and 21 mol% O2.

Without the CSTR (air_cstr=False, the “partial model” of Greenfield et al.[1]), all the stage-2 vapor is collected and \(T_3 = T_2\).

Heating-rate control

Finally, the heating rate is adjusted to keep the collection rate in the 4-5 mL/min band: \(\dot{Q}_1\) is multiplied by \(\exp(\delta t / \tau)\) when the rate is below the band and by \(\exp(-\delta t / \tau)\) when it is above, with \(\tau = 30\) s. The simulation ends when \(W\) falls below residue_fraction of its initial value.

Differences from Greenfield et al.

Table 15 Parts of the FuelLib implementation that differ from Greenfield et al.

Item

Greenfield et al.

FuelLib

Vapor pressure

Reid et al. correlation and Antoine equation (eq. 15-16)

Lee-Kesler (see Individual component properties (fuellib.correlate.components))

Liquid heat capacity

Eq. 18-19 (nonpolar), Yuan-Stiel (eq. 20-21, polar)

Nielsen GCM (see Equations for Constantinou and Gani properties)

Ideal-gas heat capacity

Eq. 18 with per-compound coefficients

Eq. 19 solved for \(C^0_{p,v}\) (eq. 18 only for air)

Activity coefficients

UNIFAC

UNIFAC 2.0 (see UNIFAC)

Dissolved air

Eq. 37-40

Not included; air only in the CSTR

Time integration

4th-order Runge-Kutta, bisection on \(D_1\)

Explicit Euler, Brent’s method on \(T_2\)

Bubble point

BUBL T algorithm of Smith and Van Ness

Newton iteration (see Bubble point)

Flash

Flash algorithm of Smith and Van Ness

Successive substitution with Rachford-Rice (see Flash)

Heating-rate control

Stepwise increase when the collection rate is too low

Exponential adjustment in both directions

Reid vapor pressure

Flash at 100 °F to a 4:1 vapor-to-liquid volume ratio

Not implemented

Greenfield et al. also do not state some quantities that the model needs. FuelLib uses:

  • \(V C^{tot}\) from the ideal-gas law at \(T_{room}\) and \(P\),

  • 79 mol% N2 and 21 mol% O2 for the heat capacity of air,

  • the outer diameter of the tube for the heat transfer area, \(A = \pi D L\), and

  • the integrated form of equation 12 given in Stage 3: air-filled CSTR.

References