在曳力模型中植入网格中心到边界距离的问题



  • 请教各位前辈:
    我以wenyu.C为基础,想把y_(wallDist::New(mesh).y())植入到曳力计算公式中:

    / * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
    Foam::dragModels::wallEffect::wallEffect
    (
        const dictionary& dict,
        const phasePair& pair,
        const bool registerObject,
        const fvMesh& mesh
       
    )
    :
        dragModel(dict, pair, registerObject),
        residualRe_("residualRe", dimless, dict),
        y_(wallDist::New(mesh).y())
           
    {}
    
    
    // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
    
    Foam::tmp<Foam::volScalarField> Foam::dragModels::wallEffect::CdRe() const
    {
        const volScalarField alpha2
        (
            max(1 - pair_.dispersed(), pair_.continuous().residualAlpha())
        );
        
        
        //const volScalarField Res(alpha2*pair_.Re());
        const volScalarField Re(pair_.Re());
    
       
        const volScalarField Cp(y_/pair_.dispersed().d());
    
           const volScalarField CdsRe
          (
             neg(Re - 1000)*(24*(1.0 + 0.15*pow(Re, 0.687))*pow(Cp,0.565)
          + pos0(Re - 1000)*0.44*max(Re, residualRe_)
          );
    

    编译可以通过,但查看未定义符号情况时出现如下问题:
    e29f8dda-ccde-4d2c-94e0-41aa6e8c4ac3-image.png

    计算时也出现错误d21a7009-8068-455e-a511-2139ca8fd62b-image.png

    不知这个y_(wallDist::New(mesh).y())该如何正确植入呢?



  • 如果改变写法:

    Foam::dragModels::wallEffect::wallEffect
    (
        const dictionary& dict,
        const phasePair& pair,
        const bool registerObject
       
    )
    :
        dragModel(dict, pair, registerObject),
        residualRe_("residualRe", dimless, dict),
        y_(nullptr)
           
    {}
    
    Foam::dragModels::wallEffect::wallEffect
    (
        const dictionary& dict,
        const phasePair& pair,
        const bool registerObject,
        const fvMesh& mesh
       
    )
    :
        dragModel(dict, pair, registerObject),
        residualRe_("residualRe", dimless, dict),
        y_(&wallDist::New(mesh).y())
           
    {}
    

    计算的时候会报错:
    d4575b34-003f-4362-bd94-41e7a5b54e23-image.png

    @李东岳 也烦请东岳老师帮忙看看这个问题如何实现~ 三月再您的课上还问过您这个问题,但是下来自己搞没搞通:135:



  • 在dargmodel.C这个衍生类中没有mesh这个成员对象,不知道该如何引入


Log in to reply
 


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