CFD中文网

    CFD中文网

    • 登录
    • 搜索
    • 最新

    LPT-VOF coupling in OF 7

    OpenFOAM
    2
    3
    676
    正在加载更多帖子
    • 从旧到新
    • 从新到旧
    • 最多赞同
    回复
    • 在新帖中回复
    登录后回复
    此主题已被删除。只有拥有主题管理权限的用户可以查看。
    • Q
      qingdong_wang 最后由 编辑

      大家好, 现在在做LPT和VOF耦合, 既把solidParticle植入到interFoam中。 我现在有的参考还是chamlers根据openFoam 3.0 做的, 但是他在OF7 中并不匹配

      void Foam::solidParticleCloud::inject(solidParticle::trackingData &td)
      {
      label cellI=1;
      label tetFaceI=1;
      label tetPtI=1;
      mesh_.findCellFacePt(td.cloud().posP1_, cellI, tetFaceI, tetPtI);
      solidParticle* ptr1 = new solidParticle(mesh_, td.cloud().posP1_, cellI,
      tetFaceI, tetPtI,td.cloud().dP1_, td.cloud().UP1_);
      Cloud<solidParticle>::addParticle(ptr1);
      mesh_.findCellFacePt(td.cloud().posP2_, cellI, tetFaceI, tetPtI);
      solidParticle* ptr2 = new solidParticle(mesh_, td.cloud().posP2_, cellI,
      tetFaceI, tetPtI, td.cloud().dP2_, td.cloud().UP2_);
      Cloud<solidParticle>::addParticle(ptr2);
      }
      

      这个是加入到solidParticleCloud.H 的代码, 然后显示member function cloud 不存在,然后我去看了particle.H 中的代码,

      class particle
      :
          public IDLList<particle>::link
      {
          // Private member data
      
              //- Size in bytes of the position data
              static const std::size_t sizeofPosition_;
      
              //- Size in bytes of the fields
              static const std::size_t sizeofFields_;
      
              //- The factor by which the displacement is increased when passing
              //  through negative space. This should be slightly bigger than one.
              //  This is needed as a straight trajectory can form a closed loop
              //  through regions of overlapping positive and negative space, leading
              //  to a track which never ends. By increasing the rate of displacement
              //  through negative regions, the change in track fraction over this
              //  part of the loop no longer exactly cancels the change over the
              //  positive part, and the track therefore terminates.
              static const scalar negativeSpaceDisplacementFactor;
      
      
      public:
      
          class trackingData
          {
          public:
      
              // Public data
      
                  //- Flag to switch processor
                  bool switchProcessor;
      
                  //- Flag to indicate whether to keep particle (false = delete)
                  bool keepParticle;
      
      
              // Constructor
              template <class TrackCloudType>
              trackingData(const TrackCloudType& cloud)
              {}
          };
      
      

      发现trackingData已经没有private成员和member function了,OF5中还是有的, 如下

      class particle
      :
          public IDLList<particle>::link
      {
          // Private member data
      
              //- Size in bytes of the position data
              static const std::size_t sizeofPosition_;
      
              //- Size in bytes of the fields
              static const std::size_t sizeofFields_;
      
              //- The factor by which the displacement is increased when passing
              //  through negative space. This should be slightly bigger than one.
              //  This is needed as a straight trajectory can form a closed loop
              //  through regions of overlapping positive and negative space, leading
              //  to a track which never ends. By increasing the rate of displacement
              //  through negative regions, the change in track fraction over this
              //  part of the loop no longer exactly cancels the change over the
              //  positive part, and the track therefore terminates.
              static const scalar negativeSpaceDisplacementFactor;
      
      
      public:
      
          template<class CloudType>
          class TrackingData
          {
              // Private data
      
                  //- Reference to the cloud containing (this) particle
                  CloudType& cloud_;
      
      
          public:
      
              // Public data
      
                  typedef CloudType cloudType;
      
                  //- Flag to switch processor
                  bool switchProcessor;
      
                  //- Flag to indicate whether to keep particle (false = delete)
                  bool keepParticle;
      
      
              // Constructor
              TrackingData(CloudType& cloud)
              :
                  cloud_(cloud)
              {}
      
      
              // Member functions
      
                  //- Return a reference to the cloud
                  CloudType& cloud()
                  {
                      return cloud_;
                  }
          };
      

      我看官方貌似对particle和injection做了挺多改变的。请问一下有大神对这个有所涉及或者可以给个hint吗?

      1 条回复 最后回复 回复 引用
      • 李东岳
        李东岳 管理员 最后由 编辑

        你可以直接用MPPICInterFoam试试

        CFD高性能服务器 http://dyfluid.com/servers.html
        2023年,线下CFD课,预热一下 http://dyfluid.com/class.html

        Q 1 条回复 最后回复 回复 引用
        • Q
          qingdong_wang @李东岳 最后由 编辑

          @东岳 但是那个貌似是在v1906这种版本,我现在用的是OpenFoam 7, 貌似没有MPPICInterFoam

          1 条回复 最后回复 回复 引用
          • First post
            Last post