CFD中文网

    CFD中文网

    • 登录
    • 搜索
    • 最新

    一些constrainPressure的疑问

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

      先贴icofoam中的一段代码

                  adjustPhi(phiHbyA, U, p);
      
                  // Update the pressure BCs to ensure flux consistency
                  constrainPressure(p, U, phiHbyA, rAU);
      

      疑问是constrainPressure是做什么用的?有的求解器前面跟了adjustPhi,像icofoam,adjustPhi是修正压力边界使连续性方程有解,有的求解器像buoyantBoussinesqPimpleFoam没有adjustPhi只有constrainPressure。
      再来看constrainPressure的代码

      forAll(pBf, patchi)
          {
              if (isA<fixedFluxPressureFvPatchScalarField>(pBf[patchi]))
              {
                  refCast<fixedFluxPressureFvPatchScalarField>
                  (
                      pBf[patchi]
                  ).updateCoeffs
                  (
                      (
                          phiHbyABf[patchi]
                        - rho.boundaryField()[patchi]
                         *MRF.relative(SfBf[patchi] & UBf[patchi], patchi)
                      )
                     /(magSfBf[patchi]*rhorAUBf[patchi])
                  );
              }
          }
      }
      

      所以以上代码的意思是压力的边界条件如果是fixedFluxPressure,那么压力的边界面法向梯度等于

      (边界流量 - 边界流量)/网格面积*密度/Uequ.A() ????????这不成0了

      完全一脸茫然??????这干嘛用的,有啥意义呢?

      1 条回复 最后回复 回复 引用
      • 麦迪文
        麦迪文 最后由 编辑

        。。。。。。自问自答 ,汗

        phiHbyABf不是边界流量。。。。

        所以以下代码应该是符合动量方程,猜测可能是进入压力PISO循环之前修改下边界条件的系数

                        (
                            phiHbyABf[patchi]
                          - rho.boundaryField()[patchi]
                           *MRF.relative(SfBf[patchi] & UBf[patchi], patchi)
                        )
                       /(magSfBf[patchi]*rhorAUBf[patchi])
        
        1 条回复 最后回复 回复 引用
        • First post
          Last post