コンテンツにスキップ

rayleigh-benard2d

英語 | 日本語

« Home · « 熱・相変化

Thermal LBM -- 2D Rayleigh-Benard convection: a fluid layer heated from below and cooled from above, between two rigid (no-slip) horizontal plates, periodic in the horizontal. The buoyant instability sets in above a critical Rayleigh number; below it the layer stays in pure conduction (Nu = 1), above it steady convection rolls form (Nu > 1).

概要: 下方加熱のレイリー・ベナール対流。臨界レイリー数 Ra_c=1708 を境に伝導から対流へ分岐する。上と同じステッパを壁条件だけ変えて使っており、そのモジュール共用自体が ctest で検証されている。

Geometry

rayleigh-benard2d geometry

Animation

Fields

この計算が最後の出力ステップで書き出した場をそのまま描いたもの。3D ケースは中央断面。

rayleigh-benard2d T

rayleigh-benard2d umag

Results

下から加熱・上から冷却される流体層の古典問題。Nx = 97 × Ny = 48、 Ra = 5000、Pr = 0.71、U = 0.05、摂動振幅 1e-3。写像:ν = U·H·√(Pr/Ra) = 0.05 × 48 × √(0.000142) = 0.02860、α = ν/0.71 = 0.04028、 gβ = 0.05²/48 = 5.208e-5、τ_f = 0.5858、τ_g = 0.6208。横幅は Nx = round(2.0158 × 48) = 97 — 周期箱の最低次モードを臨界波数 a_c = 3.117(2π/a_c = 2.0158)に合わせ、ロール対が 1 組ちょうど入る。 Ra/Ra_c = 5000/1707.762 = 2.93 倍の超臨界。壁時計 1.56 秒。

ログは線形不安定の教科書的三幕をそのまま描く:

  1. 伝導 + 摂動減衰:Nu ≈ 0.995–1.000、KE ~1e-10(step 0–6000)。
  2. 指数成長:step 6000–9000 で dKE が 3.40e-1 → 3.48e-1 に張り付く — 報告間隔 750 ステップごとに KE が e^0.348 ≈ 1.42 倍になる 一定成長率、つまり線形固有モードの成長。Nu はまだ ≈ 1.0002。
  3. 非線形飽和:Nu_hot = 2.108944 = Nu_cold(不均衡 0.00%)、 KE = 9.8039e-5、v_max = 17.64(α/H 単位)で step 52500 に定常判定。 RESULT 行の growth_sigma = 8.4955e-06。

🧩 モジュールゲートの話。この駆動部も thermal_ddf.hpp の壁設定替え (左右を Periodic、Dirichlet を上下へ)にすぎない。その入れ替え自体が ctest thermal_rayleigh_benard でゲートされている:周期プレート層で Ra = 1200 → Nu = 0.9999(Ra_c = 1708 未満、純伝導)、Ra = 4000 → Nu = 1.924(超臨界、対流)— Clever–Busse の剛体壁臨界値 Ra_c = 1707.76 を挟み撃ちにする合否判定(docs/design/module-architecture-design.md)。 この移行過程でモジュールが正方箱を仮定していた欠陥が露見し、H を 「Dirichlet 壁間距離」に一般化する修正が入った。

Governing equations

剛体・剛体境界の Rayleigh–Bénard 安定性(Chandrasekhar 1961, Ch. II):

\[
Ra=\frac{g\beta\,\Delta T\,H^3}{\nu\alpha},\qquad
Ra_c=1707.762,\quad a_c=3.117
\]

Ra < Ra_c では熱は伝導のみ(Nu = 1)、超えると定常対流ロールが立ち Nu > 1(超臨界分岐)。数値解法は thermal-cavity2d と同一の DDF 熱 LBM (D2Q9 + D2Q5、Guo 浮力)で、変更点は ThermalParams のみ:

\[
T_{\rm bottom}=+\tfrac12,\;T_{\rm top}=-\tfrac12\ (\text{Dirichlet}),\qquad
\text{left/right: periodic}
\]

単一モードの微小温度摂動(amp = 1e-3)が種となり、その成長率と飽和 Nusselt 数が診断量になる。超臨界の定常 2D ロールの Nu(Ra) 傾向は Clever & Busse (1974) が参照系。

Code walkthrough

ソース(213 行)。

%%{init: {'themeVariables': {'fontSize': '11px'}}}%%
flowchart TB
    T["上板 冷 T=−1/2(Dirichlet・ノースリップ)"]
    M["97×48 層(Lx = 2.02H = 臨界モード 1 波長)<br/>DDF 熱 LBM / 左右周期"]
    B["下板 熱 T=+1/2(Dirichlet・ノースリップ)"]
    B --> M --> T
  1. 設定 — Ny = 48 から Nx = 2.0158·Ny を導出。壁種別と摂動場を用意。
  2. 行進 — 750 ステップごとに Nu_hot・平均 KE・両者のドリフトを記録。 Nu と KE が同時に定常化したら停止(converge = 1)。
  3. 成長率 — KE 時系列から指数成長区間をフィット(RESULT の sigma)。
  4. 出力 — T/u 場と KE 時系列 CSV、ギャラリーアニメ(ロール形成が映る)。

Build & run

cmake -S native -B native/build && cmake --build native/build -j
./native/build/orheo-rayleigh-benard2d

rayleigh_benard2d [Nx] [Ny] [Ra] [steps] [Pr] [out_prefix] [U] [amp]

このページの図を作った計算のコスト(Miyabi-G Grace CPU (72 cores, -stdpar=multicore)): 1.6 s wall。

Things to try

  • 臨界を自分で挟む:rayleigh_benard2d 97 48 1600 と 1800 — Ra_c = 1708 の直下/直上で Nu が 1 に残るか離れるかを見る(ctest の 1200/4000 より意地悪な設定)。
  • 箱の横幅を外す:Nx = 64(a ≠ a_c)にすると成長率と飽和 Nu が 下がるはず。波数選択の感覚が掴める。
  • amp を 1e-5 に:線形成長区間が長くなり、成長率フィットが安定する。 σ が amp に依らないことを確認。
  • Ra = 1e5:ctest の合成試験と同じ強対流域(Nu ≈ 3.9)。境界層解像の ため Ny を上げて比較。

Validation

Tier T1 — 自動ゲートあり
QoI Nu
Reference Clever & Busse (1974) critical Ra=1708; Nu(Ra) scaling
Gate 🧩 モジュールゲート (thermal_rayleigh_benard)

Source & run details

View source

Item Value
Target orheo-rayleigh-benard2d
Source native/benchmarks/rayleigh_benard2d.cpp
Lattice D2Q9 + D2Q5 (DDF)
GPU twin no
Modules thermal_ddf.hpp
Gallery run 2026-07-27 @ 7628c0cf
Args ``
Wall time 1.56 s
CPU time 106.22 s
Device Miyabi-G Grace CPU (72 cores, -stdpar=multicore)

Computation log

この計算の実際の出力(先頭と末尾)。

rayleigh_benard2d Nx=97 Ny=48 Ra=5000 Pr=0.710 U=0.0500 amp=1.0e-03 nu=0.02860 alpha=0.04028 gbeta=5.208e-05 tau_f=0.5858 tau_g=0.6208
  step 0: Nu_hot=0.999953 KE=5.6490e-11 dNu=1.00e+09 dKE=1.77e+19
  step 750: Nu_hot=0.995258 KE=3.4223e-10 dNu=4.72e-03 dKE=8.35e-01
  step 1500: Nu_hot=0.997204 KE=6.1972e-10 dNu=1.95e-03 dKE=4.48e-01
  step 2250: Nu_hot=0.998340 KE=8.3271e-10 dNu=1.14e-03 dKE=2.56e-01
  step 3000: Nu_hot=0.999036 KE=1.0819e-09 dNu=6.97e-04 dKE=2.30e-01
  step 3750: Nu_hot=0.999467 KE=1.4747e-09 dNu=4.31e-04 dKE=2.66e-01
  step 4500: Nu_hot=0.999732 KE=2.1207e-09 dNu=2.65e-04 dKE=3.05e-01
  step 5250: Nu_hot=0.999893 KE=3.1572e-09 dNu=1.62e-04 dKE=3.28e-01
  step 6000: Nu_hot=0.999994 KE=4.7840e-09 dNu=1.01e-04 dKE=3.40e-01
  step 6750: Nu_hot=1.000062 KE=7.3054e-09 dNu=6.78e-05 dKE=3.45e-01
  step 7500: Nu_hot=1.000117 KE=1.1191e-08 dNu=5.57e-05 dKE=3.47e-01
  step 8250: Nu_hot=1.000178 KE=1.7163e-08 dNu=6.03e-05 dKE=3.48e-01
  step 9000: Nu_hot=1.000259 KE=2.6334e-08 dNu=8.10e-05 dKE=3.48e-01
...

  step 48750: Nu_hot=2.108966 KE=9.8041e-05 dNu=1.26e-06 dKE=4.99e-06
  step 49500: Nu_hot=2.108960 KE=9.8041e-05 dNu=2.78e-06 dKE=6.44e-06
  step 50250: Nu_hot=2.108954 KE=9.8040e-05 dNu=2.99e-06 dKE=5.80e-06
  step 51000: Nu_hot=2.108949 KE=9.8040e-05 dNu=2.44e-06 dKE=4.16e-06
  step 51750: Nu_hot=2.108946 KE=9.8039e-05 dNu=1.60e-06 dKE=2.34e-06
  step 52500: Nu_hot=2.108944 KE=9.8039e-05 dNu=7.82e-07 dKE=8.23e-07
  converged (Nu & KE stationary) at step 52500
Nu_hot=2.10894 Nu_cold=2.10894 (imbalance 0.00%)  vmax=17.64  growth_sigma=8.4955e-06 (used 52501 steps)
RESULT Ra=5000 Nx=97 Ny=48 Nu_hot=2.108944 Nu_cold=2.108944 sigma=8.495485e-06 vmax=17.644680 used=52501

References

  • Lord Rayleigh, Phil. Mag. 32 (1916) 529 — 問題の起源。
  • S. Chandrasekhar, Hydrodynamic and Hydromagnetic Stability (1961), Ch. II — Ra_c = 1707.762、a_c = 3.117(剛体・剛体)。
  • R. M. Clever & F. H. Busse, J. Fluid Mech. 65 (1974) 625 — 超臨界 2D ロールの Nu(Ra)。
  • X. He, S. Chen & G. D. Doolen, J. Comput. Phys. 146 (1998) 282; Z. Guo, C. Zheng & B. Shi, Phys. Rev. E 65 (2002) 046308.