PR

【OpenFOAMv1706】Foam::error::printStack(Foam::Ostream&)#0 Foam::sigSegv::sigHandler(int) at ??:?

OpenFOAMv1706で出たエラーとその原因・対処法

スポンサーリンク

エラー内容

新しい乱流モデルを実装し,コンパイルが通ったので計算を回したところ,計算が落ちた

log.pimpleFOAMを見ると次のようなエラーが出ていた

/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v1706                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
Build  : v1706
Arch   : "LSB;label=64;scalar=64"
Exec   : pimpleFoam -parallel
Date   : Nov 22 2021
Time   : 13:22:42
Host   : "XX"
PID    : XXX
Case   : /home/XX/OpenFOAM/XX-v1706/CaseName
nProcs : 36
Slaves : 
35
(
    :
)

Pstream initialized with:
    floatTransfer      : 0
    nProcsSimpleSum    : 0
    commsType          : nonBlocking
    polling iterations : 0
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 10)
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0


PIMPLE: Operating solver in PISO mode

Reading field p

Reading field U

Reading/calculating face flux field phi

Selecting incompressible transport model Newtonian
Selecting turbulence model type LES
Selecting LES turbulence model XXX
Selecting LES delta type YYY
[4] #0  Foam::error::printStack(Foam::Ostream&)[3] #0  Foam::error::printStack(Foam::Ostream&)[12] #0  [20] #0  [26] #0  Foam::error::printStack(Foam::Ostream&)[10] #0  Foam::error::printStack(Foam::Ostream&)Foam::error::printStack(Foam::Ostream&)[7] #0  Foam::error::printStack(Foam::Ostream&)[9] #0  [11] #0  Foam::error::printStack(Foam::Ostream&)[15] #0  Foam::error::printStack(Foam::Ostream&)[16] #0  [17] #0  Foam::error::printStack(Foam::Ostream&)[18] #0  Foam::error::printStack(Foam::Ostream&)[19] #0  Foam::error::printStack(Foam::Ostream&)Foam::error::printStack(Foam::Ostream&)[22] #0  Foam::error::printStack(Foam::Ostream&)[24] #0  Foam::error::printStack(Foam::Ostream&)[25] #0  Foam::error::printStack(Foam::Ostream&)[27] #0  [28] #0  Foam::error::printStack(Foam::Ostream&)[30] #0  Foam::error::printStack(Foam::Ostream&)[31] #0  Foam::error::printStack(Foam::Ostream&)[32] #0  [33] #0  Foam::error::printStack(Foam::Ostream&)[34] #0  Foam::error::printStack(Foam::Ostream&)[35] #0  Foam::error::printStack(Foam::Ostream&)[0] #0  Foam::error::printStack(Foam::Ostream&)[1] #0  Foam::error::printStack(Foam::Ostream&)[5] #0  [6] #0  Foam::error::printStack(Foam::Ostream&)Foam::error::printStack(Foam::Ostream&)[29] #0  Foam::error::printStack(Foam::Ostream&)[8] #0  Foam::error::printStack(Foam::Ostream&)[13] #0  Foam::error::printStack(Foam::Ostream&)[14] #0  Foam::error::printStack(Foam::Ostream&)Foam::error::printStack(Foam::Ostream&)[21] #0  Foam::error::printStack(Foam::Ostream&)[23] #0  Foam::error::printStack(Foam::Ostream&)Foam::error::printStack(Foam::Ostream&)Foam::error::printStack(Foam::Ostream&)[2] #0  Foam::error::printStack(Foam::Ostream&)Foam::error::printStack(Foam::Ostream&)
--------------------------------------------------------------------------
(中略)
--------------------------------------------------------------------------
 at ??:?
 at ??:?
[22] #1  Foam::sigSegv::sigHandler(int)[12] #1  Foam::sigSegv::sigHandler(int) at ??:?
[24] #1  Foam::sigSegv::sigHandler(int) at ??:?
[26] #1  Foam::sigSegv::sigHandler(int) at ??:?
[14] #1  Foam::sigSegv::sigHandler(int) at ??:?
[29] #1  Foam::sigSegv::sigHandler(int) at ??:?
[6] #1  Foam::sigSegv::sigHandler(int) at ??:?
[2] #1  Foam::sigSegv::sigHandler(int) at ??:?
[28] #1  Foam::sigSegv::sigHandler(int) at ??:?
[1] #1  Foam::sigSegv::sigHandler(int) at ??:?
[9] #1  Foam::sigSegv::sigHandler(int) at ??:?

(以下,無限に続くエラー文)

原因

調べたところ,セグメンテーション違反らしい

SIGSEGV
The SIGSEGV signal is sent to a process when it makes an invalid virtual memory reference, or segmentation fault, i.e. when it performs a segmentation violation.[17]

Signal (IPC) - Wikipedia

ソースコードを調べたところ,.Cファイルで壁面距離y_を宣言する前に粘性散逸率epsilon_の初期化の計算で使ってしまっていた

    epsilon_
    (
        IOobject
        (
            IOobject::groupName("epsilon", alphaRhoPhi.group()),
            runTime_.timeName(),
            mesh_,
            IOobject::NO_READ,
            IOobject::AUTO_WRITE
        ),
    dimensionedScalar("zero",dimensionSet(0,2,-3,0,0,0,0),SMALL)
    ),

    y_(wallDist::New(mesh_).y()),

対処法

epsilon_y_の位置を入れ替えた

(.Cファイル)

    y_(wallDist::New(mesh_).y()),

    epsilon_
    (
        IOobject
        (
            IOobject::groupName("epsilon", alphaRhoPhi.group()),
            runTime_.timeName(),
            mesh_,
            IOobject::NO_READ,
            IOobject::AUTO_WRITE
        ),
    dimensionedScalar("zero",dimensionSet(0,2,-3,0,0,0,0),SMALL)
    ),

(.Hファイル)

        volScalarField epsilon_;
        volScalarField wallDistance_;
バグレポート
質問・感想・意見などあれば気軽にTwitterのDMかコメントお願いします!
スポンサーリンク
mtk_birdman's blog

コメント