@xpqiu 牛,谢谢老兄,
赵海盛
帖子
-
求教forAll循环内部场问题 -
求教forAll循环内部场问题@李东岳 在 求教forAll循环内部场问题 中说:
owner是内部面的label。不包括边界面。
但owner的size不是和faces一样吗?那遍历不是遍历所有面?哈哈,项目和科研压力大啊,必须卷起来。不像李老师,信手拈来,风轻云淡
-
求教forAll循环内部场问题神们,阅读cellLimited代码时遇到forAll循环的问题,具体见下面代码:
const labelUList& owner = mesh.owner(); //owner单元列表 const labelUList& neighbour = mesh.neighbour(); //neighbour单元列表 Field<Type> maxVsf(vsf.primitiveField()); //定义一个场量,并只将vsf内部场值赋给它 Field<Type> minVsf(vsf.primitiveField()); //定义一个场量,并只将vsf内部场值赋给它 forAll(owner, facei) //facei从0到owner.size()增加,遍历owner单元 { label own = owner[facei]; //facei对应的owner单元号 label nei = neighbour[facei]; //facei对应的neighbour单元号 const Type& vsfOwn = vsf[own]; const Type& vsfNei = vsf[nei]; maxVsf[own] = max(maxVsf[own], vsfNei); minVsf[own] = min(minVsf[own], vsfNei); maxVsf[nei] = max(maxVsf[nei], vsfOwn); minVsf[nei] = min(minVsf[nei], vsfOwn); }
上面代码我知道什么意思,即求某个网格单元与其相邻的所有网格单元的某个量的最大值和最小值。但不明白的是为何上述forAll循环只是针对内部场的,owner中不是包含所有面(包括边界面)对应的owner单元吗?face文件和owner文件的size是一样的。
另外,也请牛们看下我代码的注释对不?
求教了, -
OpenFOAM中网格面方向问题@李东岳 : 谢谢东岳大神
-
OpenFOAM中网格面方向问题求教各路牛神一个简单的问题,OpenFOAM中任一个网格面的面矢量方向是怎么计算的,按照owner指向neigbour的方向,还是针对每个单元,该单元中此面的外法向?
谢谢啦!!! -
OpenFOAM源代码解析问题@李东岳 是滴
-
OpenFOAM源代码解析问题@李东岳 多谢东岳大婶,恍然大悟的赶脚啊,
-
OpenFOAM源代码解析问题大伙好,最近在读OpenFOAM源代码,遇到两个问题不太明白,望各路大神指点啊。
1)比如这样的语法:
theta.primitiveFieldRef() /= mesh.time().deltaTValue()*mesh.V();
以我幼儿园级别的C++语法知识,mesh是类对象,time()是成员函数,但搞不懂为何成员函数后面还可以加“.deltaTValue()”这个成员函数呢?2)经常看到这样的一个表达形式,
scalarField sumPhi ( fvc::surfaceSum(mag(phi))().primitiveField() );
这个代码我能读懂啥意思,就是求某个单元体的各个面的通量和,但有两个问题,一个是
surfaceSum(mag(phi))()
,为何(mag(phi))
后面还有个()
,费解啊,不懂啊;第二个是primitiveField()
这个函数是干啥的,看到很多地方都用它。求指点,好人一生平安!!!
-
用pimpleFOAM做圆柱的涡激振动遇到收敛性问题@Fu 是的,大兄弟。我其他文件中改参数了,但forceCoeffs中忘改了,都改后已经可以算了。谢谢哈!
-
用pimpleFOAM做圆柱的涡激振动遇到收敛性问题@同学博 谢谢兄弟哈,pointDisplacement设置应该没啥问题。现在找到原因了,我其他文件中参数值改了,forceCoeffs中参数没改,晕了。都改完后已经能正常算了。但forceCoeffs不应该只是输出力参数了?
-
用pimpleFOAM做圆柱的涡激振动遇到收敛性问题@同学博 网格有60万,还是挺大的。方便时兄弟帮我看一下我这些文件设置有没有问题吧。计算的问题是“一个带底座的短圆柱在恒定来流下的涡激振动”。
-
用pimpleFOAM做圆柱的涡激振动遇到收敛性问题@Fu 边界条件挺简单的,应该没啥问题吧。
-
用pimpleFOAM做圆柱的涡激振动遇到收敛性问题 -
用pimpleFOAM做圆柱的涡激振动遇到收敛性问题@同学博 已经加过松弛了,速度0.7,压力0.5,还是算不过去
-
用pimpleFOAM做圆柱的涡激振动遇到收敛性问题求助啊,大兄弟们!!!错误信息如下:
PIMPLE: Iteration 1 Restraint verticalSpring: attachmentPt - anchor (0 1.14264e-05 0) spring length 1.14264e-05 force (-0 -4.72392e-05 -0) 6-DoF rigid body motion Centre of rotation: (0 1.14788e-05 0.084) Centre of mass: (0 1.14788e-05 0.084) Orientation: (1 0 0 0 1 0 0 0 1) Linear velocity: (0 2.61184e-05 0) Angular velocity: (0 0 0) GAMG: Solving for pcorr, Initial residual = 1, Final residual = 0.0197574, No Iterations 40 GAMG: Solving for pcorr, Initial residual = 0.27233, Final residual = 0.0156253, No Iterations 4 time step continuity errors : sum local = 3.08875e-14, global = 7.0696e-15, cumulative = 9.56635e-09 smoothSolver: Solving for Ux, Initial residual = 3.30404e-06, Final residual = 3.30404e-06, No Iterations 0 smoothSolver: Solving for Uy, Initial residual = 0.000208158, Final residual = 1.22015e-07, No Iterations 1 smoothSolver: Solving for Uz, Initial residual = 2.49119e-05, Final residual = 1.94723e-08, No Iterations 1 GAMG: Solving for p, Initial residual = 0.212445, Final residual = 0.00136547, No Iterations 4 GAMG: Solving for p, Initial residual = 0.0257973, Final residual = 9.60752e-07, No Iterations 45 time step continuity errors : sum local = 1.04039e-13, global = -1.47872e-14, cumulative = 9.56634e-09 PIMPLE: Iteration 2 smoothSolver: Solving for Ux, Initial residual = 1.52276e-06, Final residual = 1.52276e-06, No Iterations 0 smoothSolver: Solving for Uy, Initial residual = 9.39697e-05, Final residual = 1.19676e-07, No Iterations 1 smoothSolver: Solving for Uz, Initial residual = 1.10536e-05, Final residual = 2.00238e-08, No Iterations 1 GAMG: Solving for p, Initial residual = 0.25598, Final residual = 0.00164346, No Iterations 4 [0] #0 Foam::error::printStack(Foam::Ostream&) at ??:? [0] #1 Foam::sigSegv::sigHandler(int) at ??:? [0] #2 ? in "/lib/x86_64-linux-gnu/libc.so.6" [0] #3 Foam::lduMatrix::Amul(Foam::Field<double>&, Foam::tmp<Foam::Field<double> > const&, Foam::FieldField<Foam::Field, double> const&, Foam::UPtrList<Foam::lduInterfaceField const> const&, unsigned char) const at ??:? [0] #4 Foam::GAMGSolver::scale(Foam::Field<double>&, Foam::Field<double>&, Foam::lduMatrix const&, Foam::FieldField<Foam::Field, double> const&, Foam::UPtrList<Foam::lduInterfaceField const> const&, Foam::Field<double> const&, unsigned char) const at ??:? [0] #5 Foam::GAMGSolver::Vcycle(Foam::PtrList<Foam::lduMatrix::smoother> const&, Foam::Field<double>&, Foam::Field<double> const&, Foam::Field<double>&, Foam::Field<double>&, Foam::Field<double>&, Foam::Field<double>&, Foam::Field<double>&, Foam::PtrList<Foam::Field<double> >&, Foam::PtrList<Foam::Field<double> >&, unsigned char) const at ??:? [0] #6 Foam::GAMGSolver::solve(Foam::Field<double>&, Foam::Field<double> const&, unsigned char) const at ??:? [0] #7 Foam::fvMatrix<double>::solveSegregated(Foam::dictionary const&) at ??:? [0] #8 Foam::fvMatrix<double>::solve(Foam::dictionary const&) in "/home/abc/OpenFOAM/OpenFOAM-8/platforms/linux64GccDPInt32Opt/bin/pimpleFoam" [0] #9 Foam::fvMatrix<double>::solve() in "/home/abc/OpenFOAM/OpenFOAM-8/platforms/linux64GccDPInt32Opt/bin/pimpleFoam" [0] #10 ? in "/home/abc/OpenFOAM/OpenFOAM-8/platforms/linux64GccDPInt32Opt/bin/pimpleFoam" [0] #11 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6" [0] #12 ? in "/home/abc/OpenFOAM/OpenFOAM-8/platforms/linux64GccDPInt32Opt/bin/pimpleFoam" [111:1838841] *** Process received signal *** [111:1838841] Signal: Segmentation fault (11) [111:1838841] Signal code: (-6) [111:1838841] Failing at address: 0x3e8001c0ef9 [111:1838841] [ 0] /lib/x86_64-linux-gnu/libc.so.6(+0x46210)[0x7f5a7570c210] [111:1838841] [ 1] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0xcb)[0x7f5a7570c18b] [111:1838841] [ 2] /lib/x86_64-linux-gnu/libc.so.6(+0x46210)[0x7f5a7570c210] [111:1838841] [ 3] /home/abc/OpenFOAM/OpenFOAM-8/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so(_ZNK4Foam9lduMatrix4AmulERNS_5FieldIdEERKNS_3tmpIS2_EERKNS_10FieldFieldIS1_dEERKNS_8UPtrListIKNS_17lduInterfaceFieldEEEh+0x1dc)[0x7f5a76140c3c] [111:1838841] [ 4] /home/abc/OpenFOAM/OpenFOAM-8/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so(_ZNK4Foam10GAMGSolver5scaleERNS_5FieldIdEES3_RKNS_9lduMatrixERKNS_10FieldFieldIS1_dEERKNS_8UPtrListIKNS_17lduInterfaceFieldEEERKS2_h+0x62)[0x7f5a76166dc2] [111:1838841] [ 5] /home/abc/OpenFOAM/OpenFOAM-8/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so(_ZNK4Foam10GAMGSolver6VcycleERKNS_7PtrListINS_9lduMatrix8smootherEEERNS_5FieldIdEERKS8_S9_S9_S9_S9_S9_RNS1_IS8_EESD_h+0x885)[0x7f5a7616ae35] [111:1838841] [ 6] /home/abc/OpenFOAM/OpenFOAM-8/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so(_ZNK4Foam10GAMGSolver5solveERNS_5FieldIdEERKS2_h+0x524)[0x7f5a7616d154] [111:1838841] [ 7] /home/abc/OpenFOAM/OpenFOAM-8/platforms/linux64GccDPInt32Opt/lib/libfiniteVolume.so(_ZN4Foam8fvMatrixIdE15solveSegregatedERKNS_10dictionaryE+0x18b)[0x7f5a783322ab] [111:1838841] [ 8] pimpleFoam(_ZN4Foam8fvMatrixIdE5solveERKNS_10dictionaryE+0x1e8)[0x55f9e9e962e8] [111:1838841] [ 9] pimpleFoam(_ZN4Foam8fvMatrixIdE5solveEv+0x120)[0x55f9e9e96590] [111:1838841] [10] pimpleFoam(+0x2e50b)[0x55f9e9e4450b] [111:1838841] [11] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3)[0x7f5a756ed0b3] [111:1838841] [12] pimpleFoam(+0x313fe)[0x55f9e9e473fe] [111:1838841] *** 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.