Navigation

    CFD中文网

    CFD中文网

    • Login
    • Search
    • 最新
    1. Home
    2. 陈琦
    陈
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 3
    • Groups 0

    陈琦

    @陈琦

    409
    Profile views
    3
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    陈琦 Unfollow Follow

    Latest posts made by 陈琦

    • RE: 怎么获取边界上一点的压力值

      这是我根据网上的模板修改的一个喷口边界条件(jet),喷口的速度随时间和空间位置变化,可以正常使用。请问一下,如果我想输出网格ID为faceI0的格心的压力,应该怎么实现呢? 再进一步,如果这个网格点不在jet边界上(比如在hump边界上),那么在这里可以获得该点的压力吗?

      /*--------------------------------*- C++ -*----------------------------------*\
      | =========                 |                                                 |
      | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
      |  \\    /   O peration     | Version:  5.0                                   |
      |   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
      |    \\/     M anipulation  |                                                 |
      \*---------------------------------------------------------------------------*/
      FoamFile
      {
          version     2.0;
          format      ascii;
          class       volVectorField;
          location    "11012";
          object      U;
      }
      // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
      
      dimensions      [0 1 -1 0 0 0 0];
      
      internalField   uniform (0 0 0);
      
      boundaryField
      {
          backfront
          {
              type            empty;
          }
          
          hump
          {
              type            noSlip;
          }
         
          inlet
          {
              type            timeVaryingMappedFixedValue;
              offset          constant (0 0 0);
              value           nonuniform List<vector> 
              216
               (..... )  ;
          }
          
          jet
          {
              type            codedFixedValue;
              name            nouse;
              value           (0 0 0);
              redirectType    jeton;
              
              codeOptions
              #{
                  -I$(LIB_SRC)/finiteVolume/lnInclude \
                  -I$(LIB_SRC)/meshTools/lnInclude
              #}; 
      
              codeInclude
              #{
                  #include "fvCFD.H"
                  #include <cmath>
                  #include <iostream>
              #};         
      
              code
              #{
                  const fvPatch& boundaryPatch = patch();   
                  const vectorField& Cf = boundaryPatch.Cf();
                  vectorField& field = *this;
      
                  const scalar pi = constant::mathematical::pi;
                  scalar x0=0.654157, z0=0.115013, d=0.004554;
                  scalar umax=26.6,   fjet=138.5;
                  scalar theta = 18.31163/pi;
                 
                  forAll(Cf, faceI)
                  {
                      scalar x  = Cf[faceI].x();
                      scalar z  = Cf[faceI].z();
                      scalar t  = this->db().time().value();
      
                      scalar kesi  = pow( (x-x0)*(x-x0)+(z-z0)*(z-z0),0.5);
                      scalar ujmag = 6*umax*( (kesi/d)-pow(kesi/d,2) )*sin(2*pi*fjet*t);
                      scalar ujet  = ujmag*sin(theta);
                      scalar vjet  = ujmag*cos(theta);
                      
                      field[faceI] = vector(ujet,0,vjet);
                  }
              #};    
          }
      
          lowWall
          {
              type            noSlip;
          }
          outlet
          {
              type            zeroGradient;
          }
          top
          {
              type            zeroGradient;
          }
      }
      
      posted in OpenFOAM
      陈
      陈琦
    • RE: 怎么获取边界上一点的压力值

      李老师,是这样的,我想做一个流动反馈控制的一个研究。在流场下游有个分离区,在分离点附近有喷口,通过喷流实现对流动的控制。现在的想法是在分离区选择一个点,测量该点的压力波动,以该物理量作为输入,实时调节喷口的速度。
      所以我希望能在计算中随时获取该点压力值,并根据该值计算出喷口边界上的速度,并不只是想输出压力。

      posted in OpenFOAM
      陈
      陈琦
    • 怎么获取边界上一点的压力值

      请教各位,在使用OpenFoam的codefixedvalue边界时,可以每一个时间步都输出该边界上某个坐标点(x0,y0,z0)附近的压力吗? 代码应该怎么写呢? C++小白求帮助

      posted in OpenFOAM
      陈
      陈琦