openfoam学习笔记-3
学习笔记-3
OpenFOAM programming tutorial
使用paraview或paraFoam查看昨天myIcoFoam的求解结果;其中标量T场如下图所示: 按照我们之前T字典文件中的边界条件定义,最上面的moving wall T为1,其它wall为零;标量场T的控制方程为:
为扩散+耗散,内部标量场的值应不会超过边界,即内部值应均小于1;其次T为被动输运,T场应同速度场保持一致;下图为速度场,可同上面的标量场进行对比。 下面我们来看一下上文中留下的两个问题:
- divSchemes总共有多少种离散格式选项?
关于该问题,在《Openfoam user guide version 4.0》中有介绍,openfoam中散度的离散全部基于高斯方法,用户可运行foamSearch脚本在案例文件中提取div(phi,U)关键字:
zhoudq@zhoudq-MacBookAir:~/OpenFOAM/CFD/cavity/cavity$ foamSearch /home/zhoudq/OpenFOAM/OpenFOAM-6/tutorials fvSchemes divSchemes."div(phi,U)"
div(phi,U) bounded Gauss limitedLinear 0.2;
div(phi,U) bounded Gauss limitedLinearV 1;
div(phi,U) bounded Gauss linear;
div(phi,U) bounded Gauss linearUpwind grad;
div(phi,U) bounded Gauss linearUpwind grad(U);
div(phi,U) bounded Gauss linearUpwind limited;
div(phi,U) bounded Gauss linearUpwind unlimited;
div(phi,U) bounded Gauss linearUpwindV grad(U);
div(phi,U) bounded Gauss upwind;
div(phi,U) Gauss cubic;
div(phi,U) Gauss limitedLinear 1;
"div\(phi.*,U.*\)" Gauss limitedLinearV 1;
div(phi,U) Gauss limitedLinearV 1;
div(phi,U) Gauss linear;
div(phi,U) Gauss linearUpwind grad(U);
div(phi,U) Gauss linearUpwind limited;
div(phi,U) Gauss linearUpwindV grad(U);
div(phi,U) Gauss LUST grad(U);
div(phi,U) Gauss LUST unlimitedGrad(U);
div(phi,U) Gauss upwind;
div(phi,U) Gauss vanLeerV;
从上面的搜索结果可以看出,对于散度离散,全为gauss方法,其中比较常见的有:
iv(phi,U) Gauss linear;
div(phi,U) Gauss linearUpwind grad(U);
div(phi,U) Gauss LUST grad(U);
div(phi,U) Gauss LUST unlimitedGrad(U);
div(phi,U) Gauss upwind;
其中Gauss linear为二阶,无界;linearUpwind为二阶迎风格式,无界;LUST为混合格式75%线性/25%线性迎风;upwind为一阶迎风格式,通常精度低,不推荐使用。
- T的求解中为什么要采用PBiCG以及DILU预测器?
首先介绍CG,CG为Conjugate Gradient,实质就是沿着残差减少得最快的方向搜索解,还记得本科的使用有对比过共轭梯度和模糊推理在求解导热反问题的差异,后面再找找资料,再详细介绍一下(如果有精力)。PCG在Openfoam中就是加了预条件(Precondition),主要用于求解对称矩阵;同理PBiCG为加了预条件的双共轭梯度求解算法,主要用于反对称矩阵; DILU预测器,对角不完全LU;DIC预测器,对角不完全Cholesky方法。
本文总阅读量次 ⤧ Next post openfoam学习笔记-4 ⤧ Previous post openfoam学习笔记-2