kh2d-solver:一個用於理想化二維不可壓縮克爾文-亥姆霍茲不穩定性的Python庫
kh2d-solver: A Python Library for Idealized Two-Dimensional Incompressible Kelvin-Helmholtz Instability
September 19, 2025
作者: Sandy H. S. Herho, Nurjanna J. Trilaksono, Faiz R. Fajary, Gandhi Napitupulu, Iwan P. Anwar, Faruq Khadami, Dasapta E. Irawan
cs.AI
摘要
我們提出了一個開源的Python函式庫,用於模擬分層剪切流中的二維不可壓縮克爾文-亥姆霍茲不穩定性。該求解器採用分步投影法,通過快速正弦變換進行譜泊松求解,實現了二階空間精度。實現過程中利用了NumPy、SciPy和Numba的即時編譯功能,以確保計算效率。四個經典測試案例探討了雷諾數1000至5000和理查森數0.1至0.3的範圍:經典剪切層、雙剪切配置、旋轉流和強迫湍流。使用香農熵和複雜度指數的統計分析顯示,儘管雷諾數較低,雙剪切層的混合速率比強迫湍流高出2.8倍。該求解器在標準桌面硬體上運行高效,384x192網格的模擬大約在31分鐘內完成。結果表明,混合效率取決於不穩定性的生成路徑,而非僅依賴於強度測量,這對基於理查森數的參數化提出了挑戰,並為氣候模型中的次網格尺度表示提供了改進建議。
English
We present an open-source Python library for simulating two-dimensional
incompressible Kelvin-Helmholtz instabilities in stratified shear flows. The
solver employs a fractional-step projection method with spectral Poisson
solution via Fast Sine Transform, achieving second-order spatial accuracy.
Implementation leverages NumPy, SciPy, and Numba JIT compilation for efficient
computation. Four canonical test cases explore Reynolds numbers 1000--5000 and
Richardson numbers 0.1--0.3: classical shear layer, double shear configuration,
rotating flow, and forced turbulence. Statistical analysis using Shannon
entropy and complexity indices reveals that double shear layers achieve
2.8times higher mixing rates than forced turbulence despite lower Reynolds
numbers. The solver runs efficiently on standard desktop hardware, with
384times192 grid simulations completing in approximately 31 minutes. Results
demonstrate that mixing efficiency depends on instability generation pathways
rather than intensity measures alone, challenging Richardson number-based
parameterizations and suggesting refinements for subgrid-scale representation
in climate models.