技能 fluidsim
🌊
FluidSim 將高效能計算流體動力學帶入 Python。透過簡單的 Python 指令執行 Navier-Stokes 模擬、分析紊流並視覺化結果。無需複雜的 Fortran 或 C++ 設定。
支援: Claude Codex Code(CC)
1
下載技能 ZIP
2
在 Claude 中上傳
前往 設定 → 功能 → 技能 → 上傳技能
3
開啟並開始使用
測試它
正在使用「fluidsim」。 Run a 2D turbulence simulation and show me the energy spectrum
預期結果:
- Created 2D Navier-Stokes simulation with 256x256 grid
- Running for 10 time units with viscosity 1e-3
- Generated energy spectrum showing -5/3 slope in inertial range
- Saved vorticity field visualization at t=10.0
- Simulation completed successfully - energy decay rate: 0.95
正在使用「fluidsim」。 Configure a stratified flow simulation for internal gravity waves
預期結果:
- Initialized ns2d.strat solver with Brunt-Väisälä frequency N=2.0
- Set up 256x256 grid with domain size 2pi x 2pi
- Created dense layer initial condition with Gaussian profile
- Running for 20 time units with adaptive CFL time stepping
- Configured output periods for buoyancy and velocity fields
安全審計
安全v4 • 1/17/2026
All 330 static findings are false positives. The scanner incorrectly flagged markdown documentation code blocks as shell commands. The skill is a legitimate scientific computing framework for computational fluid dynamics with no security risks. All detected patterns are documentation examples showing Python code for simulations.
8
已掃描檔案
1,802
分析行數
1
發現項
4
審計總數
風險因素
審計者: claude 查看審計歷史 →
品質評分
45
架構
90
可維護性
87
內容
29
社群
100
安全
91
規範符合性
你能建構什麼
研究 2D 紊流能量級聯
模擬強制性 2D 紊流以觀察逆向能量級聯和正向縱向級聯現象
模擬分層大氣流
模擬密度分層流以研究內重力波和大氣動力學
分析地球物理渦旋動力學
使用淺水方程式模擬海洋渦旋和旋轉盆地動力學
試試這些提示
基本 2D 紊流
Create a 2D Navier-Stokes simulation with 256x256 grid, run for 10 time units with noise initialization and save vorticity plots
分層流設定
Set up a stratified 2D simulation with Brunt-Väisälä frequency N=2.0, configure for 20 time units, and initialize with a dense layer
高解析度 3D
Configure a 512x512x512 3D Navier-Stokes simulation with MPI support, set viscosity to 1e-5, and enable spectra output
Taylor-Green 驗證
Initialize Taylor-Green vortex in 2D, run simulation, and compare energy decay with analytical solution
最佳實務
- 網域解析度使用 2 的冪次方(128、256、512)以獲得最佳 FFT 效能
- 啟用 CFL 條件,CFL=0.5 以實現穩定的自適應時間步進
- 謹慎儲存物理場以節省磁碟空間,對時間序列使用空間平均值
- 先以較低解析度測試,再擴展到正式執行
避免
- 不要使用任意網域大小 - 堅持使用 2 的冪次方以提高 FFT 效率
- 避免在沒有 CFL 檢查的情況下為紊流設定固定時間步長
- 不要儲存每個時間步 - 使用適當的輸出週期來管理資料量
常見問題
為什麼我的模擬不穩定?
確保啟用 CFL 條件或使用足夠小的時間步長。檢查黏性值對於您的解析度是否不太低。
如何選擇正確的求解器?
對 2D 紊流使用 ns2d,對 3D 流體使用 ns3d,對密度分層流使用 strat 求解器,對旋轉淺水系統使用 sw1l。
我可以執行的最大解析度是多少?
取決於可用記憶體。512x512x512 模擬需要約 8GB RAM。對於更高解析度,請使用 MPI 平行化。
如何重新啟動模擬?
使用 params.init_fields.type='from_file' 並指向模擬目錄中的狀態檔案。
我可以在筆電上執行嗎?
可以,對於最高 512x512 解析度的 2D 模擬可以。對於 3D 或高解析度執行,請使用記憶體更多的工作站或叢集。
為什麼要使用偽光譜方法?
光譜方法為週期性網域提供高準確度,並透過 FFT 演算法有效率地計算導數。