动网格细化植入interFoam
-
大家好,最近尝试在基于openfoam-240版本的interThermalPhaseChangeFoam(https://github.com/MahdiNabil/CFD-PC)中植入动网格细化的代码,但是碰到了莫名其妙的bug.因为该求解器和of22x版本interFoam比较接近,就参考了interDymFoam和interFoam照猫画虎.植入代码后的求解器编译顺利没什么问题,然后使用了二维的单气泡沸腾算例来测试动网格相界面细化是否能运行,但是提示求解温度方程EEqn.H时始终报错,终端提示
*** Error in `interThermalPhaseChangeDymFoam': double free or corruption (!prev): 0x0000000001ec3530 *** ======= Backtrace: ========= /lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f8eabb9e7e5] /lib/x86_64-linux-gnu/libc.so.6(+0x8037a)[0x7f8eabba737a] /lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f8eabbab53c]
另外,尝试了把能量方程剔除后运行算例,即//EEqn.H或者把算例中的fvSolution文件设置nEnergyLoops为0不求解能量方程,结果仍然报错提示网格数量不匹配,可能这两种报错都是一个原因引起的:
Starting mesh update Selected 64 cells for refinement out of 4062. Refined from 4062 to 4510 cells. --> FOAM FATAL ERROR: Incompatible size before mapping. Field size: 3950 map size: 4062 From function void MapInternalField<Type, MeshMapper, volMesh>::operator() ( Field<Type>& field, const MeshMapper& mapper ) const in file lnInclude/MapFvVolField.H at line 73. FOAM aborting #0 Foam::error::printStack(Foam::Ostream&) at ??:? #1 Foam::error::abort() at ??:? #2 ? at fvMesh.C:? #3 ? at fvMesh.C:? #4 Foam::fvMesh::mapFields(Foam::mapPolyMesh const&) at ??:?
为了排除相变模型的影响,已经在transportProperties字典中设置为不使用相变,none.事实上为了找到出问题的量,已经进行了各种尝试还是搞不定,外网也已经翻了底朝天了...
网盘链接是植入动网格代码后的求解器和测试算例:
链接: https://pan.baidu.com/s/1g6eMsUzSy3a6DADyxrtg1w 提取码: uigh在240版本下输入source Allwmake.sh即可完成编译,测试算例是NucleateBoiling2D文件夹,该算例简化成了2d平面,然后如果运行原版interThermalPhaseChangeFoam没有问题.
实在没办法了,来论坛问问各位老师和大神们有什么好办法没,谢谢~