Navigation

    CFD中文网

    CFD中文网

    • Login
    • Search
    • 最新

    请教:第三代涡识别方法Liutex的代码在linux中运行的问题

    OpenFOAM
    7
    25
    2121
    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.
    • yfleung
      yfleung last edited by

      在浪潮上将liutex程序编译成了一个独立的程序,然后发现算的很慢,256³的网格算了半个月都没有算出一个时间步文件!
      请问哪位大佬能帮我指出问题或者有什么可以并行的方法?
      1602136307(1).png

      这是代码的下载地址:http://www.jhydrodynamics.com/en/download-of-liutex-code/

      yhdthu 1 Reply Last reply Reply Quote
      • bestucan
        bestucan 版主 副教授 last edited by

        真耐心啊,半个月了还能等:jingya:

        万一程序卡死了呢?或者进死循环了。

        如果需要的时间步文件很大,也可以用小时间步写出来,后面删着很快的。出时间步好歹说明正常运行了。这一个时间步都没有,就不是是跑的慢还是没跑了。

        如果时间步是这样的

        0.01 0.011 0.012 0.013 ……
        

        或者这样的

        0.010 0.011 0.012 0.013 ……
        

        那就这样

        mkdir result
        mv 0.0? result
        

        或者这样

        mkdir result
        mv 0.0?0 result
        

        通配符?只匹配一个未知字符,不像*那样。很适合用来给文件分类。
        然后把 result 带走,剩下的删了。写的密集断点续算也方便。

        滚来滚去……~(~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/blob/master/README-zh_CN.md

        yfleung 1 Reply Last reply Reply Quote
        • 小
          小张同学 last edited by

          有没有试着用那个fluent的呀

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

            @yfleung 在 请教:第三代涡识别方法Liutex的代码在linux中运行的问题 中说:

            然后发现算的很慢,256³的网格算了半个月都没有算出一个时间步文件!

            这只是一个后处理程序,我这面3300万网格,算出来了Q应该在分钟级别,你那面是不是操作不对。

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

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

              @东岳 我检查了一下,程序可以并行了。程序应该是没有问题的。我算了一个64³网格的,大概15s出一个文件夹的数据。但是256³的算了一天还是没有出一个。我发现我并行之后只有一个结点是有负载的,其他好像没有起作用?想请教一下,有人知道可能原因吗?fff.png

              1 Reply Last reply Reply Quote
              • yfleung
                yfleung @bestucan last edited by

                @bestucan 谢谢,应该不是程序的问题。现在可以并行了,但是发现并行之后好像只有一个结点起作用的。:143: fff.png

                bestucan 1 Reply Last reply Reply Quote
                • bestucan
                  bestucan 版主 副教授 @yfleung last edited by

                  @yfleung 呃,那就看看$64^3$网格的时候用几个节点呀。一个节点基本就是一个主机了。大机器不是很重的任务分一个节点也差不多了。

                  看64分到几个节点,如果也是一个呢。

                  调试阶段还是时间步越小越好。确定正常工作了再调大:xiezuoye:

                  滚来滚去……~(~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/blob/master/README-zh_CN.md

                  1 Reply Last reply Reply Quote
                  • 荷
                    荷兰后腰阿贾克斯 last edited by

                    @yfleung 请问是编译完成了把exe拷贝到case目录下直接运行就可以吗?不知道是不是版本太新了ReadingU之后直接崩溃了(Uheader已经改过来了)
                    r.png

                    五好青年 1 Reply Last reply Reply Quote
                    • 五好青年
                      五好青年 @荷兰后腰阿贾克斯 last edited by

                      @荷兰后腰阿贾克斯 exe拷贝到case目录下直接运行???

                      I am a CFD machine with no emotions. Welcome to browse my Bilibili, search: seeeeeeeeeeer

                      1 Reply Last reply Reply Quote
                      • 五好青年
                        五好青年 last edited by

                        您好,请问怎么解决的呢?
                        我用Liutex后处理1万网格,大概20s出一个时间序列文件夹。
                        处理400万网格,2天了一个时间结果都没出来,一直在下面的界面,我用3台电脑同时尝试,结果都是这样。
                        请问楼主怎么解决的呢
                        af724fdd-7fab-41b4-9182-39aebe07c4fb-image.png

                        I am a CFD machine with no emotions. Welcome to browse my Bilibili, search: seeeeeeeeeeer

                        李东岳 1 Reply Last reply Reply Quote
                        • 李东岳
                          李东岳 管理员 @五好青年 last edited by

                          应该是算法上本身在处理某种计算 看看公式 看看那部分处理比较耗时间

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

                          五好青年 2 Replies Last reply Reply Quote
                          • 五好青年
                            五好青年 @李东岳 last edited by

                            @yfleung @荷兰后腰阿贾克斯 @波流力
                            请问你们的Liutex,后处理一个时间文件夹,大概多久呢?

                            I am a CFD machine with no emotions. Welcome to browse my Bilibili, search: seeeeeeeeeeer

                            1 Reply Last reply Reply Quote
                            • 五好青年
                              五好青年 @李东岳 last edited by

                              @李东岳
                              但是别人文献说,这个就是个后处理。计算速度和使用方法类似OpenFOAM自带的Q和Vorticity。
                              但是目前网上开源的那个代码,就是遇到网格50万以上,运行2天没反应。
                              东岳老师,能帮忙看下代码,提示下可能是代码哪里问题吗?
                              感谢!

                              I am a CFD machine with no emotions. Welcome to browse my Bilibili, search: seeeeeeeeeeer

                              李东岳 1 Reply Last reply Reply Quote
                              • 李东岳
                                李东岳 管理员 @五好青年 last edited by

                                @五好青年 http://www.jhydrodynamics.com/en/download-of-liutex-code/

                                是这个代码么?我对liutex的计算方法不熟悉。但肯定是代码里面什么地方某个算法卡住了。

                                1. 这种期刊的代码可以直接找通讯作者交流类似的技术问题。

                                2. https://www.cfd-china.com/topic/3499 在这里面有一个获取某个函数的计算时间,你可以放在代码里面看看哪里的计算时间比较长,卡在哪里了。

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

                                五好青年 1 Reply Last reply Reply Quote
                                • 五好青年
                                  五好青年 @李东岳 last edited by

                                  @李东岳 在 请教:第三代涡识别方法Liutex的代码在linux中运行的问题 中说:

                                  计算时间

                                  谢谢东岳老师

                                  I am a CFD machine with no emotions. Welcome to browse my Bilibili, search: seeeeeeeeeeer

                                  李东岳 1 Reply Last reply Reply Quote
                                  • 李东岳
                                    李东岳 管理员 @五好青年 last edited by

                                    @五好青年 我把这个帖子发到刘老师那面有个群里面去了,但目前没啥反馈。你这面有啥结果,告诉我。搞不定的话,我给你调试。

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

                                    五好青年 1 Reply Last reply Reply Quote
                                    • 五好青年
                                      五好青年 @李东岳 last edited by

                                      @李东岳
                                      目前我将cavity算例改成三维,三个方向网格相同,试算了后进行Liutex后处理。记录如下:
                                      30^3网格 单核,Liutex处理时间:4s
                                      35^3网格 单核,Liutex处理时间:14s
                                      40^3网格 单核,Liutex处理时间:60s
                                      45^3网格 单核,单核,Liutex处理时间:131s
                                      50^3网格 Liutex处理时间:327s
                                      55^3网格 单核,浮点溢出
                                      58^3网格 单核,浮点溢出
                                      60^3网格 单核,浮点溢出
                                      70^3网格 单核,浮点溢出
                                      80^3网格 4核并行后处理,报错

                                      300万网格以前的算例,扩大机器内存,单核处理3天了,还没出结果

                                      I am a CFD machine with no emotions. Welcome to browse my Bilibili, search: seeeeeeeeeeer

                                      李东岳 1 Reply Last reply Reply Quote
                                      • 李东岳
                                        李东岳 管理员 @五好青年 last edited by 李东岳

                                        @五好青年

                                        #include <chrono>
                                        
                                        auto start = std::chrono::steady_clock::now();                                                   
                                        // Functions here
                                        auto end = std::chrono::steady_clock::now();                                                     
                                        auto diff = end - start;
                                        Info<< "Calculation using " 
                                            << std::chrono::duration <double, std::milli> (diff).count()                                 
                                            << " ms" << endl;
                                        

                                        你可以用上段代码测试哪个函数运行时间比较长

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

                                        1 Reply Last reply Reply Quote
                                        • yhdthu
                                          yhdthu 讲师 @yfleung last edited by

                                          @yfleung jhd上的代码有bug,且效率低,我自己重写可用。
                                          https://cloud.tsinghua.edu.cn/d/05b0149e37904e7ca61c/

                                          长风破浪会有时,直挂云帆济沧海

                                          五好青年 李东岳 3 Replies Last reply Reply Quote
                                          • 五好青年
                                            五好青年 @yhdthu last edited by

                                            @yhdthu
                                            谢谢海东博士,请问您这个是在OpenFOAM的哪个版本实现的呢?

                                            I am a CFD machine with no emotions. Welcome to browse my Bilibili, search: seeeeeeeeeeer

                                            五好青年 1 Reply Last reply Reply Quote
                                            • 五好青年
                                              五好青年 @五好青年 last edited by

                                              已测试,OpenFOAM-2006以上版本
                                              感谢

                                              I am a CFD machine with no emotions. Welcome to browse my Bilibili, search: seeeeeeeeeeer

                                              1 Reply Last reply Reply Quote
                                              • 五好青年
                                                五好青年 @yhdthu last edited by

                                                @yhdthu
                                                您好
                                                我尝试往OF官网版本上移植,提示了一些报错,主要有:error: ‘complex’ was not declared in this scope
                                                经过很久的折腾,发现您可能参考tensor.C文件来修改的,并且我对比了OpenFOAM低版本的tensor.C来逐个修改报错,但是始终没能解决。
                                                可否帮忙帮忙编一个低版本的,或者给一些修改的思路
                                                感谢

                                                dyfluid@dyfluid:~/postVersion$ wclean
                                                dyfluid@dyfluid:~/postVersion$ wmake
                                                Making dependency list for source file Liutex.C
                                                SOURCE=Liutex.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-100 -I/home/dyfluid/OpenFOAM/OpenFOAM-2.4.x/src/finiteVolume/lnInclude -I/home/dyfluid/OpenFOAM/OpenFOAM-2.4.x/src/meshTools/lnInclude -IlnInclude -I. -I/home/dyfluid/OpenFOAM/OpenFOAM-2.4.x/src/OpenFOAM/lnInclude -I/home/dyfluid/OpenFOAM/OpenFOAM-2.4.x/src/OSspecific/POSIX/lnInclude   -fPIC -c $SOURCE -o Make/linux64GccDPOpt/Liutex.o
                                                Liutex.C: In function ‘Foam::vector getZdEVec(const tensor&)’:
                                                Liutex.C:44:18: error: ‘complex’ was not declared in this scope
                                                     const Vector<complex> EVals(eigenValues(T));
                                                                  ^
                                                Liutex.C:44:25: error: template argument 1 is invalid
                                                     const Vector<complex> EVals(eigenValues(T));
                                                                         ^
                                                Liutex.C:44:47: error: cannot convert ‘Foam::vector {aka Foam::Vector<double>}’ to ‘const int’ in initialization
                                                     const Vector<complex> EVals(eigenValues(T));
                                                                                               ^
                                                Liutex.C:46:25: error: type/value mismatch at argument 1 in template parameter list for ‘template<class Cmpt> class Foam::Vector’
                                                     const Vector<complex> standardBasis1(Zero, pTraits<complex>::one, Zero);
                                                                         ^
                                                Liutex.C:46:25: note:   expected a type, got ‘complex’
                                                Liutex.C:46:42: error: ‘Zero’ was not declared in this scope
                                                     const Vector<complex> standardBasis1(Zero, pTraits<complex>::one, Zero);
                                                                                          ^
                                                Liutex.C:46:63: error: type/value mismatch at argument 1 in template parameter list for ‘template<class PrimitiveType> class Foam::pTraits’
                                                     const Vector<complex> standardBasis1(Zero, pTraits<complex>::one, Zero);
                                                                                                               ^
                                                Liutex.C:46:63: note:   expected a type, got ‘complex’
                                                Liutex.C:46:75: error: expression list treated as compound expression in initializer [-fpermissive]
                                                     const Vector<complex> standardBasis1(Zero, pTraits<complex>::one, Zero);
                                                                                                                           ^
                                                Liutex.C:47:25: error: type/value mismatch at argument 1 in template parameter list for ‘template<class Cmpt> class Foam::Vector’
                                                     const Vector<complex> standardBasis2(Zero, Zero, pTraits<complex>::one);
                                                                         ^
                                                Liutex.C:47:25: note:   expected a type, got ‘complex’
                                                Liutex.C:47:69: error: type/value mismatch at argument 1 in template parameter list for ‘template<class PrimitiveType> class Foam::pTraits’
                                                     const Vector<complex> standardBasis2(Zero, Zero, pTraits<complex>::one);
                                                                                                                     ^
                                                Liutex.C:47:69: note:   expected a type, got ‘complex’
                                                Liutex.C:47:75: error: expression list treated as compound expression in initializer [-fpermissive]
                                                     const Vector<complex> standardBasis2(Zero, Zero, pTraits<complex>::one);
                                                                                                                           ^
                                                Liutex.C:48:25: error: type/value mismatch at argument 1 in template parameter list for ‘template<class Cmpt> class Foam::Vector’
                                                     const Vector<complex> EVec
                                                                         ^
                                                Liutex.C:48:25: note:   expected a type, got ‘complex’
                                                Liutex.C:50:30: error: request for member ‘x’ in ‘EVals’, which is of non-class type ‘const int’
                                                         eigenVector(T, EVals.x(), standardBasis1, standardBasis2)
                                                                              ^
                                                Liutex.C:53:23: error: request for member ‘x’ in ‘EVec’, which is of non-class type ‘const int’
                                                     vector EVecR(EVec.x().real(), EVec.y().real(), EVec.z().real());
                                                                       ^
                                                Liutex.C:53:40: error: request for member ‘y’ in ‘EVec’, which is of non-class type ‘const int’
                                                     vector EVecR(EVec.x().real(), EVec.y().real(), EVec.z().real());
                                                                                        ^
                                                Liutex.C:53:57: error: request for member ‘z’ in ‘EVec’, which is of non-class type ‘const int’
                                                     vector EVecR(EVec.x().real(), EVec.y().real(), EVec.z().real());
                                                                                                         ^
                                                Liutex.C: In function ‘Foam::tensor rotation(const vector&)’:
                                                Liutex.C:62:14: error: ‘Zero’ was not declared in this scope
                                                     tensor q(Zero); 
                                                              ^
                                                Liutex.C: In function ‘Foam::vector liutex(const tensor&, const vector&)’:
                                                Liutex.C:100:19: error: ‘Zero’ was not declared in this scope
                                                     vector liutex(Zero);
                                                                   ^
                                                Liutex.C: In function ‘int main(int, char**)’:
                                                Liutex.C:156:48: error: ‘Zero’ was not declared in this scope
                                                             dimensionedVector("zero", dimless, Zero)
                                                                                                ^
                                                Liutex.C:158:39: error: ‘Foam::volVectorField {aka class Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>}’ has no member named ‘primitiveFieldRef’
                                                         vectorField& iLiutex = Liutex.primitiveFieldRef();
                                                                                       ^
                                                Liutex.C:174:43: error: ‘Foam::volTensorField {aka class Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh>}’ has no member named ‘primitiveField’
                                                         const tensorField& iGradU = gradU.primitiveField();
                                                                                           ^
                                                Liutex.dep:674: recipe for target 'Make/linux64GccDPOpt/Liutex.o' failed
                                                make: *** [Make/linux64GccDPOpt/Liutex.o] Error 1
                                                dyfluid@dyfluid:~/postVersion$ 
                                                
                                                
                                                

                                                I am a CFD machine with no emotions. Welcome to browse my Bilibili, search: seeeeeeeeeeer

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

                                                  @yhdthu 你写的看起来比期刊上的那个neat很多:146:

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

                                                  五好青年 1 Reply Last reply Reply Quote
                                                  • 五好青年
                                                    五好青年 @李东岳 last edited by

                                                    测试了一下这个程序,给大家反馈下

                                                    1. OpenFOAM-v2006以上可用
                                                    2. OpenFOAM-8调试好了,编译没报错,但是处理算例报错
                                                    3. foam-extend4.1上,调试好了,但是不识别浸入边界

                                                    目前只能在高版本上用了,如果谁编译了低版本,记得回来分享下啊

                                                    I am a CFD machine with no emotions. Welcome to browse my Bilibili, search: seeeeeeeeeeer

                                                    五好青年 1 Reply Last reply Reply Quote
                                                    • 五好青年
                                                      五好青年 @五好青年 last edited by

                                                      东岳老师,能不能分享一个空的Ubuntu虚拟机出来呢。我记得以前是有的呢,但是找不到啦。
                                                      这样我在空的ubuntu系统上,尝试装一下不同版本,安装完我再反馈提供给您。分享给CFD中文网的Fans

                                                      I am a CFD machine with no emotions. Welcome to browse my Bilibili, search: seeeeeeeeeeer

                                                      1 Reply Last reply Reply Quote
                                                      • First post
                                                        Last post

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