Smagorinsky模型不输出k_sgs场


  • 管理员

    可以做如下改动进行输出,至少适用于OpenFOAM-8

    1. 打开Smagorinsky.H,添加k_:
        // Protected data
    
            dimensionedScalar Ck_;
            
            volScalarField k_;//这是添加的一行
    
    
        // Protected Member Functions
    
    1. 打开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_);
    }
    

Log in to reply
 


CFD中文网 | 东岳流体学术 | 东岳流体商业 | 吉ICP备20003622号-1