Skip to content
  • 最新
  • 版块
  • 东岳流体
  • 随机看[请狂点我]
皮肤
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • 默认(不使用皮肤)
  • 不使用皮肤
折叠
CFD中文网

CFD中文网

  1. CFD中文网
  2. OpenFOAM
  3. kinematicCloud.SU(Uc)的返回值

kinematicCloud.SU(Uc)的返回值

已定时 已固定 已锁定 已移动 OpenFOAM
2 帖子 2 发布者 1.6k 浏览
  • 从旧到新
  • 从新到旧
  • 最多赞同
回复
  • 在新帖中回复
登录后回复
此主题已被删除。只有拥有主题管理权限的用户可以查看。
  • J 离线
    J 离线
    Jasper 0
    写于 最后由 编辑
    #1

    大家好,我想请教一下调用momentum source函数的时候,返回值是哪一个?在KinematicCloudI.H中有这个函数的定义:

    template<class CloudType>
     inline Foam::tmp<Foam::fvVectorMatrix>
     Foam::KinematicCloud<CloudType>::SU(volVectorField& U, bool incompressible)
     const
     {
         if (debug)
         {
             Pout<< "UTrans min/max = " << min(UTrans()).value() << ", "
                 << max(UTrans()).value() << nl
                 << "UCoeff min/max = " << min(UCoeff()).value() << ", "
                 << max(UCoeff()).value() << endl;
         }
      
         dimensionSet dim(dimForce);
         if (incompressible)
         {
             dim.reset(dimForce/dimDensity);
         }
      
         if (solution_.coupled())
         {
             if (solution_.semiImplicit("U"))
             {
                 volScalarField::Internal
                     Vdt(mesh_.V()*this->db().time().deltaT());
      
                 if (incompressible)
                 {
                     Vdt.dimensions() *= dimDensity;
                 }
      
                 return UTrans()/Vdt - fvm::Sp(UCoeff()/Vdt, U) + UCoeff()/Vdt*U;
             }
             else
             {
                 tmp<fvVectorMatrix> tfvm(new fvVectorMatrix(U, dim));
                 fvVectorMatrix& fvm = tfvm.ref();
      
                 fvm.source() = -UTrans()/(this->db().time().deltaT());
      
                 return tfvm;
             }
         }
      
         return tmp<fvVectorMatrix>::New(U, dim);
     }
    

    在调用这个函数的时候,如果我用semiImplicit格式的话,返回的是

    return UTrans()/Vdt - fvm::Sp(UCoeff()/Vdt, U) + UCoeff()/Vdt*U;
    

    还是

    return tmp<fvVectorMatrix>::New(U, dim);
    

    呢?
    我认为返回的应该是后者吧 tmp<fvVectorMatrix>::New(U, dim);
    我想知道它是什么意思呢?

    1 条回复 最后回复
  • bestucanB 离线
    bestucanB 离线
    bestucan 版主 大神
    写于 最后由 编辑
    #2

    把 return 挨个屏蔽,看看屏蔽了哪个报错。。。:yes:
    就知道调用哪个了

    我想知道它是什么意思呢?

    好像是用 u 和 dim 初始化了一个新的 fvVectorMatrix 类型的变量

    滚来滚去……~(~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

    1 条回复 最后回复

  • 登录

  • 登录或注册以进行搜索。
  • 第一个帖子
    最后一个帖子
0
  • 最新
  • 版块
  • 东岳流体
  • 随机看[请狂点我]