关于壁面函数有些不懂
-
@random_ran 好多文献就是这样的,给定初值,求解N-S,得到速度带入k-e,更新湍流粘度。就是第二张图片那个连接里面的,而且他直接在wall上设置k和e为0
-
当求解湍流粘度的时候需要调用y+(看方程31),其可以采用不同的方法,最简单的方法就是我网页那种方法,然而另一种方法就是上文中提出的牛顿迭代法。俩种方法最后都需要使用方程31更新粘度。
下面是OpenFOAM中采用我网页中方法的步骤:
tmp<scalarField> nutkWallFunctionFvPatchScalarField::calcNut() const { const label patchi = patch().index(); const turbulenceModel& turbModel = db().lookupObject<turbulenceModel> ( IOobject::groupName ( turbulenceModel::propertiesName, internalField().group() ) ); const scalarField& y = turbModel.y()[patchi]; const tmp<volScalarField> tk = turbModel.k(); const volScalarField& k = tk(); const tmp<scalarField> tnuw = turbModel.nu(patchi); const scalarField& nuw = tnuw(); const scalar Cmu25 = pow025(Cmu_); tmp<scalarField> tnutw(new scalarField(patch().size(), 0.0)); scalarField& nutw = tnutw.ref(); forAll(nutw, facei) { label faceCelli = patch().faceCells()[facei]; scalar yPlus = Cmu25*y[facei]*sqrt(k[faceCelli])/nuw[facei];//简单计算y+ if (yPlus > yPlusLam_) { nutw[facei] = nuw[facei]*(yPlus*kappa_/log(E_*yPlus) - 1.0);//方程31 } } return tnutw; }
下面是OpenFOAM中采用你截图的迭代法求解的步骤:
tmp<scalarField> nutUWallFunctionFvPatchScalarField::calcNut() const { const label patchi = patch().index(); const turbulenceModel& turbModel = db().lookupObject<turbulenceModel> ( IOobject::groupName ( turbulenceModel::propertiesName, internalField().group() ) ); const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi]; const scalarField magUp(mag(Uw.patchInternalField() - Uw)); const tmp<scalarField> tnuw = turbModel.nu(patchi); const scalarField& nuw = tnuw(); tmp<scalarField> tyPlus = calcYPlus(magUp);//通过速度迭代计算y+ scalarField& yPlus = tyPlus.ref(); tmp<scalarField> tnutw(new scalarField(patch().size(), 0.0)); scalarField& nutw = tnutw.ref(); forAll(yPlus, facei) { if (yPlus[facei] > yPlusLam_) { nutw[facei] = nuw[facei]*(yPlus[facei]*kappa_/log(E_*yPlus[facei]) - 1.0);//方程31 } } return tnutw; }
一直时间很紧没有时间细看这个帖子,不过看起来非常有意思,近期我更新一下你贴图那种方法的思路。