Navigation

    CFD中文网

    CFD中文网

    • Login
    • Search
    • 最新

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

    OpenFOAM
    1
    2
    583
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • V
      veen last edited by

      今天在做模拟的时候发现,对入口进行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

      V 1 Reply Last reply Reply Quote
      • V
        veen @veen last edited by

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

        1 Reply Last reply Reply Quote
        • First post
          Last post

        CFD中文网 | 东岳流体 | 京ICP备15017992号-2