Navigation

    CFD中文网

    CFD中文网

    • Login
    • Search
    • 最新

    涡量如何在代码中引用?

    OpenFOAM
    3
    8
    1010
    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.
    • 荷
      荷兰后腰阿贾克斯 last edited by

      各位春节好~

      我想在LESdeltas中植入个方程如下:
      1.png

      根据maxDeltaxyz改动了如下:(会报错)

      void Foam::LESModels::TestDeltaxyz::calcDelta()
      {
          const fvMesh& mesh = momentumTransportModel_.mesh();
          const volVectorField& U = momentumTransportModel_.U();
           
          label nD = mesh.nGeometricD();
      
          const cellList& cells = mesh.cells();//get faces list
          const pointField& pc = mesh.points();//get point coordinates
          scalarField hmax(cells.size());
      
          forAll(cells,celli)
          {
              scalar deltaMaxTmp = 0.0;
              
              const labelList& meshPoints = mesh.cellPoints()[celli];
              const vector & Ux = U.internalField()[celli];//不知道这么写对不对
          
              const vectorField& vorticity = fvc::curl(Ux);//how can i get the vorticity?
              const vectorField& nv = (vorticity/mag(vorticity));//normal vorticity
              const vector nvi = nv[celli];
      
              forAll(meshPoints, pointi)//   i
              {
                  label pointI = meshPoints[pointi];
                  const point& rn = pc[pointI];
                  vector  ln =  nvi ^ rn;
      
                       forAll(meshPoints, pointj)//   j
                        {
                              label pointJ = meshPoints[pointj];
                              const point& rm = pc[pointJ];
                              vector lm =  nvi ^ rm;
      
                              scalar tmp = mag(ln - lm);
                              if (tmp > deltaMaxTmp)
                              {
                                  deltaMaxTmp = tmp;
                              }
                        }
              }      
      
              hmax[celli] = deltaCoeff_*deltaMaxTmp;
          }
      

      关于涡量的引入有什么方法吗?以及我的循环方式可行吗?
      我尝试加入fvc.h文件,想通过对速度求curl,但目前仍然无法使用,怎样写才能使它正常工作呢?

      祝好

      1 Reply Last reply Reply Quote
      • 李东岳
        李东岳 管理员 last edited by

        你要对U做curl,所以应该是const volVectorField vort = fvc::curl(U);

        CFD课程 改成线上了 http://dyfluid.com/class.html
        CFD高性能服务器 http://dyfluid.com/servers.html

        荷 2 Replies Last reply Reply Quote
        • 荷
          荷兰后腰阿贾克斯 @李东岳 last edited by

          @李东岳 感谢李老师的指点!
          但是现在编译遇到的报错仍和之前一样,提示我no matching function for call to curl

          error:no matching function for call to “curl(const vector&)”
                      const vectorField& vorticity = fvc::curl(Ux);//how can i get the vorticity?
          in file......note:candidate:template<class Type>  Foam::tmp::<Foam::GeometricField<Type, Foam::fvpatchField,Foam::volMesh>> Foam::fvc::curl(const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&)
                     curl
          ....other
          

          速度Ux的引入是正确的吗?我该如何使其工作?

          1 Reply Last reply Reply Quote
          • 荷
            荷兰后腰阿贾克斯 @李东岳 last edited by

            @李东岳 东岳老师您好,目前进展卡在速度的引入上

            const volVectorField& U = momentumTransportModel_.U();
            const cellList& cells = mesh.cells();
            
            forAll(cells,celli)
                {    
                    const volVectorField& uCell = U[celli];
                    const volVectorField& vorticity = fvc::curl(uCell);
                    ...
            

            编译显示速度场无效初始化

            error: invalid initialization of reference of type ‘const volVectorField& {aka const Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>&}’ from expression of type ‘const Foam::Vector<double>’
                     const volVectorField& uCell = U[celli];
            

            所以 速度 该怎么正确引入到写的代码里呢?感激不尽!

            1 Reply Last reply Reply Quote
            • 李东岳
              李东岳 管理员 last edited by

              vector uCell(U[celli]);
              

              CFD课程 改成线上了 http://dyfluid.com/class.html
              CFD高性能服务器 http://dyfluid.com/servers.html

              1 Reply Last reply Reply Quote
              • C
                cresendo last edited by

                想请问这是哪篇文献呢?:140:

                荷 1 Reply Last reply Reply Quote
                • 荷
                  荷兰后腰阿贾克斯 @cresendo last edited by

                  @cresendo shur2015年的一篇文献,An Enhanced V ersion of DES with Rapid Transition from RANS to LES in Separated Flows
                  你也做DES吗?

                  C 1 Reply Last reply Reply Quote
                  • C
                    cresendo @荷兰后腰阿贾克斯 last edited by

                    @荷兰后腰阿贾克斯 嗯嗯,谢谢老哥了:xinxin3:

                    1 Reply Last reply Reply Quote
                    • First post
                      Last post

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