OpenFOAM散热器自然散热问题
-
时间信息没有打印出来,在代码中我注释掉了。
while (simple.loop(runTime)) { // Info<< "Time = " << runTime.timeName() << nl << endl; // Pressure-velocity SIMPLE corrector { #include "UEqn.H" #include "TEqn.H" #include "pEqn.H" } laminarTransport.correct(); turbulence->correct(); runTime.write(); } Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" << " ClockTime = " << runTime.elapsedClockTime() << " s" << nl << endl;
-
@李东岳 李老师,这是计算初始的log
/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 6 \\/ M anipulation | \*---------------------------------------------------------------------------*/ Build : 6-fa1285188035 Exec : NaturalConvection -parallel Date : May 22 2024 Time : 23:08:20 Host : "ubuntu" PID : 5459 I/O : uncollated Case : /home/hyc2/OpenFOAM_RUN/0_SIMP/NaturalConvection/Parallel_version/Case/app2 nProcs : 28 Slaves : 27 ( "ubuntu.5460" "ubuntu.5461" "ubuntu.5462" "ubuntu.5463" "ubuntu.5464" "ubuntu.5465" "ubuntu.5466" "ubuntu.5467" "ubuntu.5468" "ubuntu.5469" "ubuntu.5470" "ubuntu.5471" "ubuntu.5472" "ubuntu.5473" "ubuntu.5474" "ubuntu.5475" "ubuntu.5476" "ubuntu.5477" "ubuntu.5478" "ubuntu.5479" "ubuntu.5480" "ubuntu.5481" "ubuntu.5482" "ubuntu.5483" "ubuntu.5484" "ubuntu.5485" "ubuntu.5486" ) Pstream initialized with: floatTransfer : 0 nProcsSimpleSum : 0 commsType : nonBlocking polling iterations : 0 sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE). fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 10) allowSystemOperations : Allowing user-supplied system call operations // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Create time Create mesh for time = 0 SIMPLE: No convergence criteria found Reading thermophysical properties Reading field gamma: Generate Heatsink Reading field T Reading field p_rgh Reading field U Reading/calculating face flux field phi Selecting incompressible transport model Newtonian Creating turbulence model Selecting turbulence model type laminar Selecting laminar stress model Stokes Reading field alphat Reading g Reading hRef Calculating field g.h No MRF models present Radiation model not active: radiationProperties not found Selecting radiationModel none No finite volume options present Starting time loop DILUPBiCGStab: Solving for Ux, Initial residual = 2.26016e-12, Final residual = 2.26016e-12, No Iterations 0 DILUPBiCGStab: Solving for Uy, Initial residual = 5.55456e-12, Final residual = 5.55456e-12, No Iterations 0 DILUPBiCGStab: Solving for T, Initial residual = 1, Final residual = 4.19741e-06, No Iterations 2 DICPCG: Solving for p_rgh, Initial residual = 0.9978, Final residual = 8.46846e-09, No Iterations 285 time step continuity errors : sum local = 3.21147e-18, global = 3.8703e-28, cumulative = 3.8703e-28 DILUPBiCGStab: Solving for Ux, Initial residual = 0.259229, Final residual = 2.413e-06, No Iterations 1 DILUPBiCGStab: Solving for Uy, Initial residual = 0.247759, Final residual = 1.26753e-06, No Iterations 1 DILUPBiCGStab: Solving for T, Initial residual = 0.3081, Final residual = 1.17625e-06, No Iterations 2 DICPCG: Solving for p_rgh, Initial residual = 0.429708, Final residual = 9.40879e-09, No Iterations 282 time step continuity errors : sum local = 7.68457e-15, global = -3.36581e-20, cumulative = -3.36581e-20 DILUPBiCGStab: Solving for Ux, Initial residual = 0.198942, Final residual = 1.74793e-06, No Iterations 1 DILUPBiCGStab: Solving for Uy, Initial residual = 0.138458, Final residual = 1.76607e-06, No Iterations 1 DILUPBiCGStab: Solving for T, Initial residual = 0.183205, Final residual = 6.90531e-07, No Iterations 2 DICPCG: Solving for p_rgh, Initial residual = 0.223346, Final residual = 8.62887e-09, No Iterations 281 time step continuity errors : sum local = 7.66024e-15, global = 6.73161e-20, cumulative = 3.36581e-20 DILUPBiCGStab: Solving for Ux, Initial residual = 0.151191, Final residual = 1.30986e-06, No Iterations 1 DILUPBiCGStab: Solving for Uy, Initial residual = 0.0986773, Final residual = 1.98811e-06, No Iterations 1 DILUPBiCGStab: Solving for T, Initial residual = 0.130488, Final residual = 8.37963e-06, No Iterations 2 DICPCG: Solving for p_rgh, Initial residual = 0.156401, Final residual = 9.06892e-09, No Iterations 280 time step continuity errors : sum local = 7.64333e-15, global = -3.75832e-28, cumulative = 3.36581e-20 DILUPBiCGStab: Solving for Ux, Initial residual = 0.120235, Final residual = 1.04164e-06, No Iterations 1 DILUPBiCGStab: Solving for Uy, Initial residual = 0.092295, Final residual = 1.95079e-06, No Iterations 1 DILUPBiCGStab: Solving for T, Initial residual = 0.101424, Final residual = 6.04994e-06, No Iterations 2 DICPCG: Solving for p_rgh, Initial residual = 0.12596, Final residual = 9.2546e-09, No Iterations 279 time step continuity errors : sum local = 7.5916e-15, global = -3.33951e-20, cumulative = 2.62952e-22 DILUPBiCGStab: Solving for Ux, Initial residual = 0.0985023, Final residual = 8.79964e-07, No Iterations 1 DILUPBiCGStab: Solving for Uy, Initial residual = 0.0805056, Final residual = 1.83179e-06, No Iterations 1 DILUPBiCGStab: Solving for T, Initial residual = 0.0830071, Final residual = 4.77933e-06, No Iterations 2 DICPCG: Solving for p_rgh, Initial residual = 0.110625, Final residual = 9.08261e-09, No Iterations 279 time step continuity errors : sum local = 7.66431e-15, global = 6.32595e-28, cumulative = 2.62953e-22 DILUPBiCGStab: Solving for Ux, Initial residual = 0.0821466, Final residual = 7.69235e-07, No Iterations 1 DILUPBiCGStab: Solving for Uy, Initial residual = 0.0689735, Final residual = 1.70448e-06, No Iterations 1 DILUPBiCGStab: Solving for T, Initial residual = 0.0702824, Final residual = 4.13367e-06, No Iterations 2 DICPCG: Solving for p_rgh, Initial residual = 0.105393, Final residual = 8.86695e-09, No Iterations 279 time step continuity errors : sum local = 7.71868e-15, global = 3.36581e-20, cumulative = 3.3921e-20 DILUPBiCGStab: Solving for Ux, Initial residual = 0.0699188, Final residual = 6.85981e-07, No Iterations 1 DILUPBiCGStab: Solving for Uy, Initial residual = 0.0600396, Final residual = 1.58394e-06, No Iterations 1 DILUPBiCGStab: Solving for T, Initial residual = 0.060963, Final residual = 3.73141e-06, No Iterations 2 DICPCG: Solving for p_rgh, Initial residual = 0.107299, Final residual = 9.0363e-09, No Iterations 278 time step continuity errors : sum local = 7.69957e-15, global = 3.36581e-20, cumulative = 6.75791e-20 DILUPBiCGStab: Solving for Ux, Initial residual = 0.0607945, Final residual = 6.21142e-07, No Iterations 1 DILUPBiCGStab: Solving for Uy, Initial residual = 0.0531695, Final residual = 1.47411e-06, No Iterations 1 DILUPBiCGStab: Solving for T, Initial residual = 0.0538401, Final residual = 3.43971e-06, No Iterations 2 DICPCG: Solving for p_rgh, Initial residual = 0.111654, Final residual = 9.04241e-09, No Iterations 278 time step continuity errors : sum local = 7.78919e-15, global = -2.62945e-22, cumulative = 6.73161e-20 DILUPBiCGStab: Solving for Ux, Initial residual = 0.0537628, Final residual = 5.69473e-07, No Iterations 1 DILUPBiCGStab: Solving for Uy, Initial residual = 0.0478181, Final residual = 1.37697e-06, No Iterations 1 DILUPBiCGStab: Solving for T, Initial residual = 0.0482197, Final residual = 3.21353e-06, No Iterations 2 DICPCG: Solving for p_rgh, Initial residual = 0.117545, Final residual = 9.42683e-09, No Iterations 277 time step continuity errors : sum local = 7.72011e-15, global = -3.33951e-20, cumulative = 3.3921e-20 DILUPBiCGStab: Solving for Ux, Initial residual = 0.0483543, Final residual = 5.27961e-07, No Iterations 1 DILUPBiCGStab: Solving for Uy, Initial residual = 0.0434155, Final residual = 1.29181e-06, No Iterations 1 DILUPBiCGStab: Solving for T, Initial residual = 0.0436704, Final residual = 3.07378e-06, No Iterations 2 DICPCG: Solving for p_rgh, Initial residual = 0.124436, Final residual = 9.52381e-09, No Iterations 277 time step continuity errors : sum local = 7.77171e-15, global = -2.62968e-22, cumulative = 3.36581e-20
-
DILUPBiCGStab: Solving for Ux, Initial residual = 0.259229, Final residual = 2.413e-06, No Iterations 1
你这个看起来并没有读取
relTol 0.1
的信息。正常应该是这样类似:DILUPBiCGStab: Solving for Ux, Initial residual = 0.259229, Final residual = 0.259229/10
咋回事就不知道了,需要详细debug。所有变量都没有读取relTol。不过无所谓。反正是瞬态。
另外,你的瞬态求解器里面,每个方程压力方程只求解一次,这个要最少2次。
-
问题已解决。
经过调试,自己写的求解器没有问题,fvSolution的relaxationFactors需要修改。
原本relaxationFactors设置为:relaxationFactors { fields { p_rgh 0.7; } equations { U 0.3; T 0.5; "(k|epsilon|R)" 0.7; } }
将p_rgh改为0.3,U改为0.7,去掉T的放缩因子,修改后如下:
relaxationFactors { fields { p_rgh 0.3; } equations { U 0.7; "(k|epsilon|R)" 0.7; } }
计算后结果如下图所示(热流密度修改为1.0,迭代步数200):