基于PIMPLE算流固耦合的数值方法优化
-
通过网上各种教程攒出来一个用sixDofRigidBodyMotion库模拟圆柱涡激振动的案例,目前能跑起来不发散,结果不算离谱,但是存在几个小问题想请教:
-
PIMPLE外循环次数超过100都不收敛,是residual定的太小了吗?尝试修改过tolerence和residuals,貌似没有影响。
-
尝试过用GAMG和PCG求解器,在每个循环内计算p都要很多次(200+)迭代才能收敛,这个正常吗?看教程说一般20次以内就收敛了,是应该提高nCorrectors么?
-
对于流固耦合模拟,想请教PIMPLE下面的residual control和上面的tolerance取值标准是啥?
-
从精度和计算效率两方面可以如何优化呢?
fvSchemes
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v2306 | | \\ / A nd | Website: www.openfoam.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object fvSchemes; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ddtSchemes { default CrankNicolson 0; } gradSchemes { default cellLimited Gauss linear 1; grad(k) cellLimited Gauss linear 1; grad(omega) cellLimited Gauss linear 1; grad(U) cellLimited Gauss linear 1; } divSchemes { default none; div(phi,U) Gauss linearUpwind grad(U); div(phi,k) Gauss linearUpwind grad(k); div(phi,omega) Gauss linearUpwind grad(omega); div((nuEff*dev2(T(grad(U))))) Gauss linear; } laplacianSchemes { default Gauss linear limited 1; } snGradSchemes { default limited 1; } interpolationSchemes { default linear; } wallDist { method meshWave; } // ************************************************************************* //
fvSolution
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v2306 | | \\ / A nd | Website: www.openfoam.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object fvSolution; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // solvers { "pcorr.*" { solver GAMG; tolerance 0.02; relTol 0; smoother GaussSeidel; } p { $pcorr; tolerance 1e-7; relTol 0.01; } pFinal { $p; tolerance 1e-7; relTol 0; } "(U|k|omega)" { solver smoothSolver; smoother symGaussSeidel; tolerance 1e-06; relTol 0.1; } "(U|k|omega)Final" { $U; tolerance 1e-06; relTol 0; } cellDisplacement { solver GAMG; tolerance 1e-7; relTol 0; smoother GaussSeidel; } } PIMPLE { correctPhi yes; nOuterCorrectors 50; nCorrectors 2; nNonOrthogonalCorrectors 1; residualControl { p { tolerance 1e-5; relTol 0; } U { tolerance 1e-5; relTol 0; } "(k|omega)" { tolerance 1e-4; relTol 0; } } consistent yes; turbOnFinalIterOnly true; momentumPredictor yes; } relaxationFactors { fields { p 0.5; } equations { "(U|k|omega)" 0.7; "(U|k|omega)Final" 1.0; } } cache { grad(U); } // ************************************************************************* //
-
-
@李东岳 感谢李老师回复指导
因为之前是基于多种设置续算的,就从0开始重新算了一下。可能是振动还没发展起来或者别的原因,现在还没有复现出问题1,问题2的情况也有所缓解。
因为要算的工况比较多,每工况的模拟时间也比较长,所以才用了PIMPLE,后续会和PISO对比一下。谢谢李老师的建议!
log如下:
PIMPLE: iteration 1 forces forces: rho: rhoInf Freestream density (rhoInf) set to 1024.81 Not including porosity effects Restraint verticalSpring: attachmentPt - anchor (0 0.0010966357 0) spring length 0.0010966357 force (0 -0.10118346 0) 6-DoF rigid body motion Centre of rotation: (0 0.0010691972 0.15) Centre of mass: (0 0.0010691972 0.15) Orientation: (1 0 0 0 1 0 0 0 1) Linear velocity: (0 -0.01668704 0) Angular velocity: (0 0 0) GAMG: Solving for pcorr, Initial residual = 1, Final residual = 0.01988723, No Iterations 36 GAMG: Solving for pcorr, Initial residual = 0.15492815, Final residual = 0.019874775, No Iterations 3 time step continuity errors : sum local = 3.7598085e-09, global = 3.4248906e-10, cumulative = -6.3316969e-09 smoothSolver: Solving for Ux, Initial residual = 0.00014400004, Final residual = 2.2329647e-06, No Iterations 1 smoothSolver: Solving for Uy, Initial residual = 0.0020709532, Final residual = 3.1958459e-05, No Iterations 1 smoothSolver: Solving for Uz, Initial residual = 0.00066233531, Final residual = 8.9617005e-06, No Iterations 1 GAMG: Solving for p, Initial residual = 0.14903872, Final residual = 0.0013876837, No Iterations 5 GAMG: Solving for p, Initial residual = 0.0049832553, Final residual = 4.6426996e-05, No Iterations 32 time step continuity errors : sum local = 7.443206e-10, global = 5.6565011e-11, cumulative = -6.2751319e-09 GAMG: Solving for p, Initial residual = 0.080233525, Final residual = 0.00073683149, No Iterations 5 GAMG: Solving for p, Initial residual = 0.0027394104, Final residual = 9.8256671e-08, No Iterations 197 time step continuity errors : sum local = 1.6053351e-12, global = 1.4372461e-13, cumulative = -6.2749881e-09 PIMPLE: iteration 2 smoothSolver: Solving for Ux, Initial residual = 5.2998192e-05, Final residual = 9.0530989e-07, No Iterations 1 smoothSolver: Solving for Uy, Initial residual = 0.00075801305, Final residual = 1.2921938e-05, No Iterations 1 smoothSolver: Solving for Uz, Initial residual = 0.00023451882, Final residual = 3.4634273e-06, No Iterations 1 GAMG: Solving for p, Initial residual = 0.071265773, Final residual = 0.00051097706, No Iterations 5 GAMG: Solving for p, Initial residual = 0.0021031081, Final residual = 1.9347582e-05, No Iterations 30 time step continuity errors : sum local = 3.1370341e-10, global = 2.5263834e-11, cumulative = -6.2497243e-09 GAMG: Solving for p, Initial residual = 0.040103047, Final residual = 0.00026070028, No Iterations 5 GAMG: Solving for p, Initial residual = 0.0011598975, Final residual = 9.7230208e-08, No Iterations 150 time step continuity errors : sum local = 1.5923563e-12, global = 1.2733625e-13, cumulative = -6.249597e-09 PIMPLE: iteration 3 PIMPLE: iteration 4 PIMPLE: iteration 5 PIMPLE: iteration 6 PIMPLE: iteration 7 PIMPLE: iteration 8 PIMPLE: iteration 9 PIMPLE: iteration 10 smoothSolver: Solving for Ux, Initial residual = 5.8890765e-08, Final residual = 5.8890765e-08, No Iterations 0 smoothSolver: Solving for Uy, Initial residual = 5.8962683e-07, Final residual = 5.8962683e-07, No Iterations 0 smoothSolver: Solving for Uz, Initial residual = 1.8452167e-07, Final residual = 1.8452167e-07, No Iterations 0 GAMG: Solving for p, Initial residual = 0.0005765656, Final residual = 5.0530797e-06, No Iterations 4 GAMG: Solving for p, Initial residual = 1.3481753e-05, Final residual = 1.2684884e-07, No Iterations 34 time step continuity errors : sum local = 2.0757314e-12, global = -1.6681465e-13, cumulative = -6.290363e-09 GAMG: Solving for p, Initial residual = 0.00035690212, Final residual = 2.8143682e-06, No Iterations 4 GAMG: Solving for p, Initial residual = 7.8004164e-06, Final residual = 9.4688323e-08, No Iterations 32 time step continuity errors : sum local = 1.5495463e-12, global = -1.2432685e-13, cumulative = -6.2904873e-09 PIMPLE: iteration 11 smoothSolver: Solving for Ux, Initial residual = 4.2089274e-08, Final residual = 4.2089274e-08, No Iterations 0 smoothSolver: Solving for Uy, Initial residual = 4.6201943e-07, Final residual = 4.6201943e-07, No Iterations 0 smoothSolver: Solving for Uz, Initial residual = 1.2388523e-07, Final residual = 1.2388523e-07, No Iterations 0 GAMG: Solving for p, Initial residual = 0.11552903, Final residual = 0.0010667998, No Iterations 4 GAMG: Solving for p, Initial residual = 0.003825712, Final residual = 3.5873819e-05, No Iterations 27 time step continuity errors : sum local = 8.3616504e-10, global = -6.3755075e-11, cumulative = -6.3542424e-09 GAMG: Solving for p, Initial residual = 0.032558178, Final residual = 0.00030672465, No Iterations 3 GAMG: Solving for p, Initial residual = 0.00088095902, Final residual = 9.6112528e-08, No Iterations 154 time step continuity errors : sum local = 2.1285461e-12, global = -1.790588e-13, cumulative = -6.3544214e-09 smoothSolver: Solving for omega, Initial residual = 3.6974157e-06, Final residual = 1.8111492e-07, No Iterations 1 smoothSolver: Solving for k, Initial residual = 0.00057213364, Final residual = 1.4744873e-07, No Iterations 3 bounding k, min: -6.9207899e-06 max: 0.028407784 average: 0.0012676458 PIMPLE: converged in 11 iterations ExecutionTime = 4850.49 s ClockTime = 4876 s --> FOAM Warning : From Foam::IOobjectList Foam::sampledSurfaces::preCheckFields() in file sampledSurface/sampledSurfaces/sampledSurfaces.C at line 138 Cannot find registered field matching 1(Q) forces forces write: Sum of forces Total : (0.93724138 0.021367463 -0.070174322) Pressure : (0.91719323 0.019209612 -0.066963711) Viscous : (0.020048151 0.0021578513 -0.0032106112) Sum of moments Total : (-0.0069183905 0.16084472 -0.00098339753) Pressure : (-0.0064798603 0.15767397 -0.00097408967) Viscous : (-0.00043853028 0.0031707533 -9.3078582e-06) writing force and moment files. Courant Number mean: 0.08151294 max: 4.9972435 deltaT = 0.0016751103 Time = 0.45223894