Navigation

    CFD中文网

    CFD中文网

    • Login
    • Search
    • 最新

    turbulence->validate有何意义

    OpenFOAM
    3
    5
    675
    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.
    • evensun
      evensun last edited by 李东岳

      如题,想请教一下各位前辈turbulence->validate这行代码的意义,我用抓取字符串的方式并没有在openfoam源码中找到解释,感到奇怪(当然大概率是我找的方式不对),网上也没有找到介绍
      其实除了turbulence->validate,laminarTransport.correct()和turbulence->correct()也都不太明白其具体意义,如果可以的话有大佬能帮我指出其对应软件中的源码吗,感激不尽:baobao:

      1 Reply Last reply Reply Quote
      • evensun
        evensun last edited by 李东岳

        各位老师我找到了,在openfoam API Guide里,是这么写的

        ◆ validate()
        void validate	(		)	
        virtual
        Validate the turbulence fields after construction.
        Update derived fields as required
        Definition at line 89 of file turbulenceModel.C.
        ◆ correct()
        void correct	(		)	
        pure virtual
        Solve the turbulence equations and correct the turbulence viscosity.
        Definition at line 93 of file turbulenceModel.C.
        

        网址在这里https://www.openfoam.com/documentation/guides/latest/api/classFoam_1_1turbulenceModel.html#details

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

          你问的大体属于C++的内容,主要是这两个符号吧?->,这个表示指针。具体指针如何用,估计在这里是解释不清楚了。可以找一本C++教材看看,我推荐C++ primer plus

          CFD课程 改成线上了 http://dyfluid.com/class.html
          CFD高性能服务器 http://dyfluid.com/servers.html

          1 Reply Last reply Reply Quote
          • 刘
            刘雄国 last edited by 李东岳

            其实也不难,你用grep大概能猜出个所以然来。
            grep -rn "validate"
            其他都是空函数只有一个函数有点意思

            template<class BasicTurbulenceModel>
            void Foam::ReynoldsStress<BasicTurbulencemModel>::validate()
            {
                       correctNut();
            }
            

            然后我又grep 了correctNut()
            常用的是kOmega 我看了下

            template<class BasicTurbulenceModel>
            void kOmega<BasicTurbulenceModel>::correctNut()
            {
                 this->nut_ = k_/omega_;
                 correctBC;
                 BasicTurbulenceModel::correctNut():
            }
            

            我虽然没有一行行debug, 大概猜出来就是湍流初始化。最开始给定k omega 初始值计算出第一步的nut 初始值给k omega方程,即previous time step,欢迎指正。

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

              This post is deleted!
              1 Reply Last reply Reply Quote
              • First post
                Last post

              CFD中文网 | 东岳流体 | 京ICP备15017992号-2