###### tags: `深度學習` # GitHub code GitHub 上面的 code 使用的 OpenFOAM 是版本 5 的,但我們現在使用的是版本 10 的,同時 wsl 上目前使用的 Ubuntu-20.04 並不支援 OpenFOAM 5,所以需要修改原始 code ## 新增 configuration 使用 `foamGet` 指令加入 `internalProbes` 這個 configuration - 進到要使用的 case 資料夾中 /data/OpenFOAM/ - 輸入指令 `foamGet internalProbes` - 在 /system/ 中會出現 internalProbes 這個檔案 ## 給予 ./Allclean 及 ./Allrun 可執行的權限 - 進到 ./data/OpenFOAM/ - 輸入指令 `chmod +x ./Allclean ./Allrun` ## 修改 ControlDict 打開 ControlDict 將最後面的 function 改成 `includeFunc internalProbes` ![](https://i.imgur.com/6CORGhs.png) ## gmsh - 輸入指令 `gmsh -3 -format msh2 airfoil ~.geo` 這會產生對應的 msh 檔案 - 輸入指令 `gmshToFoam airfoil ~.msh` 完成後 /constant/PolyMesh/ 會有對應的資料產生 ## 修改 /0/ 及 /boundary/ 中檔案的語法 因為版本問題,所以需要調整語法 ## simpleFoam & postProcess 使用 `simpleFoam` 指令來測試是否能正確的運行 ## 修改 dataGen ### genMesh 加上 `-format msh2` ![](https://i.imgur.com/bKXxOaT.png) ### outputProcessing - `output` 三維矩陣 `output[0][i]` `[i]` : - [0] fsX - [1] fsY - [2] mask - [3] pressure - [4] local u - [5] local v - `LnD` $C_L\ and\ C_D$ 三圍矩陣 `['LnD'][0][i]` `[i]` : - [0] $C_L$ - [1] $C_D$