Smagorinsky模型不输出k_sgs场
-
可以做如下改动进行输出,至少适用于OpenFOAM-8
- 打开Smagorinsky.H,添加
k_
:
// Protected data dimensionedScalar Ck_; volScalarField k_;//这是添加的一行 // Protected Member Functions - 打开Smagorinsky.C,添加下面代码:
: LESeddyViscosity<BasicMomentumTransportModel> ( type, alpha, rho, U, alphaRhoPhi, phi, transport ), Ck_ ( dimensioned<scalar>::lookupOrAddToDict ( "Ck", this->coeffDict_, 0.094 ) ),//这里加个逗号 //下面是添加的 k_ ( IOobject ( IOobject::groupName("k", this->alphaRhoPhi_.group()), this->runTime_.timeName(), this->mesh_, IOobject::MUST_READ, IOobject::AUTO_WRITE ), this->mesh_ ) { if (type == typeName) { this->printCoeffs(type); } }
correctnut()
函数通过下面代码替换:void Smagorinsky<BasicMomentumTransportModel>::correctNut() { k_ = (this->k(fvc::grad(this->U_))); this->nut_ = Ck_*this->delta()*sqrt(k_); this->nut_.correctBoundaryConditions(); fv::options::New(this->mesh_).correct(this->nut_); }
- 打开Smagorinsky.H,添加
-
-
-
-
-
-
@李东岳epsilon()函数要不要改
template<class BasicTurbulenceModel> tmp<volScalarField> tshbSmagorinsky<BasicTurbulenceModel>::epsilon() const { k_ = (this->k(fvc::grad(this->U_))); return volScalarField::New ( IOobject::groupName("epsilon", this->alphaRhoPhi_.group()), this->Ce_*k_*sqrt(k_)/this->delta() ); }
-
@ZZ给我趴下 在 Smagorinsky模型不输出k_sgs场 中说:
老帖子了,为了方便后面的人看,这里指出下问题。原始的代码159行这里是调用correctNut,而它的实现是在上面的59行。李老师的意思是换掉59行位置correctNut的函数实现代码里面的k_,不是把此处调用correctNut换成另一个新的实现,因此会报重复定义错误
2021年4月22日 01:36
6/11
2025年1月10日 13:35