Navigation

    CFD中文网

    CFD中文网

    • Login
    • Search
    • 最新

    fvOptions(rho, Yi)与scalarSemiImplicitSource

    OpenFOAM
    3
    10
    7917
    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.
    • Wayne
      Wayne last edited by

      reactingFoam中加个甲烷的质量源项,如下:

      scalarTracer //name
      {
          type            scalarSemiImplicitSource;
          active          true;
          selectionMode   cellZone;  // all, cellSet, points, cellZone 
          cellZone       f0;
          
          scalarSemiImplicitSourceCoeffs
          {
              volumeMode      absolute; // absolute <quantity>; specific <quantity>/m^3
              injectionRateSuSp 
              {
                  CH4      (14.8e-6 0); //kg/s    1e-6 almost perfect
              }
          }
      }
      

      这样是在f0加了14.8e-6 kg/s的甲烷吗?我试算的一个算例表明似乎是的。

      但是组分方程中的变量是质量分数Yi,而不是质量浓度kg/m^3,应该是利用了当地的混合气体的密度。能否从fvOptions(rho, Yi)实现代码的角度解释一下?

      另外 any comments are welcome!

      Blog: http://blog.sina.com.cn/multiphyzks
      RG:https://www.researchgate.net/profile/Yan_Wang154

      1 Reply Last reply Reply Quote
      • Wayne
        Wayne last edited by

        另外通过fvOptions的方式注入的气体如何指定其温度?

        Blog: http://blog.sina.com.cn/multiphyzks
        RG:https://www.researchgate.net/profile/Yan_Wang154

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

          这样是在f0加了14.8e-6 kg/s的甲烷吗?我试算的一个算例表明似乎是的。

          如果你想每个网格单元附加12.8e-6的甲烷,是的。因为你用的是绝对形式。不过在方程中应该是kg/(m^3 s)。

          组分方程中的变量是质量分数Yi,而不是质量浓度kg/s,

          参考:

          template<class Type>
          Foam::tmp<Foam::fvMatrix<Type> > Foam::fv::optionList::operator()
          (
              const volScalarField& rho,
              GeometricField<Type, fvPatchField, volMesh>& field
          )
          {
              return this->operator()(rho, field, field.name());
          }
          
          const dimensionSet ds
              (
                  rho.dimensions()*field.dimensions()/dimTime*dimVolume
              );
          ···
          
          在fvOptions中已经把单位转换为kg/s了

          线上CFD课程 7月1日报名截止 http://dyfluid.com/class.html
          CFD高性能服务器 http://dyfluid.com/servers.html

          1 Reply Last reply Reply Quote
          • Wayne
            Wayne last edited by Wayne

            多谢。有个小问题,我与实验对照过计算结果,absolute应该是加在整个zone上的,不是每个网格单元。

            Blog: http://blog.sina.com.cn/multiphyzks
            RG:https://www.researchgate.net/profile/Yan_Wang154

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

              @Wayne 在 fvOptions(rho, Yi)与scalarSemiImplicitSource 中说:

              absolute应该是加在整个zone上的,不是每个网格单元。

              10个网格,

              injectionRateSuSp 
                      {
                          CH4      (1 0); //kg/s    1e-6 almost perfect
                      }
              

              就是所有10个网格总共是1,而不是每个网格是1,整体是10?

              线上CFD课程 7月1日报名截止 http://dyfluid.com/class.html
              CFD高性能服务器 http://dyfluid.com/servers.html

              Wayne 1 Reply Last reply Reply Quote
              • Wayne
                Wayne @李东岳 last edited by

                @李东岳 额,我不确定了。突然想起来我是拿归一化的浓度和实验对比的 = = 等有空测试测试

                Blog: http://blog.sina.com.cn/multiphyzks
                RG:https://www.researchgate.net/profile/Yan_Wang154

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

                  @Wayne 最近主要做反应流了?

                  线上CFD课程 7月1日报名截止 http://dyfluid.com/class.html
                  CFD高性能服务器 http://dyfluid.com/servers.html

                  Wayne 1 Reply Last reply Reply Quote
                  • Wayne
                    Wayne @李东岳 last edited by

                    @李东岳 做一个奇怪的东西,自由流和多孔介质流的耦合,遇到好多问题,最近我要来刷屏了

                    Blog: http://blog.sina.com.cn/multiphyzks
                    RG:https://www.researchgate.net/profile/Yan_Wang154

                    Wayne 1 Reply Last reply Reply Quote
                    • Wayne
                      Wayne @Wayne last edited by

                      参考fvOptions 之 semiImplicitSource
                      。

                      absolute是加在整个Set上的。如下

                          // Set volume information
                          V_ = 0.0;
                          forAll(cells_, i)
                          {
                              V_ += mesh_.V()[cells_[i]];
                          }
                          reduce(V_, sumOp<scalar>());
                      
                          Info<< indent
                              << "- selected " << returnReduce(cells_.size(), sumOp<label>())
                              << " cell(s) with volume " << V_ << endl;
                      

                      另外,fvOptions(rho, he) 中的rho 可能实际上没有使用,如下:

                      template<class Type>
                      void Foam::fv::SemiImplicitSource<Type>::addSup
                      (
                          const volScalarField& rho,
                          fvMatrix<Type>& eqn,
                          const label fieldi
                      )
                      {
                          if (debug)
                          {
                              Info<< "SemiImplicitSource<" << pTraits<Type>::typeName
                                  << ">::addSup for source " << name_ << endl;
                          }
                      
                          return this->addSup(eqn, fieldi); //又调用了不带rho的addSup函数
                      }
                      

                      Blog: http://blog.sina.com.cn/multiphyzks
                      RG:https://www.researchgate.net/profile/Yan_Wang154

                      1 Reply Last reply Reply Quote
                      • N
                        nanxuan last edited by

                        前辈,您好,在这个设置区域的浓度方面这个fvoptions与setfields的用法上,fvoptions能实现随时间的变化,其他还要什么呢。

                        1 Reply Last reply Reply Quote
                        • First post
                          Last post

                        CFD中文网 | 东岳流体 | 京ICP备15017992号-2
                        论坛登录问题反馈可联系 li.dy@dyfluid.com