【質問】snappyHexMesh時のエラーについて(複雑な系)

465 views
Skip to first unread message

Gaku Murakami

unread,
Oct 21, 2021, 8:41:27 PM10/21/21
to OpenFOAM
お世話になっております.
snappyHexMeshを用いてメッシュの作成を行う際,エラーが生じて動作が停止してしまいます.
解決に向けてご助言をいただければ幸いです.

1. BlockMeshでの系作成
0.8mm x 0.8mm x 0.6mmの直方体形状です.
座標系の取り方としましては,(Xmin, Ymin, Zmin) = (-0.4, -0.4, 0),(Xmax, Ymax, Zmax) = (0.4, 0.4, 0.6) としています.
メッシュは0.002mm/grid(400分割, 400分割, 300分割)に設定しています.

2. 用意したstlファイル
複数パターンを有する多孔質体形状のモデルとなっています.
寸法については添付の画像に示すとおりです.
(詳細に記載することはできないのですが)細長いパイプ形状のものが複雑に入り組んだモデルとなっています.
openfoam_googlegroup.png


3. snappyHexMeshエラー文
以下に示すエラーが発生しました.
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
#計算途中から抜粋しています.
Undo iteration 1
----------------
Checking faces in error :
    non-orthogonality > 65  degrees                        : 261
    faces with face pyramid volume < 1e-13                 : 136149479
    faces with face-decomposition tet quality < 1e-15      : 0
    faces with concavity > 80  degrees                     : 0
    faces with skewness > 4   (internal) or 20  (boundary) : 0
    faces with interpolation weights (0..1)  < 0.05        : 0
    faces with volume ratio of neighbour cells < 0.01      : 0
    faces with face twist < 0.02                           : 0
    faces on cells with determinant < 0.001                : 0
Masters that need to be restored:0

Merging all points on surface that
- are used by only two boundary faces and
- make an angle with a cosine of more than 0.866025.

No straight edges simplified and no points removed ...
Snapped mesh : cells:45010050  faces:136149740  points:46105142
Cells per refinement level:
    0 45010050
Writing mesh to time constant
Wrote mesh in = 1132.49 s.
Mesh snapped in = 8840.64 s.

Shrinking and layer addition phase
----------------------------------

Using mesh parameters 
{
    maxNonOrtho     65;
    maxBoundarySkewness 20;
    maxInternalSkewness 4;
    maxConcave      80;
    minVol          1e-13;
    minTetQuality   1e-15;
    minArea         -1;
    minTwist        0.02;
    minDeterminant  0.001;
    minFaceWeight   0.05;
    minVolRatio     0.01;
    minTriangleTwist -1;
    relaxed
    {
        maxNonOrtho     75;
    }
    nSmoothScale    4;
    errorReduction  0.75;
}



Merging all faces of a cell
---------------------------
    - which are on the same patch
    - which make an angle < 130 degrees
      (cos:-0.642788)
    - as long as the resulting face doesn't become concave by more than 90 degrees
      (0=straight, 180=fully concave)



--> FOAM FATAL ERROR: 
Multiple outside loops:0()

    From function static Foam::face Foam::combineFaces::getOutsideFace(const indirectPrimitivePatch&)
    in file polyTopoChange/polyTopoChange/combineFaces.C at line 420.

FOAM aborting

#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::error::abort() at ??:?
#2  Foam::combineFaces::getOutsideFace(Foam::PrimitivePatch<Foam::face, Foam::IndirectList, Foam::Field<Foam::Vector<double> > const&, Foam::Vector<double> > const&) at ??:?
#3  Foam::combineFaces::validFace(double, Foam::PrimitivePatch<Foam::face, Foam::IndirectList, Foam::Field<Foam::Vector<double> > const&, Foam::Vector<double> > const&) at ??:?
#4  Foam::combineFaces::getMergeSets(double, double, Foam::HashSet<int, Foam::Hash<int> > const&) const at ??:?
#5  Foam::meshRefinement::mergePatchFacesUndo(double, double, Foam::List<int> const&, Foam::dictionary const&, Foam::List<int> const&) at ??:?
#6  Foam::snappyLayerDriver::mergePatchFacesUndo(Foam::layerParameters const&, Foam::dictionary const&) at ??:?
#7  Foam::snappyLayerDriver::doLayers(Foam::dictionary const&, Foam::dictionary const&, Foam::layerParameters const&, bool, Foam::decompositionMethod&, Foam::fvMeshDistribute&) at ??:?
#8  ? at ??:?
#9  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#10  ? at ??:?
中止 (コアダンプ)
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

最初,メッシュサイズ0.004mm/grid で実行したところ,上に示すエラーが発生したので,メッシュサイズを1/2にした(0.002mm/grid)のですが,同様のエラーが発生しました.
また,同様の寸法でより単純なモデル(パイプ形状の本数を減らした多孔質体モデル)であれば,snappyHexMeshでメッシュを作成することに成功しています.

以上,snappyHexMeshのエラーについて,何かわかることがあればご教授いただきたいです.
よろしくお願いいたします.

haruka tsubota @xsim.info

unread,
Oct 23, 2021, 4:44:22 AM10/23/21
to OpenFOAM
ソースコードを読むとパッチの縁のエッジを数えるところで正しくカウントできずゼロになっていることが直接の原因の様です(下記 OpenFOAM のバージョンは適宜、読み変えてください)。

- OpenFOAM-8/src/dynamicMesh/polyTopoChange/polyTopoChange/combineFaces.C
https://github.com/OpenFOAM/OpenFOAM-8/blob/c84029a9929412f2fc3c053eb2a14aaca97d9ceb/src/dynamicMesh/polyTopoChange/polyTopoChange/combineFaces.C

- OpenFOAM-8/src/OpenFOAM/meshes/primitiveMesh/PrimitivePatch/PrimitivePatchEdgeLoops.C
https://github.com/OpenFOAM/OpenFOAM-8/blob/c84029a9929412f2fc3c053eb2a14aaca97d9ceb/src/OpenFOAM/meshes/primitiveMesh/PrimitivePatch/PrimitivePatchEdgeLoops.C

なぜカウントがゼロになるかは処理を追わないとわかりませんが、エラーメッセージで検索すると特徴線周りのメッシュを1段階細かくしたら問題が解消したという報告があるようです。

- [snappyHexMesh] Error snappyhexmesh - Multiple outside loops
https://www.cfd-online.com/Forums/openfoam-meshing/131185-error-snappyhexmesh-multiple-outside-loops.html

従ってsurfaceFeatures(またはsurfaceFeatureExtract)した上でsnappyHexMeshDictの castellatedMeshControls > features > level を上げてみると良いかも知れません。

2021年10月22日金曜日 9:41:27 UTC+9 2gaku...@gmail.com:

Gaku Murakami

unread,
Oct 25, 2021, 8:02:48 AM10/25/21
to OpenFOAM
ご回答いただき,ありがとうございます.
STLファイルを出力する際,メッシュを粗くする設定を行うと,snappyHexMeshでメッシュを作成することができました.

その後,interFoamソルバーで計算を実施していたのですが,以下のエラーコードを伴い,計算が停止しました(質問下部に掲載します).
(なお,今回計算している系について,他のSTLファイル(より単純な構造のもの)を使用した際は問題なく最後まで計算が終了しています.境界条件,control,setFields等の各設定はその際と同様です).

ご教授頂いた通り,特徴線(境界層?)周りのメッシュを細かくすることは今回の場合も有効でしょうか?
その他のソリューション等,お教えいただけると幸いです.
よろしくお願いいたします.

PIMPLE: iteration 1
smoothSolver:  Solving for alpha.water, Initial residual = 3.52754e-11, Final residual = 3.52754e-11, No Iterations 0
Phase-1 volume fraction = 0.0473968  Min(alpha.water) = -4.13483e-11  Max(alpha.water) = 1
MULES: Correcting alpha.water
MULES: Correcting alpha.water
Phase-1 volume fraction = 0.0473968  Min(alpha.water) = -4.13483e-11  Max(alpha.water) = 1
DICPCG:  Solving for p_rgh, Initial residual = 0.99999, Final residual = 0.0467694, No Iterations 100
time step continuity errors : sum local = 1.102e-08, global = 2.19398e-12, cumulative = 0.00677971
DICPCG:  Solving for p_rgh, Initial residual = 0.578843, Final residual = 0.0262182, No Iterations 155
time step continuity errors : sum local = 1.72713e-08, global = 1.38354e-12, cumulative = 0.00677971
DICPCG:  Solving for p_rgh, Initial residual = 0.68651, Final residual = 0.00124388, No Iterations 1001
time step continuity errors : sum local = 2.71614e-09, global = -1.90117e-10, cumulative = 0.00677971
ExecutionTime = 4318.04 s  ClockTime = 4391 s

Courant Number mean: 4.9894e-05 max: 254.946
Interface Courant Number mean: 6.04973e-10 max: 2.45617e-05
deltaT = 7.2963e-113
Time = 1.11703e-06

PIMPLE: iteration 1
smoothSolver:  Solving for alpha.water, Initial residual = 2.47143e-11, Final residual = 2.47143e-11, No Iterations 0
Phase-1 volume fraction = 0.0473968  Min(alpha.water) = -4.13483e-11  Max(alpha.water) = 1
MULES: Correcting alpha.water
MULES: Correcting alpha.water
Phase-1 volume fraction = 0.0473968  Min(alpha.water) = -4.13483e-11  Max(alpha.water) = 1
[2] #0  Foam::error::printStack(Foam::Ostream&) at ??:?
[2] #1  Foam::sigFpe::sigHandler(int) at ??:?
[2] #2  ? in "/lib/x86_64-linux-gnu/libc.so.6"
[2] #3  double Foam::sumProd<double>(Foam::UList<double> const&, Foam::UList<double> const&) at ??:?
[2] #4  Foam::PCG::solve(Foam::Field<double>&, Foam::Field<double> const&, unsigned char) const at ??:?
[2] #5  Foam::fvMatrix<double>::solveSegregated(Foam::dictionary const&) at ??:?
[2] #6  Foam::fvMatrix<double>::solve(Foam::dictionary const&) at ??:?
[2] #7  ? at ??:?
[2] #8  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
[2] #9  ? at ??:?
[ceres:09794] *** Process received signal ***
[ceres:09794] Signal: Floating point exception (8)
[ceres:09794] Signal code:  (-6)
[ceres:09794] Failing at address: 0x3e800002642
[ceres:09794] [ 0] /lib/x86_64-linux-gnu/libc.so.6(+0x354c0)[0x7f85ff1f64c0]
[ceres:09794] [ 1] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x38)[0x7f85ff1f6438]
[ceres:09794] [ 2] /lib/x86_64-linux-gnu/libc.so.6(+0x354c0)[0x7f85ff1f64c0]
[ceres:09794] [ 3] /opt/openfoam5/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so(_ZN4Foam7sumProdIdEEdRKNS_5UListIT_EES5_+0x39)[0x7f86006af6f9]
[ceres:09794] [ 4] /opt/openfoam5/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so(_ZNK4Foam3PCG5solveERNS_5FieldIdEERKS2_h+0xc80)[0x7f86004bb9a0]
[ceres:09794] [ 5] /opt/openfoam5/platforms/linux64GccDPInt32Opt/lib/libfiniteVolume.so(_ZN4Foam8fvMatrixIdE15solveSegregatedERKNS_10dictionaryE+0x15b)[0x7f86026f9bfb]
[ceres:09794] [ 6] interFoam(_ZN4Foam8fvMatrixIdE5solveERKNS_10dictionaryE+0x191)[0x4d26a1]
[ceres:09794] [ 7] interFoam[0x4485f6]
[ceres:09794] [ 8] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f85ff1e1840]
[ceres:09794] [ 9] interFoam[0x44f6a9]
[ceres:09794] *** End of error message ***
--------------------------------------------------------------------------
mpirun noticed that process rank 2 with PID 9794 on node ceres exited on signal 8 (Floating point exception).


2021年10月23日土曜日 17:44:22 UTC+9 haruka tsubota @xsim.info:

kominami

unread,
Oct 25, 2021, 9:59:10 AM10/25/21
to OpenFOAM
kominamiです。

>Courant Number mean: 4.9894e-05 max: 254.946
>Interface Courant Number mean: 6.04973e-10 max: 2.45617e-05
>deltaT = 7.2963e-113
>Time = 1.11703e-06

>その後,interFoamソルバーで計算を実施していたのですが,以下のエラーコード
>を伴い,計算が停止しました(質問下部に掲載します).
>(なお,今回計算している系について,他のSTLファイル(より単純な構造のもの)
>を使用した際は問題なく最後まで計算が終了しています.境界条件,control,
>setFields等の各設定はその際と同様です).

メッシュサイズが小さくなりタイムステップの設定を変えていないから、クーラン数が大きくなったのだと推定します。

controlDict ファイル内の設定でタイムステップを小さくするか自動調整にしてみてください。
と言いつつ、deltaTは非常に小さな値ですね。転記されているログも、計算初期のものではなくて或る程度計算が進んだあとのものでしょう。
おそらく既にタイムステップを自動調整にしているのでしょう。

>特徴線(境界層?)周りのメッシュを細かくすることは今回の場合も有効でしょうか?
たぶん、これは有効ではないと思います。
計算の発散対策については、このサイトの他の投稿を調べてください。すでに多くの投稿が保存されています。

以上 よろしくお願いいたします。






2021年10月25日月曜日 21:02:48 UTC+9 2gaku...@gmail.com:
Reply all
Reply to author
Forward
0 new messages