计算钝体涡激振动时发散(pimpleDyMFoam)
-
各位老师好,我使用pimpleDyMFoam计算钝体涡激振动时,算例的CFL越来越大并计算一段时间后发散。通过查看速度和压力场,发现一开始就不太正常,然后随着时间推移,误差逐渐积累最后发散。报错如下:
#0 Foam::error::printStack(Foam::Ostream&) at ??:? #1 Foam::sigFpe::sigHandler(int) at ??:? #2 ? in "/lib/x86_64-linux-gnu/libc.so.6" #3 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 ??:? #4 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 ??:? #5 Foam::GAMGSolver::solve(Foam::Field<double>&, Foam::Field<double> const&, unsigned char) const at ??:? #6 Foam::fvMatrix<double>::solveSegregated(Foam::dictionary const&) at ??:? #7 Foam::fvMatrix<double>::solve(Foam::dictionary const&) in "/home/ying/OpenFOAM41/OpenFOAM-4.1/platforms/linux64GccDPInt32Opt/bin/pimpleDyMFoam" #8 ? in "/home/ying/OpenFOAM41/OpenFOAM-4.1/platforms/linux64GccDPInt32Opt/bin/pimpleDyMFoam" #9 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6" #10 ? in "/home/ying/OpenFOAM41/OpenFOAM-4.1/platforms/linux64GccDPInt32Opt/bin/pimpleDyMFoam" Floating point exception (core dumped)
我查了一下有人说很可能是网格或边界条件的问题。我的边界条件是比较基础的速度入口/压力出口,感觉应该没问题;我也使用了refine的网格重新计算,发现crash的时间延长了,但速度场和压力场还是一开始就不正确。两种网格质量都没问题。
我附加了我的算例设置文件,和流场图以供参考。
-
粗网格及流场
-
细网格及流场
-
边界条件(U/p/pointDisplacement)
FoamFile { version 2.0; format ascii; class volVectorField; location "0"; object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField uniform (0 0 0); boundaryField { INLET { type fixedValue; value uniform (1 0 0); } OUTLET { type zeroGradient; } TOP { type symmetry; } BOTTOM { type symmetry; } CYLINDER { type movingWallVelocity; value uniform (0 0 0); } frontAndBackPlanes { type empty; } }
FoamFile { version 2.0; format ascii; class volScalarField; location "0"; object p; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -2 0 0 0 0]; internalField uniform 0; boundaryField { INLET { type zeroGradient; } OUTLET { type fixedValue; value uniform 0; } TOP { type symmetry; } BOTTOM { type symmetry; } CYLINDER { type zeroGradient; } frontAndBackPlanes { type empty; } }
FoamFile { version 2.0; format ascii; class pointVectorField; location "0"; object pointDisplacement; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 0 0 0 0 0]; internalField uniform (0 0 0); boundaryField { INLET { type fixedValue; value uniform (0 0 0); } OUTLET { type fixedValue; value uniform (0 0 0); } TOP { type symmetry; } BOTTOM { type symmetry; } CYLINDER { type calculated; } frontAndBackPlanes { type empty; } }
- fvScheme & fvSolution
FoamFile { version 2.0; format ascii; class dictionary; object fvSchemes; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ddtSchemes { default backward; } gradSchemes { default Gauss linear; grad(p) Gauss linear; grad(U) Gauss linear; } divSchemes { default none; div(phi,U) Gauss linearUpwind grad(U); div(div(phi,U)) Gauss linear; div(phi,k) Gauss limitedLinear 1; div(phi,omega) Gauss limitedLinear 1; div((nuEff*dev2(T(grad(U))))) Gauss linear; } laplacianSchemes { default Gauss linear corrected; } interpolationSchemes { default linear; } snGradSchemes { default corrected; } wallDist { method meshWave; }
FoamFile { version 2.0; format ascii; class dictionary; object fvSolution; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // solvers { "pcorr.*" { solver GAMG; tolerance 0.02; relTol 0; smoother GaussSeidel; } "(p|Phi)" { $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-5; relTol 0; smoother GaussSeidel; } } PIMPLE { correctPhi yes; nOuterCorrectors 2; nCorrectors 2; nNonOrthogonalCorrectors 1; } relaxationFactors { fields { p 0.3; } equations { "(U|k|omega)" 0.7; "(U|k|omega)Final" 1.0; } } potentialFlow { nNonOrthogonalCorrectors 15; } cache { grad(U); }
- dynamicMeshDict
FoamFile { version 2; format ascii; class dictionary; object dynamicMeshDict; } dynamicFvMesh dynamicMotionSolverFvMesh; motionSolverLibs ( "libsixDoFRigidBodyMotion.so" ); solver sixDoFRigidBodyMotion; sixDoFRigidBodyMotionCoeffs { patches ( CYLINDER ); innerDistance 2.5; outerDistance 20; mass 11.4586; centreOfMass ( 0.280485 0 0 ); momentOfInertia ( 0.6414 0.6414 0.24 ); g ( 0 0 0 ); rho rhoInf; rhoInf 1.225; report on; solver { type Newmark; gamma 0.5; beta 0.25; } constraints { yLine { sixDoFRigidBodyMotionConstraint line; centreOfRotation ( 0.280485 0 0 ); direction ( 0 1 0 ); } noRotation { sixDoFRigidBodyMotionConstraint orientation; } } restraints { verticalSpring { sixDoFRigidBodyMotionRestraint linearSpring; anchor ( 0.280485 0 0 ); refAttachmentPt ( 0.280485 0 0 ); stiffness 10.70694631; damping 0; restLength 0; } } }
请各位老师帮忙看看是什么问题,困扰好久了。。。谢谢!
-
-
@cresendo 我按照您的建议,调整了accelerationRelaxation 0.4,计算可以正常进行,CFL数小于1, 流场看上去也正常。
但有一个小疑问,通过查询dynamicMeshDict文件的官方描述,得知accelerationRelaxation直接减小刚体的加速度,比如在某时间步solver求出的加速度为10m/s^2,如果设置accelerationRelaxation=0.4,那么实际应用的加速为4m/s^2,这是一个很大的松弛。而官方描述中建议的accelerationRelaxation范围是0.9-1,并且提到 “Be careful with this accelerationRelaxation. Too low of a value will mean that the Body does not respond to the fluid forces correctly”。因此我担心设置较小的加速度松弛会不会对结果产生太大影响?因为没有实验结果作为参照,所以无法判断结果的准确性。不知道您一般是如何处理这种误差的?谢谢!