PIMPLE算法的使用
-
最近想用PIMPLE算法,只是修改了fvSolution里面 PIMPLE下面的 nOuterCorrectors
代码如下
solvers { alpha.water { nAlphaCorr 1; nAlphaSubCycles 1; cAlpha 1; MULESCorr yes; nLimiterIter 5; solver smoothSolver; smoother symGaussSeidel; tolerance 1e-7; relTol 0; maxIter 100; } alpha.waterFinal { nAlphaCorr 1; nAlphaSubCycles 1; cAlpha 1; MULESCorr yes; nLimiterIter 5; solver smoothSolver; smoother symGaussSeidel; tolerance 1e-8; relTol 0; maxIter 100; } "U.*" { solver smoothSolver; smoother symGaussSeidel; tolerance 1e-6; relTol 0; }; ".*(rho|rhoFinal)" { solver diagonal; } pcorr { solver PCG; preconditioner { preconditioner GAMG; tolerance 1e-05; relTol 0; smoother DICGaussSeidel; } tolerance 1e-05; relTol 0; maxIter 500; } Phi { $p_rgh; relTol 0; }; p_rgh { solver GAMG; tolerance 1e-07; relTol 0.00001; smoother DIC; } p_rghFinal { solver PCG; preconditioner { preconditioner GAMG; tolerance 1e-07; relTol 0; nVcycles 2; smoother DICGaussSeidel; nPreSweeps 2; } tolerance 1e-07; relTol 0; maxIter 1000; } U { solver smoothSolver; smoother GaussSeidel; tolerance 1e-06; relTol 0; nSweeps 1; } "(U|k|omega)" { solver smoothSolver; smoother symGaussSeidel; tolerance 1e-08; relTol 0.0001; } "(T|k|B|nuTilda).*" { solver smoothSolver; smoother symGaussSeidel; tolerance 1e-08; relTol 0; maxIter 100; } "(U|k|omega)Final" { solver smoothSolver; smoother symGaussSeidel; tolerance 1e-08; relTol 0; } } PIMPLE { momentumPredictor no; transonic no; nOuterCorrectors 1; nCorrectors 2; nNonOrthogonalCorrectors 0; }
但计算输出的log文件里面显示
PIMPLE: No convergence criteria found PIMPLE: Operating solver in PISO mode
PIMPLE算法的收敛准则如何设置呢?
-
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object fvSolution; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // solvers { rho { /*solver PCG; preconditioner DIC; tolerance 1e-05; relTol 0.1; minIter 1;*/ solver GAMG; tolerance 1e-06; relTol 0; smoother GaussSeidel; nPreSweeps 0; nPostSweeps 2; cacheAgglomeration true; nCellsInCoarsestLevel 64; agglomerator faceAreaPair; mergeLevels 1; minIter 1; } rhoFinal { $rho; tolerance 1e-05; relTol 0; minIter 1; } "(U|k|epsilon)" { solver GAMG; tolerance 1e-06; relTol 0; smoother GaussSeidel; nPreSweeps 0; nPostSweeps 2; cacheAgglomeration true; nCellsInCoarsestLevel 64; agglomerator faceAreaPair; mergeLevels 1; minIter 1; } p { solver GAMG; tolerance 1e-06; relTol 0; smoother GaussSeidel; nPreSweeps 0; nPostSweeps 2; cacheAgglomeration true; nCellsInCoarsestLevel 64; agglomerator faceAreaPair; mergeLevels 1; minIter 1; } pFinal { $p; tolerance 1e-06; relTol 0; } "(U|k|epsilon)Final" { $U; tolerance 1e-06; relTol 0; } "(Yi|O2|N2|H2O)" { solver PBiCG; preconditioner DILU; tolerance 1e-6; relTol 0; minIter 1; } h { $Yi; relTol 0.1; } hFinal { $Yi; } } PIMPLE { nOuterCorrectors 10; //for PIMPLE . if 1 PISO nCorrectors 3; //set the number of times the algorithm solves //the P and momentum corrector in each Time step momentumPredictor yes; nNonOrthogonalCorrectors 1; pRefCell 0; pRefValue 0; transonic no; turbOnFinalIterOnly false; } residualControl { U { tolerance 1e-5; relTol 0; } p { tolerance 1e-5; relTol 0; } k { tolerance 1e-5; relTol 0; } epsilon { tolerance 1e-5; relTol 0; } rho { tolerance 1e-5; relTol 0; } } relaxationFactors { equations { ".*Final" 0.1; } }/* solvers { p { solver GAMG; tolerance 1e-05; relTol 0; smoother DICGaussSeidel; nPreSweeps 0; nPostSweeps 2; cacheAgglomeration true; nCellsInCoarsestLevel 8; agglomerator faceAreaPair; mergeLevels 2; minIter 1; } pFinal { $p; smoother DICGaussSeidel ; //DILUGaussSeidel -> para malhas mais complexas tolerance 1e-07; relTol 0; } "(U|k|epsilon)" { solver GAMG; tolerance 1e-05; relTol 0; smoother DILUGaussSeidel; nPreSweeps 0; nPostSweeps 2; cacheAgglomeration true; nCellsInCoarsestLevel 8; agglomerator faceAreaPair; mergeLevels 2; minIter 1; } "(U|k|epsilon)Final" { solver GAMG; tolerance 1e-05; relTol 0; smoother DILUGaussSeidel; nPreSweeps 0; nPostSweeps 2; cacheAgglomeration true; nCellsInCoarsestLevel 8; agglomerator faceAreaPair; mergeLevels 2; minIter 1; } } PIMPLE { nOuterCorrectors 30;//for PIMPLE . if 1 PISO nCorrectors 3; //set the number of times the algorithm solves //the P and momentum corrector in each Time step momentumPredictor yes; nNonOrthogonalCorrectors 1; pRefCell 0; pRefValue 0; turbOnFinalIterOnly false; residualControl { U { tolerance 1e-4; relTol 0; } p { tolerance 1e-4; relTol 0; } } relaxationFactors { equations { "k.*" 0.1; } } }*/ /***************************************************Explain Documentation*********************** simulation stop at { 1. the residual falls below the solver tolerance, tolerance; 2. the ratio of current to initial residuals falls below the solver relative tolerance, relTol; 3. maxIter 1000 in transient simulation always force relTol= 0 to force simulation at each time step should be converged } GAMG generalised geometric-algebraic multi-grid. { solver GAMG; tolerance 1e-07; relTol 0; cacheAgglomeration true; switch specifying caching of the agglomeration strategy (default true). nCellsInCoarsestLevel 2; approximate mesh size at the most coarse level in terms of the number of cells (default 10). directSolveCoarset false use a direct solver at the coarsest level (default false). agglomerator faceAreaPair; mergeLevels 2; keyword controls the speed at which coarsening or refinement is performed. simple mesh use 2 preSweepsLevelMultiplier multiplier for the the number of sweeps between each coarsening level (default 1). maxPreSweeps maximum number of sweeps as the algorithm is coarsening (default 4). nPostSweeps number of sweeps as the algorithm is refining (default 2). postSweepsLevelMultiplier multiplier for the the number of sweeps between each refinement level (default 1). maxPostSweeps maximum number of sweeps as the algorithm is refining (default 4). nFinestSweeps number of sweeps at finest level (default 2). smoother DILUGaussSeidel; nPreSweeps 0; number of sweeps as the algorithm is coarsening (default 0). nPostSweeps 2; minIter 1; } *******************************************************************************/ /*rho { solver PCG; preconditioner DIC; tolerance 1e-05; relTol 0.1; } rhoFinal { $rho; tolerance 1e-05; relTol 0; } */ /*"(Yi|O2|N2|H2O)" { solver PBiCG; preconditioner DILU; tolerance 1e-6; relTol 0; } h { $Yi; relTol 0.1; } hFinal { $Yi; } } */ /*PIMPLE { transonic no; nCorrectors 2; nNonOrthogonalCorrectors 0; momentumPredictor yes; } relaxationFactors { equations { ".*Final" 1; } }*/ // ************************************************************************* // // ************************************************************************* //
-
-
@Calf-Z-DNS 是的,其实这个是相当于设置计算p的次数,我的理解是根据网格情况选择,网格简单,结构不是特别复杂的,1就可以,你可以具体找一下PIMPLE的介绍