在单管泊肃叶流动中与例子不符的问题(新手菜鸟)
-
在网上找了一个学习open foam的算例学习文件,完全按照算例画网格和编写边界条件,最终结果与算例结果有很大的不同,对照例子找了半天没找到原因,希望各位大佬能帮忙看一下,感谢!
自己的曲线结果
!!
例子的曲线
教程图
我的程序文件/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 5 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "constant"; object turbulenceProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // simulationType laminar; /*RAS { // Tested with kEpsilon, realizableKE, kOmega, kOmegaSST, v2f, // ShihQuadraticKE, LienCubicKE. RASModel kEpsilon; turbulence on; printCoeffs on; }*/ // ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 5 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "constant"; object turbulenceProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // simulationType laminar; // ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 5 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volVectorField; object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField uniform (0 0 0); boundaryField { inlet { type fixedValue; value uniform (1 0 0); } outlet { type zeroGradient; } top { type symmetryPlane; } bottom { type fixedValue; value uniform (0 0 0); } frontAndBack { type empty; } } // ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 5 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; object p; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -2 0 0 0 0]; internalField uniform 0; boundaryField { inlet { type zeroGradient; } outlet { type fixedValue; value uniform 0; } top { type symmetryPlane; } bottom { type zeroGradient; }
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 5 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object fvSolution; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // solvers { p { solver GAMG; tolerance 1e-06; relTol 0.1; smoother GaussSeidel; } U { solver smoothSolver; smoother symGaussSeidel; tolerance 1e-05; relTol 0.1; } } SIMPLE { nNonOrthogonalCorrectors 0; consistent yes; residualControl { p 1e-5; U 1e-5; } } relaxationFactors { equations { U 0.9; // 0.9 is more stable but 0.95 more convergent ".*" 0.9; // 0.9 is more stable but 0.95 more convergent } } // ************************************************************************* //
-
关注一下,也等一个回复
-
例子用的openfoam3.0,我用的5.0,应该和版本没有问题吧
我自己看曲线的感觉是考虑粘滞力的设置问题,但是不知道在程序中哪一块出了问题, -
今天刚好跑了一个,可以试试这个:Hagen_Poiseuille_flow.zip
你的案例中
fvSolution
的U final和p final没有定义
p
文件中frontAndBack粘漏了? -
@veen 是的,p文件中frontAndBack粘漏了,现在就下载例子,试一试,感谢
-
把你的粘度调高试试
-
找到错误了,网格尺度与例子不符,因为例子设置的流体粘度偏低,所以只有在毫米尺度的网格观察才会是抛物线,而我的网格是0.1m的,所以看上去就像是一条陡峭的直线。
图中就是网格尺度,我错误写成0.1了。
-
@东岳 是的,粘度调高也可以出现抛物线,感谢 感谢。我把网格尺度变小了,也能观察到。