Skip to content

OpenFOAM

OpenFOAM交流区

5.3k 主题 31.3k 帖子
  • OpenFOAM调用Fortran程序

    1
    1 帖子
    417 浏览
    S

    仿照https://www.cfd-online.com/Forums/openfoam-solving/60471-call-fortran-program-openfoam.html进行Fortran程序的调用,编译过程中报错: from chemistryModel/rho2ChemistryModel/rho2ChemistryModels.C:37:
    /home/sy/OpenFOAM/sy-v1706/src/thermophysicalModels/strath/strathSpecie/lnInclude/CEATransportI.H:152:7: error: expected constructor, destructor, or type conversion before ‘(’ token
    phypro(&TG, &TE, &PT, &PE, &CON[0], &CP_FINAL[0][0], &H_FINAL[0][0], &MIU_FINAL, &K_FINAL[0]);
    但仿照https://www.cnblogs.com/snake553/p/6962386.html编写C++程序可以实现Fortran程序的调用

  • 求助pisofoam报错

    1
    1 帖子
    364 浏览
    Y
    只修改了粘度出现一下报错想问问该如何解决,粘度为2e-6m2/s
    [8] #0 Foam::error::printStack(Foam::Ostream&)[11] #0 [14] #0 Foam::error::printStack(Foam::Ostream&)Foam::error::printStack(Foam::Ostream&) at ??:?
    [11] #1 Foam::sigFpe::sigHandler(int) at ??:?
    [8] #1 Foam::sigFpe::sigHandler(int) at ??:?
    [14] #1 Foam::sigFpe::sigHandler(int) at ??:?
    [11] #2 ? at ??:?
    [8] #2 ? at ??:?
    [14] #2 ? in "/lib64/libpthread.so.0"
    [8] #3 Foam::multiply(Foam::Field<double>&, Foam::UList<double> const&, Foam::UList<double> const&) in "/lib64/libpthread.so.0"
    [11] #3 Foam::multiply(Foam::Field<double>&, Foam::UList<double> const&, Foam::UList<double> const&) in "/lib64/libpthread.so.0"
    [14] #3 Foam::multiply(Foam::Field<double>&, Foam::UList<double> const&, Foam::UList<double> const&) at ??:?
    at ??:?
    [8] #4 void Foam::multiply<Foam::fvPatchField, Foam::volMesh>(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&)[11] #4 void Foam::multiply<Foam::fvPatchField, Foam::volMesh>(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) at ??:?
    [14] #4 void Foam::multiply<Foam::fvPatchField, Foam::volMesh>(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) at ??:?
    [8] #5 Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam::operator*<Foam::fvPatchField, Foam::volMesh>(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > const&) at ??:?
    [11] #5 Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam::operator*<Foam::fvPatchField, Foam::volMesh>(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > const&) at ??:?
    [14] #5 Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam::operator*<Foam::fvPatchField, Foam::volMesh>(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > const&) at ??:?
    [8] #6 Foam::RASModels::RNGkEpsilon<Foam::IncompressibleTurbulenceModelFoam::transportModel >::correct() at ??:?
    [11] #6 Foam::RASModels::RNGkEpsilon<Foam::IncompressibleTurbulenceModelFoam::transportModel >::correct() at ??:?
    [14] #6 Foam::RASModels::RNGkEpsilon<Foam::IncompressibleTurbulenceModelFoam::transportModel >::correct() at ??:?
    [8] #7 at ??:?
    [11] #7 at ??:?
    [14] #7 ??? at ??:?
    [8] #8 __libc_start_main at ??:?
    [11] #8 __libc_start_main at ??:?
    [14] #8 __libc_start_main in "/lib64/libc.so.6"
    [8] #9 in "/lib64/libc.so.6"
    [11] #9 in "/lib64/libc.so.6"
    [14] #9 ??? at ??:?
    [ibnode77:65243:0:65243] Caught signal 8 (Floating point exception: tkill(2) or tgkill(2))
    at ??:?
    [ibnode77:65246:0:65246] Caught signal 8 (Floating point exception: tkill(2) or tgkill(2))
    at ??:?
    [ibnode77:65249:0:65249] Caught signal 8 (Floating point exception: tkill(2) or tgkill(2))
    ==== backtrace (tid: 65243) ====
    0 0x000000000000f4fb raise() ???:0
    1 0x000000000069a44d Foam::multiply() ???:0
    2 0x00000000000d4418 Foam::multiply<Foam::fvPatchField, Foam::volMesh>() ???:0
    3 0x000000000015f8b6 Foam::operator*<Foam::fvPatchField, Foam::volMesh>() ???:0
    4 0x00000000001ab676 Foam::RASModels::RNGkEpsilon<Foam::IncompressibleTurbulenceModelFoam::transportModel >::correct() ???:0
    5 0x000000000042a05e main() ???:0
    6 0x0000000000022555 __libc_start_main() ???:0
    7 0x000000000042e172 _start() ???:0 [ibnode77:65243] *** Process received signal ***
    [ibnode77:65243] Signal: Floating point exception (8)
    [ibnode77:65243] Signal code: (-6)
    [ibnode77:65243] Failing at address: 0x4080000fedb
    [ibnode77:65243] [ 0] /lib64/libpthread.so.0(+0xf630)[0x2b424c49c630]
    [ibnode77:65243] [ 1] /lib64/libpthread.so.0(raise+0x2b)[0x2b424c49c4fb]
    [ibnode77:65243] [ 2] /lib64/libpthread.so.0(+0xf630)[0x2b424c49c630]
    [ibnode77:65243] [ 3] /share/home/wangshuai/OpenFOAM/OpenFOAM-5.x/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so(ZN4Foam8multiplyERNS_5FieldIdEERKNS_5UListIdEES6+0x11d)[0x2b424b51044d]
    [ibnode77:65243] [ 4] /share/home/wangshuai/OpenFOAM/OpenFOAM-5.x/platforms/linux64GccDPInt32Opt/lib/libincompressibleTurbulenceModels.so(ZN4Foam8multiplyINS_12fvPatchFieldENS_7volMeshEEEvRNS_14GeometricFieldIdT_T0_EERKS6_S9+0xa8)[0x2b4247910418]
    [ibnode77:65243] [ 5] /share/home/wangshuai/OpenFOAM/OpenFOAM-5.x/platforms/linux64GccDPInt32Opt/lib/libincompressibleTurbulenceModels.so(ZN4FoammlINS_12fvPatchFieldENS_7volMeshEEENS_3tmpINS_14GeometricFieldIdT_T0_EEEERKS7_RKS8+0x156)[0x2b424799b8b6]
    [ibnode77:65243] [ 6] /share/home/wangshuai/OpenFOAM/OpenFOAM-5.x/platforms/linux64GccDPInt32Opt/lib/libincompressibleTurbulenceModels.so(_ZN4Foam9RASModels11RNGkEpsilonINS_29IncompressibleTurbulenceModelINS_14transportModelEEEE7correctEv+0x386)[0x2b42479e7676]
    [ibnode77:65243] [ 7] cfdemSolverPiso[0x42a05e]
    [ibnode77:65243] [ 8] /lib64/libc.so.6(__libc_start_main+0xf5)[0x2b424c6cb555]
    [ibnode77:65243] [ 9] cfdemSolverPiso[0x42e172]
    [ibnode77:65243] *** End of error message ***
    ==== backtrace (tid: 65246) ====
    0 0x000000000000f4fb raise() ???:0
    1 0x000000000069a44d Foam::multiply() ???:0
    2 0x00000000000d4418 Foam::multiply<Foam::fvPatchField, Foam::volMesh>() ???:0
    3 0x000000000015f8b6 Foam::operator*<Foam::fvPatchField, Foam::volMesh>() ???:0
    4 0x00000000001ab676 Foam::RASModels::RNGkEpsilon<Foam::IncompressibleTurbulenceModelFoam::transportModel >::correct() ???:0
    5 0x000000000042a05e main() ???:0
    6 0x0000000000022555 __libc_start_main() ???:0
    7 0x000000000042e172 _start() ???:0 [ibnode77:65246] *** Process received signal ***
    [ibnode77:65246] Signal: Floating point exception (8)
    [ibnode77:65246] Signal code: (-6)
    [ibnode77:65246] Failing at address: 0x4080000fede
    [ibnode77:65246] [ 0] /lib64/libpthread.so.0(+0xf630)[0x2b3d893ab630]
    [ibnode77:65246] [ 1] /lib64/libpthread.so.0(raise+0x2b)[0x2b3d893ab4fb]
    [ibnode77:65246] [ 2] /lib64/libpthread.so.0(+0xf630)[0x2b3d893ab630]
    [ibnode77:65246] [ 3] /share/home/wangshuai/OpenFOAM/OpenFOAM-5.x/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so(ZN4Foam8multiplyERNS_5FieldIdEERKNS_5UListIdEES6+0x11d)[0x2b3d8841f44d]
    [ibnode77:65246] [ 4] /share/home/wangshuai/OpenFOAM/OpenFOAM-5.x/platforms/linux64GccDPInt32Opt/lib/libincompressibleTurbulenceModels.so(ZN4Foam8multiplyINS_12fvPatchFieldENS_7volMeshEEEvRNS_14GeometricFieldIdT_T0_EERKS6_S9+0xa8)[0x2b3d8481f418]
    [ibnode77:65246] [ 5] /share/home/wangshuai/OpenFOAM/OpenFOAM-5.x/platforms/linux64GccDPInt32Opt/lib/libincompressibleTurbulenceModels.so(ZN4FoammlINS_12fvPatchFieldENS_7volMeshEEENS_3tmpINS_14GeometricFieldIdT_T0_EEEERKS7_RKS8+0x156)[0x2b3d848aa8b6]
    [ibnode77:65246] [ 6] /share/home/wangshuai/OpenFOAM/OpenFOAM-5.x/platforms/linux64GccDPInt32Opt/lib/libincompressibleTurbulenceModels.so(_ZN4Foam9RASModels11RNGkEpsilonINS_29IncompressibleTurbulenceModelINS_14transportModelEEEE7correctEv+0x386)[0x2b3d848f6676]
    [ibnode77:65246] [ 7] cfdemSolverPiso[0x42a05e]
    [ibnode77:65246] [ 8] /lib64/libc.so.6(__libc_start_main+0xf5)[0x2b3d895da555]
    [ibnode77:65246] [ 9] cfdemSolverPiso[0x42e172]
    [ibnode77:65246] *** End of error message ***
    ==== backtrace (tid: 65249) ====
    0 0x000000000000f4fb raise() ???:0
    1 0x000000000069a44d Foam::multiply() ???:0
    2 0x00000000000d4418 Foam::multiply<Foam::fvPatchField, Foam::volMesh>() ???:0
    3 0x000000000015f8b6 Foam::operator*<Foam::fvPatchField, Foam::volMesh>() ???:0
    4 0x00000000001ab676 Foam::RASModels::RNGkEpsilon<Foam::IncompressibleTurbulenceModelFoam::transportModel >::correct() ???:0
    5 0x000000000042a05e main() ???:0
    6 0x0000000000022555 __libc_start_main() ???:0
    7 0x000000000042e172 _start() ???:0 [ibnode77:65249] *** Process received signal ***
    [ibnode77:65249] Signal: Floating point exception (8)
    [ibnode77:65249] Signal code: (-6)
    [ibnode77:65249] Failing at address: 0x4080000fee1
    [ibnode77:65249] [ 0] /lib64/libpthread.so.0(+0xf630)[0x2b14b9db5630]
    [ibnode77:65249] [ 1] /lib64/libpthread.so.0(raise+0x2b)[0x2b14b9db54fb]
    [ibnode77:65249] [ 2] /lib64/libpthread.so.0(+0xf630)[0x2b14b9db5630]
    [ibnode77:65249] [ 3] /share/home/wangshuai/OpenFOAM/OpenFOAM-5.x/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so(ZN4Foam8multiplyERNS_5FieldIdEERKNS_5UListIdEES6+0x11d)[0x2b14b8e2944d]
    [ibnode77:65249] [ 4] /share/home/wangshuai/OpenFOAM/OpenFOAM-5.x/platforms/linux64GccDPInt32Opt/lib/libincompressibleTurbulenceModels.so(ZN4Foam8multiplyINS_12fvPatchFieldENS_7volMeshEEEvRNS_14GeometricFieldIdT_T0_EERKS6_S9+0xa8)[0x2b14b5229418]
    [ibnode77:65249] [ 5] /share/home/wangshuai/OpenFOAM/OpenFOAM-5.x/platforms/linux64GccDPInt32Opt/lib/libincompressibleTurbulenceModels.so(ZN4FoammlINS_12fvPatchFieldENS_7volMeshEEENS_3tmpINS_14GeometricFieldIdT_T0_EEEERKS7_RKS8+0x156)[0x2b14b52b48b6]
    [ibnode77:65249] [ 6] /share/home/wangshuai/OpenFOAM/OpenFOAM-5.x/platforms/linux64GccDPInt32Opt/lib/libincompressibleTurbulenceModels.so(_ZN4Foam9RASModels11RNGkEpsilonINS_29IncompressibleTurbulenceModelINS_14transportModelEEEE7correctEv+0x386)[0x2b14b5300676]
    [ibnode77:65249] [ 7] cfdemSolverPiso[0x42a05e]
    [ibnode77:65249] [ 8] /lib64/libc.so.6(__libc_start_main+0xf5)[0x2b14b9fe4555]
    [ibnode77:65249] [ 9] cfdemSolverPiso[0x42e172]
    [ibnode77:65249] *** End of error message *** Primary job terminated normally, but 1 process returned
    a non-zero exit code. Per user-direction, the job has been aborted. mpirun noticed that process rank 14 with PID 0 on node ibnode77 exited on signal 8 (Floating point exception).
  • IOdictionary.set 语句报错求助

    2
    2 帖子
    398 浏览
    1

    已解决,解决方案是scalarDict.set("vv", "vv [0 0 0 0 0 0 0] -0.1");

  • openfoam中伪时间步下相方程的组建和求解

    11
    11 帖子
    6k 浏览
    I

    @Shihang-Chen
    你好,我在做类似的代码。想请教伪时间步植入后,计算结果中出现松弛要怎么处理(计算的周期和实际周期不一致)。我是在动量方程中加入的隐式伪时间步。
    512ceafd-f193-4d59-a045-c2859969922c-9e6a4889e6591786ea13032244e9111.png

  • 量纲不匹配

    8
    8 帖子
    1k 浏览
    B

    @学流体的小明 后来我看了一下运行日志发现量纲不匹配并不是动量方程的量纲不匹配,是我在定义阻尼区起点的时候没有定义量纲所以会一直报错,后来把阻尼区起点定义量纲之后就可以啦,整个代码是这样的。```

    dimensionedScalar r0 ( "r0", dimensionSet(0,0,-1,0,0,0,0), 0 ); dimensionedScalar r1 ( "r1", dimensionSet(0,0,-1,0,0,0,0), 5 ); dimensionedScalar x1 = max(mesh.Cf().component(vector::X))-min(mesh.Cf().component(vector::X)); dimensionedScalar x0 ( "x0", dimensionSet(0,1,0,0,0,0,0), 12 ); volScalarField R ( "R", max(r1*(mesh.C().component(vector::X)-x0)/(x1-x0),r0) ); fvVectorMatrix UEqn ( fvm::ddt(rho, U) + fvm::div(rhoPhi, U) - fvm::laplacian(muf,U) - (fvc::grad(U)&fvc::grad(muf)) + rho*U*R );
  • DLBfoam的编译

    8
    8 帖子
    2k 浏览

    @李东岳 @欧阳 我计算ODW,一百万网格,氢氨机理s59r356,cpuLoad(redistributionInterval 20; maxImbalance 0.1;)和DLBFoam(只使用负载均衡,不使用pyJac)效果基本相当。

  • 1 帖子
    412 浏览
    东方白杨

    各位大佬,我不小心在Ubunto家目录下执行了foamCleanTutorials,命令行报

    mxy@LAPTOP-CODMI2H5:~$ foamCleanTutorials Cleaning application /home/mxy/OpenFOAM/OpenFOAM-v2312/applications/solvers/DNS/dnsFoam Cleaning application /home/mxy/OpenFOAM/OpenFOAM-v2312/applications/solvers/acoustic/acousticFoam Cleaning application /home/mxy/OpenFOAM/OpenFOAM-v2312/applications/solvers/basic/laplacianFoam Cleaning application /home/mxy/OpenFOAM/OpenFOAM-v2312/applications/solvers/basic/potentialFoam Cleaning application /home/mxy/OpenFOAM/OpenFOAM-v2312/applications/solvers/basic/scalarTransportFoam Cleaning application /home/mxy/OpenFOAM/OpenFOAM-v2312/applications/solvers/combustion/PDRFoam Cleaning application /home/mxy/OpenFOAM/OpenFOAM-v2312/applications/solvers/combustion/XiFoam Cleaning application /home/mxy/OpenFOAM/OpenFOAM-v2312/applications/solvers/combustion/chemFoam Cleaning application /home/mxy/OpenFOAM/OpenFOAM-v2312/applications/solvers/combustion/coldEngineFoam Cleaning application /home/mxy/OpenFOAM/OpenFOAM-v2312/applications/solvers/combustion/fireFoam Cleaning application /home/mxy/OpenFOAM/OpenFOAM-v2312/applications/solvers/combustion/reactingFoam wclean libso BCs Cleaning application /home/mxy/OpenFOAM/OpenFOAM-v2312/applications/solvers/compressible/rhoPimpleAdiabaticFoam Cleaning application /home/mxy/OpenFOAM/OpenFOAM-v2312/applications/solvers/compressible/rhoPimpleFoam Cleaning application /home/mxy/OpenFOAM/OpenFOAM-v2312/applications/solvers/compressible/rhoSimpleFoam Cleaning application /home/mxy/OpenFOAM/OpenFOAM-v2312/applications/solvers/compressible/sonicFoam Cleaning application /home/mxy/OpenFOAM/OpenFOAM-v2312/applications/solvers/discreteMethods/dsmc/dsmcFoam Cleaning application /home/mxy/OpenFOAM/OpenFOAM-v2312/applications/solvers/discreteMethods/molecularDynamics/mdEquilibrationFoam Cleaning application /home/mxy/OpenFOAM/OpenFOAM-v2312/applications/solvers/discreteMethods/molecularDynamics/mdFoam Cleaning application /home/mxy/OpenFOAM/OpenFOAM-v2312/applications/solvers/electromagnetics/electrostaticFoam Cleaning application /home/mxy/OpenFOAM/OpenFOAM-v2312/applications/solvers/electromagnetics/magneticFoam

    删了我好多,这种情况需要重新wmake求解器吗??

  • starccm添加oversetPatch导入到OpenFOAM

    1
    1 帖子
    379 浏览
    Z

    963df654ce25372fc5621513b9fe905.png 如图是blockMesh中创建的oversetPatch,用于触发在任何其他边界条件之前进行重叠(overset)插值。ccmTo.png 这张图的polyMesh是利用ccmToFoam,将starccm网格导入到OpenFoam的,请问如何在starccm里面加上图1中的oversetPatch呢。@李东岳

  • 拉格朗日边界问题

    2
    2 帖子
    516 浏览
    李东岳

    是不是边界的名重复了呢

  • 四面体interFoam怎么设置离散格式啊

    3
    3 帖子
    290 浏览
    李东岳

    算出来的最低温度一直在降

    数值扩散掉了

  • phiHbyA边界问题

    12
    12 帖子
    3k 浏览
    李东岳

    是的,你试试

  • 求助:在codedict中读取求解器中定义的标量

    8
    8 帖子
    1k 浏览
    1

    @1064168551 在 求助:在codedict中读取求解器中定义的标量 中说:

    @李东岳 a6bccb55-b62e-4688-bc61-dc2f9e6911e5-image.png 东岳老师,抱歉再打扰您,我现在改成这个样子,还是会报错,dimensionedScalar好像还是无法lookup

    报错在这里,就还是这行const dimensionedScalar vv = mesh.lookupObject<dimensionedScalar>("vv");有问题
    56be09a2-6412-49a3-9c59-598dfb8ef235-image.png

  • 12 帖子
    7k 浏览
    A

    遇到了类似的问题,就是水平集模拟两相流时,怎么样利用水平集计算的相界面把一个对流扩散方程隔离开,只在一个相内求解对流扩散方程。

  • fvsolution文件报错

    4
    4 帖子
    834 浏览
    李东岳

    发散的话就是发散了,问题就很多,需要你详细的debug

  • scalarTransport求解负温问题

    4
    4 帖子
    721 浏览
    S

    好像是因为我没缩放网格

  • 流固耦合、气膜冷却

    1
    1 帖子
    342 浏览
    W

    请问有前辈用 OpenFOAM 计算过叶片冷却、气膜冷却吗,想交流一下
    图片1.png

  • 流固耦合温度求解问题

    5
    5 帖子
    859 浏览
    李东岳

    温度方程保证的是能量守恒。T本身不是一个守恒量。你看看大体的效果是可以的。要是做研究要传输比能,比晗之类的

  • 同一个算例存储时间不一样,结果有较大差别

    6
    6 帖子
    819 浏览
    S

    @李东岳 老师,我学一下怎么处理成allrun文件

  • 3 帖子
    841 浏览
    Z

    @zhou 已解决,在Moordyn的输入文件的OPTIONS栏下,加入一行:

    1 ICgenDynamic Legacy Initial Condition generation

    即可解决

  • SRF求解器中如何用fvOptions给定恒Urel?

    8
    8 帖子
    1k 浏览
    东方白杨

    @李东岳 老师我又想了一下,感觉旋转状态下用cyclic周期性边条有问题,因为如果是一个直通道绕轴旋转的话,进出口都不在一个旋转半径上,存在离心力加速,如果此时用周期性边条的话,算出来显示通道内中心点速度Urel越来越大了。