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. denseParticleFoam中动量源项的求解

denseParticleFoam中动量源项的求解

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

    各位老师、大佬,最近在看denseParticleFoam求解器,不太清楚动量方程中的源项矩阵cloudSU具体是怎么求出来的,我目前找到这里,求大家指点一下我:
    :135:

    求解器中,在createFields文件中,创建了一个parcelCloudList类:

    parcelCloudList clouds(rhoc, Uc, muc, g);
    

    随后在计算过程中创建了这个源项的矩阵cloudSU? 应该是通过计算出来的源项场 clouds.SU(Uc) 构造的 ?如下:

    fvVectorMatrix cloudSU(clouds.SU(Uc));
    

    parcelCloudList类中的 SU 函数如下:

    Foam::tmp<Foam::fvVectorMatrix> Foam::parcelCloudList::SU
    (  
    const volVectorField& U 
    ) const
    {
        tmp<fvVectorMatrix> tSU(new fvVectorMatrix(U, dimMass*dimAcceleration));**
      forAll(*this, i)
        {
            tSU.ref() += operator[](i).SU(U);
        }
        return tSU;
    }
    

    这里想问一下:我理解成,parcelCloudList类继承自PtrList<parcelCloud>类,operator返回了PtrList<parcelCloud>类中指向的第i个parcelCloud类成员的指针,是这个意思吗?也就是说这里的tSU.ref()遍历了PtrList中的所有粒子团的指针然后把每一个粒子团所属类的parcelCloud.SU函数的返回值相加了得到了一个源项的场,可以这么理解吗?

    parcelCloud类的SU函数

     tmp<fvVectorMatrix> SU(const volVectorField& U) const
    {
         return tmp<fvVectorMatrix>
         (
              new fvVectorMatrix(U, dimMass*dimAcceleration)
          );
    }
    

    但是在这里,parcelCloud中的SU函数又是怎么返回一个动量源项的值的呢?new这里实在是看不懂什么意思了!!!包括我看设置文件中,还可以选用WenYu曳力模型等,现在搞不清楚求解器在哪读取了这些相关设置,又是如何计算的。

    求来大佬/老师帮忙看看吧!!!

    1 条回复 最后回复
  • 李东岳李 在线
    李东岳李 在线
    李东岳 管理员
    写于 最后由 编辑
    #2

    也就是说这里的tSU.ref()遍历了PtrList中的所有粒子团的指针然后把每一个粒子团所属类的parcelCloud.SU函数的返回值相加了得到了一个源项的场,可以这么理解吗?

    你的理解是对的

    http://dyfluid.com/EL.html

    http://dyfluid.com/index.html
    需要帮助debug算例的看这个 https://cfd-china.com/topic/8018

    李 1 条回复 最后回复
  • 李 离线
    李 离线
    李炳锐
    在 中回复了 李东岳 最后由 李炳锐 编辑
    #3

    @李东岳 感谢李老师回复,我才注意到老师已经写过这个求解器的算法分析了。
    但是我还是不太清楚operator.SU(U)调用的是什么函数,如果按我的理解,它调用的是这个,因为parcelCloud继承自ParcelCloudBase:

    class ParcelCloudBase
    :
        public Cloud<ParticleType>,
        virtual public parcelCloudBase
    {
    public:
    tmp<fvVectorMatrix> SU(const volVectorField& U) const
                    {
                        return tmp<fvVectorMatrix>
                        (
                            new fvVectorMatrix(U, dimMass*dimAcceleration)
                        );
                    }
    }
    
    

    但是我看李老师写的文章,似乎实际用的是这个

    code_texttemplate<class CloudType>
    inline Foam::tmp<Foam::fvVectorMatrix>
    Foam::MomentumCloud<CloudType>::SU(const volVectorField& U) const
    {
        if (debug)
        {
            Info<< "UTrans min/max = " << min(UTrans()).value() << ", "
                << max(UTrans()).value() << nl
                << "UCoeff min/max = " << min(UCoeff()).value() << ", "
                << max(UCoeff()).value() << endl;
        }
    
        if (solution_.coupled())
        {
            if (solution_.semiImplicit("U"))
            {
                const volScalarField::Internal
                    Vdt(this->mesh().V()*this->db().time().deltaT());
    
                return UTrans()/Vdt - fvm::Sp(UCoeff()/Vdt, U) + UCoeff()/Vdt*U;
            }
            else
            {
                tmp<fvVectorMatrix> tfvm(new fvVectorMatrix(U, dimForce));
                fvVectorMatrix& fvm = tfvm.ref();
    
                fvm.source() = -UTrans()/(this->db().time().deltaT());
    
                return tfvm;
            }
        }
    
        return tmp<fvVectorMatrix>(new fvVectorMatrix(U, dimForce));
    }
    

    我有点搞不清,想再请教一下李老师

    1 条回复 最后回复
  • 李东岳李 在线
    李东岳李 在线
    李东岳 管理员
    写于 最后由 编辑
    #4

    ParcelCloudBase里面是提供了SU这个功能,但是在MomentumCloud这里面提供具体的SU功能后,ParcelCloudBase里面是提供了SU就被覆盖掉了。有一些cloud不需要SU功能。那么就使用的ParcelCloudBase里得SU,返回一个0。

    http://dyfluid.com/index.html
    需要帮助debug算例的看这个 https://cfd-china.com/topic/8018

    李 1 条回复 最后回复
  • 李东岳李 在线
    李东岳李 在线
    李东岳 管理员
    写于 最后由 编辑
    #5

    这个求解器在顶层比较有意思的地方在于cloudSU的处理,新版本有3个方法,旧版本有1个方法,改天我更新一下

    http://dyfluid.com/index.html
    需要帮助debug算例的看这个 https://cfd-china.com/topic/8018

    1 条回复 最后回复
  • 李 离线
    李 离线
    李炳锐
    在 中回复了 李东岳 最后由 编辑
    #6

    @李东岳 期待!谢谢老师

    1 条回复 最后回复
  • 李东岳李 在线
    李东岳李 在线
    李东岳 管理员
    写于 最后由 李东岳 编辑
    #7

    http://dyfluid.com/EL.html

    我更新了一下semiImplicit这部分内容,你看看。还有一些没弄完。下次继续弄3个方法。或者你可以自己看一下:faceExplicitCellImplicit\faceExplicitCellLagged\faceImplicit

    http://dyfluid.com/index.html
    需要帮助debug算例的看这个 https://cfd-china.com/topic/8018

    李 1 条回复 最后回复
  • 李 离线
    李 离线
    李炳锐
    在 中回复了 李东岳 最后由 李炳锐 编辑
    #8

    @李东岳 太好了!学习中!:142: :142: :142: :ok3:

    1 条回复 最后回复

  • 登录

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