According to the equilibrium Al–Cu phase diagram, an aerospace Al–4.5 wt% Cu casting lies to the left of the maximum solid solubility limit () and should freeze into single-phase -Al with zero brittle eutectic. A real casting of this alloy nevertheless contains interdendritic eutectic and cored dendrites, because the solid does not have time to homogenize by diffusion during freezing. This lecture covers equilibrium tie-line mass balance (lever_rule), proeutectic vs. eutectic microconstituent accounting, and non-equilibrium casting without solid back-diffusion via scheil_gulliver_solidification.
Learning objectives¶
Derive and apply the inverse-arm mass-balance
phase_thermodynamics.lever_ruleacross binary two-phase tie-lines.Distinguish total equilibrium phase fractions () from proeutectic primary vs. lamellar eutectic microconstituent fractions across a eutectic isotherm.
Integrate the differential solute-redistribution ODE to obtain
phase_thermodynamics.scheil_gulliver_solidification() and verify exact global solute conservation .Quantify dendritic coring, non-equilibrium eutectic formation, and post-cast homogenization annealing kinetics ().
Time: about 60 min
try: # use the installed package, or the copy in this repository
import engmaterials
except ImportError:
import pathlib, subprocess, sys
for _root in [pathlib.Path.cwd(), *pathlib.Path.cwd().parents]:
if (_root / "engmaterials" / "__init__.py").exists():
sys.path.insert(0, str(_root))
break
else: # on Google Colab: install from GitHub
subprocess.run([sys.executable, "-m", "pip", "install", "-q",
"git+https://github.com/ktwyw/engmaterials.git"], check=True)
import engmaterials
import inspect
import numpy as np
import matplotlib.pyplot as plt
from engmaterials import (atomistics, constants, diffraction, elasticity, kinetics_selection,
lattices, phase_field, phase_thermodynamics)
from engmaterials.plotting import label_panels, panel_label, use_style
use_style()
def show_source(obj):
"""Return the source code of a library function or class."""
return inspect.getsource(obj)
def heading(text):
print(f"\n{text}\n" + "=" * len(text))1. Tie-Line Mass Balance & the Equilibrium Lever Rule¶
Consider one mole (or unit mass) of an alloy of overall composition equilibrated inside a two-phase field at temperature . Total amount conservation () and solute conservation () form a linear system whose unique solution is the inverse-arm Lever Rule (phase_thermodynamics.lever_rule):
A lever gives the picture: think of as a fulcrum balancing weights at and at , , so the phase fraction of is proportional to the opposite tie-line arm .
heading("Demonstration 1: Equilibrium Solidification Path of Cu-50 at.% Ni via Seltz + Lever Rule")
x0_cuni = 0.50
T_path = [1558.0, 1552.0, 1546.0, 1540.0, 1534.0]
print(f"Overall alloy composition x0 = {x0_cuni:.3f} Ni")
print(f"{'T [K]':>7s} | {'x_L (Liquidus)':>14s} | {'x_S (Solidus)':>14s} | {'f_Liquid':>10s} | {'f_Solid':>10s} | {'Mass Balance x_chk':>18s}")
print("-" * 88)
for tk in T_path:
bounds = phase_thermodynamics.isomorphous_phase_boundaries(tk, 1357.77, 13260.0, 1728.0, 17480.0)
xl, xs = bounds["x_liquidus"], bounds["x_solidus"]
if xl <= x0_cuni <= xs:
fr = phase_thermodynamics.lever_rule(x0_cuni, xl, xs)
f_liq, f_sol = fr["f_alpha"], fr["f_beta"]
x_chk = f_liq * xl + f_sol * xs
print(f"{tk:7.1f} | {xl:14.4f} | {xs:14.4f} | {f_liq:10.4f} | {f_sol:10.4f} | {x_chk:18.8f}")
assert np.isclose(f_liq + f_sol, 1.0, atol=1e-15)
assert np.isclose(x_chk, x0_cuni, atol=1e-15)
Demonstration 1: Equilibrium Solidification Path of Cu-50 at.% Ni via Seltz + Lever Rule
========================================================================================
Overall alloy composition x0 = 0.500 Ni
T [K] | x_L (Liquidus) | x_S (Solidus) | f_Liquid | f_Solid | Mass Balance x_chk
----------------------------------------------------------------------------------------
1558.0 | 0.4967 | 0.5672 | 0.9534 | 0.0466 | 0.50000000
1552.0 | 0.4803 | 0.5513 | 0.7222 | 0.2778 | 0.50000000
1546.0 | 0.4639 | 0.5353 | 0.4947 | 0.5053 | 0.50000000
1540.0 | 0.4476 | 0.5193 | 0.2694 | 0.7306 | 0.50000000
1534.0 | 0.4315 | 0.5032 | 0.0450 | 0.9550 | 0.50000000
T_line = np.linspace(1357.77, 1728.0, 200)
lens = [phase_thermodynamics.isomorphous_phase_boundaries(t, 1357.77, 13260.0, 1728.0, 17480.0) for t in T_line[1:-1]]
x_liq_line = [0.0] + [b["x_liquidus"] for b in lens] + [1.0]
x_sol_line = [0.0] + [b["x_solidus"] for b in lens] + [1.0]
tie = phase_thermodynamics.isomorphous_phase_boundaries(1546.0, 1357.77, 13260.0, 1728.0, 17480.0)
fig, ax = plt.subplots(figsize=(6.4, 4.0))
ax.plot(x_liq_line, T_line, "-", label="liquidus"); ax.plot(x_sol_line, T_line, "--", label="solidus")
ax.plot([tie["x_liquidus"], tie["x_solidus"]], [1546.0, 1546.0], "k-o", ms=4, lw=1.0, label="tie-line at 1546 K")
ax.plot([x0_cuni], [1546.0], "s", color="C3", label="alloy, 50 at.% Ni")
ax.set_xlabel("mole fraction of Ni"); ax.set_ylabel("temperature [K]"); ax.legend(loc="upper left")
plt.show()
Figure 11.1. Liquidus and solidus of Cu–Ni in the ideal-solution model, with the tie-line at 1546 K. The lever rule gives the phase fractions from the distances of the alloy composition to the two ends of the tie-line.
What Demonstration 1 shows. Under infinitely slow cooling (complete solid and liquid diffusion), Cu–50 at.% Ni forms its first Ni-rich solid () just below in this ideal-solution model; as cooling proceeds, the solid takes up Cu by solid-state diffusion until the last Cu-enriched liquid () disappears near , with at every step.
2. Eutectic Tie-Lines: Total Phase Fractions vs. Microconstituent Fractions¶
In a binary eutectic system at eutectic temperature (such as Pb–Sn solder: , , , ), cooling a hypoeutectic alloy () across produces two visually distinct microconstituents:
Primary (proeutectic) dendrites formed above : .
Lamellar eutectic microconstituent formed from the remaining liquid of composition at : .
Just below , the total phase equals primary plus the lamellae embedded inside the eutectic colonies.
heading("Demonstration 2: Pb-Sn Eutectic Solder — Primary vs Eutectic Microconstituent Accounting")
x_alpha_sn, x_eut_sn, x_beta_sn = 0.183, 0.619, 0.978 # wt fraction Sn at TE = 183 C
# Fraction of alpha inside pure eutectic colonies (x0 = x_E):
eut_internal = phase_thermodynamics.lever_rule(x_eut_sn, x_alpha_sn, x_beta_sn)
f_alpha_in_E = eut_internal["f_alpha"]
print(f"{'Alloy x0':>9s} | {'Regime':13s} | {'f_primary':>10s} | {'f_Eutectic':>10s} | {'f_alpha_tot':>11s} | {'f_beta_tot':>10s}")
print("-" * 78)
for x0 in [0.30, 0.45, 0.619, 0.80]:
tot = phase_thermodynamics.lever_rule(x0, x_alpha_sn, x_beta_sn)
if x0 <= x_eut_sn:
reg = "Hypoeutectic"
above = phase_thermodynamics.lever_rule(x0, x_alpha_sn, x_eut_sn)
f_prim, f_E = above["f_alpha"], above["f_beta"]
# Exact identity: f_alpha_primary + f_E * f_alpha_in_E == f_alpha_total
assert np.isclose(f_prim + f_E * f_alpha_in_E, tot["f_alpha"], atol=1e-14)
else:
reg = "Hypereutectic"
above = phase_thermodynamics.lever_rule(x0, x_eut_sn, x_beta_sn)
f_E, f_prim = above["f_alpha"], above["f_beta"]
assert np.isclose(f_E * f_alpha_in_E, tot["f_alpha"], atol=1e-14)
print(f"{x0:9.3f} | {reg:13s} | {f_prim:10.4f} | {f_E:10.4f} | {tot['f_alpha']:11.4f} | {tot['f_beta']:10.4f}")
Demonstration 2: Pb-Sn Eutectic Solder — Primary vs Eutectic Microconstituent Accounting
========================================================================================
Alloy x0 | Regime | f_primary | f_Eutectic | f_alpha_tot | f_beta_tot
------------------------------------------------------------------------------
0.300 | Hypoeutectic | 0.7317 | 0.2683 | 0.8528 | 0.1472
0.450 | Hypoeutectic | 0.3876 | 0.6124 | 0.6642 | 0.3358
0.619 | Hypoeutectic | 0.0000 | 1.0000 | 0.4516 | 0.5484
0.800 | Hypereutectic | 0.5042 | 0.4958 | 0.2239 | 0.7761
What Demonstration 2 shows. In plumbing-grade Pb–30 wt% Sn solder (), of the microstructure solidifies over a wide mushy zone as coarse primary -Pb dendrites (enabling pasty wiping), whereas eutectic Pb–61.9 wt% Sn (, ) freezes isothermally at into a fine lamellar composite ideal for electronics reflow.
3. Non-Equilibrium Scheil–Gulliver Solidification & Global Solute Conservation¶
In real foundry casting, liquid diffusivity () is faster than substitutional solid diffusivity (). Assuming complete liquid mixing (), zero solid back-diffusion (), and local interfacial partitioning ( constant), advancing the solid fraction by rejects . Integrating from gives the Scheil–Gulliver equations (phase_thermodynamics.scheil_gulliver_solidification):
Equation (3.1) conserves the solute at every solid fraction:
heading("Demonstration 3: Aerospace Al-4.5 wt% Cu Casting — Scheil Coring & Non-Equilibrium Eutectic")
c0_alcu = 4.50 # [wt% Cu]
k_alcu = 0.17 # Partition ratio k = c_alpha / c_L (= 5.65 / 33.2)
c_eut_alcu = 33.0 # Eutectic liquid composition [wt% Cu]
# Exact solid fraction where interdendritic liquid reaches c_L == c_E = 33.0 wt% Cu:
fs_eut = 1.0 - (c_eut_alcu / c0_alcu) ** (1.0 / (k_alcu - 1.0))
f_eut_scheil = 1.0 - fs_eut
fs_vec = np.linspace(0.0, fs_eut, 300)
sch = phase_thermodynamics.scheil_gulliver_solidification(fs_vec, c_0=c0_alcu, k_part=k_alcu)
# Verify global solute conservation f_s * c_solid_mean + (1 - f_s) * c_liquid == c_0 everywhere:
total_solute = fs_vec * sch["c_solid_mean"] + (1.0 - fs_vec) * sch["c_liquid"]
max_cons_err = float(np.max(np.abs(total_solute - c0_alcu)))
print(f"Al-4.5 wt% Cu (k = {k_alcu}): Equilibrium eutectic = 0.00% vs Scheil non-equilibrium eutectic = {100.0*f_eut_scheil:.2f}%")
print(f"Dendrite core c_s*(0) = {sch['c_solid_interface'][0]:.3f} wt% Cu -> Dendrite rim c_s*(fs_E) = {sch['c_solid_interface'][-1]:.3f} wt% Cu")
print(f"Max global solute conservation error |f_s*c_bar_s + (1-f_s)*c_L - c0| = {max_cons_err:.3e} wt% Cu")
assert 0.08 < f_eut_scheil < 0.10
assert max_cons_err < 1e-13
fig, ax = plt.subplots(figsize=(7.2, 4.1))
ax.plot(fs_vec, sch["c_solid_interface"], lw=2.2, color="#1f77b4", label=r"Scheil Interface Solid $c_s^*(f_s)$")
ax.plot(fs_vec, sch["c_solid_mean"], "--", lw=2.0, color="#2ca02c", label=r"Cumulative Mean Solid $\bar{c}_s(f_s)$")
ax.plot(fs_vec, sch["c_liquid"], lw=2.0, color="#c0392b", label=r"Enriched Interdendritic Liquid $c_L(f_s)$")
ax.axvline(fs_eut, color="black", ls=":", lw=1.5, label=rf"Eutectic arrest $f_s = {fs_eut:.3f}$ ($f_E = {100*f_eut_scheil:.1f}\%$)")
ax.axhline(c0_alcu, color="gray", ls="-.", lw=1.2, label=rf"Overall $c_0 = {c0_alcu}$ wt% Cu")
ax.set_xlabel(r"Solidified Fraction $f_s$ [-]")
ax.set_ylabel(r"Copper Concentration [wt% Cu]")
ax.set_title("Scheil–Gulliver Microsegregation in Al–4.5 wt% Cu")
ax.legend(fontsize=8.0)
Demonstration 3: Aerospace Al-4.5 wt% Cu Casting — Scheil Coring & Non-Equilibrium Eutectic
===========================================================================================
Al-4.5 wt% Cu (k = 0.17): Equilibrium eutectic = 0.00% vs Scheil non-equilibrium eutectic = 9.07%
Dendrite core c_s*(0) = 0.765 wt% Cu -> Dendrite rim c_s*(fs_E) = 5.610 wt% Cu
Max global solute conservation error |f_s*c_bar_s + (1-f_s)*c_L - c0| = 8.882e-16 wt% Cu

Figure 11.2. Scheil–Gulliver solidification of Al–4.5 wt% Cu with a constant partition coefficient : composition of the solid at the interface, mean composition of the solid and composition of the liquid against the solid fraction. The vertical line is where the liquid reaches the eutectic composition.
What Demonstration 3 shows. Because frozen solid layers cannot absorb rejected Cu when , the first dendrite cores freeze lean at , forcing to rise to the eutectic limit at , leaving non-equilibrium interdendritic eutectic in an alloy that is single-phase on the equilibrium diagram.
4. Conceptual Exploration & Parameter Sensitivity (“What-If”: Regimes & Homogenization Annealing)¶
How does Scheil segregation behave across (zone-refining semiconductor purification), (normal solute rejection), and (peritectic/high- solute enrichment into dendrite cores)?
How do metallurgists erase dendritic coring after casting? By a homogenization anneal below , whose sinusoidal Fourier decay constant scales with the square of the secondary dendrite arm spacing .
heading("Demonstration 4: Partition Coefficient Regimes (k < 1 vs k > 1) & Dendrite Homogenization Scaling")
k_list = [0.08, 0.25, 0.70, 1.40]
print(f"{'k_part':>7s} | {'c_s*(0)/c0':>11s} | {'c_s*(0.8)/c0':>13s} | {'c_L(0.8)/c0':>12s} | {'Segregation Direction':24s}")
print("-" * 78)
for kv in k_list:
s0 = phase_thermodynamics.scheil_gulliver_solidification(0.0, c_0=1.0, k_part=kv)
s8 = phase_thermodynamics.scheil_gulliver_solidification(0.8, c_0=1.0, k_part=kv)
direction = "Rejects to liquid (cL up)" if kv < 1.0 else "Depletes liquid (cL down)"
print(f"{kv:7.2f} | {s0['c_solid_interface']:11.4f} | {s8['c_solid_interface']:13.4f} | {s8['c_liquid']:12.4f} | {direction:24s}")
if kv < 1.0:
assert s8["c_liquid"] > 1.0
else:
assert s8["c_liquid"] < 1.0 # k > 1 enriches cores and depletes residual liquid
# Homogenization time tau_99% = -ln(0.01) * lambda_2^2 / (4 * pi^2 * D_s) for Cu in Al at 525 C (D_s ~ 9e-14 m^2/s):
D_Cu_Al_525C = 9.0e-14
tau_sand_hr = (-np.log(0.01) * ((90e-6) ** 2) / (4.0 * (np.pi ** 2) * D_Cu_Al_525C)) / 3600.0
tau_chill_hr = (-np.log(0.01) * ((25e-6) ** 2) / (4.0 * (np.pi ** 2) * D_Cu_Al_525C)) / 3600.0
print(f"\n99% Homogenization at 525 C: Sand cast (lambda_2 = 90 um) = {tau_sand_hr:.2f} h vs Chill cast (25 um) = {tau_chill_hr:.2f} h ({tau_sand_hr/tau_chill_hr:.1f}x faster)")
assert np.isclose(tau_sand_hr / tau_chill_hr, (90.0 / 25.0) ** 2, rtol=1e-12)
Demonstration 4: Partition Coefficient Regimes (k < 1 vs k > 1) & Dendrite Homogenization Scaling
=================================================================================================
k_part | c_s*(0)/c0 | c_s*(0.8)/c0 | c_L(0.8)/c0 | Segregation Direction
------------------------------------------------------------------------------
0.08 | 0.0800 | 0.3517 | 4.3959 | Rejects to liquid (cL up)
0.25 | 0.2500 | 0.8359 | 3.3437 | Rejects to liquid (cL up)
0.70 | 0.7000 | 1.1345 | 1.6207 | Rejects to liquid (cL up)
1.40 | 1.4000 | 0.7354 | 0.5253 | Depletes liquid (cL down)
99% Homogenization at 525 C: Sand cast (lambda_2 = 90 um) = 2.92 h vs Chill cast (25 um) = 0.23 h (13.0x faster)
Inside the algorithm¶
In Demonstration 4, refining secondary dendrite arm spacing from (sand casting) to (permanent-mold chill casting) cuts the homogenization heat-treatment time by (from to with the assumed diffusivity). Also, when , dendrites absorb solute preferentially () and residual liquid depletes toward pure solvent.
Below we inspect phase_thermodynamics.lever_rule and phase_thermodynamics.scheil_gulliver_solidification and verify the removable-singularity handling in c_solid_mean.
Check against the library¶
heading("Inside the Algorithm: lever_rule & scheil_gulliver_solidification")
print(show_source(phase_thermodynamics.lever_rule))
print(show_source(phase_thermodynamics.scheil_gulliver_solidification))
# Verify removable L'Hopital limit lim_{fs->0} c0*(1 - (1-fs)^k)/fs == k * c0:
s_zero = phase_thermodynamics.scheil_gulliver_solidification(0.0, c_0=4.5, k_part=0.17)
s_tiny = phase_thermodynamics.scheil_gulliver_solidification(1e-9, c_0=4.5, k_part=0.17)
assert np.isclose(s_zero["c_solid_mean"], 0.17 * 4.5, rtol=1e-15, atol=1e-15)
assert np.isclose(s_tiny["c_solid_mean"], 0.17 * 4.5, rtol=1e-7)
print(f"Removable singularity verified: c_solid_mean(0) = {s_zero['c_solid_mean']:.6f} == k*c0 = {0.17*4.5:.6f}.")
Inside the Algorithm: lever_rule & scheil_gulliver_solidification
=================================================================
def lever_rule(x_overall: float | np.ndarray, x_alpha: float, x_beta: float) -> dict:
"""Compute equilibrium phase mole fractions f_alpha and f_beta inside a two-phase tie-line [x_alpha, x_beta]."""
if abs(x_beta - x_alpha) < 1e-14:
raise ValueError("Tie-line endpoints x_alpha and x_beta must be distinct.")
x0 = np.asarray(x_overall, dtype=float)
lo, hi = min(x_alpha, x_beta), max(x_alpha, x_beta)
if np.any((x0 < lo - 1e-12) | (x0 > hi + 1e-12)):
raise ValueError("x_overall must lie within the tie-line interval [x_alpha, x_beta].")
f_alpha = (x_beta - x0) / (x_beta - x_alpha)
f_beta = (x0 - x_alpha) / (x_beta - x_alpha)
if np.ndim(x_overall) == 0:
return {"f_alpha": float(f_alpha), "f_beta": float(f_beta)}
return {"f_alpha": f_alpha, "f_beta": f_beta}
def scheil_gulliver_solidification(
f_s: float | np.ndarray,
c_0: float,
k_part: float,
) -> dict:
"""Evaluate non-equilibrium Scheil-Gulliver solid composition c_s*, liquid c_L, and cumulative mean c_s."""
fs = np.asarray(f_s, dtype=float)
if np.any((fs < 0.0) | (fs >= 1.0)) or k_part <= 0.0 or c_0 < 0.0:
raise ValueError("Require f_s in [0, 1), k_part > 0, and c_0 >= 0.")
rem = 1.0 - fs
c_liq = c_0 * (rem ** (k_part - 1.0))
c_sol_if = k_part * c_liq
c_sol_avg = np.where(fs > 1e-14, c_0 * (1.0 - rem**k_part) / np.where(fs > 1e-14, fs, 1.0), k_part * c_0)
if np.ndim(f_s) == 0:
return {
"c_solid_interface": float(c_sol_if),
"c_liquid": float(c_liq),
"c_solid_mean": float(c_sol_avg),
}
return {
"c_solid_interface": c_sol_if,
"c_liquid": c_liq,
"c_solid_mean": c_sol_avg,
}
Removable singularity verified: c_solid_mean(0) = 0.765000 == k*c0 = 0.765000.
Exercises¶
Worked solutions are in 11_solutions.ipynb. The cell below the list is a short self-check to start from.
Verify a result. Verify the analytical Scheil eutectic fraction across
Al–Cualloys with (), confirming that even diluteAl–1.0 wt% Cuforms non-equilibrium eutectic when and that holds to 10-14.Find how it fails. Quantify the false mass-balance violation when instantaneous interfacial concentration is mistakenly used instead of at for , and verify
ValueErrorguards inlever_ruleandscheil_gulliver_solidification.Implement it yourself. Implement
clyne_kurz_solidification(f_s, c_0, k_part, alpha_fourier)with () and . Verify exact convergence toscheil_gulliver_solidificationas and exact convergence to the equilibrium Lever Rule as .
heading("Self-check for the exercises")
lv = phase_thermodynamics.lever_rule(0.40, 0.10, 0.90)
sg = phase_thermodynamics.scheil_gulliver_solidification(0.75, c_0=4.0, k_part=0.20)
assert np.isclose(lv["f_alpha"], 0.625, atol=1e-15) and np.isclose(lv["f_beta"], 0.375, atol=1e-15)
assert np.isclose(0.75 * sg["c_solid_mean"] + 0.25 * sg["c_liquid"], 4.0, atol=1e-14)
print(f"Lever rule f_alpha={lv['f_alpha']:.3f} | Scheil solute balance = {0.75*sg['c_solid_mean'] + 0.25*sg['c_liquid']:.6f} == 4.0.")
print("All checks passed.")
Self-check for the exercises
============================
Lever rule f_alpha=0.625 | Scheil solute balance = 4.000000 == 4.0.
All checks passed.