Navigation

    CFD中文网

    CFD中文网

    • Login
    • Search
    • 最新

    interFoam和DPMFoam耦合

    OpenFOAM
    2
    6
    2808
    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.
    • 搬
      搬运工不好当 last edited by

      大家好,

      最近我想模拟水中的例子运动,我定义了下面的粘度场:

      volScalarField muc
      (
      IOobject
      (
      "muc",
      runTime.timeName(),
      mesh,
      IOobject::READ_IF_PRESENT,
      IOobject::AUTO_WRITE
      ),
      alpha1*rho1*"nu1" + alpha2*rho2*"nu2",
      alpha1.boundaryField().types()
      );
      

      不通过,谁知道怎么处理?

      李东岳 1 Reply Last reply Reply Quote
      • 李东岳
        李东岳 管理员 @搬运工不好当 last edited by

        @搬运工不好当 Hi,

        从你的代码定义来看,你可以调用:

        twoPhaseProperties.mu();

        他已经在incompressibleTwoPhaseMixture类中定义了。

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

        搬 1 Reply Last reply Reply Quote
        • 搬
          搬运工不好当 @李东岳 last edited by

          @李东岳

          twoPhaseProperties.mu();
          这行代码返回混合粘度? "alpha1rho1nu1+alpha2rho2nu2"?

          李东岳 1 Reply Last reply Reply Quote
          • 李东岳
            李东岳 管理员 @搬运工不好当 last edited by

            @搬运工不好当

            是的,他已经在这里定义了:

            Foam::tmp<Foam::volScalarField>
            Foam::incompressibleTwoPhaseMixture::mu() const
            {
                const volScalarField limitedAlpha1
                (
                    min(max(alpha1_, scalar(0)), scalar(1))
                );
            
                return tmp<volScalarField>
                (
                    new volScalarField
                    (
                        "mu",
                        limitedAlpha1*rho1_*nuModel1_->nu()
                      + (scalar(1) - limitedAlpha1)*rho2_*nuModel2_->nu()
                    )
                );
            }
            

            或许可以参考这篇文章中的公式(21): 链接文本

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

            搬 1 Reply Last reply Reply Quote
            • 搬
              搬运工不好当 @李东岳 last edited by

              @李东岳

              我这么定义的:

              volScalarField muc
              (
              IOobject
              (
              "muc",
              runTime.timeName(),
              mesh,
              IOobject::MUST_READ,
              IOobject::AUTO_WRITE
              ),
              twoPhaseProperties.mu(),
              alpha1.boundaryField().types()
              );
              

              提示

              ‘twoPhaseProperties’ was not declared"

              文档不错,多谢了!

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

                Hi,

                你的twoPhaseProperties没有定义,如果你是在interFoam中调用mu,在interFoam的createFields.H中已经定义了:

                Info<< "Reading transportProperties\n" << endl;
                incompressibleTwoPhaseMixture twoPhaseProperties(U, phi);
                

                所以可以这样写:

                volScalarField& muc(twoPhaseProperties.mu());
                

                试一下。我没有测试,有问题再联系。

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

                1 Reply Last reply Reply Quote
                • First post
                  Last post

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