CodedFixedValue边界赋值后,noslip壁面变为滑移边界?



  • 今天在做模拟的时候发现,对入口进行CodedFixedValue边界赋值后,noslip壁面的速度不为0,换成FixedValue边界后又正常了,这是为什么呢?
    Uboundary condition

    FoamFile
    {
        version     2.0;
        format      ascii;
        class       volVectorField;
        object      U;
    }
    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
    
    dimensions      [0 1 -1 0 0 0 0];
    
    internalField   uniform (10 0 0);
    
    boundaryField
    {
        inlet
        {
            type            codedFixedValue;
            value           uniform (10 0 0);
            name            codeinlet;
            code            #{
                const fvPatch& boundaryPatch = this->patch();
    
                vectorField U = boundaryPatch.Cf();
                vectorField u = boundaryPatch.Cf();
                
                scalar zstar = 0.003;
                scalar kappa = 0.41;
                scalar ustar = 0.726;
                scalar ubar  = 10;
    
                forAll(boundaryPatch, faceI)
                {
                //spatial coordinates, type: scalar
                scalar y = boundaryPatch.Cf()[faceI].y();
                            
                U[faceI] = vector((ustar/kappa)*log(1+y/zstar), 0, 0);
                u[faceI] = 0.1*ubar*exp(-0.5*y)*vector(rand() % 2 - 1, rand() % 2 - 1, rand() % 2 - 1);
                U[faceI] = U[faceI]+u[faceI];
                if (U[faceI].x() < 0)
                {
                    U[faceI].x() = -U[faceI].x();
                }
                }
                
                operator==(U+u);
            #};
        }
    
        outlet
        {
            type            zeroGradient;
        }
    
        land
        {
            type            noSlip;
        }
    
        symmetry
        {
            type            slip;
        }
    }
    

    这是计算得到的流场
    51f92c91-e1be-4eb3-95ff-d41e0212ca4d-image.png
    案例文件在这:case.zip



  • @veen 破案了,应该是paraview读取case的问题openfoam-post-processing


Log in to reply
 


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