Upload
etsuji-nomura
View
1.040
Download
6
Embed Size (px)
Citation preview
オープンCAEコンサルタント OCSE^2 代表 野村悦治
2015/1/10 第36回オープンCAE勉強会@岐阜
motorBikeチュートリアルをcfMeshで実施する方法
on DEXCS2014 for OpenFOAM®
OPENFOAM and OpenCFD are registered trademarks of OpenCFD Ltd.
モデル概要 https://groups.google.com/forum/?hl=ja#!topic/openfoam/k3MfuHsjyj4
motorBikeチュートリアルの境界名と合致させました。
cfMeshSetting.py の課題
1
3
2
マクロを起動できません(こういう仕様です)
❏ ポリゴンパーツをソリッド化
❏ ポリゴン以外のソリッドパーツでマクロ実行
⇒出力された設定ファイルを修正
● 統合ツールを使う
● stl ⇒step 変換ツールを使う(例)
対応方法
http://www.solveering.com/instep.htm
サイズが小さければOKですが、本例の場合(約60MB)は無理なようです
有料版ならOKみたいですが、フリー版では 3,000 faceまでしか変換できません。本例の場合、
300,000 ほどになります。
参照ケースの作成
1
2
43
motorBike チュートリアル
1
2
3
4
motorBike チュートリアルケースの作成
1
2
Allrunの実行
1
2
3
4
5
ケースファイルの整備
ダブルクリック
名前変更
cfMesh用ケースファイル(motorBike チュートリアルケースをコピー)
マウス右クリック
1 2
3
45
6
cfMesh用ケースファイルの整備(1)
ダブルクリック
削除
cfMesh用ケースファイルの整備(2)
供試モデルファイル
名前変更
モデルファイルを開く(FreeCAD起動)
ダブルクリック
ポリゴンパーツのSTLファイル出力
1
2
3
4
5 6
makeCfMeshSetting.py のダミー実行
4
2
3ポリゴンパーツは非表示状態
1
cfMeshパラメタ設定
ダミーとしての設定
1
変更箇所
ファイル確認と拡張子名変更
マクロによって作成されたファイル
ポリゴンパーツから出力されたSTLファイル
拡張子を変更(.ast ⇒.stl)
Blenderの起動
1
2
Deleteキーを押す
stlファイルのインポート
2
1
3
stlファイルのエクスポート
2
1
3
stlファイル出力
1
ファイル確認
ファイルサイズの違い!
ファイルサイズの違いの要因
厚み≒0表面・裏面が存在
単面のみ
重複面が削除されている
solid名の変更Blenderの出力デフォルト
所望のpatch名
stlファイルの合体とfmsファイルの作成
cat motorBikeA.stl >> MotorBike.stlsurfaceFeatureEdges MotorBike.stl MotorBike.fms -angle 30
fmsファイルの修正
所望の境界Type
system/meshDict の修正
ダミーで設定済み
所望のpatch名
スペースを追加(バグ)
所望のpatch(コピペ追加)
値も変更
cfMesh実行
cfMesh snappy
Mesh stats points: 405030 faces: 1103934 internal faces: 1053816 cells: 352163
Mesh stats points: 492433 faces: 1416369 internal faces: 1335802 cells: 459890
cfMesh snappy
並列計算では実行の都度結果が異なる
(参考)重複面有りモデルを使用すると...
cat motorBike.stl >> MotorBike.stlsurfaceFeatureEdges MotorBike.stl MotorBike.fms -angle 30
計算が進まない
コアダンプ
稀に計算完了した場合もありました
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
計算準備
このままだと発散
計算状況
ExecutionTime = 458.85 s ClockTime = 828 s
ExecutionTime = 476.41 s ClockTime = 704 s
参考
計算結果の例(速度場)
snappycfMesh
計算結果の例(圧力場)
cfMesh snappy
計算結果の例(y+)
snappycfMesh
まとめ
❏ motorBikeチュートリアルケースをcfMeshでメッシュ作成し、計算実行できた。
❏ snappyHexMeshとの比較
❏ メッシュ生成時間、checkMesh品質は劣ったが、境界レイ
ヤーは格段に優れていた。❏ 本例のようにポリゴンパーツが存在する場合には、
makeCfMeshSetting.pyの出力ファイルをベースに、比較的簡単な手修正作業で設定ファイルの適合可能。
⇒makeCfMeshSetting.pyの機能拡張に組み込む予定。
処理の流れの概要まとめ
ポリゴンパーツ
ソリッドパーツ meshDict
Solids.stl Solids.fms
STL.ast STL.stl
STL.stl Solids.stl2
1
3
4 6
7
8マクロ実行(p.15-16)
エクスポート(p.14)
拡張子名変更 (p.17)
ファイルの合体 (p.25)
輪郭線処理(p.25)
パラメタ適合(p.26-27)
4 重複面削除(p.18-23)FreeCADへインポートする前に実施しておくのがベター
5
5 ソリッド名変更 (p.24)
Let’s smart OpenCAE
presented by