请教:第三代涡识别方法Liutex的代码在linux中运行的问题
-
在浪潮上将liutex程序编译成了一个独立的程序,然后发现算的很慢,256³的网格算了半个月都没有算出一个时间步文件!
请问哪位大佬能帮我指出问题或者有什么可以并行的方法?这是代码的下载地址:http://www.jhydrodynamics.com/en/download-of-liutex-code/
-
真耐心啊,半个月了还能等
万一程序卡死了呢?或者进死循环了。
如果需要的时间步文件很大,也可以用小时间步写出来,后面删着很快的。出时间步好歹说明正常运行了。这一个时间步都没有,就不是是跑的慢还是没跑了。
如果时间步是这样的
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 带走,剩下的删了。写的密集断点续算也方便。 -
@五好青年 http://www.jhydrodynamics.com/en/download-of-liutex-code/
是这个代码么?我对liutex的计算方法不熟悉。但肯定是代码里面什么地方某个算法卡住了。
-
这种期刊的代码可以直接找通讯作者交流类似的技术问题。
-
https://www.cfd-china.com/topic/3499 在这里面有一个
获取某个函数的计算时间
,你可以放在代码里面看看哪里的计算时间比较长,卡在哪里了。
-
-
@李东岳
目前我将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天了,还没出结果
-
#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;
你可以用上段代码测试哪个函数运行时间比较长
-
@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$
-
@yhdthu 在 请教:第三代涡识别方法Liutex的代码在linux中运行的问题 中说:
@yfleung jhd上的代码有bug,且效率低,我自己重写可用。
https://cloud.tsinghua.edu.cn/d/05b0149e37904e7ca61c/你好,这个下载地址已经失效了,能否再提供一下吗,非常感谢
-
1、李老师,我用
OpenFOAM-8
编译了这个程序,编译过程提示有一些未使用变量,但能正常编译。Making dependency list for source file Rotex.C g++ -std=c++11 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3 -DNoRepository -ftemplate-depth-100 -I/home/install/OpenFOAM/OpenFOAM-8/src/finiteVolume/lnInclude -I/home/install/OpenFOAM/OpenFOAM-8/src/meshTools/lnInclude -IlnInclude -I. -I/home/install/OpenFOAM/OpenFOAM-8/src/OpenFOAM/lnInclude -I/home/install/OpenFOAM/OpenFOAM-8/src/OSspecific/POSIX/lnInclude -fPIC -c Rotex.C -o Make/linux64GccDPInt32Opt/Rotex.o Rotex.C: In function \u2018int main(int, char**)\u2019: Rotex.C:153:20: warning: unused variable \u2018eig1c_r\u2019 [-Wunused-variable] 153 | scalar eig1c_r=-0.5*(aaaa+bbbb)-aa/3.0; | ^~~~~~~ Rotex.C:154:20: warning: unused variable \u2018eig1c_i\u2019 [-Wunused-variable] 154 | scalar eig1c_i=0.5*Foam::sqrt(scalar(3.0))*(aaaa-bbbb); | ^~~~~~~ Rotex.C:155:20: warning: unused variable \u2018eig2c_r\u2019 [-Wunused-variable] 155 | scalar eig2c_r=-0.5*(aaaa+bbbb)-aa/3.0; | ^~~~~~~ Rotex.C:156:20: warning: unused variable \u2018eig2c_i\u2019 [-Wunused-variable] 156 | scalar eig2c_i=-0.5*Foam::sqrt(scalar(3.0))*(aaaa-bbbb); | ^~~~~~~ g++ -std=c++11 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3 -DNoRepository -ftemplate-depth-100 -I/home/install/OpenFOAM/OpenFOAM-8/src/finiteVolume/lnInclude -I/home/install/OpenFOAM/OpenFOAM-8/src/meshTools/lnInclude -IlnInclude -I. -I/home/install/OpenFOAM/OpenFOAM-8/src/OpenFOAM/lnInclude -I/home/install/OpenFOAM/OpenFOAM-8/src/OSspecific/POSIX/lnInclude -fPIC -fuse-ld=bfd -Xlinker --add-needed -Xlinker --no-as-needed Make/linux64GccDPInt32Opt/Rotex.o -L/home/install/OpenFOAM/OpenFOAM-8/platforms/linux64GccDPInt32Opt/lib \ -lfiniteVolume -lfvOptions -lmeshTools -lOpenFOAM -ldl \ -lm -o /home/user1/OpenFOAM/user1-8/platforms/linux64GccDPInt32Opt/bin/Rotex
2、提供4个加载CDRFG脉动风的空风洞算例结果下载链接:
(1)3个算例用snappyHexMesh画的六面体网格,数量分别为9.6w,150w,364w。
(2)1个算例用fluentmeshing画的poly网格,网格数量为141w
(3)RotexCase下载链接:
链接:https://pan.baidu.com/s/1HQZkWVg2-ZKUF8SmqwkwOg
提取码:fgzl3、测试结果
(1)9.6w SHM网格算例,Rotex
用单核、并行都能正常计算,单核40 s
,并行20核计算用0.36 s
。但用paraview看后处理结果,虽然可以看到Rotex数据,但由于Rotex输出的结果为矢量,画contour图的时候,选项找不到Rotex,但能选择Lambda2
和Q
画等值面图。
问题是采用Liutex如何画出三维形状的涡?
这是选择Rotex画出来的纵向截面图:
这是选择Q准则画出的涡形状:
(2)150w SHM网格算例。
Rotex
并行20核计算用时127 s
。(3)364w SHM网格算例。
Rotex
并行20核计算用时1855 s
。可以看出运行Rotex随着网格增加,运行时间是非线性增加的。(4)141w poly网格算例。
Rotex
并行20核计算,报错Floating point exception
,但运行Lambda2
和Q
画等值面图,能正常运行。Time = 9 Reading U [4] #0 Foam::error::printStack(Foam::Ostream&) at ??:? [4] #1 Foam::sigFpe::sigHandler(int) at ??:? [4] #2 ? in "/lib64/libc.so.6" [4] #3 ? at ??:? [4] #4 __libc_start_main in "/lib64/libc.so.6" [4] #5 ? at ??:? [hpws14:21072] *** Process received signal *** [hpws14:21072] Signal: Floating point exception (8) [hpws14:21072] Signal code: (-6) [hpws14:21072] Failing at address: 0x3e800005250 [hpws14:21072] [ 0] /lib64/libc.so.6(+0x36400)[0x7fab592fb400] [hpws14:21072] [ 1] /lib64/libc.so.6(gsignal+0x37)[0x7fab592fb387] [hpws14:21072] [ 2] /lib64/libc.so.6(+0x36400)[0x7fab592fb400] [hpws14:21072] [ 3] Rotex[0x4136e0] [hpws14:21072] [ 4] /lib64/libc.so.6(__libc_start_main+0xf5)[0x7fab592e7555] [hpws14:21072] [ 5] Rotex[0x4146f0] [hpws14:21072] *** End of error message *** [9] #0 Foam::error::printStack(Foam::Ostream&) at ??:? [9] #1 Foam::sigFpe::sigHandler(int) at ??:? [9] #2 ? in "/lib64/libc.so.6" [9] #3 ? at ??:? [9] #4 __libc_start_main in "/lib64/libc.so.6" [9] #5 ? at ??:? [hpws14:21077] *** Process received signal *** [hpws14:21077] Signal: Floating point exception (8) [hpws14:21077] Signal code: (-6) [hpws14:21077] Failing at address: 0x3e800005255 [hpws14:21077] [ 0] /lib64/libc.so.6(+0x36400)[0x7f02ac8ea400] [hpws14:21077] [ 1] /lib64/libc.so.6(gsignal+0x37)[0x7f02ac8ea387] [hpws14:21077] [ 2] /lib64/libc.so.6(+0x36400)[0x7f02ac8ea400] [hpws14:21077] [ 3] Rotex[0x4136e0] [hpws14:21077] [ 4] /lib64/libc.so.6(__libc_start_main+0xf5)[0x7f02ac8d6555] [hpws14:21077] [ 5] Rotex[0x4146f0] [hpws14:21077] *** End of error message *** -------------------------------------------------------------------------- Primary job terminated normally, but 1 process returned a non-zero exit code. Per user-direction, the job has been aborted. -------------------------------------------------------------------------- [6] #0 Foam::error::printStack(Foam::Ostream&) at ??:? [6] #1 Foam::sigFpe::sigHandler(int) at ??:? [6] #2 ? in "/lib64/libc.so.6" [6] #3 ? at ??:? [6] #4 __libc_start_main-------------------------------------------------------------------------- mpirun noticed that process rank 9 with PID 0 on node hpws14 exited on signal 8 (Floating point exception). --------------------------------------------------------------------------
这是poly网格选择Q准则画出的涡形状:
-
@李东岳 在 请教:第三代涡识别方法Liutex的代码在linux中运行的问题 中说:
你用calculator做一个计算器,计算Liutex的mag,然后做等值面图可以么。
这个可能要看一下liutex的sci的定义,看是不是通过这个方法来进行的。
李老师,我看了刘老师的论文(刘超群, Liutex-涡定义和第三代涡识别方法. 空气动力学学报, 2020. 038(003): 第413-431,478页.),里边提到以下几点:
- Liutex算出的是一个矢量,而Q是标量。
2.文章中提到Liutex为基础的几个涡识别方法,其中之一就是可以用计算mag来画等值面,但这个时候又需要指定阈值:
3.用paraview计算9.6w 网格的算例的
mag(Rotex)
,阈值分别取不同结果如下。Liutex采用幅值等值面因此会存在跟用Q准则一样指定阈值的问题,但根据论文意思是此时画出的等值面和Liutex向量线是大致平行的。
(1)mag(Rotex)=0.1
结果
(2)mag(Rotex)=0.5
结果
(3)mag(Rotex)=2
结果
-
@lizhisongsjtu 在 请教:第三代涡识别方法Liutex的代码在linux中运行的问题 中说:
@李东岳 近期科研需要,花了两天研究这个程序。没调通,但发现一个bug。
原始程序142行qq=(Foam::pow(aa,2), 3bb)/9与《LiutexG涡定义和第三代涡识别方法》中公式12不同。应改为qq=(-Foam::pow(aa,2)+3bb)/9。
另外,求具体执行Rotex的命令!
我执行的命令是
postProcess -latestTime -func Rotex,提示cannot find functionObject file Rotex. -
@lizhisongsjtu
单进程执行Rotex -latestTime > log.Rotex-single
并行执行,20改为实际用的线程数
decomposePar mpirun -np 20 Rotex -latestTime -parallel > log.Rotex-parallel reconstructPar
-
@coolhhh 谢谢大佬
下载:RotexZhisong.zip在原始版本和东岳大佬版本基础上,用OF自带的场函数替换PQR\delta 的计算语句,200万网格,单核6s。
提示:新旧PQR\delta计算结果的差异,量级是-12,但最后Rotex的x和y分量有一点差异,z分量差异可忽略。
@李东岳 在 请教:第三代涡识别方法Liutex的代码在linux中运行的问题 中说:
我把 http://www.jhydrodynamics.com/en/download-of-liutex-code/ 这个链接里面的代码,小改了一下,放到了OpenFOAM-9里面可以编译成功。
下载:Rotex.zip
-
-
@lizhisongsjtu 感觉这个liutex没有那么好啊,我计算的是槽道流,liutex识别的结果很混乱(liutex的等值面),感觉还没Q准则显示的涡结构清晰,但是看刘老师文章里的效果挺好的。。。
下图是Q准则识别的涡(只显示了下半部分区域),可以看出清晰的流向结构(Q等值由速度染色)
(下图Q等值由温度(这里是被动标量)染色)
but,liutex等值面画出来就很混乱,我调了一些阈值都不是很好,感觉很混乱,下面是统一阈值的各个角度的liutex等值面,总体感觉就很混乱。
(下面图liutex等值面都为速度染色)
PS:之前用omega方法识别涡时也出现了跟liutex等值面差不多的现象,刘老师文章里也提到omega方法是跟阈值关系不大的(优于Q准则),但是在我的槽道流算例里,这两种方法似乎都不如Q准则好,请问大家在进行涡识别时有没有类似的经历,请格外大佬指教。
-
@lizhisongsjtu 感谢分享,请问下在of7下同样编译成功,但运行Rotex -latestTime会出现这种报错是什么原因呢