CodedFixedValue边界赋值后,noslip壁面变为滑移边界?
-
今天在做模拟的时候发现,对入口进行CodedFixedValue边界赋值后,noslip壁面的速度不为0,换成FixedValue边界后又正常了,这是为什么呢?
U
boundary conditionFoamFile { 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; } }
这是计算得到的流场
案例文件在这:case.zip