PR

【OpenFOAMv1706】Foam::error::printStack(Foam::Ostream&)#0 Foam::sigFpe::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   : 12:35:55
Host   : "XX"
PID    : XX
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 HLR
Selecting LES delta type maxSqrtFace
Selecting patchDistMethod meshWave
[0] [14] #0  Foam::error::printStack(Foam::Ostream&)#0  Foam::error::printStack(Foam::Ostream&)[17] #0  Foam::error::printStack(Foam::Ostream&)[26] #0  Foam::error::printStack(Foam::Ostream&)[30] [25] #0  [31] #0  [2] #0  Foam::error::printStack(Foam::Ostream&)[7] #0  [12] #0  Foam::error::printStack(Foam::Ostream&)[16] #0  Foam::error::printStack(Foam::Ostream&)[21] #0  [8] #0  [9] #0  Foam::error::printStack(Foam::Ostream&)[10] #0  Foam::error::printStack(Foam::Ostream&)[11] #0  Foam::error::printStack(Foam::Ostream&)[13] #0  Foam::error::printStack(Foam::Ostream&)[15] #0  Foam::error::printStack(Foam::Ostream&)[18] #0  [19] #0  [20] #0  Foam::error::printStack(Foam::Ostream&)[22] #0  Foam::error::printStack(Foam::Ostream&)[23] #0  Foam::error::printStack(Foam::Ostream&)[24] #0  Foam::error::printStack(Foam::Ostream&)#0  Foam::error::printStack(Foam::Ostream&)[27] #0  [28] #0  [29] #0  Foam::error::printStack(Foam::Ostream&)[32] #0  Foam::error::printStack(Foam::Ostream&)[33] #0  [34] #0  [35] #0  [1] #0  Foam::error::printStack(Foam::Ostream&)Foam::error::printStack(Foam::Ostream&)[3] #0  Foam::error::printStack(Foam::Ostream&)[4] #0  Foam::error::printStack(Foam::Ostream&)[5] #0  Foam::error::printStack(Foam::Ostream&)[6] #0  Foam::error::printStack(Foam::Ostream&)Foam::error::printStack(Foam::Ostream&)Foam::error::printStack(Foam::Ostream&)Foam::error::printStack(Foam::Ostream&)Foam::error::printStack(Foam::Ostream&)Foam::error::printStack(Foam::Ostream&)Foam::error::printStack(Foam::Ostream&)Foam::error::printStack(Foam::Ostream&)Foam::error::printStack(Foam::Ostream&)Foam::error::printStack(Foam::Ostream&)Foam::error::printStack(Foam::Ostream&)Foam::error::printStack(Foam::Ostream&)
--------------------------------------------------------------------------
(中略)
--------------------------------------------------------------------------
 at ??:?
[14] #1  Foam::sigFpe::sigHandler(int) at ??:?
[4] #1  Foam::sigFpe::sigHandler(int) at ??:?
[10] #1  Foam::sigFpe::sigHandler(int) at ??:?
[6] #1  Foam::sigFpe::sigHandler(int) at ??:?
[18] #1  Foam::sigFpe::sigHandler(int) at ??:?
[24] #1  Foam::sigFpe::sigHandler(int) at ??:?
[11] #1  Foam::sigFpe::sigHandler(int) at ??:?
[13] #1  Foam::sigFpe::sigHandler(int) at ??:?
[19] #1  Foam::sigFpe::sigHandler(int) at ??:?
[22] #1  Foam::sigFpe::sigHandler(int) at ??:?
[20] #1  Foam::sigFpe::sigHandler(int) at ??:?

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

原因

調べたところ,プログラムのどこかでゼロ除算が起きているらしい

Getting Foam__sigFpe__sigHandler(int) from custom code -- CFD Online Discussion Forums

SIGFPE The SIGFPE signal is sent to a process when an exceptional (but not necessarily erroneous) condition has been detected in the floating point or integer arithmetic hardware. This may include division by zero, floating point underflow or overflow, integer overflow, an invalid operation or an inexact computation. Behaviour may differ depending on hardware.

Signal (IPC) - Wikipedia

ソースコードを調べたところ,粘性散逸率epsilon_の初期化の際に0を入れており,別の変数の計算でepsilon_による割り算が行われていた

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

対処法

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)
    ),

コメント