Chapter 2: 合金の状態図と相変態

相律、状態図の読み方、固溶体、金属間化合物、共析・包析反応

2.1 合金と状態図の基礎

合金(alloy)は、2種類以上の元素を混合して作られた金属材料です。純金属に比べて、合金は強度、耐食性、耐熱性などの特性を大幅に向上させることができます。合金の性質を理解するには、状態図(相図、phase diagram)が不可欠です。

2.1.1 相律(Gibbs の相律)

熱力学平衡状態において、系の自由度を決定する基本法則がGibbsの相律です。

Gibbsの相律:

$$F = C - P + 2$$

ここで、

  • $F$: 自由度(temperature, pressure, compositionなどの独立変数の数)
  • $C$: 成分数(elements の数)
  • $P$: 相の数(phases の数)

2成分系($C = 2$)、一定圧力(通常1気圧)の場合、圧力を固定するため自由度は1減って:

$$F = C - P + 1 = 2 - P + 1 = 3 - P$$

例:

flowchart TD A[Gibbsの相律: F = C - P + 2] --> B[2成分系, 圧力一定] B --> C[F = 3 - P] C --> D[単相領域 P=1] C --> E[二相共存 P=2] C --> F[三相共存点 P=3] D --> G[F = 2: 温度・組成を自由に選べる] E --> H[F = 1: 温度を決めれば組成が決まる] F --> I[F = 0: 温度・組成ともに固定]

2.1.2 状態図の基本要素

状態図は、温度と組成を軸とし、異なる相が安定な領域を示した図です。

  • 相境界線(Phase boundary): 異なる相の安定領域を区切る線
  • 液相線(Liquidus): これより上では完全に液体
  • 固相線(Solidus): これより下では完全に固体
  • 固溶体(Solid solution): 1つの相に2種類以上の元素が溶け込んだ状態
  • 共晶点(Eutectic point): 液相から2つの固相が同時に晶出する点
  • 共析点(Eutectoid point): 固相から2つの異なる固相が同時に生成する点

2.1.3 固溶体の種類

固溶体には、原子の配置様式により2種類があります。

  • 置換型固溶体(Substitutional solid solution): 溶質原子が溶媒原子の格子点を置換
    • 条件(Hume-Rotheryの法則):原子半径の差 < 15%、結晶構造が同じ、電気陰性度が近い、原子価が近い
    • 例:Cu-Ni、Au-Ag、Fe-Cr
  • 侵入型固溶体(Interstitial solid solution): 溶質原子が格子の隙間(interstice)に侵入
    • 条件:溶質原子が小さい(C, N, H, O など)
    • 例:Fe-C(鋼)、Ti-O

コード例1: 2成分系状態図の基本構造を可視化

import numpy as np
import matplotlib.pyplot as plt

def plot_simple_phase_diagram():
    """
    単純な2成分系状態図(共晶型)を描画

    この例では、理想化された共晶型状態図を示します。
    実際の状態図は実験データや熱力学計算で求められます。
    """
    # 組成範囲(元素Bの質量%)
    composition_B = np.linspace(0, 100, 300)

    # 液相線(Liquidus)の定義(簡略化した形状)
    T_melt_A = 1000  # 元素Aの融点 (°C)
    T_melt_B = 900   # 元素Bの融点 (°C)
    T_eutectic = 700  # 共晶温度 (°C)
    C_eutectic = 60   # 共晶組成 (質量% B)

    # 液相線の計算(放物線近似)
    liquidus = np.where(
        composition_B <= C_eutectic,
        T_melt_A - (T_melt_A - T_eutectic) * (composition_B / C_eutectic)**1.5,
        T_melt_B - (T_melt_B - T_eutectic) * ((100 - composition_B) / (100 - C_eutectic))**1.5
    )

    # 固相線(Solidus)の定義(簡略化)
    # α相の固溶限とβ相の固溶限
    C_alpha_max = 20   # α相の最大固溶度 (質量% B)
    C_beta_min = 85    # β相の最小固溶度 (質量% B)

    solidus_alpha = T_eutectic * np.ones_like(composition_B)
    solidus_beta = T_eutectic * np.ones_like(composition_B)

    # 固溶限の温度依存性(簡略化)
    for i, c in enumerate(composition_B):
        if c <= C_alpha_max:
            solidus_alpha[i] = T_eutectic + (T_melt_A - T_eutectic) * (1 - c / C_alpha_max)**2
        if c >= C_beta_min:
            solidus_beta[i] = T_eutectic + (T_melt_B - T_eutectic) * (1 - (100 - c) / (100 - C_beta_min))**2

    # プロット
    fig, ax = plt.subplots(figsize=(12, 8))

    # 液相線
    ax.plot(composition_B, liquidus, 'r-', linewidth=2.5, label='液相線 (Liquidus)')

    # 固相線
    ax.plot(composition_B[:len(composition_B)//3], solidus_alpha[:len(composition_B)//3],
            'b-', linewidth=2.5, label='固相線 (Solidus, α相)')
    ax.plot(composition_B[2*len(composition_B)//3:], solidus_beta[2*len(composition_B)//3:],
            'g-', linewidth=2.5, label='固相線 (Solidus, β相)')

    # 共晶温度の水平線
    ax.axhline(T_eutectic, color='purple', linestyle='--', linewidth=2, alpha=0.7)
    ax.text(50, T_eutectic - 30, f'共晶温度 ({T_eutectic}°C)',
            fontsize=11, ha='center', bbox=dict(boxstyle='round', facecolor='wheat', alpha=0.8))

    # 共晶点のマーカー
    ax.plot(C_eutectic, T_eutectic, 'ko', markersize=12, label='共晶点')

    # 領域のラベル
    ax.text(10, 950, '液相 (L)', fontsize=13, fontweight='bold', color='red')
    ax.text(10, 800, 'α固溶体', fontsize=12, fontweight='bold', color='blue')
    ax.text(50, 650, 'α + β', fontsize=12, fontweight='bold', color='purple')
    ax.text(90, 800, 'β固溶体', fontsize=12, fontweight='bold', color='green')
    ax.text(50, 850, 'L + α', fontsize=11, fontweight='bold', color='orange', alpha=0.7)
    ax.text(75, 850, 'L + β', fontsize=11, fontweight='bold', color='orange', alpha=0.7)

    # 軸設定
    ax.set_xlabel('組成 (質量% B)', fontsize=13, fontweight='bold')
    ax.set_ylabel('温度 (°C)', fontsize=13, fontweight='bold')
    ax.set_title('2成分系状態図(共晶型)の基本構造', fontsize=15, fontweight='bold', pad=15)
    ax.set_xlim(0, 100)
    ax.set_ylim(600, 1100)
    ax.grid(True, alpha=0.3, linestyle='--')
    ax.legend(fontsize=11, loc='upper right')

    plt.tight_layout()
    plt.savefig('simple_phase_diagram.png', dpi=300, bbox_inches='tight')
    plt.show()

    print("=" * 70)
    print("2成分系状態図の基本要素")
    print("=" * 70)
    print("\n【主要な特徴】")
    print(f"  元素Aの融点:    {T_melt_A}°C")
    print(f"  元素Bの融点:    {T_melt_B}°C")
    print(f"  共晶温度:        {T_eutectic}°C")
    print(f"  共晶組成:        {C_eutectic} 質量% B")
    print("\n【相領域】")
    print("  L:        液相")
    print("  α:        A元素が主体の固溶体")
    print("  β:        B元素が主体の固溶体")
    print("  L + α:    液相とα相の二相共存")
    print("  L + β:    液相とβ相の二相共存")
    print("  α + β:    α相とβ相の二相共存")
    print("\n【Gibbsの相律による自由度】")
    print("  単相領域 (L, α, β):     F = 2 (温度と組成を自由に選べる)")
    print("  二相共存領域:           F = 1 (温度を決めると組成が決まる)")
    print("  共晶点:                 F = 0 (温度・組成ともに固定)")
    print("=" * 70)

    print("\n✓ グラフを 'simple_phase_diagram.png' として保存しました")

# 実行
plot_simple_phase_diagram()

2.2 Fe-C状態図と鋼の組織

鉄-炭素(Fe-C)状態図は、材料科学において最も重要な状態図の1つです。鋼(steel)の性質は、炭素含有量と熱処理によって大きく変化し、これはFe-C状態図で説明できます。

2.2.1 Fe-C状態図の主要な相

2.2.2 共析反応と共晶反応

共析反応(Eutectoid reaction)

727°C、0.76質量% Cの共析点で起こる反応:

$$\gamma \text{(オーステナイト)} \rightarrow \alpha \text{(フェライト)} + \text{Fe}_3\text{C} \text{(セメンタイト)}$$

この反応で生成する層状組織をパーライトと呼びます。

共晶反応(Eutectic reaction)

1147°C、4.3質量% Cの共晶点で起こる反応:

$$L \text{(液相)} \rightarrow \gamma \text{(オーステナイト)} + \text{Fe}_3\text{C} \text{(セメンタイト)}$$

この反応で生成する組織をレデブライト(Ledeburite)と呼びます(鋳鉄に出現)。

2.2.3 鋼の分類

炭素含有量により、鉄-炭素合金は以下のように分類されます:

コード例2: Fe-C状態図の作成(簡略版)

import numpy as np
import matplotlib.pyplot as plt

def plot_fe_c_diagram():
    """
    Fe-C状態図(簡略版)を描画

    実際のFe-C状態図は非常に複雑ですが、ここでは主要な特徴を
    簡略化して示します。
    """
    # 主要な点の定義
    # 温度 (°C)
    T_alpha_max = 912    # α→γ変態温度(純鉄)
    T_gamma_max = 1394   # γ→δ変態温度(純鉄)
    T_eutectoid = 727    # 共析温度
    T_eutectic = 1147    # 共晶温度

    # 組成 (質量% C)
    C_eutectoid = 0.76   # 共析組成
    C_eutectic = 4.3     # 共晶組成
    C_max_austenite = 2.14  # γ相の最大炭素固溶度
    C_max_ferrite = 0.022   # α相の最大炭素固溶度

    # プロット
    fig, ax = plt.subplots(figsize=(14, 10))

    # 共析温度の水平線
    ax.axhline(T_eutectoid, color='purple', linestyle='--', linewidth=2, alpha=0.7, label='共析温度 (727°C)')

    # 共析点
    ax.plot(C_eutectoid, T_eutectoid, 'ro', markersize=15, label=f'共析点 ({C_eutectoid}% C, {T_eutectoid}°C)')

    # 共晶点
    ax.plot(C_eutectic, T_eutectic, 'bs', markersize=15, label=f'共晶点 ({C_eutectic}% C, {T_eutectic}°C)')

    # α/γ境界(簡略版)
    C_alpha_gamma = np.linspace(0, C_max_ferrite, 50)
    T_alpha_gamma = T_alpha_max + (T_eutectoid - T_alpha_max) * (C_alpha_gamma / C_max_ferrite)**0.5
    ax.plot(C_alpha_gamma, T_alpha_gamma, 'b-', linewidth=2.5, label='α/γ境界')

    # γ相領域の右側境界(γ/γ+Fe₃C)
    C_gamma_right = np.linspace(C_eutectoid, C_max_austenite, 50)
    T_gamma_right = T_eutectoid + (T_eutectic - T_eutectoid) * (C_gamma_right - C_eutectoid) / (C_max_austenite - C_eutectoid)
    ax.plot(C_gamma_right, T_gamma_right, 'g-', linewidth=2.5, label='γ/γ+Fe₃C境界')

    # 液相線(簡略版)
    C_liquidus = np.linspace(0, C_eutectic, 100)
    T_liquidus = 1538 - 200 * C_liquidus  # 簡略化した直線近似
    ax.plot(C_liquidus, T_liquidus, 'r-', linewidth=2.5, label='液相線')

    # セメンタイトの垂直線
    ax.axvline(6.67, color='black', linestyle='-', linewidth=2, alpha=0.5, label='セメンタイト (Fe₃C)')

    # 領域のラベル
    ax.text(0.1, 1200, 'γ\n(オーステナイト)', fontsize=14, fontweight='bold', ha='center', color='darkgreen')
    ax.text(0.3, 600, 'α + パーライト', fontsize=12, fontweight='bold', ha='center', color='blue')
    ax.text(1.5, 600, 'パーライト\n+ Fe₃C', fontsize=12, fontweight='bold', ha='center', color='purple')
    ax.text(C_eutectoid, 820, 'パーライト', fontsize=11, fontweight='bold', ha='center',
            bbox=dict(boxstyle='round', facecolor='yellow', alpha=0.7))

    # 鋼の分類領域を示す
    ax.axvspan(0, C_eutectoid, alpha=0.15, color='blue', label='亜共析鋼')
    ax.axvspan(C_eutectoid, C_max_austenite, alpha=0.15, color='red', label='過共析鋼')
    ax.axvspan(C_max_austenite, 6.67, alpha=0.15, color='gray', label='鋳鉄')

    # 軸設定
    ax.set_xlabel('炭素含有量 (質量% C)', fontsize=14, fontweight='bold')
    ax.set_ylabel('温度 (°C)', fontsize=14, fontweight='bold')
    ax.set_title('Fe-C状態図(簡略版)', fontsize=16, fontweight='bold', pad=20)
    ax.set_xlim(0, 7)
    ax.set_ylim(500, 1600)
    ax.grid(True, alpha=0.3, linestyle='--')
    ax.legend(fontsize=10, loc='upper right')

    # 重要な組成位置に縦線
    ax.axvline(C_eutectoid, color='purple', linestyle=':', linewidth=1.5, alpha=0.5)
    ax.axvline(C_max_austenite, color='green', linestyle=':', linewidth=1.5, alpha=0.5)

    plt.tight_layout()
    plt.savefig('fe_c_phase_diagram_simplified.png', dpi=300, bbox_inches='tight')
    plt.show()

    # 情報出力
    print("=" * 80)
    print("Fe-C状態図の主要な点")
    print("=" * 80)
    print(f"\n共析点:       {C_eutectoid}質量% C, {T_eutectoid}°C")
    print(f"  反応: γ → α + Fe₃C (パーライト生成)")
    print(f"\n共晶点:       {C_eutectic}質量% C, {T_eutectic}°C")
    print(f"  反応: L → γ + Fe₃C (レデブライト生成)")
    print(f"\nα相の最大炭素固溶度: {C_max_ferrite}質量% C ({T_eutectoid}°C)")
    print(f"γ相の最大炭素固溶度: {C_max_austenite}質量% C ({T_eutectic}°C)")
    print("\n【鋼の分類】")
    print(f"  亜共析鋼:     0 ~ {C_eutectoid}質量% C")
    print(f"  共析鋼:       {C_eutectoid}質量% C")
    print(f"  過共析鋼:     {C_eutectoid} ~ {C_max_austenite}質量% C")
    print(f"  鋳鉄:         {C_max_austenite} ~ 6.67質量% C")
    print("=" * 80)

    print("\n✓ グラフを 'fe_c_phase_diagram_simplified.png' として保存しました")

# 実行
plot_fe_c_diagram()

コード例3: てこの法則による相分率計算

import numpy as np
import matplotlib.pyplot as plt

def lever_rule_calculation(C_total, C_alpha, C_beta, T):
    """
    てこの法則(Lever rule)で各相の質量分率を計算

    Parameters:
    -----------
    C_total : float
        全体の組成 (質量% B)
    C_alpha : float
        α相の組成 (質量% B)
    C_beta : float
        β相の組成 (質量% B)
    T : float
        温度 (°C)

    Returns:
    --------
    f_alpha : float
        α相の質量分率
    f_beta : float
        β相の質量分率
    """
    # てこの法則
    # f_α = (C_β - C_total) / (C_β - C_α)
    # f_β = (C_total - C_α) / (C_β - C_α)

    if C_alpha == C_beta:
        # 単相領域の場合
        if abs(C_total - C_alpha) < 1e-6:
            return 1.0, 0.0
        else:
            raise ValueError("組成が相境界外です")

    f_alpha = (C_beta - C_total) / (C_beta - C_alpha)
    f_beta = (C_total - C_alpha) / (C_beta - C_alpha)

    # 分率は0~1の範囲
    f_alpha = np.clip(f_alpha, 0, 1)
    f_beta = np.clip(f_beta, 0, 1)

    return f_alpha, f_beta

# 例題:Fe-0.4% C鋼を800°Cから室温まで冷却
print("=" * 80)
print("てこの法則による相分率計算の例題")
print("=" * 80)
print("\n【問題設定】")
print("Fe-0.4質量% C鋼(亜共析鋼)を727°C直下まで冷却したとき、")
print("フェライトとパーライトの質量分率を計算してください。")

# 与えられた値
C_steel = 0.4        # 鋼の炭素含有量 (質量% C)
C_ferrite = 0.022    # フェライトの炭素含有量 (質量% C)
C_eutectoid = 0.76   # 共析組成(パーライト) (質量% C)
T = 727              # 温度 (°C)

# てこの法則で計算
f_ferrite, f_pearlite = lever_rule_calculation(C_steel, C_ferrite, C_eutectoid, T)

print(f"\n【与えられた値】")
print(f"  鋼の組成:           {C_steel}質量% C")
print(f"  フェライトの組成:   {C_ferrite}質量% C")
print(f"  パーライトの組成:   {C_eutectoid}質量% C(共析組成)")
print(f"  温度:               {T}°C(共析温度直下)")

print(f"\n【てこの法則の適用】")
print(f"  f_フェライト = (C_パーライト - C_鋼) / (C_パーライト - C_フェライト)")
print(f"               = ({C_eutectoid} - {C_steel}) / ({C_eutectoid} - {C_ferrite})")
print(f"               = {f_ferrite:.4f} = {f_ferrite * 100:.2f}%")
print(f"  ")
print(f"  f_パーライト = (C_鋼 - C_フェライト) / (C_パーライト - C_フェライト)")
print(f"               = ({C_steel} - {C_ferrite}) / ({C_eutectoid} - {C_ferrite})")
print(f"               = {f_pearlite:.4f} = {f_pearlite * 100:.2f}%")

print(f"\n【検算】")
print(f"  f_フェライト + f_パーライト = {f_ferrite + f_pearlite:.4f} ✓")

# 可視化
fig, ax = plt.subplots(figsize=(12, 6))

# 組成軸
compositions = [C_ferrite, C_steel, C_eutectoid]
labels = ['フェライト\n(α)', '鋼の組成\n(0.4% C)', 'パーライト\n(共析組成)']
colors = ['blue', 'red', 'purple']

for c, label, color in zip(compositions, labels, colors):
    ax.axvline(c, color=color, linestyle='--', linewidth=2, alpha=0.7)
    ax.text(c, 0.9, label, ha='center', fontsize=11, fontweight='bold',
            bbox=dict(boxstyle='round', facecolor=color, alpha=0.3))

# てこの法則の可視化
ax.plot([C_ferrite, C_eutectoid], [0.5, 0.5], 'k-', linewidth=3, label='てこ')
ax.plot(C_steel, 0.5, 'ro', markersize=15, label='支点(鋼の組成)')

# 距離の表示
ax.annotate('', xy=(C_ferrite, 0.35), xytext=(C_steel, 0.35),
            arrowprops=dict(arrowstyle='<->', color='blue', lw=2))
ax.text((C_ferrite + C_steel) / 2, 0.3, f'{C_steel - C_ferrite:.3f}%',
        ha='center', fontsize=10, color='blue', fontweight='bold')

ax.annotate('', xy=(C_steel, 0.35), xytext=(C_eutectoid, 0.35),
            arrowprops=dict(arrowstyle='<->', color='purple', lw=2))
ax.text((C_steel + C_eutectoid) / 2, 0.3, f'{C_eutectoid - C_steel:.3f}%',
        ha='center', fontsize=10, color='purple', fontweight='bold')

# 質量分率の表示
ax.text(C_ferrite - 0.1, 0.7, f'質量分率\n{f_ferrite * 100:.1f}%',
        ha='center', fontsize=12, fontweight='bold',
        bbox=dict(boxstyle='round', facecolor='lightblue', alpha=0.8))
ax.text(C_eutectoid + 0.1, 0.7, f'質量分率\n{f_pearlite * 100:.1f}%',
        ha='center', fontsize=12, fontweight='bold',
        bbox=dict(boxstyle='round', facecolor='lightcoral', alpha=0.8))

ax.set_xlabel('炭素含有量 (質量% C)', fontsize=13, fontweight='bold')
ax.set_ylabel('', fontsize=13)
ax.set_title('てこの法則による相分率計算(Fe-0.4% C鋼)', fontsize=15, fontweight='bold', pad=15)
ax.set_xlim(0, 1.0)
ax.set_ylim(0, 1)
ax.set_yticks([])
ax.legend(fontsize=11, loc='upper left')
ax.grid(axis='x', alpha=0.3)

plt.tight_layout()
plt.savefig('lever_rule_example.png', dpi=300, bbox_inches='tight')
plt.show()

print("\n" + "=" * 80)
print("【結論】")
print("=" * 80)
print(f"Fe-0.4質量% C鋼を共析温度直下まで冷却すると、")
print(f"  フェライト:  {f_ferrite * 100:.1f}質量%")
print(f"  パーライト:  {f_pearlite * 100:.1f}質量%")
print(f"の組織となります。")
print("\nこれは典型的な亜共析鋼の組織であり、")
print("初析フェライト(白色、軟らかい)とパーライト(層状組織)から")
print("構成されます。炭素含有量が増えるほど、パーライト分率が増加し、")
print("強度・硬度が上昇します。")
print("=" * 80)

print("\n✓ グラフを 'lever_rule_example.png' として保存しました")

2.3 相変態の熱力学

相変態(phase transformation)は、温度や圧力の変化により、ある相から別の相へと変化する現象です。相変態を理解するには、Gibbs自由エネルギーの概念が重要です。

2.3.1 Gibbs自由エネルギー

Gibbs自由エネルギーの定義:

$$G = H - TS$$

ここで、$G$: Gibbs自由エネルギー、$H$: エンタルピー、$T$: 温度、$S$: エントロピー

平衡状態では、系のGibbs自由エネルギーが最小になります。温度が変化すると、最もGibbs自由エネルギーが低い相が安定相となり、相変態が起こります。

2.3.2 相変態の駆動力

相変態が起こるための駆動力は、2つの相のGibbs自由エネルギー差です。

$$\Delta G = G_{\beta} - G_{\alpha}$$

$\Delta G < 0$ のとき、α相からβ相への変態が熱力学的に有利です。

コード例4: Gibbs自由エネルギーと相安定性の可視化

import numpy as np
import matplotlib.pyplot as plt

def gibbs_energy_phases(T):
    """
    2つの相(αとβ)のGibbs自由エネルギーを温度の関数として計算

    簡略化したモデル:
    G_α = H_α - T * S_α
    G_β = H_β - T * S_β

    ここでは、β相がより高いエントロピーを持つと仮定
    """
    # パラメータ(任意単位)
    H_alpha = 1000  # α相のエンタルピー
    H_beta = 1200   # β相のエンタルピー(α相より高い)
    S_alpha = 5     # α相のエントロピー
    S_beta = 8      # β相のエントロピー(α相より高い)

    G_alpha = H_alpha - T * S_alpha
    G_beta = H_beta - T * S_beta

    return G_alpha, G_beta

# 温度範囲
temperatures = np.linspace(0, 500, 1000)

# 各温度でのGibbs自由エネルギーを計算
G_alpha_values = []
G_beta_values = []

for T in temperatures:
    G_alpha, G_beta = gibbs_energy_phases(T)
    G_alpha_values.append(G_alpha)
    G_beta_values.append(G_beta)

G_alpha_values = np.array(G_alpha_values)
G_beta_values = np.array(G_beta_values)

# 平衡温度(G_α = G_β となる温度)
# H_α - T_eq * S_α = H_β - T_eq * S_β
# T_eq = (H_β - H_α) / (S_β - S_α)
H_alpha = 1000
H_beta = 1200
S_alpha = 5
S_beta = 8
T_equilibrium = (H_beta - H_alpha) / (S_beta - S_alpha)

print("=" * 70)
print("Gibbs自由エネルギーと相変態")
print("=" * 70)
print(f"\nパラメータ:")
print(f"  α相: H_α = {H_alpha}, S_α = {S_alpha}")
print(f"  β相: H_β = {H_beta}, S_β = {S_beta}")
print(f"\n平衡温度 T_eq = (H_β - H_α) / (S_β - S_α)")
print(f"             = ({H_beta} - {H_alpha}) / ({S_beta} - {S_alpha})")
print(f"             = {T_equilibrium:.2f}")
print(f"\n相の安定性:")
print(f"  T < {T_equilibrium:.2f}: G_α < G_β → α相が安定")
print(f"  T = {T_equilibrium:.2f}: G_α = G_β → 平衡")
print(f"  T > {T_equilibrium:.2f}: G_α > G_β → β相が安定")
print("=" * 70)

# プロット
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(16, 6))

# 左図: Gibbs自由エネルギーの温度依存性
ax1.plot(temperatures, G_alpha_values, 'b-', linewidth=2.5, label='α相')
ax1.plot(temperatures, G_beta_values, 'r-', linewidth=2.5, label='β相')
ax1.axvline(T_equilibrium, color='green', linestyle='--', linewidth=2, label=f'平衡温度 ({T_equilibrium:.1f})')

# 安定相の領域を色分け
ax1.fill_between(temperatures, G_alpha_values.min(), G_alpha_values.max(),
                  where=(temperatures < T_equilibrium),
                  alpha=0.2, color='blue', label='α相安定領域')
ax1.fill_between(temperatures, G_alpha_values.min(), G_alpha_values.max(),
                  where=(temperatures >= T_equilibrium),
                  alpha=0.2, color='red', label='β相安定領域')

# 平衡点
ax1.plot(T_equilibrium, gibbs_energy_phases(T_equilibrium)[0], 'go', markersize=12)

ax1.set_xlabel('温度 (K)', fontsize=13, fontweight='bold')
ax1.set_ylabel('Gibbs自由エネルギー G (任意単位)', fontsize=13, fontweight='bold')
ax1.set_title('Gibbs自由エネルギーの温度依存性', fontsize=14, fontweight='bold')
ax1.legend(fontsize=11)
ax1.grid(True, alpha=0.3)

# 右図: Gibbs自由エネルギー差 ΔG = G_β - G_α
delta_G = G_beta_values - G_alpha_values

ax2.plot(temperatures, delta_G, 'purple', linewidth=2.5, label='ΔG = G_β - G_α')
ax2.axhline(0, color='black', linestyle='-', linewidth=1, alpha=0.5)
ax2.axvline(T_equilibrium, color='green', linestyle='--', linewidth=2, label=f'平衡温度 ({T_equilibrium:.1f})')

# ΔG < 0 と ΔG > 0 の領域
ax2.fill_between(temperatures, 0, delta_G, where=(delta_G < 0),
                  alpha=0.3, color='blue', label='ΔG < 0 (α→β不利)')
ax2.fill_between(temperatures, 0, delta_G, where=(delta_G >= 0),
                  alpha=0.3, color='red', label='ΔG > 0 (α→β有利)')

ax2.set_xlabel('温度 (K)', fontsize=13, fontweight='bold')
ax2.set_ylabel('ΔG = G_β - G_α (任意単位)', fontsize=13, fontweight='bold')
ax2.set_title('相変態の駆動力(Gibbs自由エネルギー差)', fontsize=14, fontweight='bold')
ax2.legend(fontsize=11)
ax2.grid(True, alpha=0.3)

plt.tight_layout()
plt.savefig('gibbs_energy_phase_transformation.png', dpi=300, bbox_inches='tight')
plt.show()

print("\n✓ グラフを 'gibbs_energy_phase_transformation.png' として保存しました")

print("\n【物理的解釈】")
print("-" * 70)
print("β相はα相よりエンタルピーが高い(H_β > H_α)ため、")
print("低温ではエネルギー的に不利です。")
print("")
print("しかし、β相はエントロピーが高い(S_β > S_α)ため、")
print("高温では -TS 項の寄与により Gibbs自由エネルギーが低下し、")
print("β相が安定となります。")
print("")
print("これは、固体→液体変態(融解)や、BCC→FCC変態などの")
print("実際の相変態で観察される挙動と一致します。")
print("-" * 70)

2.4 pycalphadによる状態図計算

実際の材料研究では、CALPHAD(CALculation of PHAse Diagrams)法を用いて、熱力学データベースから状態図を計算します。Pythonではpycalphadライブラリがこの機能を提供しています。

pycalphadとは?

pycalphadは、多成分系の状態図計算、相平衡計算、熱力学的性質の計算を行うPythonライブラリです。商用ソフトウェア(Thermo-Calc、FactSageなど)と同等の機能をオープンソースで提供します。

コード例5: pycalphadによるAl-Cu系状態図の計算

"""
pycalphadを使ったAl-Cu系状態図の計算

注: pycalphadのインストールが必要です
pip install pycalphad

また、熱力学データベース(TDBファイル)が必要です
ここでは簡易的なデモを示します
"""

try:
    from pycalphad import Database, equilibrium, variables as v
    from pycalphad.plot.binary import binplot
    import matplotlib.pyplot as plt
    import numpy as np

    print("=" * 80)
    print("pycalphadによるAl-Cu系状態図計算のデモ")
    print("=" * 80)

    # デモ用の簡易的な熱力学データベース(TDB形式文字列)
    # 実際の計算では、詳細なTDBファイルを使用します
    tdb_string = """
    ELEMENT AL FCC_A1 26.98 4540.0 28.3 !
    ELEMENT CU FCC_A1 63.546 5004.0 33.15 !

    PHASE FCC_A1  %  2 1   1 !
    CONSTITUENT FCC_A1  :AL,CU : VA :  !

    PHASE LIQUID  %  1  1.0  !
    CONSTITUENT LIQUID  :AL,CU :  !

    FUNCTION GHSERAL  298.15
       -7976.15+137.093038*T-24.3671976*T*LN(T)
       -1.884662E-3*T**2-0.877664E-6*T**3+74092*T**(-1);  700.00  Y
       -11276.24+223.048446*T-38.5844296*T*LN(T)
       +18.531982E-3*T**2-5.764227E-6*T**3+74092*T**(-1);  933.47  Y
       -11278.378+188.684153*T-31.748192*T*LN(T)
       -1.234264E28*T**(-9);  2900.00  N !

    FUNCTION GHSERCU  298.15
       -7770.458+130.485235*T-24.112392*T*LN(T)
       -2.65684E-3*T**2+0.129223E-6*T**3+52478*T**(-1);  1357.77  Y
       -13542.026+183.803828*T-31.38*T*LN(T)
       +3.64167E29*T**(-9);  3200.00  N !

    PARAMETER G(FCC_A1,AL:VA;0)  298.15  +GHSERAL; 6000 N !
    PARAMETER G(FCC_A1,CU:VA;0)  298.15  +GHSERCU; 6000 N !
    PARAMETER G(FCC_A1,AL,CU:VA;0)  298.15  -53520+7.2*T; 6000 N !

    PARAMETER G(LIQUID,AL;0)  298.15  +11005.553-11.840873*T+GHSERAL+7.934E-20*T**7; 933.47 Y
       +10481.974-11.252014*T+GHSERAL+1.234264E28*T**(-9); 6000 N !
    PARAMETER G(LIQUID,CU;0)  298.15  +12964.735-9.511904*T+GHSERCU-5.8489E-21*T**7; 1357.77 Y
       +13495.481-9.922344*T+GHSERCU-3.64167E29*T**(-9); 3200 N !
    PARAMETER G(LIQUID,AL,CU;0)  298.15  -66220+7.5*T; 6000 N !
    """

    # データベースを読み込み
    db = Database(tdb_string)

    # 計算条件
    components = ['AL', 'CU', 'VA']
    phases = ['FCC_A1', 'LIQUID']

    # 温度範囲
    T_range = (500, 1500, 10)  # 500-1500K, 10K刻み

    # 組成範囲(CUのモル分率)
    X_range = (0, 1, 0.01)  # 0-1, 0.01刻み

    print("\n計算条件:")
    print(f"  成分: {components}")
    print(f"  相: {phases}")
    print(f"  温度範囲: {T_range[0]}-{T_range[1]} K")
    print(f"  組成範囲: X(CU) = {X_range[0]}-{X_range[1]}")
    print("\n計算を開始します(数分かかる場合があります)...")

    # 平衡計算
    # 注: 実際の計算には時間がかかります
    eq_result = equilibrium(db, components, phases,
                             {v.X('CU'): X_range, v.T: T_range, v.P: 101325})

    print("✓ 計算が完了しました")

    # 状態図をプロット
    fig = plt.figure(figsize=(12, 8))
    ax = fig.gca()

    # pycalphadの内蔵プロット関数を使用
    binplot(db, components, phases, {v.X('CU'): X_range, v.T: T_range, v.P: 101325},
            eq_result=eq_result, ax=ax)

    ax.set_xlabel('組成 X(Cu)', fontsize=13, fontweight='bold')
    ax.set_ylabel('温度 (K)', fontsize=13, fontweight='bold')
    ax.set_title('Al-Cu系状態図(pycalphadによる計算)', fontsize=15, fontweight='bold', pad=15)
    ax.grid(True, alpha=0.3)

    plt.tight_layout()
    plt.savefig('al_cu_phase_diagram_pycalphad.png', dpi=300, bbox_inches='tight')
    plt.show()

    print("\n✓ グラフを 'al_cu_phase_diagram_pycalphad.png' として保存しました")

    print("\n" + "=" * 80)
    print("【Al-Cu系の特徴】")
    print("=" * 80)
    print("Al-Cu系は、アルミニウム合金(ジュラルミンなど)の基礎となる系です。")
    print("主要な特徴:")
    print("  - Al-richではFCC固溶体(α-Al)が形成")
    print("  - Cu-richではFCC固溶体(α-Cu)が形成")
    print("  - 中間組成では複数の金属間化合物が生成")
    print("  - 時効硬化処理により高強度化が可能(析出硬化)")
    print("=" * 80)

except ImportError:
    print("エラー: pycalphadがインストールされていません")
    print("インストール方法: pip install pycalphad")
    print("\npycalphadは以下の機能を提供します:")
    print("  - 多成分系状態図の計算")
    print("  - 相平衡計算")
    print("  - 熱力学的性質(エンタルピー、エントロピーなど)の計算")
    print("  - 析出相の安定性評価")
    print("\n代替手段として、手動で状態図を描画することもできます(コード例2参照)")
except Exception as e:
    print(f"エラーが発生しました: {e}")
    print("pycalphadの計算には熱力学データベース(TDB)が必要です")
    print("詳細なTDBファイルは、NIST、GTT-Technologies、Thermo-Calcなどから入手できます")

演習問題

演習 2.1

Easy

問題:2成分系、一定圧力の状態図において、次の場合の自由度 $F$ を計算してください。

  1. 単相領域(液相のみ)
  2. 二相共存領域(液相 + α固相)
  3. 共晶点(液相 + α固相 + β固相)
解答を表示
print("=" * 70)
print("Gibbsの相律による自由度の計算")
print("=" * 70)

# Gibbsの相律: F = C - P + 2
# 2成分系、一定圧力の場合: F = C - P + 1 = 2 - P + 1 = 3 - P

C = 2  # 成分数
pressure_fixed = True  # 圧力を固定

print(f"\nGibbsの相律: F = C - P + 2")
print(f"成分数 C = {C}")
print(f"圧力固定の場合: F = C - P + 1 = 3 - P")

cases = [
    ("単相領域(液相のみ)", 1),
    ("二相共存領域(液相 + α固相)", 2),
    ("共晶点(液相 + α固相 + β固相)", 3)
]

print("\n" + "=" * 70)
print("【計算結果】")
print("=" * 70)

for i, (description, P) in enumerate(cases, 1):
    F = 3 - P
    print(f"\n({i}) {description}")
    print(f"    相の数 P = {P}")
    print(f"    自由度 F = 3 - {P} = {F}")

    if F == 2:
        print(f"    → 温度と組成の両方を独立に変えられる")
    elif F == 1:
        print(f"    → 温度を決めれば、各相の組成が一意に決まる")
        print(f"       (または組成を決めれば、温度が決まる)")
    elif F == 0:
        print(f"    → 温度も組成も固定(不変点)")

print("\n" + "=" * 70)
print("【物理的意味】")
print("=" * 70)
print("\n自由度 F は、系の状態を指定するために必要な独立変数の数です。")
print("")
print("F = 2: 単相領域では、温度と組成を自由に選べます。")
print("       状態図上で面(2次元領域)として表現されます。")
print("")
print("F = 1: 二相共存領域では、温度を決めると各相の組成が")
print("       熱力学的に一意に決まります(てこの法則で分率は決まる)。")
print("       状態図上で線(1次元)として表現されます。")
print("")
print("F = 0: 三相共存点では、温度も組成も固定されます。")
print("       状態図上で点(0次元)として表現されます。")
print("       例: 共晶点、共析点、包晶点")
print("=" * 70)

# 図示
import matplotlib.pyplot as plt
import numpy as np

fig, ax = plt.subplots(figsize=(10, 8))

# 簡略化した状態図
composition = np.linspace(0, 100, 300)
T_liquidus_1 = 1000 - 5 * composition[:150]
T_liquidus_2 = 250 + 5 * (composition[150:] - 50)
liquidus = np.concatenate([T_liquidus_1, T_liquidus_2])

ax.plot(composition, liquidus, 'r-', linewidth=3, label='液相線')
ax.axhline(250, color='blue', linestyle='--', linewidth=2, label='共晶温度')

# 領域のラベル
ax.text(50, 800, 'F = 2\n(単相領域)', fontsize=14, fontweight='bold',
        ha='center', bbox=dict(boxstyle='round', facecolor='yellow', alpha=0.7))
ax.text(25, 400, 'F = 1\n(二相共存)', fontsize=13, fontweight='bold',
        ha='center', bbox=dict(boxstyle='round', facecolor='lightblue', alpha=0.7))
ax.text(75, 400, 'F = 1\n(二相共存)', fontsize=13, fontweight='bold',
        ha='center', bbox=dict(boxstyle='round', facecolor='lightgreen', alpha=0.7))
ax.plot(50, 250, 'ko', markersize=15, label='共晶点 (F=0)')

ax.set_xlabel('組成 (質量% B)', fontsize=13, fontweight='bold')
ax.set_ylabel('温度 (°C)', fontsize=13, fontweight='bold')
ax.set_title('自由度と状態図の関係', fontsize=15, fontweight='bold', pad=15)
ax.set_xlim(0, 100)
ax.set_ylim(200, 1100)
ax.legend(fontsize=12)
ax.grid(True, alpha=0.3)

plt.tight_layout()
plt.savefig('gibbs_phase_rule_degrees_of_freedom.png', dpi=300, bbox_inches='tight')
plt.show()

print("\n✓ グラフを 'gibbs_phase_rule_degrees_of_freedom.png' として保存しました")

演習 2.2

Medium

問題:Fe-0.6質量% C鋼を900°Cから室温まで徐冷しました。727°C直下での組織を、てこの法則を用いて計算してください。

与えられた値:

  • 鋼の炭素含有量: 0.6質量% C
  • フェライトの炭素含有量(727°C): 0.022質量% C
  • 共析組成: 0.76質量% C
解答を表示
import numpy as np
import matplotlib.pyplot as plt

# 与えられた値
C_steel = 0.6        # 鋼の炭素含有量 (質量% C)
C_ferrite = 0.022    # フェライトの炭素含有量 (質量% C)
C_pearlite = 0.76    # 共析組成(パーライト) (質量% C)
T = 727              # 温度 (°C)

print("=" * 80)
print("Fe-0.6質量% C鋼の組織計算(てこの法則)")
print("=" * 80)

print("\n【問題設定】")
print(f"鋼の組成: {C_steel}質量% C(亜共析鋼)")
print(f"冷却温度: 900°C → 室温")
print(f"評価温度: {T}°C直下(共析温度直下)")

print("\n【与えられた値】")
print(f"  C_鋼:           {C_steel}質量% C")
print(f"  C_フェライト:   {C_ferrite}質量% C")
print(f"  C_パーライト:   {C_pearlite}質量% C(共析組成)")

# てこの法則の適用
# f_α = (C_パーライト - C_鋼) / (C_パーライト - C_フェライト)
# f_パーライト = (C_鋼 - C_フェライト) / (C_パーライト - C_フェライト)

f_ferrite = (C_pearlite - C_steel) / (C_pearlite - C_ferrite)
f_pearlite = (C_steel - C_ferrite) / (C_pearlite - C_ferrite)

print("\n【てこの法則の計算】")
print("\nフェライトの質量分率:")
print(f"  f_フェライト = (C_パーライト - C_鋼) / (C_パーライト - C_フェライト)")
print(f"               = ({C_pearlite} - {C_steel}) / ({C_pearlite} - {C_ferrite})")
print(f"               = {C_pearlite - C_steel:.2f} / {C_pearlite - C_ferrite:.3f}")
print(f"               = {f_ferrite:.4f}")
print(f"               = {f_ferrite * 100:.2f}%")

print("\nパーライトの質量分率:")
print(f"  f_パーライト = (C_鋼 - C_フェライト) / (C_パーライト - C_フェライト)")
print(f"               = ({C_steel} - {C_ferrite}) / ({C_pearlite} - {C_ferrite})")
print(f"               = {C_steel - C_ferrite:.3f} / {C_pearlite - C_ferrite:.3f}")
print(f"               = {f_pearlite:.4f}")
print(f"               = {f_pearlite * 100:.2f}%")

print("\n【検算】")
total = f_ferrite + f_pearlite
print(f"  f_フェライト + f_パーライト = {f_ferrite:.4f} + {f_pearlite:.4f}")
print(f"                               = {total:.4f}")
if abs(total - 1.0) < 1e-6:
    print("  ✓ 合計が1.0になることを確認")
else:
    print(f"  ⚠ 誤差: {total - 1.0:.6f}")

# パーライト組織内のフェライトとセメンタイトの比率
# パーライト = フェライト(0.022% C) + セメンタイト(6.67% C)
# パーライトの組成 = 0.76% C

C_cementite = 6.67  # セメンタイトの炭素含有量

f_ferrite_in_pearlite = (C_cementite - C_pearlite) / (C_cementite - C_ferrite)
f_cementite_in_pearlite = (C_pearlite - C_ferrite) / (C_cementite - C_ferrite)

print("\n【パーライト組織の詳細】")
print("パーライトはフェライトとセメンタイトの層状組織です。")
print(f"\nパーライト内のフェライト分率:")
print(f"  = ({C_cementite} - {C_pearlite}) / ({C_cementite} - {C_ferrite})")
print(f"  = {f_ferrite_in_pearlite:.4f} = {f_ferrite_in_pearlite * 100:.2f}%")
print(f"\nパーライト内のセメンタイト分率:")
print(f"  = ({C_pearlite} - {C_ferrite}) / ({C_cementite} - {C_ferrite})")
print(f"  = {f_cementite_in_pearlite:.4f} = {f_cementite_in_pearlite * 100:.2f}%")

# 鋼全体での各相の質量分率
f_ferrite_total = f_ferrite + f_pearlite * f_ferrite_in_pearlite
f_cementite_total = f_pearlite * f_cementite_in_pearlite

print("\n【鋼全体での各相の質量分率】")
print(f"  初析フェライト:              {f_ferrite * 100:.2f}%")
print(f"  パーライト:                  {f_pearlite * 100:.2f}%")
print(f"    └ パーライト内フェライト:  {f_pearlite * f_ferrite_in_pearlite * 100:.2f}%")
print(f"    └ セメンタイト:            {f_cementite_total * 100:.2f}%")
print(f"  ────────────────────────────")
print(f"  全フェライト:                {f_ferrite_total * 100:.2f}%")
print(f"  全セメンタイト:              {f_cementite_total * 100:.2f}%")

# 可視化
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(16, 6))

# 左図: てこの法則の図解
compositions = [C_ferrite, C_steel, C_pearlite]
labels = ['フェライト\n(α)', '鋼の組成\n(0.6% C)', 'パーライト\n(共析組成)']
colors = ['blue', 'red', 'purple']

for c, label, color in zip(compositions, labels, colors):
    ax1.axvline(c, color=color, linestyle='--', linewidth=2, alpha=0.7)
    ax1.text(c, 0.9, label, ha='center', fontsize=12, fontweight='bold',
            bbox=dict(boxstyle='round', facecolor=color, alpha=0.3))

ax1.plot([C_ferrite, C_pearlite], [0.5, 0.5], 'k-', linewidth=3)
ax1.plot(C_steel, 0.5, 'ro', markersize=15, label='支点')

ax1.annotate('', xy=(C_ferrite, 0.35), xytext=(C_steel, 0.35),
            arrowprops=dict(arrowstyle='<->', color='blue', lw=2.5))
ax1.text((C_ferrite + C_steel) / 2, 0.28, f'{C_steel - C_ferrite:.3f}%',
        ha='center', fontsize=11, color='blue', fontweight='bold')

ax1.annotate('', xy=(C_steel, 0.35), xytext=(C_pearlite, 0.35),
            arrowprops=dict(arrowstyle='<->', color='purple', lw=2.5))
ax1.text((C_steel + C_pearlite) / 2, 0.28, f'{C_pearlite - C_steel:.2f}%',
        ha='center', fontsize=11, color='purple', fontweight='bold')

ax1.text(C_ferrite - 0.1, 0.7, f'質量分率\n{f_ferrite * 100:.1f}%',
        ha='center', fontsize=13, fontweight='bold',
        bbox=dict(boxstyle='round', facecolor='lightblue', alpha=0.9))
ax1.text(C_pearlite + 0.1, 0.7, f'質量分率\n{f_pearlite * 100:.1f}%',
        ha='center', fontsize=13, fontweight='bold',
        bbox=dict(boxstyle='round', facecolor='lightcoral', alpha=0.9))

ax1.set_xlabel('炭素含有量 (質量% C)', fontsize=13, fontweight='bold')
ax1.set_title('てこの法則による計算', fontsize=15, fontweight='bold', pad=15)
ax1.set_xlim(0, 1.0)
ax1.set_ylim(0, 1)
ax1.set_yticks([])
ax1.grid(axis='x', alpha=0.3)

# 右図: 組織の円グラフ
phases = ['初析フェライト', f'パーライト\n({f_pearlite * 100:.1f}%)']
sizes = [f_ferrite * 100, f_pearlite * 100]
colors_pie = ['lightblue', 'lightcoral']
explode = (0.05, 0.05)

wedges, texts, autotexts = ax2.pie(sizes, explode=explode, labels=phases, colors=colors_pie,
                                     autopct='%1.1f%%', startangle=90, textprops={'fontsize': 12, 'fontweight': 'bold'})

for autotext in autotexts:
    autotext.set_color('white')
    autotext.set_fontweight('bold')
    autotext.set_fontsize(14)

ax2.set_title('Fe-0.6% C鋼の組織構成', fontsize=15, fontweight='bold', pad=15)

plt.tight_layout()
plt.savefig('fe_06c_microstructure_calculation.png', dpi=300, bbox_inches='tight')
plt.show()

print("\n" + "=" * 80)
print("【結論】")
print("=" * 80)
print(f"Fe-{C_steel}質量% C鋼を共析温度直下まで徐冷すると、")
print(f"  初析フェライト:  {f_ferrite * 100:.1f}質量%")
print(f"  パーライト:      {f_pearlite * 100:.1f}質量%")
print(f"の組織となります。")
print("")
print("これは典型的な亜共析鋼の組織です。")
print("初析フェライトは白色で軟らかく、パーライトは層状組織で硬いため、")
print(f"この鋼は中程度の強度・硬度を持ちます。")
print("")
print(f"炭素含有量が0.76%(共析鋼)に近づくほど、パーライト分率が増加し、")
print("強度・硬度が上昇します。")
print("=" * 80)

print("\n✓ グラフを 'fe_06c_microstructure_calculation.png' として保存しました")

演習 2.3

Hard

問題:Fe-C状態図において、Fe-1.2質量% C鋼(過共析鋼)を1000°Cから室温まで徐冷したときの組織変化を、各温度範囲で説明してください。また、727°C直下での組織(初析セメンタイトとパーライトの質量分率)をてこの法則で計算してください。

解答を表示
import numpy as np
import matplotlib.pyplot as plt

# 与えられた値
C_steel = 1.2         # 鋼の炭素含有量 (質量% C) - 過共析鋼
C_eutectoid = 0.76    # 共析組成 (質量% C)
C_cementite = 6.67    # セメンタイトの炭素含有量 (質量% C)
T_eutectoid = 727     # 共析温度 (°C)

print("=" * 80)
print("Fe-1.2質量% C鋼(過共析鋼)の冷却過程と組織変化")
print("=" * 80)

print("\n【鋼の分類】")
print(f"炭素含有量: {C_steel}質量% C")
print(f"分類: 過共析鋼({C_eutectoid}質量% C < C < 2.14質量% C)")

print("\n【冷却過程の組織変化】")
print("=" * 80)

# 冷却過程の各段階
cooling_stages = [
    ("1000°C", "γ相(オーステナイト)単相", "すべての炭素がγ相に固溶"),
    ("1000°C → 約850°C", "γ相のまま冷却", "γ相内で炭素が均一分布"),
    ("約850°C", "初析セメンタイト析出開始", "γ/γ+Fe₃C境界線に到達、過剰な炭素がFe₃Cとして析出"),
    ("850°C → 727°C", "初析セメンタイト析出継続", "γ相の炭素濃度が徐々に共析組成へ"),
    ("727°C(共析温度)", "共析反応発生", "残存γ相がパーライト(α+Fe₃C層状組織)に変態"),
    ("727°C以下", "初析Fe₃C + パーライト", "最終組織、室温まで変化なし")
]

for i, (temp_range, phase, description) in enumerate(cooling_stages, 1):
    print(f"\n{i}. {temp_range}")
    print(f"   相: {phase}")
    print(f"   説明: {description}")

print("\n" + "=" * 80)
print("【727°C直下での組織計算(てこの法則)】")
print("=" * 80)

# 727°C直下では、初析セメンタイトとパーライトが共存
# γ相の組成は共析組成(0.76% C)になっている
# 全体の組成 1.2% C = 初析Fe₃C (6.67% C) + パーライト (0.76% C)

print(f"\n二相共存状態:")
print(f"  相1: 初析セメンタイト (Fe₃C), C = {C_cementite}質量%")
print(f"  相2: パーライト(γ→α+Fe₃C), C = {C_eutectoid}質量%")
print(f"  全体の組成: {C_steel}質量% C")

# てこの法則
# f_Fe₃C = (C_鋼 - C_共析) / (C_Fe₃C - C_共析)
# f_パーライト = (C_Fe₃C - C_鋼) / (C_Fe₃C - C_共析)

f_cementite = (C_steel - C_eutectoid) / (C_cementite - C_eutectoid)
f_pearlite = (C_cementite - C_steel) / (C_cementite - C_eutectoid)

print(f"\n初析セメンタイトの質量分率:")
print(f"  f_Fe₃C = (C_鋼 - C_共析) / (C_Fe₃C - C_共析)")
print(f"         = ({C_steel} - {C_eutectoid}) / ({C_cementite} - {C_eutectoid})")
print(f"         = {C_steel - C_eutectoid:.2f} / {C_cementite - C_eutectoid:.2f}")
print(f"         = {f_cementite:.4f}")
print(f"         = {f_cementite * 100:.2f}%")

print(f"\nパーライトの質量分率:")
print(f"  f_パーライト = (C_Fe₃C - C_鋼) / (C_Fe₃C - C_共析)")
print(f"               = ({C_cementite} - {C_steel}) / ({C_cementite} - {C_eutectoid})")
print(f"               = {C_cementite - C_steel:.2f} / {C_cementite - C_eutectoid:.2f}")
print(f"               = {f_pearlite:.4f}")
print(f"               = {f_pearlite * 100:.2f}%")

print(f"\n【検算】")
total = f_cementite + f_pearlite
print(f"  f_Fe₃C + f_パーライト = {f_cementite:.4f} + {f_pearlite:.4f} = {total:.4f}")
if abs(total - 1.0) < 1e-6:
    print("  ✓ 合計が1.0になることを確認")

# 可視化
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(16, 7))

# 左図: 冷却曲線と組織変化
temperatures = [1000, 900, 850, 800, 727, 500, 25]
time = np.arange(len(temperatures))

ax1.plot(time, temperatures, 'ro-', linewidth=2.5, markersize=10)
ax1.axhline(T_eutectoid, color='purple', linestyle='--', linewidth=2, alpha=0.7, label='共析温度 (727°C)')
ax1.axhline(850, color='green', linestyle='--', linewidth=1.5, alpha=0.5, label='Fe₃C析出開始温度')

# 組織変化のアノテーション
ax1.text(0.5, 1050, 'γ単相', fontsize=12, fontweight='bold', ha='center',
         bbox=dict(boxstyle='round', facecolor='yellow', alpha=0.7))
ax1.text(2, 900, 'γ + 初析Fe₃C', fontsize=11, fontweight='bold', ha='center',
         bbox=dict(boxstyle='round', facecolor='lightgreen', alpha=0.7))
ax1.text(4, 650, '初析Fe₃C\n+ パーライト', fontsize=11, fontweight='bold', ha='center',
         bbox=dict(boxstyle='round', facecolor='lightcoral', alpha=0.7))

ax1.set_xlabel('冷却時間(任意単位)', fontsize=13, fontweight='bold')
ax1.set_ylabel('温度 (°C)', fontsize=13, fontweight='bold')
ax1.set_title('Fe-1.2% C鋼の冷却曲線と組織変化', fontsize=15, fontweight='bold', pad=15)
ax1.set_ylim(0, 1100)
ax1.legend(fontsize=11)
ax1.grid(True, alpha=0.3)

# 右図: 最終組織の円グラフ
phases = ['初析セメンタイト', f'パーライト\n({f_pearlite * 100:.1f}%)']
sizes = [f_cementite * 100, f_pearlite * 100]
colors_pie = ['darkgray', 'lightcoral']
explode = (0.1, 0)

wedges, texts, autotexts = ax2.pie(sizes, explode=explode, labels=phases, colors=colors_pie,
                                     autopct='%1.2f%%', startangle=90,
                                     textprops={'fontsize': 12, 'fontweight': 'bold'})

for autotext in autotexts:
    autotext.set_color('white')
    autotext.set_fontweight('bold')
    autotext.set_fontsize(14)

ax2.set_title('Fe-1.2% C鋼の最終組織(727°C直下)', fontsize=15, fontweight='bold', pad=15)

plt.tight_layout()
plt.savefig('fe_12c_hypereutectoid_cooling.png', dpi=300, bbox_inches='tight')
plt.show()

print("\n" + "=" * 80)
print("【最終組織の特徴】")
print("=" * 80)
print(f"Fe-{C_steel}質量% C鋼を徐冷すると、")
print(f"  初析セメンタイト:  {f_cementite * 100:.2f}質量%")
print(f"  パーライト:        {f_pearlite * 100:.2f}質量%")
print(f"の組織となります。")
print("")
print("【過共析鋼の特性】")
print("  - 初析セメンタイトはγ粒界に網目状に析出")
print("  - セメンタイトは極めて硬い(HV 800程度)が脆い")
print("  - 粒界セメンタイトにより、鋼全体の靭性が低下")
print("  - 高硬度・低靭性が求められる工具鋼などに使用")
print("  - 球状化焼鈍により、セメンタイトを球状化して靭性改善可能")
print("")
print("【亜共析鋼との比較】")
print("  亜共析鋼: 初析フェライト(軟) + パーライト → 延性高い")
print("  過共析鋼: 初析セメンタイト(硬・脆) + パーライト → 硬度高い、靭性低い")
print("=" * 80)

print("\n✓ グラフを 'fe_12c_hypereutectoid_cooling.png' として保存しました")

# 追加: 共析反応の詳細
print("\n【共析反応の詳細】")
print("=" * 80)
print(f"727°Cで起こる反応:")
print(f"  γ({C_eutectoid}% C) → α({0.022}% C) + Fe₃C({C_cementite}% C)")
print(f"")
print(f"パーライト内の相分率:")
C_ferrite_eutectoid = 0.022
f_ferrite_in_pearlite = (C_cementite - C_eutectoid) / (C_cementite - C_ferrite_eutectoid)
f_cementite_in_pearlite = (C_eutectoid - C_ferrite_eutectoid) / (C_cementite - C_ferrite_eutectoid)
print(f"  フェライト: {f_ferrite_in_pearlite * 100:.2f}質量%")
print(f"  セメンタイト: {f_cementite_in_pearlite * 100:.2f}質量%")
print("")
print(f"鋼全体でのセメンタイト量:")
total_cementite = f_cementite + f_pearlite * f_cementite_in_pearlite
print(f"  初析セメンタイト: {f_cementite * 100:.2f}%")
print(f"  パーライト内セメンタイト: {f_pearlite * f_cementite_in_pearlite * 100:.2f}%")
print(f"  合計: {total_cementite * 100:.2f}%")
print("=" * 80)

学習目標の確認

レベル1: 基本理解(知識の習得)

  • Gibbsの相律の意味と適用方法を理解している
  • 状態図の基本要素(液相線、固相線、共晶点、共析点)を説明できる
  • 置換型固溶体と侵入型固溶体の違いを説明できる
  • Fe-C状態図の主要な相(フェライト、オーステナイト、セメンタイト)を理解している
  • 亜共析鋼、共析鋼、過共析鋼の違いを説明できる

レベル2: 実践スキル(計算と応用)

  • Gibbsの相律で自由度を計算できる
  • てこの法則を使って各相の質量分率を計算できる
  • Fe-C状態図から鋼の組織を予測できる
  • Gibbs自由エネルギーと相安定性の関係を説明できる
  • Pythonで簡易的な状態図を作成できる
  • pycalphadを使って状態図計算ができる(基礎レベル)

レベル3: 応用力(問題解決と最適化)

  • 複雑な合金系の状態図を解釈し、組織予測ができる
  • 冷却速度による組織変化を予測できる
  • 熱処理条件を設計し、目的の組織・特性を得られる
  • pycalphadやCALPHAD法を使った高度な状態図計算ができる
  • 実験データと熱力学計算を組み合わせて材料設計ができる

参考文献

  1. Porter, D.A., Easterling, K.E., Sherif, M.Y. (2009). Phase Transformations in Metals and Alloys, 3rd ed. CRC Press, pp. 1-102, 215-289.
  2. Callister, W.D., Jr., Rethwisch, D.G. (2020). Materials Science and Engineering: An Introduction, 10th ed. Wiley, pp. 269-345.
  3. Krauss, G. (2015). Steels: Processing, Structure, and Performance, 2nd ed. ASM International, pp. 1-89, 155-234.
  4. Hillert, M. (2008). Phase Equilibria, Phase Diagrams and Phase Transformations: Their Thermodynamic Basis, 2nd ed. Cambridge University Press, pp. 1-78, 234-301.
  5. Massalski, T.B., ed. (1990). Binary Alloy Phase Diagrams, 2nd ed. ASM International.
  6. Otis, R., Liu, Z.-K. (2017). "pycalphad: CALPHAD-based Computational Thermodynamics in Python". Journal of Open Research Software, 5(1), p.1. DOI: 10.5334/jors.140
  7. pycalphad documentation. https://pycalphad.org/