gauss upwind和gauss linearUpwind grad(U)结果差异大
-
在计算建筑物外流场时,使用的是simpleFoam稳态求解器,我首先使用了gauss upwind作为div项的离散格式,因为我发现这个格式计算的快一些。
在计算稳定后,提取了屋面的摩擦速度,(此时计算已经稳定了),然后我把gauss upwind格式改为gauss linearUpwind grad(U),其他设置不动,接着这个时间步进行往下计算,算了一段时间后,再提取屋面摩擦速度,发现gauss linearUpwind grad(U)的摩擦速度特别怪异,请大家帮忙分析一下原因。。
麻烦点在于,我看论文一般都用的二阶格式,但是我的这个二阶格式算出来太怪异了,效果还有没有一阶的gauss upwind好,论文里不敢说自己用的一阶的格式。。 -
@xpqiu
fvSchemes:ddtSchemes { default steadyState; } gradSchemes { default Gauss linear; grad(U) cellLimited leastSquares 1;//还用了cellLimited gauss linear和gauss linear grad(k) cellLimited leastSquares 1; grad(epsilon) cellLimited leastSquares 1; } divSchemes { default none; div(phi,U) Gauss limitedLinear 1;//还用了gauss upwind, gauss linearUpwind grad(U), bounded Gauss linearUpwind grad(U), 发现就gauss upwind和计算结果最吻合,gauss limitedLinear 1吻合的还行,其他的就完全有问题了。。 div(phi,k) bounded Gauss linearUpwind limited;//k和epsilon换了几个格式,发现影响不大 div(phi,epsilon) bounded Gauss linearUpwind limited; div((nuEff*dev2(T(grad(U))))) Gauss linear; } laplacianSchemes { default Gauss linear corrected; } interpolationSchemes { default linear; } snGradSchemes { default corrected; } wallDist { method meshWave; }
fvSolution:
solvers { p { //solver PCG; //preconditioner DIC; solver GAMG; tolerance 1e-7; relTol 0.1; smoother DICGaussSeidel; } "(U|k|epsilon|omega)" { solver PBiCGStab; preconditioner DILU; //solver smoothSolver; //smoother symGaussSeidel; tolerance 1e-7; relTol 0.001; } } SIMPLE { nNonOrthogonalCorrectors 2; consistent yes; residualControl { p 1e-7; U 1e-7; "(k|epsilon|omega|f|v2)" 1e-7; } } /*relaxationFactors { equations { U 0.9; ".*" 0.8; } }*/ relaxationFactors { fields { p 0.3; } equations { U 0.7; "(k|omega|epsilon).*" 0.7; } }
我换了另一个小模型,算的快一些,结果如下(红线的数据不见了,但我记得形状):
-
@xpqiu 我是用postProcess -func wallShearStress 和 writeCellCentres把roof这个patch 输出出来,再在paraview里面用calculater: 摩擦速度=sqrt(mag(wallShearStress)),最后在excel里画的roof里的每个面单元Cx(横坐标)和对应的摩擦速度的曲线。。我研究一下怎么整合出一个后处理脚本。。主要是postProcess似乎没有sqrt这个命令,如果有就可以不用paraview了。。
-
@Samuel-Tu
你这个算例设置得不太合理的地方有好几个,我没有一个一个去考察每个因素的影响,只是直接改成了我认为合理的设置。我把我改过的文件打包了,如下:
OFPlate0.zip另外,你的网格也不太好
这个网格咋一看,直觉就是边界层附近网格太粗了,看了一下最后一步的 yPlus分布,只看 roof 这个面,
果然,最小都300 多了。你用的湍流模型是 rke,这个是合理的选择,但是这个模型最好把 yPlus 控制在 30-100 范围内。
最后,我把我这边 gauss upwind 和 gauss linearUpwind 的结果对比放上来,
虽然看起来可能还是 upwind 的结果在中间这一段跟文献的更接近,但是左边这一段实际上这两个结果都与文献值有明显的偏差。我觉得你还是先把网格改得合理之后再算算看,应该会有改进的。
-
@xpqiu 确实是只有仿真结果,没有直接的试验结果参考。。但是这个仿真是为风吹雪这个物理过程做参考的,他们是做了风吹雪的风洞试验的,按照这个仿真结果算风吹雪的现象和风洞试验对上了。。。
另外我看您的设置有两个问题:
1.我看k文件里把壁面kLowREWallFucntion改成了kqrWallFunction。我记得kLowREWallFunction是适合低、高雷诺的,kqrWallFunction只适合高雷诺。我就是按比较保险的设置,所以用的kLowREWallFunction(当然现在看来yPLus那么大,没有必要用这个低、高雷诺都可以的壁面)。您这里为什么改成kqrWallFunction呢
2.fvSolution里面把nNonOrthogonalCorrectors从2改成0了。我记得这个是好像用来修正网格非正交的,我的网格有非正交的网格,这里改动的目的是啥呢。。 -
cfdOnline里关于这个非正交修正次数的讨论
Non-orthogonal correctorsare here to save you if your code is blowing up because the mesh is so non-orthogonal that the first solution is driving the velocity to be stupid. If your velocity is OK, you just keep doing "normal" correctors, without special need for non-orthogonal ones.I use them on bad meshes (some people call them "industrial") when the solver is giving me trouble. Usually, 1 is enough, and I never used more than 3.
Hope this helps,
Hrvoje
按照hjasak的说法,nNonOrthogonalCorrectors实际不是修正网格非正交的,而是使得计算不容易发散。又学到了一点 -
-
@cccrrryyy
这个链接里面解释了为什么nut需要设置壁函数:https://www.slideshare.net/fumiyanozaki96/openfoam-36426892
这几个视频里面解释了壁函数以及k,epsilon的壁面处理的原则:
https://www.youtube.com/watch?v=fJDYtEGMgzs&t=4s
https://www.youtube.com/watch?v=zSIgKsQSa9k
https://www.youtube.com/watch?v=RKoXFpwi2go其他资料:
On the Wall Boundary Condition for Turbulence Models , By JONAS BREDBERGKalitzin, G., Medic, G., Iaccarino, G., & Durbin, P. (2005). Near-wall behavior of RANS turbulence models and implications for wall functions. Journal of Computational Physics, 204(1), 265–291.
Popovac, M., & Hanjalic, K. (2007). Compound wall treatment for RANS computation of complex turbulent flows and heat transfer. Flow, Turbulence and Combustion, 78(2), 177–202.
OpenFOAM里面的代码实现通常跟文献的描述有点差异,所以也只能是尽可能去了解原理,结合代码来理解,然后实践。也不是所有的出错都能找到合理的解释
CFD中文网2016-2023 | 京ICP备15017992号-2