Willie.Wang
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    HPC app - OpenFOAM == ### 1.Openfoam hardware ### 2.Openfoam real case ### 3.Openfoam GPU-accelerated issue <br> <br> <br> <br> <br> ## Openfoam hardware #### [Hardware for CFD, 2021, May <br> Lubos Pirkl Enabler, Storyteller at CFDSUPPORT, Indiana Jones in the Jungle of CAE](https://www.linkedin.com/pulse/hardware-cfd-lubos-pirkl/) * 每一個simulation所需要的size,可以看做是core*hours。 A simulation need 1 core 100 hours = 2 cores 50 hours. * 在CFD中影響simulation size關鍵因素為: 1.**Mesh size** 2.Time method 3.Physical model complexity * Hardware 元件最重要的是:**CPU 處理器**。 **主機板**檢查相容性即可,**記憶體**有一個黃金法則:「每一百萬網格需要2GB RAM」。 **螢幕**適當大小即可,**顯示卡**可以讓放大、縮小、旋轉、渲染的過程更加滑順。 * 作者以OpenFOAM motorBike為例子的實驗數據 ![image](https://hackmd.io/_uploads/rkVjV9zk0.png) 若是碩博士生需要5 core * hours來完成論文實驗; 若是設計師或工程師需要500 core * hours來完成工程; 若是專業CFD使用者需要超過500 core * hours並建立模擬集群。 <br> <br> #### [Hardware Recommendation for CFD <br> SimFlow ](https://sim-flow.com/hardware-recommendation-for-cfd/) * 對於CFD simulation挑選**CPU**的幾個要點 1. **記憶體頻寬 Memory Bandwidth (memory channels)**, CFD不會進行複雜的計算,而是會面對大量的資料處理,記憶體頻寬和允許平行資料傳輸的記憶體通道直接相關。 2. **快取大小 CPU cache size**, 大的cache可以減少檢所資料的時間,加速CFD計算。 3. **核心數量 Number of cores**, 核心和記憶體通道要保持一致避免無法充分利用,通常建議的準則是每個記憶體通道2~4個CPU cores。超執行緒對CFD計算沒有好處。 4. **時脈速度 High clock speed**, 影響較小,通常CFD計算瓶頸在於 information flow : 訊息的傳遞、收集、檢索、儲存等等。 * 推薦的CPU處理器範例(長時間運算CFD計算推薦AMD EPYC系列) > **AMD EPYC 4th Generation** > > > 12 Memory Channels and up to 460 GB/s Memory Bandwidth > > In this generation, we recommend: > > AMD EPYC™ 9354 (32 cores and 256 MB L3 Cache) ~ 3500$ > > AMD EPYC™ 9384X (32 cores and 768 MB L3 Cache) ~ 5000$ > > **AMD EPYC 3rd Generation** > > 8 Memory Channels and up to 204 GB/s Memory Bandwidth > > In this generation, we recommend: > > AMD EPYC™ 7373X (16 cores) or AMD EPYC™ 7473X (24 cores) ~4000$ > > AMD EPYC™ 74F3 ~3000$ > > The AMD EPYC 3rd generation has a worse performance but is compatible with older and more affordable components, such as AM4 motherboards and DDR4 memory. * RAM記憶體 **低於** 10M 網格的模擬計算32gb RAM就足夠。 **小於** 10M 網格的simulation = 32GB RAM **等於** 10M 網格的simulation且在一台PC上執行多項分析 = 64GB RAM **大於** 10M 網格的simulation = 每1M節點使用2GB RAM 不論RAM總量為何,建議每個記憶體通道配置一個RAM module ex.4 記憶體通道 需要 64gb RAM <br> <br> #### [Hardware for CFD simulations <br> CFDSUPPORT ](https://www.cfdsupport.com/hardware-for-cfd.html) * Laptop, PC, Cluster - Server, Storage - Server <br> <br> #### [AMD EPYC 7002 SERIES PROCESSORS AND OPENFOAM FOR COMPUTATIONAL FLUID DYNAMICS, 2020, Feb](https://www.amd.com/content/dam/amd/en/documents/epyc-business-docs/solution-briefs/AMD-EPYC-7002-OpenFOAM.pdf) * OpenFOAM motorBike為例子,測試160,000網格和351,520網格 ![image](https://hackmd.io/_uploads/SJC7Gsz1R.png) ![image](https://hackmd.io/_uploads/H13NzjzyR.png) <br> <br> <br> <br> ## Openfoam real case <br> | case | institution | abstract | cell | link | | -------- | -------- | -------- | -------- | -------- | | motorBike | CFDSUPPORT | 摩托車幾何形狀的外部空氣動力學。 | 1,280 | [link](https://www.cfdsupport.com/OpenFOAM-Training-by-CFD-Support/node133.html) | | cavity | CFDSUPPORT | 在二維正方形腔體中模擬簡單流動,包括層流和湍流。 | 400 | [link](https://www.cfdsupport.com/OpenFOAM-Training-by-CFD-Support/node39.html) | | Backward-Facing-Step | CFDSUPPORT | 測試湍流模型的準確性,通過模擬流體在台階處的分離和重新附著來評估模型。 | 400 | [link](https://www.cfdsupport.com/OpenFOAM-Training-by-CFD-Support/node39.html) | | External Aerodynamics of a Car | CFDSUPPORT | 汽車外部空氣動力學,包括不同幾何形狀的車身流動和發動機艙內的熱交換效應。 | 13,500 | [link](https://www.cfdsupport.com/OpenFOAM-Training-by-CFD-Support/node256.html) | | roomWithRadiator | CFDSUPPORT | 散熱器內的熱水通過傳導和輻射加熱房間,並通過自然對流傳播熱空氣。 | | [link](https://www.cfdsupport.com/OpenFOAM-Training-by-CFD-Support/node246.html) | | Wind Turbine | CFDSUPPORT | 風力渦輪建構高級網格,評估其扭矩和功率 | | [link](https://www.cfdsupport.com/OpenFOAM-Training-by-CFD-Support/node276.html) | | Verification and Validation of aerospike designs in supersonic flow (2023) | CFD FOSSEE | 利用 OpenFOAM 模擬高速飛行器上的減阻裝置,旨在通過降低空氣阻力來提高飛行效率,並確保設計的可靠性和準確性 | approximately 790k cells | [link](https://cfd.fossee.in/case-study-project/case-study-run/236) | | 3D modelling of Porcupine River Training Works (2021) | CFD FOSSEE | 通過 OpenFOAM 模擬分析砥礪結構在減緩河流流速和防止河岸侵蝕方面的效果,並將模擬結果與實驗數據進行比較。 | approximately 560k cells | [link](https://cfd.fossee.in/case-study-project/case-study-run/195) | | Wind analysis around tall buildings (2019) | CFD FOSSEE | 使用 OpenFOAM 研究高層建築在風力作用下的影響,以指導安全施工和提高建築耐久性。 | approximately 125k cells | [link](https://cfd.fossee.in/case-study-project/case-study-run/209) | | Pollutant Dispersion Modelling using CFD: A walkthrough of solver development in OpenFOAM (2022) | CFD FOSSEE | 使用 OpenFOAM 對城市污染物擴散進行建模,通過開發湍流穩態求解器並與實驗對比來優化預測。 | 182,249 | [link](https://cfd.fossee.in/case-study-project/case-study-run/209) | | Thermal Simulation of Electric Vehicle Battery (2021) | CFD FOSSEE | 通過熱模擬分析電動車鋰離子電池的溫度變化,並使用強制對流冷卻技術來驗證電池的實時性能。 | 15,300 | [link](https://cfd.fossee.in/case-study-project/case-study-run/168) | | Multiphase simulation using OpenFOAM for calculating ship hull resistance (2022) | CFD FOSSEE | 使用 OpenFOAM 對船體在水中航行時的阻力進行多相模擬,並通過不同求解器和方案進行比較驗證。 | 570,000~2,000,000 (570k~2M) | [link](https://cfd.fossee.in/case-study-project/case-study-run/225) | <br> <br> --- ### motorBike case : 主要目標:觀察摩托車幾何形狀的外部空氣動力學結果 ![image](https://hackmd.io/_uploads/Bywrz2MkC.png) ``` ##Copy *motorBike* tutorial:## cd $FOAM_RUN cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/motorBike ./ # solver = simpleFoam cd motorBike ``` <br> ### step1.調整範例 **1.1 根據需求從初始化文件中調整物理參數。** 相關物理參數: - 入口速度 Inlet velocity: U = 20 m/s - 摩托車長度約 Motorbike length: L = 2 m - 雷諾平均納維-斯托克斯 (RANS) 湍流建模 Reynolds Averaged Navier-Stokes (RANS) turbulence modeling - 湍流參數 Turbulence parameters - 不可壓縮流體流動 Incompressible fluid flow - 穩態解 Steady-state solution <br> <br> <br> ### step2.網格生成 **2.1 一般而言,針對湍流 RANS 流動的網格設計和選擇** https://www.cfdsupport.com/OpenFOAM-Training-by-CFD-Support/node136.html <br> <br> **2.2 分析在流體與固體接觸壁面處的網格限制情況** https://www.cfdsupport.com/OpenFOAM-Training-by-CFD-Support/node137.html <br> <br> **2.3 準備OBJ模型** **motorBike.obj.gz** 是一個壓縮的 OBJ 文件,它包含了一個摩托車模型的三維表面幾何訊息。 *(OBJ 是一種標準的 3D 模型文件格式,可以被許多 3D 建模軟體和渲染引擎識別。)* ``` ## resources/geometry/motorBike.obj.gz ## gzip -d motorBike.obj.gz ⇒ motorBike.obj ``` 解壓縮後的.obj檔案: - 可以透過**3D建模軟體**(ex. **Blender**)或**可視化工具**(ex. **ParaView**)查看或編輯。 ``` paraview - -data=motorBike.obj ``` ![Untitled](https://hackmd.io/_uploads/r1tAm3GyA.png) - 可以做為流體流動模擬的幾何邊界進行計算。 <br> <br> **2.4 網格生成 Meshing** 透過編輯 *blockMeshDict* 檔案,設置適當的 域邊界 以及 背景網格。 ![Untitled2](https://hackmd.io/_uploads/SyeXV2fJ0.png) ![Untitled2-1](https://hackmd.io/_uploads/SJBQNhGJA.png) 透過指令”blockMesh”生成背景網格。 ``` blockMesh ``` <br> <br> **2.5 執行 snappyHexMesh** ``` snappyHexMesh -overwrite #(overwrite可以保證覆蓋過去舊的網格) ``` 使用上述blockMesh生成的背景網格,根據幾何模型細化網格,生成出更複雜的網格。 ![Untitled3](https://hackmd.io/_uploads/rJUKE2zy0.png) <br> <br> <br> ### step3.開始模擬計算 **3.1複製存放初始參數資料夾** ``` cp -r 0.orig/* 0 ``` <br> <br> **3.2.1 run : 單核運行** ``` simpleFoam > log.simpleFoam & ``` <br> <br> **3.2.2 run : 平行運行** > ##修改system/decomposeParDict的”numberOfSubdomains”數量## numberOfSubdomains 1 ; ⇒ numberOfSubdomains 2 分割網格 ``` decomposePar ``` 開始平行運算 ``` mpiexec -np 2 simpleFoam -parallel > log.simpleFoam & ``` 使用*reconstructPar*重建網格並且使用paraview功能來查看 ``` reconstructPar paraFoam ``` ![Untitled4](https://hackmd.io/_uploads/H19JS3zJA.png) <br> <br> ### **面對任何openfoam case running大致流程:** **挑選模擬案例 => 設置初始條件 => 準備幾何模型 => 網格生成 (背景網格設置 + 細化網格生成) => 單核或平行運行計算 => 後處理分析。** <br> <br> <br> <br> ## Openfoam GPU-accelerated issue <br> 官方openfoam並不支援GPU。 <br> SimFlow團隊 開源套件 **[RapidCFD](https://github.com/SimFlowCFD/RapidCFD-dev)** https://sim-flow.com/rapid-cfd-gpu/ https://github.com/SimFlowCFD/RapidCFD-dev <br> <br> NTNU 使用 RapidCFD https://www.hpc.ntnu.no/vilje/software/a-benchmark-test-for-openfoam-using-gpu-cards-flow-past-a-centrifugal-pump/ <br> <br> GPU Acceleration of CFD Simulations in OpenFOAM 2023 Sep https://www.mdpi.com/2226-4310/10/9/792 <br> <br> GPU-accelerated OpenFOAM simulations using PETSc4FOAM 2020 Oct https://www.esi-group.com/sites/default/files/resource/other/1806/8th_OpenFOAM_Conference_Cineca_Spisso_2_0.pdf <br> <br> QA. GPU Parallelization in OpenFoam https://www.cfd-online.com/Forums/openfoam-programming-development/214050-gpu-parallelization-openfoam.html

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully