Navigation

    CFD中文网

    CFD中文网

    • Login
    • Search
    • 最新

    程序中防止分母为0的情况?

    OpenFOAM
    2
    9
    4472
    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.
    • M
      mark last edited by

      谁能用google啊,帮我搜一下VSMALL

      Wayne 1 Reply Last reply Reply Quote
      • Wayne
        Wayne @mark last edited by Wayne

        GREAT = 1.0e+6;
        VGREAT = 1.0e+37;
        ROOTVGREAT = 1.0e+18;
        SMALL = 1.0e-6;
        VSMALL = 1.0e-37;
        ROOTVSMALL = 1.0e-18

        Blog: http://blog.sina.com.cn/multiphyzks
        RG:https://www.researchgate.net/profile/Yan_Wang154

        1 Reply Last reply Reply Quote
        • M
          mark last edited by

          很感谢

          1 Reply Last reply Reply Quote
          • M
            mark last edited by

            volScalarField alphalCoeff(1.0/rho1() - alpha1_*(1.0/rho1() - 1.0/rho2()));
            rho1() 不为0 rho2()为0  密度2由于空化产生, 怎样用VSMALL方法解决这种问题呢?

            Wayne 1 Reply Last reply Reply Quote
            • Wayne
              Wayne @mark last edited by

              @mark 1/(分母+VSMALL)

              Blog: http://blog.sina.com.cn/multiphyzks
              RG:https://www.researchgate.net/profile/Yan_Wang154

              M 1 Reply Last reply Reply Quote
              • M
                mark @Wayne last edited by mark

                @Wayne @李东岳
                0_1461243195636_QQ截图20160421205531.png 这样做运行还出错是什么原因呢?缺别的代码?

                1 Reply Last reply Reply Quote
                • M
                  mark last edited by

                  0_1461244034760_QQ截图20160421211455.png

                  1 Reply Last reply Reply Quote
                  • Wayne
                    Wayne last edited by

                    sigSegv错误,和之前报错不一样,是访问了未定义的内存。

                    Blog: http://blog.sina.com.cn/multiphyzks
                    RG:https://www.researchgate.net/profile/Yan_Wang154

                    M 1 Reply Last reply Reply Quote
                    • M
                      mark @Wayne last edited by

                      @Wayne 在openfoam里面, 访问未定义的内存是什么意思呢?

                      1 Reply Last reply Reply Quote
                      • First post
                        Last post

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