【问题标题】:printStack error when running blockMesh in OpenFOAM在 OpenFOAM 中运行 blockMesh 时出现 printStack 错误
【发布时间】:2022-01-19 17:46:58
【问题描述】:

我正在尝试关注this tutorial,了解如何实施求解器,但在设置案例时遇到了麻烦。

原案可以在here找到。一开始,在运行blockMesh时,我的OpenFOAM版本无法识别blockMeshDict中的#eval(),所以我将其更改为#calc

/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  1.5                                   |
|   \\  /    A nd           | Web:      http://www.openfoam.org               |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/

FoamFile
{
    version         2.0;
    format          ascii;
    class           dictionary;
    object          blockMeshDict;
}

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

scale 1e-4;

mergeType points; //Or: blockMesh -merge-points

wedgeAngle              2.5;
rodRadius               9.9;
airRadius               999;
tanAlpha                #calc"tan(0.5*degToRad($wedgeAngle))";
posRodZ                 #calc"$rodRadius*$tanAlpha";
negRodZ                 #calc"-$posRodZ";
posAirZ                 #calc"$airRadius*$tanAlpha";
negAirZ                 #calc"-$posAirZ";

vertices        
(
  (0 0 0)                   // vertex #0
  (100 0 0)                 // vertex #1
  (100 $rodRadius $posRodZ) // vertex #2
  (0 $rodRadius  $posRodZ)  // vertex #3
  (0 $rodRadius $negRodZ)   // vertex #4
  (100 $rodRadius $negRodZ) // vertex #5
  (0 $airRadius $posAirZ)   // vertex #6
  (100 $airRadius $posAirZ) // vertex #7
  (100 $airRadius $negAirZ) // vertex #8
  (0 $airRadius $negAirZ)   // vertex #9    
);

blocks          
(
  hex (0 1 5 4 0 1 2 3) (30 6 1)   simpleGrading (1 1 1)    // block #0
  hex (4 5 8 9 3 2 7 6) (30 599 1) simpleGrading (1 1 1)    // block #1
);

edges           
(
);

boundary
(
    leftWall
    {
        type patch;
        faces
        (
            (3 4 0 0)
        );
    }
    rightWall
    {
        type patch;
        faces
        (
            (1 5 2 1)
        );
    }
    
    atmosphereTop 
    {
        type patch;
        faces
        (
            (9 6 7 8)
        );
    }

    atmosphereRight
    {
        type patch;
        faces
        (
            (3 6 9 4)
        );
    }

    atmosphereLeft
    {
        type patch;
        faces
        (
            (5 8 7 2)
        );
    }

    axis   
    {
        type empty;
        faces
        (
            (0 1 1 0)
        );
    }

    rodBack 
    {
        type wedge;
        faces
        (
            (0 4 5 1)
        );
    }

    rodFront  
    {
        type wedge;
        faces
        (
            (0 1 2 3)
        );
    }

    airBack 
    {
        type wedge;
        faces
        (
            (4 9 8 5)
        );
    }

    airFront  
    {
        type wedge;
        faces
        (
            (3 2 7 6)
        );
    }
);

mergePatchPairs
(
);

// ************************************************************************* //

现在,在运行 blockMesh 时,我收到以下错误:

/*---------------------------------------------------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  9
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
Build  : 9-c8374a4890ad
Exec   : blockMesh
Date   : Dec 16 2021
Time   : 12:59:36
Host   : "endeavouros"
PID    : 346839
I/O    : uncollated
Case   : /home/ariedinger/uni/gimap/openfoam/03emf/01huang/0rodFoam/rodFoamCase
nProcs : 1
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

Reading "blockMeshDict"

Creating block mesh from
    "system/blockMeshDict"
Using #calcEntry at line 26 in file "/home/ariedinger/uni/gimap/openfoam/03emf/01huang/0rodFoam/rodFoamCase/system/blockMeshDict"
Using #codeStream with "/home/ariedinger/uni/gimap/openfoam/03emf/01huang/0rodFoam/rodFoamCase/dynamicCode/platforms/linux64GccDPInt32Opt/lib/libcodeStream_28b21b5898ba159392899d5ac4d05a7158e0c6d6.so"
Creating new library in "dynamicCode/_28b21b5898ba159392899d5ac4d05a7158e0c6d6/platforms/linux64GccDPInt32Opt/lib/libcodeStream_28b21b5898ba159392899d5ac4d05a7158e0c6d6.so"
"/opt/OpenFOAM/OpenFOAM-9/etc/codeTemplates/dynamicCode/codeStreamTemplate.C" "/home/ariedinger/uni/gimap/openfoam/03emf/01huang/0rodFoam/rodFoamCase/dynamicCode/_28b21b5898ba159392899d5ac4d05a7158e0c6d6/codeStreamTemplate.C"
Invoking "wmake -s libso /home/ariedinger/uni/gimap/openfoam/03emf/01huang/0rodFoam/rodFoamCase/dynamicCode/_28b21b5898ba159392899d5ac4d05a7158e0c6d6"
wmake libso /home/ariedinger/uni/gimap/openfoam/03emf/01huang/0rodFoam/rodFoamCase/dynamicCode/_28b21b5898ba159392899d5ac4d05a7158e0c6d6
    ln: ./lnInclude
    wmkdep: codeStreamTemplate.C
    Ctoo: codeStreamTemplate.C
    ld: /home/ariedinger/uni/gimap/openfoam/03emf/01huang/0rodFoam/rodFoamCase/dynamicCode/_28b21b5898ba159392899d5ac4d05a7158e0c6d6/../platforms/linux64GccDPInt32Opt/lib/libcodeStream_28b21b5898ba159392899d5ac4d05a7158e0c6d6.so
codeStream : dictionary:"/home/ariedinger/uni/gimap/openfoam/03emf/01huang/0rodFoam/rodFoamCase/system/blockMeshDict" master-only-reading:1
Opening cached dictionary:"/home/ariedinger/uni/gimap/openfoam/03emf/01huang/0rodFoam/rodFoamCase/dynamicCode/platforms/linux64GccDPInt32Opt/lib/libcodeStream_28b21b5898ba159392899d5ac4d05a7158e0c6d6.so"
codeStream : dictionary:"/home/ariedinger/uni/gimap/openfoam/03emf/01huang/0rodFoam/rodFoamCase/system/blockMeshDict" master-only-reading:1
Using #calcEntry at line 27 in file "/home/ariedinger/uni/gimap/openfoam/03emf/01huang/0rodFoam/rodFoamCase/system/blockMeshDict"
Using #codeStream with "/home/ariedinger/uni/gimap/openfoam/03emf/01huang/0rodFoam/rodFoamCase/dynamicCode/platforms/linux64GccDPInt32Opt/lib/libcodeStream_efc80fd5ffbc4db1928cd9ff3362f686671433be.so"
Creating new library in "dynamicCode/_efc80fd5ffbc4db1928cd9ff3362f686671433be/platforms/linux64GccDPInt32Opt/lib/libcodeStream_efc80fd5ffbc4db1928cd9ff3362f686671433be.so"
"/opt/OpenFOAM/OpenFOAM-9/etc/codeTemplates/dynamicCode/codeStreamTemplate.C" "/home/ariedinger/uni/gimap/openfoam/03emf/01huang/0rodFoam/rodFoamCase/dynamicCode/_efc80fd5ffbc4db1928cd9ff3362f686671433be/codeStreamTemplate.C"
Invoking "wmake -s libso /home/ariedinger/uni/gimap/openfoam/03emf/01huang/0rodFoam/rodFoamCase/dynamicCode/_efc80fd5ffbc4db1928cd9ff3362f686671433be"
wmake libso /home/ariedinger/uni/gimap/openfoam/03emf/01huang/0rodFoam/rodFoamCase/dynamicCode/_efc80fd5ffbc4db1928cd9ff3362f686671433be
    ln: ./lnInclude
    wmkdep: codeStreamTemplate.C
    Ctoo: codeStreamTemplate.C
    ld: /home/ariedinger/uni/gimap/openfoam/03emf/01huang/0rodFoam/rodFoamCase/dynamicCode/_efc80fd5ffbc4db1928cd9ff3362f686671433be/../platforms/linux64GccDPInt32Opt/lib/libcodeStream_efc80fd5ffbc4db1928cd9ff3362f686671433be.so
codeStream : dictionary:"/home/ariedinger/uni/gimap/openfoam/03emf/01huang/0rodFoam/rodFoamCase/system/blockMeshDict" master-only-reading:1
Opening cached dictionary:"/home/ariedinger/uni/gimap/openfoam/03emf/01huang/0rodFoam/rodFoamCase/dynamicCode/platforms/linux64GccDPInt32Opt/lib/libcodeStream_efc80fd5ffbc4db1928cd9ff3362f686671433be.so"
codeStream : dictionary:"/home/ariedinger/uni/gimap/openfoam/03emf/01huang/0rodFoam/rodFoamCase/system/blockMeshDict" master-only-reading:1
Using #calcEntry at line 28 in file "/home/ariedinger/uni/gimap/openfoam/03emf/01huang/0rodFoam/rodFoamCase/system/blockMeshDict"
Using #codeStream with "/home/ariedinger/uni/gimap/openfoam/03emf/01huang/0rodFoam/rodFoamCase/dynamicCode/platforms/linux64GccDPInt32Opt/lib/libcodeStream_dc962d55c61555e401d9aa57fd57792f105fea79.so"
Creating new library in "dynamicCode/_dc962d55c61555e401d9aa57fd57792f105fea79/platforms/linux64GccDPInt32Opt/lib/libcodeStream_dc962d55c61555e401d9aa57fd57792f105fea79.so"
"/opt/OpenFOAM/OpenFOAM-9/etc/codeTemplates/dynamicCode/codeStreamTemplate.C" "/home/ariedinger/uni/gimap/openfoam/03emf/01huang/0rodFoam/rodFoamCase/dynamicCode/_dc962d55c61555e401d9aa57fd57792f105fea79/codeStreamTemplate.C"
Invoking "wmake -s libso /home/ariedinger/uni/gimap/openfoam/03emf/01huang/0rodFoam/rodFoamCase/dynamicCode/_dc962d55c61555e401d9aa57fd57792f105fea79"
wmake libso /home/ariedinger/uni/gimap/openfoam/03emf/01huang/0rodFoam/rodFoamCase/dynamicCode/_dc962d55c61555e401d9aa57fd57792f105fea79
    ln: ./lnInclude
    wmkdep: codeStreamTemplate.C
    Ctoo: codeStreamTemplate.C
    ld: /home/ariedinger/uni/gimap/openfoam/03emf/01huang/0rodFoam/rodFoamCase/dynamicCode/_dc962d55c61555e401d9aa57fd57792f105fea79/../platforms/linux64GccDPInt32Opt/lib/libcodeStream_dc962d55c61555e401d9aa57fd57792f105fea79.so
codeStream : dictionary:"/home/ariedinger/uni/gimap/openfoam/03emf/01huang/0rodFoam/rodFoamCase/system/blockMeshDict" master-only-reading:1
Opening cached dictionary:"/home/ariedinger/uni/gimap/openfoam/03emf/01huang/0rodFoam/rodFoamCase/dynamicCode/platforms/linux64GccDPInt32Opt/lib/libcodeStream_dc962d55c61555e401d9aa57fd57792f105fea79.so"
codeStream : dictionary:"/home/ariedinger/uni/gimap/openfoam/03emf/01huang/0rodFoam/rodFoamCase/system/blockMeshDict" master-only-reading:1
Using #calcEntry at line 29 in file "/home/ariedinger/uni/gimap/openfoam/03emf/01huang/0rodFoam/rodFoamCase/system/blockMeshDict"
Using #codeStream with "/home/ariedinger/uni/gimap/openfoam/03emf/01huang/0rodFoam/rodFoamCase/dynamicCode/platforms/linux64GccDPInt32Opt/lib/libcodeStream_4510c2296fa7a962a6a70dda03e9219ebc01dac4.so"
Creating new library in "dynamicCode/_4510c2296fa7a962a6a70dda03e9219ebc01dac4/platforms/linux64GccDPInt32Opt/lib/libcodeStream_4510c2296fa7a962a6a70dda03e9219ebc01dac4.so"
"/opt/OpenFOAM/OpenFOAM-9/etc/codeTemplates/dynamicCode/codeStreamTemplate.C" "/home/ariedinger/uni/gimap/openfoam/03emf/01huang/0rodFoam/rodFoamCase/dynamicCode/_4510c2296fa7a962a6a70dda03e9219ebc01dac4/codeStreamTemplate.C"
Invoking "wmake -s libso /home/ariedinger/uni/gimap/openfoam/03emf/01huang/0rodFoam/rodFoamCase/dynamicCode/_4510c2296fa7a962a6a70dda03e9219ebc01dac4"
wmake libso /home/ariedinger/uni/gimap/openfoam/03emf/01huang/0rodFoam/rodFoamCase/dynamicCode/_4510c2296fa7a962a6a70dda03e9219ebc01dac4
    ln: ./lnInclude
    wmkdep: codeStreamTemplate.C
    Ctoo: codeStreamTemplate.C
    ld: /home/ariedinger/uni/gimap/openfoam/03emf/01huang/0rodFoam/rodFoamCase/dynamicCode/_4510c2296fa7a962a6a70dda03e9219ebc01dac4/../platforms/linux64GccDPInt32Opt/lib/libcodeStream_4510c2296fa7a962a6a70dda03e9219ebc01dac4.so
codeStream : dictionary:"/home/ariedinger/uni/gimap/openfoam/03emf/01huang/0rodFoam/rodFoamCase/system/blockMeshDict" master-only-reading:1
Opening cached dictionary:"/home/ariedinger/uni/gimap/openfoam/03emf/01huang/0rodFoam/rodFoamCase/dynamicCode/platforms/linux64GccDPInt32Opt/lib/libcodeStream_4510c2296fa7a962a6a70dda03e9219ebc01dac4.so"
codeStream : dictionary:"/home/ariedinger/uni/gimap/openfoam/03emf/01huang/0rodFoam/rodFoamCase/system/blockMeshDict" master-only-reading:1
Using #calcEntry at line 30 in file "/home/ariedinger/uni/gimap/openfoam/03emf/01huang/0rodFoam/rodFoamCase/system/blockMeshDict"
Using #codeStream with "/home/ariedinger/uni/gimap/openfoam/03emf/01huang/0rodFoam/rodFoamCase/dynamicCode/platforms/linux64GccDPInt32Opt/lib/libcodeStream_0af64279ad3a68c6091e4927dfe1317848075c64.so"
Creating new library in "dynamicCode/_0af64279ad3a68c6091e4927dfe1317848075c64/platforms/linux64GccDPInt32Opt/lib/libcodeStream_0af64279ad3a68c6091e4927dfe1317848075c64.so"
"/opt/OpenFOAM/OpenFOAM-9/etc/codeTemplates/dynamicCode/codeStreamTemplate.C" "/home/ariedinger/uni/gimap/openfoam/03emf/01huang/0rodFoam/rodFoamCase/dynamicCode/_0af64279ad3a68c6091e4927dfe1317848075c64/codeStreamTemplate.C"
Invoking "wmake -s libso /home/ariedinger/uni/gimap/openfoam/03emf/01huang/0rodFoam/rodFoamCase/dynamicCode/_0af64279ad3a68c6091e4927dfe1317848075c64"
wmake libso /home/ariedinger/uni/gimap/openfoam/03emf/01huang/0rodFoam/rodFoamCase/dynamicCode/_0af64279ad3a68c6091e4927dfe1317848075c64
    ln: ./lnInclude
    wmkdep: codeStreamTemplate.C
    Ctoo: codeStreamTemplate.C
    ld: /home/ariedinger/uni/gimap/openfoam/03emf/01huang/0rodFoam/rodFoamCase/dynamicCode/_0af64279ad3a68c6091e4927dfe1317848075c64/../platforms/linux64GccDPInt32Opt/lib/libcodeStream_0af64279ad3a68c6091e4927dfe1317848075c64.so
codeStream : dictionary:"/home/ariedinger/uni/gimap/openfoam/03emf/01huang/0rodFoam/rodFoamCase/system/blockMeshDict" master-only-reading:1
Opening cached dictionary:"/home/ariedinger/uni/gimap/openfoam/03emf/01huang/0rodFoam/rodFoamCase/dynamicCode/platforms/linux64GccDPInt32Opt/lib/libcodeStream_0af64279ad3a68c6091e4927dfe1317848075c64.so"
codeStream : dictionary:"/home/ariedinger/uni/gimap/openfoam/03emf/01huang/0rodFoam/rodFoamCase/system/blockMeshDict" master-only-reading:1
Creating block edges
No non-planar block faces defined
Creating topology blocks
#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::sigFpe::sigHandler(int) at ??:?
#2  ? in "/usr/lib/libc.so.6"
#3  Foam::face::centre(Foam::Field<Foam::Vector<double> > const&) const at ??:?
#4  Foam::blockDescriptor::check(Foam::Istream const&) at ??:?
#5  Foam::blockDescriptor::blockDescriptor(Foam::dictionary const&, int, Foam::Field<Foam::Vector<double> > const&, Foam::PtrList<Foam::blockEdge> const&, Foam::PtrList<Foam::blockFace> const&, Foam::Istream&) at ??:?
#6  Foam::block::block(Foam::dictionary const&, int, Foam::Field<Foam::Vector<double> > const&, Foam::PtrList<Foam::blockEdge> const&, Foam::PtrList<Foam::blockFace> const&, Foam::Istream&) at ??:?
#7  Foam::block::New(Foam::dictionary const&, int, Foam::Field<Foam::Vector<double> > const&, Foam::PtrList<Foam::blockEdge> const&, Foam::PtrList<Foam::blockFace> const&, Foam::Istream&) at ??:?
#8  void Foam::PtrList<Foam::block>::read<Foam::block::iNew>(Foam::Istream&, Foam::block::iNew const&) at ??:?
#9  Foam::blockMesh::createTopology(Foam::IOdictionary const&, Foam::word const&) at ??:?
#10  Foam::blockMesh::blockMesh(Foam::IOdictionary const&, Foam::word const&) at ??:?
#11  ? in "/opt/OpenFOAM/OpenFOAM-9/platforms/linux64GccDPInt32Opt/bin/blockMesh"
#12  __libc_start_main in "/usr/lib/libc.so.6"
#13  ? in "/opt/OpenFOAM/OpenFOAM-9/platforms/linux64GccDPInt32Opt/bin/blockMesh"
fish: Job 2, 'blockMesh' terminated by signal SIGFPE (Floating point exception)

所以,我有点迷失在哪里看,我希望有一些提示来尝试解决错误。

除了将#eval() 更改为blockMeshDict 中的#calc 之外,其他一切都与原来的情况几乎相同,但here are the rest of my files

给定的案例似乎是为 OpenFOAM v2 构建的,我正在尝试在 OpenFOAM v9 上运行它(从 AUR 的包 openfoam-org 安装)。那么,也许这会是个问题?尽管如此,在course 中,案例是在 2020 年给出的(请参阅 Proceedings 2020 中的Implement electromagnetic solver Case: rodFoamCase.tgz)。

提前致谢。

【问题讨论】:

    标签: c++ compiler-errors openfoam


    【解决方案1】:

    也值得用“openfoam-com”进行测试,看看那里是否有区别。可以使用 AUR 配方或(可能更快)使用 docker 实例和 openfom.com 进行测试

    https://develop.openfoam.com/Development/openfoam/-/wikis/precompiled/docker

    【讨论】:

      猜你喜欢
      • 2021-12-16
      • 2021-10-04
      • 2021-07-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-02-28
      • 1970-01-01
      • 2012-07-30
      相关资源
      最近更新 更多