41
オープンCAEコンサルタント OCSE^2 代表 野村悦治 2015/1/10 36回オープンCAE勉強会@岐阜 motorBikeチュートリアルを cfMeshで実施する方法 on DEXCS2014 for OpenFOAM® OPENFOAM and OpenCFD are registered trademarks of OpenCFD Ltd.

Motor bike by cfmesh

Embed Size (px)

Citation preview

Page 1: Motor bike by cfmesh

オープンCAEコンサルタント OCSE^2 代表 野村悦治

2015/1/10 第36回オープンCAE勉強会@岐阜 

motorBikeチュートリアルをcfMeshで実施する方法

on DEXCS2014 for OpenFOAM®

OPENFOAM and OpenCFD are registered trademarks of OpenCFD Ltd.

Page 2: Motor bike by cfmesh

モデル概要 https://groups.google.com/forum/?hl=ja#!topic/openfoam/k3MfuHsjyj4

motorBikeチュートリアルの境界名と合致させました。

Page 3: Motor bike by cfmesh

cfMeshSetting.py の課題

1

3

2

マクロを起動できません(こういう仕様です)

Page 4: Motor bike by cfmesh

❏ ポリゴンパーツをソリッド化

❏ ポリゴン以外のソリッドパーツでマクロ実行

⇒出力された設定ファイルを修正

● 統合ツールを使う

● stl ⇒step 変換ツールを使う(例)

対応方法

http://www.solveering.com/instep.htm

サイズが小さければOKですが、本例の場合(約60MB)は無理なようです

有料版ならOKみたいですが、フリー版では 3,000 faceまでしか変換できません。本例の場合、

300,000 ほどになります。

Page 5: Motor bike by cfmesh

参照ケースの作成

1

2

43

Page 6: Motor bike by cfmesh

motorBike チュートリアル

1

2

3

4

Page 7: Motor bike by cfmesh

motorBike チュートリアルケースの作成

1

2

Page 8: Motor bike by cfmesh

Allrunの実行

1

2

3

4

5

Page 9: Motor bike by cfmesh

ケースファイルの整備

ダブルクリック

名前変更

Page 10: Motor bike by cfmesh

cfMesh用ケースファイル(motorBike チュートリアルケースをコピー)

マウス右クリック

1 2

3

45

6

Page 11: Motor bike by cfmesh

cfMesh用ケースファイルの整備(1)

ダブルクリック

削除

Page 12: Motor bike by cfmesh

cfMesh用ケースファイルの整備(2)

供試モデルファイル

名前変更

Page 13: Motor bike by cfmesh

モデルファイルを開く(FreeCAD起動)

ダブルクリック

Page 14: Motor bike by cfmesh

ポリゴンパーツのSTLファイル出力

1

2

3

4

5 6

Page 15: Motor bike by cfmesh

makeCfMeshSetting.py のダミー実行

4

2

3ポリゴンパーツは非表示状態

1

Page 16: Motor bike by cfmesh

cfMeshパラメタ設定

ダミーとしての設定

1

変更箇所

Page 17: Motor bike by cfmesh

ファイル確認と拡張子名変更

マクロによって作成されたファイル

ポリゴンパーツから出力されたSTLファイル

拡張子を変更(.ast ⇒.stl)

Page 18: Motor bike by cfmesh

Blenderの起動

1

2

Deleteキーを押す

Page 19: Motor bike by cfmesh

stlファイルのインポート

2

1

3

Page 20: Motor bike by cfmesh

stlファイルのエクスポート

2

1

3

Page 21: Motor bike by cfmesh

stlファイル出力

1

Page 22: Motor bike by cfmesh

ファイル確認

ファイルサイズの違い!

Page 23: Motor bike by cfmesh

ファイルサイズの違いの要因

厚み≒0表面・裏面が存在

単面のみ

重複面が削除されている

Page 24: Motor bike by cfmesh

solid名の変更Blenderの出力デフォルト

所望のpatch名

Page 25: Motor bike by cfmesh

stlファイルの合体とfmsファイルの作成

cat motorBikeA.stl >> MotorBike.stlsurfaceFeatureEdges MotorBike.stl MotorBike.fms -angle 30

Page 26: Motor bike by cfmesh

fmsファイルの修正

所望の境界Type

Page 27: Motor bike by cfmesh

system/meshDict の修正

ダミーで設定済み

所望のpatch名

スペースを追加(バグ)

所望のpatch(コピペ追加)

値も変更

Page 28: Motor bike by cfmesh

cfMesh実行

cfMesh snappy

Page 29: Motor bike by cfmesh

Mesh stats points: 405030 faces: 1103934 internal faces: 1053816 cells: 352163

Mesh stats points: 492433 faces: 1416369 internal faces: 1335802 cells: 459890

cfMesh snappy

並列計算では実行の都度結果が異なる

Page 30: Motor bike by cfmesh

(参考)重複面有りモデルを使用すると...

cat motorBike.stl >> MotorBike.stlsurfaceFeatureEdges MotorBike.stl MotorBike.fms -angle 30

Page 31: Motor bike by cfmesh

計算が進まない

コアダンプ

稀に計算完了した場合もありました

Page 32: Motor bike by cfmesh

Mesh stats points: 492374 faces: 1416947 internal faces: 1336398 cells: 460202 faces per cell: 5.98291 boundary patches: 6.......

Checking geometry... Overall domain bounding box (-5 -4 -1.73252e-05) (15 4 8) Mesh (non-empty, non-wedge) directions (1 1 1) Mesh (non-empty) directions (1 1 1) Boundary openness (6.06686e-16 2.31695e-17 -7.79465e-17) OK. Max cell openness = 5.10346e-16 OK. Max aspect ratio = 36.2971 OK. Minimum face area = 4.29584e-10. Maximum face area = 1.45522. Face area magnitudes OK. Min volume = 2.55897e-13. Max volume = 1.34485. Total volume = 1279.67. Cell volumes OK. Mesh non-orthogonality Max: 88.0226 average: 16.0198 *Number of severely non-orthogonal (> 70 degrees) faces: 1693. Non-orthogonality check OK. <<Writing 1693 non-orthogonal faces to set nonOrthoFaces ***Error in face pyramids: 2 faces are incorrectly oriented. <<Writing 2 faces with incorrect orientation to set wrongOrientedFaces ***Max skewness = 15.8065, 68 highly skew faces detected which may impair the quality of the results <<Writing 68 skew faces to set skewFaces Coupled point location match (average 0) OK.

Failed 2 mesh checks.

Mesh stats points: 492202 faces: 1414538 internal faces: 1334149 cells: 459111 faces per cell: 5.98698 boundary patches: 6 point zones: 0 face zones:

Checking geometry... Overall domain bounding box (-5 -4 -4.57223e-05) (15 4 8) Mesh (non-empty, non-wedge) directions (1 1 1) Mesh (non-empty) directions (1 1 1) Boundary openness (-1.29676e-16 2.11227e-16 -4.53638e-15) OK. Max cell openness = 5.46261e-16 OK. Max aspect ratio = 40.5241 OK. Minimum face area = 2.12499e-13. Maximum face area = 1.45522. Face area magnitudes OK. Min volume = 3.18488e-13. Max volume = 1.34485. Total volume = 1279.67. Cell volumes OK. Mesh non-orthogonality Max: 87.663 average: 15.9505 *Number of severely non-orthogonal (> 70 degrees) faces: 1811. Non-orthogonality check OK. <<Writing 1811 non-orthogonal faces to set nonOrthoFaces Face pyramids OK. ***Max skewness = 10.5582, 31 highly skew faces detected which may impair the quality of the results <<Writing 31 skew faces to set skewFaces Coupled point location match (average 0) OK.

Failed 1 mesh checks.

checkMeshMesh stats points: 405030 faces: 1103934 internal faces: 1053816 cells: 352163 faces per cell: 6.12713 boundary patches: 72

Checking geometry... Overall domain bounding box (-5 -4 0) (15 4 8) Mesh (non-empty, non-wedge) directions (1 1 1) Mesh (non-empty) directions (1 1 1) Boundary openness (5.51186e-18 5.04519e-18 -6.12207e-16) OK. Max cell openness = 9.08478e-16 OK. Max aspect ratio = 40.9312 OK. Minimum face area = 1.18487e-06. Maximum face area = 1.01432. Face area magnitudes OK. Min volume = 8.64466e-09. Max volume = 1.00612. Total volume = 1279.67. Cell volumes OK. Mesh non-orthogonality Max: 64.986 average: 9.93472 Non-orthogonality check OK. Face pyramids OK. ***Max skewness = 9.93881, 11 highly skew faces detected which may impair the quality of the results <<Writing 11 skew faces to set skewFaces Coupled point location match (average 0) OK.

Failed 1 mesh checks.

cfMesh

snappy

Page 33: Motor bike by cfmesh

計算準備

このままだと発散

Page 34: Motor bike by cfmesh

計算状況

ExecutionTime = 458.85 s ClockTime = 828 s

ExecutionTime = 476.41 s ClockTime = 704 s

Page 35: Motor bike by cfmesh

参考

Page 36: Motor bike by cfmesh

計算結果の例(速度場)

snappycfMesh

Page 37: Motor bike by cfmesh

計算結果の例(圧力場)

cfMesh snappy

Page 38: Motor bike by cfmesh

計算結果の例(y+)

snappycfMesh

Page 39: Motor bike by cfmesh

まとめ

❏ motorBikeチュートリアルケースをcfMeshでメッシュ作成し、計算実行できた。

❏ snappyHexMeshとの比較

❏ メッシュ生成時間、checkMesh品質は劣ったが、境界レイ

ヤーは格段に優れていた。❏ 本例のようにポリゴンパーツが存在する場合には、

makeCfMeshSetting.pyの出力ファイルをベースに、比較的簡単な手修正作業で設定ファイルの適合可能。

⇒makeCfMeshSetting.pyの機能拡張に組み込む予定。

Page 40: Motor bike by cfmesh

処理の流れの概要まとめ

ポリゴンパーツ

ソリッドパーツ meshDict

Solids.stl Solids.fms

STL.ast STL.stl

STL.stl Solids.stl2

1

3

4 6

8マクロ実行(p.15-16)

エクスポート(p.14)

拡張子名変更 (p.17)

ファイルの合体 (p.25)

輪郭線処理(p.25)

パラメタ適合(p.26-27)

4 重複面削除(p.18-23)FreeCADへインポートする前に実施しておくのがベター

5 ソリッド名変更 (p.24)

Page 41: Motor bike by cfmesh

Let’s smart OpenCAE

presented by