This closing project links all eight modules of engmaterials (constants, lattices, diffraction, atomistics, elasticity, phase_thermodynamics, phase_field and kinetics_selection) in one calculation that runs from processing to microstructure to properties for a model FCC alloy that hardens by spinodal decomposition. The steps are: (1) lattice constant and density from Vegard’s law, the shift of the X-ray peaks, the vacancy fraction and the Peierls–Nabarro stress; (2) Voigt–Reuss–Hill moduli and the Pugh ratio (); (3) the spinodal region of a regular solution and the domain size from a two-dimensional Cahn–Hilliard simulation; (4) a yield-strength model that adds Hall–Petch and modulation hardening, and the Pareto front of low density against high yield strength.
The alloy is a teaching model, not a real material. Real Al–Cu dissolves at most about Cu in FCC aluminium and forms intermetallic phases beyond that; it has no FCC miscibility gap. The interaction parameter, the mobility and all strengthening coefficients below are assumed values. The numbers show how the modules connect; they are not predictions for a real alloy.
Learning objectives¶
Synthesize crystal structure, Vegard density , powder XRD peak shifts (
diffraction), vacancy concentration, and Peierls–Nabarro dislocation friction (atomistics) fromconstants.ELEMENTS_DBandlattices.Screen single-crystal cubic stiffnesses for Born mechanical stability, Zener anisotropy, polycrystalline , and intrinsic ductility () via
elasticity.Identify the thermodynamic spinodal aging window via
phase_thermodynamicsand evolve 2-D nanoscale composition modulations viaphase_field.cahn_hilliard_2d_spectral.Combine
kinetics_selection.hall_petch_yield_strengthand nanoscale spinodal strengthening to select non-dominated(density, yield_strength)ICME alloy schedules viakinetics_selection.pareto_frontier_2d.
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. ICME Pillar 1 & 2: Crystal Lattice, XRD, Atomistics & Polycrystalline Ductility¶
Consider a hypothetical FCC solid solution across solute mole fraction by combining elemental end-members in constants.ELEMENTS_DB:
Crystallography & Density (
lattices): By Vegard’s law, and on an FCC lattice (, cell volume ), yielding theoretical mass density (lattices.theoretical_density_g_cm3) and slip-plane spacing (lattices.interplanar_spacing).X-Ray Characterization & Atomistics (
diffraction,atomistics):diffraction.simulate_powder_xrdpredicts the shift of the Bragg peak with composition,diffraction.scherrer_crystallite_size_nmmeasures coherent domain size,atomistics.vacancy_equilibrium_fractiongives the thermal vacancy concentration driving substitutional aging diffusion, andatomistics.peierls_nabarro_stressevaluates the intrinsic FCC lattice friction ().Polycrystalline Elasticity & Pugh Ductility (
elasticity): Interpolating throughelasticity.voigt_reuss_hill_cubicyields , and the Pugh (1954) criterion separating intrinsically ductile FCC alloys from brittle covalent crystals.
heading("Demonstration 1: Stage 1 & 2 ICME Screening — Lattice Density, XRD, Atomistics & Pugh Ductility")
el_A, el_B = constants.ELEMENTS_DB["Al"], constants.ELEMENTS_DB["Cu"]
def screen_fcc_alloy_composition(x_sol: float, T_homog_K: float = 850.0) -> dict:
"""Link constants, lattices, diffraction, atomistics, and elasticity for an FCC Al_{1-x}Cu_x model alloy."""
a_alloy = (1.0 - x_sol) * el_A["a_A"] + x_sol * el_B["a_A"]
mw_alloy = (1.0 - x_sol) * el_A["Mw"] + x_sol * el_B["Mw"]
z_alloy = (1.0 - x_sol) * el_A["Z"] + x_sol * el_B["Z"]
cell = lattices.cubic_unit_cell("fcc", a_A=a_alloy)
vol_A3 = lattices.metric_tensor(cell["lattice_vectors"])["volume_A3"]
rho_kg_m3 = 1000.0 * lattices.theoretical_density_g_cm3(mw_alloy, cell["n_atoms"], vol_A3)
d111 = lattices.interplanar_spacing((1, 1, 1), cell["lattice_vectors"])
b_burgers = a_alloy / np.sqrt(2.0)
xrd_peaks = diffraction.simulate_powder_xrd("fcc", a_A=a_alloy, max_hkl=2, atomic_Z=z_alloy)
tt_111 = xrd_peaks[0]["two_theta_deg"]
c11 = (1.0 - x_sol) * el_A["C11_GPa"] + x_sol * el_B["C11_GPa"]
c12 = (1.0 - x_sol) * el_A["C12_GPa"] + x_sol * el_B["C12_GPa"]
c44 = (1.0 - x_sol) * el_A["C44_GPa"] + x_sol * el_B["C44_GPa"]
born = elasticity.verify_born_stability_cubic(c11, c12, c44)
vrh = elasticity.voigt_reuss_hill_cubic(c11, c12, c44)
az = elasticity.zener_anisotropy(c11, c12, c44)
pn = atomistics.peierls_nabarro_stress(G_GPa=vrh["G_hill"], nu=vrh["nu_hill"], b_A=b_burgers, d_A=d111)
xv = atomistics.vacancy_equilibrium_fraction(T_homog_K, E_v_eV=0.75 + 0.30 * x_sol, S_v_kB=1.5)
return {
"x": x_sol, "a_A": a_alloy, "rho_kg_m3": rho_kg_m3, "tt_111_deg": tt_111,
"b_nm": 0.1 * b_burgers, "born_stable": born["stable"], "A_Z": az,
"E_GPa": vrh["E_hill"], "G_GPa": vrh["G_hill"], "pugh_B_G": vrh["pugh_B_over_G"],
"ductile": vrh["ductile_by_pugh"], "tau_pn_MPa": pn["tau_pn_MPa"], "x_vac": float(xv),
}
print(f"{'x_Cu':>6s} | {'a [A]':>7s} | {'rho [kg/m^3]':>12s} | {'2theta_111':>10s} | {'E_Hill [GPa]':>12s} | {'Pugh B/G':>9s} | {'tau_PN [MPa]':>12s} | {'x_vac(850K)':>11s}")
print("-" * 102)
for x_val in [0.00, 0.25, 0.35, 0.50]:
sc = screen_fcc_alloy_composition(x_val)
print(f"{sc['x']:6.2f} | {sc['a_A']:7.4f} | {sc['rho_kg_m3']:12.0f} | {sc['tt_111_deg']:10.2f} | "
f"{sc['E_GPa']:12.1f} | {sc['pugh_B_G']:9.2f} | {sc['tau_pn_MPa']:12.1f} | {sc['x_vac']:11.2e}")
assert sc["born_stable"] is True and sc["ductile"] is True
# Contrast against covalent Silicon in ELEMENTS_DB (Pugh B/G < 1.75 -> intrinsically brittle):
si_el = constants.ELEMENTS_DB["Si"]
si_vrh = elasticity.voigt_reuss_hill_cubic(si_el["C11_GPa"], si_el["C12_GPa"], si_el["C44_GPa"])
print(f"\nBrittle reference check — Diamond-cubic Si: Pugh B/G = {si_vrh['pugh_B_over_G']:.2f} (< 1.75), ductile_by_pugh = {si_vrh['ductile_by_pugh']}")
assert si_vrh["ductile_by_pugh"] is False
Demonstration 1: Stage 1 & 2 ICME Screening — Lattice Density, XRD, Atomistics & Pugh Ductility
===============================================================================================
x_Cu | a [A] | rho [kg/m^3] | 2theta_111 | E_Hill [GPa] | Pugh B/G | tau_PN [MPa] | x_vac(850K)
------------------------------------------------------------------------------------------------------
0.00 | 4.0495 | 2699 | 38.47 | 70.4 | 2.92 | 31.3 | 1.60e-04
0.25 | 3.9409 | 3920 | 39.58 | 86.6 | 2.84 | 40.2 | 5.75e-05
0.35 | 3.8974 | 4463 | 40.04 | 92.5 | 2.83 | 43.1 | 3.82e-05
0.50 | 3.8322 | 5342 | 40.75 | 101.1 | 2.83 | 47.0 | 2.07e-05
Brittle reference check — Diamond-cubic Si: Pugh B/G = 1.47 (< 1.75), ductile_by_pugh = False
What Demonstration 1 shows. Alloying the smaller, stiffer () into light (, ) contracts the FCC lattice, shifts the Bragg peak upward ( at ), raises from 70.4 to , raises the density () and keeps the Pugh ratio in the ductile range (, unlike covalent at ).
2. ICME Pillar 3: CALPHAD Spinodal Heat-Treatment Window & 2-D Phase-Field Microstructure¶
Next, assume that the FCC solid solution is a regular solution with the interaction parameter (phase_thermodynamics):
Solutionizing Window ():
phase_thermodynamics.regular_solution_critical_tempgives (). Homogenizing at dissolves all second phases into a single uniform FCC solid solution.Spinodal Aging Dome (): Quenching inside
phase_thermodynamics.regular_solution_spinodal(T_age, Omega)triggers barrierless Cahn–Hilliard spinodal decomposition (phase_field.cahn_hilliard_2d_spectral) with equilibrium precipitate fraction set byregular_solution_binodal+lever_ruleand effective mobility scaled bykinetics_selection.arrhenius_diffusivity.
heading("Demonstration 2: Stage 3 ICME — CALPHAD Binodal/Spinodal Window & 2-D Phase-Field Aging")
omega_alloy = 14_500.0 # [J/mol]
Tc_alloy = phase_thermodynamics.regular_solution_critical_temp(omega_alloy)
T_dome = np.linspace(450.0, Tc_alloy - 2.0, 80)
bin_pts = np.array([phase_thermodynamics.regular_solution_binodal(float(T_v), omega_alloy) for T_v in T_dome])
spin_pts = np.array([phase_thermodynamics.regular_solution_spinodal(float(T_v), omega_alloy) for T_v in T_dome])
print(f"CALPHAD Regular-Solution Consolute Critical Temperature T_c = {Tc_alloy:.2f} K ({Tc_alloy - 273.15:.1f} C)")
for T_ag in [560.0, 640.0, 720.0]:
xb = phase_thermodynamics.regular_solution_binodal(T_ag, omega_alloy)
xs = phase_thermodynamics.regular_solution_spinodal(T_ag, omega_alloy)
lv = phase_thermodynamics.lever_rule(0.40, xb[0], xb[1])
print(f" T_age = {T_ag:.0f} K | Binodal [{xb[0]:.3f}, {xb[1]:.3f}] | Spinodal [{xs[0]:.3f}, {xs[1]:.3f}] | f_beta(x=0.40) = {lv['f_beta']:.3f}")
assert xb[0] < xs[0] < 0.40 < xs[1] < xb[1]
# Couple Arrhenius mobility into 2-D Cahn-Hilliard (32x32 nm periodic representative volume element, 1 nm/pixel):
rng_icme = np.random.default_rng(1702)
noise_36 = rng_icme.uniform(-0.015, 0.015, size=(32, 32))
noise_36 -= np.mean(noise_36)
_NANO_CACHE: dict[tuple[float, float, float], dict] = {}
def simulate_spinodal_nanostructure(x_sol: float, T_age_K: float, t_age_h: float) -> dict:
"""Evolve 2-D spinodal nanostructure on a 32x32 nm RVE with thermally activated mobility and driving force."""
key = (round(float(x_sol), 4), round(float(T_age_K), 2), round(float(t_age_h), 3))
if key in _NANO_CACHE:
return _NANO_CACHE[key]
spin = phase_thermodynamics.regular_solution_spinodal(T_age_K, omega_alloy)
if spin is None or not (spin[0] < x_sol < spin[1]):
return {"spinodal_active": False, "L_d_nm": np.inf, "f_beta": 0.0, "modulation_amp": 0.0}
xb = phase_thermodynamics.regular_solution_binodal(T_age_K, omega_alloy)
f_beta = phase_thermodynamics.lever_rule(x_sol, xb[0], xb[1])["f_beta"]
# Normalized mobility relative to 610 K reference diffusivity & driving force W proportional to (1 - T/Tc):
D_rel = kinetics_selection.arrhenius_diffusivity(T_age_K, 1.0, 75_000.0) / kinetics_selection.arrhenius_diffusivity(610.0, 1.0, 75_000.0)
W_eff = 6.5 * (1.0 - T_age_K / Tc_alloy)
M_eff = float(np.clip(1.0 * D_rel, 0.30, 6.0))
dt_step = 0.12 if M_eff > 2.5 else 0.22
n_steps = max(25, int(round(t_age_h * 7.5 / dt_step)))
sim = phase_field.cahn_hilliard_2d_spectral(
x_sol + noise_36, Lx=32.0, Ly=32.0, dt=dt_step, n_steps=n_steps, M=M_eff, W=W_eff, kappa=0.6, record_every=n_steps
)
amp = float(np.std(sim["final"]) * (xb[1] - xb[0]))
res_d = {"spinodal_active": True, "L_d_nm": sim["domain_sizes"][-1], "f_beta": f_beta, "modulation_amp": amp, "field": sim["final"]}
_NANO_CACHE[key] = res_d
return res_d
ag_lowT = simulate_spinodal_nanostructure(0.45, T_age_K=610.0, t_age_h=2.0)
ag_highT = simulate_spinodal_nanostructure(0.45, T_age_K=710.0, t_age_h=2.0)
print(f"\n2 h Aging at 610 K: L_d = {ag_lowT['L_d_nm']:.2f} nm, binodal-scaled amp = {ag_lowT['modulation_amp']:.3f}")
print(f"2 h Aging at 710 K: L_d = {ag_highT['L_d_nm']:.2f} nm, binodal-scaled amp = {ag_highT['modulation_amp']:.3f} (coarser & shallower)")
assert ag_highT["L_d_nm"] > ag_lowT["L_d_nm"] and ag_lowT["modulation_amp"] > ag_highT["modulation_amp"]
Demonstration 2: Stage 3 ICME — CALPHAD Binodal/Spinodal Window & 2-D Phase-Field Aging
=======================================================================================
CALPHAD Regular-Solution Consolute Critical Temperature T_c = 871.97 K (598.8 C)
T_age = 560 K | Binodal [0.061, 0.939] | Spinodal [0.201, 0.799] | f_beta(x=0.40) = 0.386
T_age = 640 K | Binodal [0.103, 0.897] | Spinodal [0.242, 0.758] | f_beta(x=0.40) = 0.374
T_age = 720 K | Binodal [0.164, 0.836] | Spinodal [0.291, 0.709] | f_beta(x=0.40) = 0.351
2 h Aging at 610 K: L_d = 6.90 nm, binodal-scaled amp = 0.298
2 h Aging at 710 K: L_d = 11.83 nm, binodal-scaled amp = 0.275 (coarser & shallower)
What Demonstration 2 shows. Thermodynamics and kinetics act together at :
At () the driving force is large, the selected wavelength is short and the mobility is low, so little coarsening occurs in two hours ().
At the driving force is smaller and the mobility higher; the initial wavelength is longer and coarsening is faster, giving .
3. ICME Pillar 4: Multi-Mechanism Yield Strength & Process–Structure–Property Pareto Design¶
In quantitative physical metallurgy, total polycrystalline yield strength combines:
Grain-boundary + lattice + solid-solution strengthening via
kinetics_selection.hall_petch_yield_strength:Nanoscale spinodal / Orowan-Cahn modulation hardening governed by modulation amplitude and spacing (peaking at an optimal nanoscale spacing before over-aging softens the alloy via ):
We evaluate a design matrix of 16 candidate ICME alloy-processing schedules spanning composition , grain size , and aging temperature , and extract the Pareto-optimal alloy designs minimizing density and maximizing yield strength (kinetics_selection.pareto_frontier_2d).
heading("Demonstration 3: Full 8-Module ICME Design Sweep & Density-vs-Yield Pareto Frontier")
def evaluate_icme_schedule(x_sol: float, d_grain_um: float, T_age_K: float, t_age_h: float = 2.5) -> dict:
"""Full 8-module ICME forward model: (x, d_grain, T_age, t_age) -> (rho, E, Pugh B/G, L_d, sigma_y)."""
lat_props = screen_fcc_alloy_composition(x_sol, T_homog_K=T_age_K)
nano = simulate_spinodal_nanostructure(x_sol, T_age_K=T_age_K, t_age_h=t_age_h)
sigma_0 = 65.0 + 3.06 * min(lat_props["tau_pn_MPa"], 25.0) + 420.0 * x_sol * (1.0 - x_sol)
sigma_hp = kinetics_selection.hall_petch_yield_strength(d_grain_um, sigma_0_MPa=sigma_0, k_hp_MPa_sqrt_um=320.0)
if nano["spinodal_active"] and nano["modulation_amp"] > 0.02:
# Coherency + modulus/Orowan nanoscale precipitation strengthening [MPa]:
b_nm = lat_props["b_nm"]
ds_spin = 180.0 * lat_props["G_GPa"] * nano["modulation_amp"] * (b_nm / (0.08 * nano["L_d_nm"] + b_nm))
else:
ds_spin = 0.0
sigma_y_total = float(sigma_hp + ds_spin)
return {
"label": f"x={x_sol:.2f}, d={d_grain_um:.1f}um, T={T_age_K:.0f}K",
"x": x_sol, "d_um": d_grain_um, "T_age_K": T_age_K,
"rho_kg_m3": lat_props["rho_kg_m3"], "E_GPa": lat_props["E_GPa"],
"pugh_B_G": lat_props["pugh_B_G"], "ductile": lat_props["ductile"],
"L_d_nm": nano["L_d_nm"], "sigma_y_MPa": sigma_y_total,
"M_tie": sigma_y_total / lat_props["rho_kg_m3"],
}
candidates = [
evaluate_icme_schedule(xv, dg, ta)
for xv in [0.28, 0.36, 0.44, 0.50]
for dg in [1.5, 12.0]
for ta in [610.0, 710.0]
]
rho_cand = np.array([c["rho_kg_m3"] for c in candidates])
sy_cand = np.array([c["sigma_y_MPa"] for c in candidates])
p_icme = kinetics_selection.pareto_frontier_2d(minimize_x=rho_cand, maximize_y=sy_cand)
print(f"Evaluated {len(candidates)} ICME alloy-processing candidates; {len(p_icme)} lie on the non-dominated Pareto frontier:")
for idx in p_icme:
c = candidates[int(idx)]
print(f" * {c['label']:28s} | rho = {c['rho_kg_m3']:5.0f} kg/m^3 | L_d = {c['L_d_nm']:5.1f} nm | sigma_y = {c['sigma_y_MPa']:6.1f} MPa | M_1 = {c['M_tie']:.3f}")
assert len(p_icme) >= 2
assert all(candidates[int(i)]["d_um"] == 1.5 for i in p_icme) # Fine grain size + peak spinodal dominates coarse-grained schedules
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(11.2, 4.3))
ax1.plot(bin_pts[:, 0], T_dome, "b-", lw=2.0, label="CALPHAD Binodal")
ax1.plot(bin_pts[:, 1], T_dome, "b-", lw=2.0)
ax1.plot(spin_pts[:, 0], T_dome, "r--", lw=2.0, label="Chemical Spinodal ($d^2G/dx^2 = 0$)")
ax1.plot(spin_pts[:, 1], T_dome, "r--", lw=2.0)
ax1.scatter([c["x"] for c in candidates], [c["T_age_K"] for c in candidates], c="k", s=28, zorder=5, label="ICME Aging Schedules")
ax1.set_xlabel("Solute mole fraction $x$ [-]")
ax1.set_ylabel("Temperature $T$ [K]")
ax1.set_title("Thermodynamic Heat-Treatment Design Map")
ax1.legend(fontsize=8)
ax2.scatter(rho_cand, sy_cand, c=[c["T_age_K"] for c in candidates], cmap="coolwarm", s=55, edgecolor="k", label="ICME Candidates")
ax2.plot(rho_cand[p_icme], sy_cand[p_icme], "g-o", lw=2.3, ms=8, label="ICME Pareto Frontier")
# Overlay Ashby benchmark metals for context:
for b_name in ["AISI 1020 Steel", "Ti-6Al-4V", "Inconel 718"]:
bp = constants.ASHBY_MATERIALS_DB[b_name]
ax2.scatter([bp["density_kg_m3"]], [bp["sigma_y_MPa"]], marker="D", s=55, label=b_name)
ax2.set_xlabel("Alloy Density $\\rho$ [$\\mathrm{kg/m^3}$] (Minimize $\\leftarrow$)")
ax2.set_ylabel("Predicted Yield Strength $\\sigma_y$ [MPa] (Maximize $\\uparrow$)")
ax2.set_title("ICME $(\\rho, \\sigma_y)$ Pareto Frontier vs. Ashby Benchmarks")
ax2.legend(fontsize=7.5)
label_panels(fig)
plt.show()
Demonstration 3: Full 8-Module ICME Design Sweep & Density-vs-Yield Pareto Frontier
===================================================================================
Evaluated 16 ICME alloy-processing candidates; 4 lie on the non-dominated Pareto frontier:
* x=0.28, d=1.5um, T=610K | rho = 4080 kg/m^3 | L_d = 7.5 nm | sigma_y = 959.7 MPa | M_1 = 0.235
* x=0.36, d=1.5um, T=610K | rho = 4519 kg/m^3 | L_d = 7.1 nm | sigma_y = 1078.0 MPa | M_1 = 0.239
* x=0.44, d=1.5um, T=610K | rho = 4981 kg/m^3 | L_d = 7.2 nm | sigma_y = 1144.5 MPa | M_1 = 0.230
* x=0.50, d=1.5um, T=610K | rho = 5342 kg/m^3 | L_d = 7.3 nm | sigma_y = 1174.5 MPa | M_1 = 0.220

Figure 17.1. The model alloy. (a) Binodal and spinodal of the assumed regular solution and the eight ageing conditions. (b) Model yield strength against density for the 16 candidates, their Pareto front and three commercial alloys from ASHBY_MATERIALS_DB for scale.
What Demonstration 3 shows. Within this model:
Every Pareto-optimal candidate has the fine grain size (, adding via Hall–Petch) and the ageing (), not the ageing.
Sweeping fraction from moves along the front: the lowest gives the lowest density (, ), and the highest model yield strength ( at ).
4. Sensitivity: the ageing curve¶
Age-hardening alloys show a hardness that first rises and then falls with ageing time, :
Under-aged (): Composition amplitude has barely grown out of the solid solution ().
Peak-aged (): Composition waves saturate near the binodal plateaus while wavelength is still just a few nanometers.
Over-aged (): Ostwald ripening coarsens without further increasing , allowing dislocations to bow easily between widely spaced domains ().
We trace a single continuous phase-field aging trajectory at and watch rise to peak hardness and then soften during over-aging.
heading("Demonstration 4: Under-Aged -> Peak-Aged -> Over-Aged Precipitation Hardening Curve")
lat_45 = screen_fcc_alloy_composition(0.45, T_homog_K=610.0)
sim_aging = phase_field.cahn_hilliard_2d_spectral(
0.45 + noise_36, Lx=32.0, Ly=32.0, dt=0.10, n_steps=320, M=1.5, W=3.5, kappa=0.5, record_every=8
)
sig0_45 = 65.0 + 3.06 * min(lat_45["tau_pn_MPa"], 25.0) + 420.0 * 0.45 * 0.55
sig_hp_45 = kinetics_selection.hall_petch_yield_strength(2.0, sigma_0_MPa=sig0_45, k_hp_MPa_sqrt_um=320.0)
sy_curve = []
amps_curve = []
for snap, ld_val in zip(sim_aging["snapshots"], sim_aging["domain_sizes"]):
amp_s = float(np.std(snap))
amps_curve.append(amp_s)
b_nm = lat_45["b_nm"]
ds = 240.0 * lat_45["G_GPa"] * amp_s * (b_nm / (0.12 * max(ld_val, 3.0) + b_nm))
sy_curve.append(sig_hp_45 + ds)
sy_curve = np.array(sy_curve)
idx_peak = int(np.argmax(sy_curve))
print(f"As-quenched (t=0) : amp = {amps_curve[0]:.4f}, sigma_y = {sy_curve[0]:.1f} MPa")
print(f"Peak-aged (t={sim_aging['times'][idx_peak]:4.1f}) : amp = {amps_curve[idx_peak]:.4f}, L_d = {sim_aging['domain_sizes'][idx_peak]:.2f} nm, PEAK sigma_y = {sy_curve[idx_peak]:.1f} MPa")
print(f"Over-aged (t={sim_aging['times'][-1]:4.1f}) : amp = {amps_curve[-1]:.4f}, L_d = {sim_aging['domain_sizes'][-1]:.2f} nm, sigma_y = {sy_curve[-1]:.1f} MPa (softened)")
assert 0 < idx_peak < len(sy_curve) - 1
assert sy_curve[idx_peak] > sy_curve[0] + 150.0 and sy_curve[idx_peak] > sy_curve[-1] + 50.0
Demonstration 4: Under-Aged -> Peak-Aged -> Over-Aged Precipitation Hardening Curve
===================================================================================
As-quenched (t=0) : amp = 0.0088, sigma_y = 505.0 MPa
Peak-aged (t= 3.2) : amp = 0.3840, L_d = 4.57 nm, PEAK sigma_y = 1591.5 MPa
Over-aged (t=32.0) : amp = 0.4172, L_d = 6.62 nm, sigma_y = 1408.0 MPa (softened)
t_age = np.array(sim_aging["times"])
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(9.6, 3.8))
ax1.plot(t_age, sy_curve, "-")
ax1.plot([t_age[idx_peak]], [sy_curve[idx_peak]], "o", color="C3", label="peak")
ax1.set_xlabel("ageing time [model units]"); ax1.set_ylabel("model yield strength [MPa]"); ax1.legend(loc="lower right")
ax2.plot(t_age, amps_curve, "-", label="amplitude (std of $c$)")
ax2.set_xlabel("ageing time [model units]"); ax2.set_ylabel("composition amplitude")
ax3 = ax2.twinx(); ax3.plot(t_age, sim_aging["domain_sizes"], "--", color="C1")
ax3.set_ylabel(r"domain size $L_d$ [nm] (dashed)")
label_panels(fig)
plt.show()
Figure 17.2. Ageing of the model alloy at . (a) Model yield strength against time, with its peak. (b) Amplitude of the composition modulation (solid) and domain size (dashed): the amplitude saturates while the domains keep coarsening, which is why the strength passes through a maximum.
Inside the algorithm¶
What Demonstration 4 shows. The model yield strength rises from as quenched to a peak of and then falls to as the domains coarsen. The shape (under-aged, peak-aged, over-aged) follows from the growth of the amplitude and of in the simulation; the absolute values depend on the assumed strengthening coefficients.
Below, a few identities that involve several modules are checked together.
Check against the library¶
heading("Inside the Algorithm: Cross-Module Verification Across All 8 engmaterials Modules")
all_8_modules = [
constants,
lattices,
diffraction,
atomistics,
elasticity,
phase_thermodynamics,
phase_field,
kinetics_selection,
]
print("Verified 8 core modules:", [m.__name__.split(".")[-1] for m in all_8_modules])
assert len(all_8_modules) == 8
# Cross-check Bragg's law + Scherrer crystallite size against nanoscale domain size L_d:
d_111_cu = lattices.interplanar_spacing((1, 1, 1), lattices.cubic_unit_cell("fcc", constants.ELEMENTS_DB["Cu"]["a_A"])["lattice_vectors"])
tt_111_cu = diffraction.bragg_two_theta_deg(d_111_cu)
d_back_cu = diffraction.bragg_d_spacing_A(tt_111_cu)
cryst_nm = diffraction.scherrer_crystallite_size_nm(beta_fwhm_rad=np.radians(0.85), two_theta_deg=tt_111_cu)
print(f"Cu (111): d = {d_111_cu:.6f} A <-> Bragg round-trip = {d_back_cu:.6f} A | Scherrer D(FWHM=0.85 deg) = {cryst_nm:.2f} nm")
assert np.isclose(d_111_cu, d_back_cu, rtol=1e-14) and 9.0 < cryst_nm < 12.0
Inside the Algorithm: Cross-Module Verification Across All 8 engmaterials Modules
=================================================================================
Verified 8 core modules: ['constants', 'lattices', 'diffraction', 'atomistics', 'elasticity', 'phase_thermodynamics', 'phase_field', 'kinetics_selection']
Cu (111): d = 2.087063 A <-> Bragg round-trip = 2.087063 A | Scherrer D(FWHM=0.85 deg) = 10.06 nm
Exercises¶
Worked solutions are in 17_solutions.ipynb. The cell below the list is a short self-check to start from.
Verify a result. Screen all 12 cubic elements in
constants.ELEMENTS_DBusinglattices.element_crystal_summary,diffraction.simulate_powder_xrd, andelasticity.voigt_reuss_hill_cubic. Verify for every element, verify the first allowed XRD reflection is for FCC, for BCC, and for diamond-cubic (with systematically absent), and verify Pugh’s classifies all 5 FCC metals as ductile and all 3 diamond-cubic semiconductors/insulators as brittle.Find how it fails. Audit two industrial ICME heat-treatment failure modes for (): (a) furnace overshoot to , where
regular_solution_spinodalreturnsNoneand everywhere; and (b) off-composition melt outside the Landau spinodal , wherecahn_hilliard_1d_spectraldamps composition fluctuations exponentially instead of forming precipitates.Implement it yourself. Implement
icme_pareto_alloy_optimizer(x_ni_grid, d_grain_grid_um)for ductile FCC solid-solution structural alloys (assumed costs of 9 USD/kg for Cu and 18 USD/kg for Ni), couplinglattices,elasticity, andkinetics_selection(hall_petch_yield_strength+pareto_frontier_2d) to find all non-dominated schedules minimizing volumetric cost () while maximizing specific yield strength ().
heading("Self-check for the exercises")
fcc_ductile = []
diamond_ductile = []
for sym, props in constants.ELEMENTS_DB.items():
if props["structure"] == "hcp":
continue
vrh_s = elasticity.voigt_reuss_hill_cubic(props["C11_GPa"], props["C12_GPa"], props["C44_GPa"])
assert vrh_s["G_voigt"] >= vrh_s["G_hill"] - 1e-12 >= vrh_s["G_reuss"] - 2e-12
if props["structure"] == "fcc":
fcc_ductile.append(vrh_s["ductile_by_pugh"])
elif props["structure"] == "diamond":
diamond_ductile.append(vrh_s["ductile_by_pugh"])
print(f"FCC metals ductile_by_pugh = {fcc_ductile} | Diamond covalent crystals ductile_by_pugh = {diamond_ductile}")
assert all(fcc_ductile) and (not any(diamond_ductile))
print("All checks passed.")
Self-check for the exercises
============================
FCC metals ductile_by_pugh = [True, True, True, True, True] | Diamond covalent crystals ductile_by_pugh = [False, False, False]
All checks passed.