拉格朗日一个bug
-
上述代码为OpenFOAM-5.x下的结果,经测试OpenFOAM-4.x结果正确。拉格朗日这面玩的这么少么?不仅是
Cloud<basicKinematicParcel>
,Cloud<basicKinematicCollidingParcel>
也有这个问题。4.x:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.x | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class Cloud<basicKinematicCollidingParcel>; location "5/lagrangian/kinematicCloud"; object positions; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 850 ( (0.1652375049 0.5 0.5) 0 (0.3082808448 0.5 0.5) 0 (0.09319717789 0.5 0.5) 0 (0.1760049582 0.5 0.5) 0 (0.1925717587 0.5 0.5) 0 (0.3543820922 0.5 0.5) 0
5.x:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 5.x | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class Cloud<basicKinematicCollidingParcel>; location "5/lagrangian/kinematicCloud"; object positions; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 850 ( (0.3261957614 0.3369021193 0.3369021193 0) 0 9 2//什么东西这是?。。 (0.4001988533 0.2999005734 0.2999005734 0) 0 9 2 (0.1530216921 0.4234891539 0.4234891539 0) 0 9 2 (0.3338597466 0.3330701267 0.3330701267 0) 0 9 2 (0.3488235028 0.3255882486 0.3255882486 0) 0 9 2 (0.4730656805 0.2634671597 0.2634671597 0) 0 9 2 (0.2571585867 0.3714207066 0.3714207066 0) 0 9 2 (0.4849837396 0.2575081302 0.2575081302 0) 0 9 2 (0.1467023563 0.4266488218 0.4266488218 0) 0 9 2 (0.2706319485 0.3646840257 0.3646840257 0) 0 9 2 (0.3640142443 0.3179928778 0.3179928778 0) 0 9 2 (0.2279260728 0.3860369636 0.3860369636 0) 0 9 2
-
这个跟颗粒追踪算法的更新有关吧,在 Openfoam 5.0 的发布说明里有提到(OpenFOAM Barycentric Tracking),更新之后颗粒输出的格式与之前版本不兼容。
在
$FOAM_SRC/lagrangian/basic/particle/particleIO.C
中可以看到保存颗粒位置信息时的区别(writePosition
函数):之前版本中为
os << position_ << token::SPACE << celli_;
在 5.0 版中为
os << coordinates_ << token::SPACE << celli_ << token::SPACE << tetFacei_ << token::SPACE << tetPti_;
变量的定义在
$FOAM_SRC/lagrangian/basic/particle/particle.H
中可以找到。 -
有道理!确实输出的是
os << coordinates_ << token::SPACE << celli_ << token::SPACE << tetFacei_ << token::SPACE << tetPti_;
5.x下面怎么后处理呢?paraview提示
ERROR: In /home/buildslave/dashboards/buildbot/paraview-pvbinsdash-linux-shared-release_superbuild/build/superbuild/paraview/src/VTK/IO/Geometry/vtkOpenFOAMReader.cxx, line 8285 vtkOpenFOAMReaderPrivate (0x5e89d60): Error reading line 20 of /home/dyfluid/OpenFOAM_tutorials/5.x/lagrangian/DPMFoam/Goldschmidt/0.01/lagrangian/kinematicCloud/positions: Expected punctuation token ')', found 0
我看5.0把
position
位置矢量写到obj文件里面去了 -
用blueCFD转化了粒子坐标后(https://github.com/blueCFD/lagrangianExtraFunctionObjects/tree/OF5x) 突然遇到了另一个报错 看起来像是转化过程中浮点数出错了 后面找了代码 发现是调用了regIOobject::write(cloud_.size())这个函数,然而我只在of里找到了 virtual bool write(const bool write = true) const这个函数 看起来不太对的样子
请问有人遇到过吗 请问如何解决?
-
-