CFD中文网

    CFD中文网

    • 登录
    • 搜索
    • 最新

    externalCoupledTemperature 怎么用在不可压缩solver中?

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

      大家好,

      最近在用externalCoupledTemperature 边界条件,这个是用来把OpenFOAM solver和其他cfd联系起来。但是目前这个BC只能用在compressible solver里面,原因可见下面的code. 基本上就是,它需要‘he'和’alpha‘,但这些传热量只能在thermo库里找到。因为incomopressible solver是分开求解温度的,只有transport库,所以会报错。

      if (db().foundObject<cmpTurbModelType>(turbName))
          {
              const cmpTurbModelType& turbModel =
                  db().lookupObject<cmpTurbModelType>(turbName);
      
              const basicThermo& thermo = turbModel.transport();
      
              const fvPatchScalarField& hep = thermo.he().boundaryField()[patchi];
      
              qDot = turbModel.alphaEff(patchi)*hep.snGrad();
          }
          else if (db().foundObject<basicThermo>(thermoName))
          {
              const basicThermo& thermo = db().lookupObject<basicThermo>(thermoName);
      
              const fvPatchScalarField& hep = thermo.he().boundaryField()[patchi];
      
              qDot = thermo.alpha().boundaryField()[patchi]*hep.snGrad();
          }
          else
          {
              FatalErrorInFunction
                  << "Condition requires either compressible turbulence and/or "
                  << "thermo model to be available" << exit(FatalError);
          }
      

      现在想修改一下这个BC, 让它可以在incompressible solver中也得到’he', 'alpha', 还请大家给点建议!十分感谢!

      1 条回复 最后回复 回复 引用
      • bestucan
        bestucan 版主 副教授 最后由 编辑

        给 incompressible 求解温度部分的代码加个 thermo 的壳(定义一套 thermo 的变量,但没有 thermo 的计算过程,变量的更新由 incompressible solver 完成后赋给它),让其他代码误以为incompressible solver 里有 thermo。如果无法实现,那要改的就太多了。

        :xiezuoye:

        滚来滚去……~(~o ̄▽ ̄)~o 滚来滚去都不能让大家看出来我不是老师么 O_o

        异步沟通方式(《posting style》from wiki)(下载后打开):
        https://www.jianguoyun.com/p/Dc52X2sQsLv2BRiqnKYD
        提问的智慧(github在gitee的镜像):
        https://gitee.com/bestucan/How-To-Ask-Questions-The-Smart-Way/blob/master/README-zh_CN.md

        sibo 1 条回复 最后回复 回复 引用
        • sibo
          sibo @bestucan 最后由 编辑

          @bestucan 感谢回复!加thermo在incomprehensible里面,理论上可以。不过今天试了一下,报错挺多好多需要改。。。并且主要是我们想做一个普适性的BC, 因为会用到多个不可压缩solvers,每个都改太麻烦了。所以还是想从改bc上入手。

          1 条回复 最后回复 回复 引用
          • C
            Cr 最后由 编辑

            或许可以将代码改为用不可压缩求解器求解的边界上的温度和导热率来获得,边界上的传热量。例如:

            if(db().foundObject<volScalarField>("T"))
            {
                const volScalarField& T = db().lookupObject<volScalarField>("T");
                const fvPatchScalarField& Tp = T.boundaryField()[patchi];
                qDot = kappa*Tp.snGrad();
            }
            

            其中kappa需要根据你的物性和边界上的温度场来计算获得

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