关于多相流的电势方程(Laplace方程)的求解问题
-
@东岳
谢谢东岳老师!
我简单修改了一下代码,让它迭代多次
scalar phiEEqRes = cttProperties.lookupOrDefault<scalar>("phiEEqRes", 1e-6 ) ; // Max number of iterations int maxIterPhiE = cttProperties.lookupOrDefault<int>("maxIterPhiE", 20 ) ; // Transport of passive scalar sigmaE == alpha1*sigmaE1 + alpha2*sigmaE2; scalar res=GREAT; int iter=0; while (res > phiEEqRes && iter < maxIterPhiE) { fvScalarMatrix phiEEqn ( fvm::laplacian( sigmaE, phiE) ); phiEEqn.relax(); res = phiEEqn.solve().initialResidual(); iter++; }
同样的算例下,log文件如下
/*---------------------------------------------------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.x | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ Build : 4.x Exec : rheoEHDPhaseFieldFoam Date : Oct 28 2019 Time : 11:01:00 Host : "cfd" PID : 103447 Case : /home/cfd/OpenFOAM/cfd-4.x/run/rheoEHDPhaseFieldFoam/electric_test2 nProcs : 1 sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE). fileModificationChecking : Monitoring run-time modified files using timeStampMaster allowSystemOperations : Allowing user-supplied system call operations // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Create time Create mesh for time = 0 PIMPLE: Operating solver in PISO mode Reading field p_rgh Reading field U Reading/calculating face flux field phi Reading transportProperties Selecting constitutive equation Newtonian Selecting constitutive equation Newtonian Reading g Reading hRef Calculating field g.h No MRF models present No finite volume options present DICPCG: Solving for pcorr, Initial residual = 0, Final residual = 0, No Iterations 0 time step continuity errors : sum local = 0, global = 0, cumulative = 0 Courant Number mean: 0 max: 0 Starting time loop Courant Number mean: 0 max: 0 Interface Courant Number mean: 0 max: 0 Time = 0.001 Phase-1 volume fraction = 0.0248178 Min(alpha.water) = -2.12354e-55 Max(alpha.water) - 1 = 0 smoothSolver: Solving for phiE, Initial residual = 2.00047e-06, Final residual = 9.0829e-09, No Iterations 2 smoothSolver: Solving for phiE, Initial residual = 2.00062e-06, Final residual = 9.08496e-09, No Iterations 2 smoothSolver: Solving for phiE, Initial residual = 2.00079e-06, Final residual = 9.08756e-09, No Iterations 2 smoothSolver: Solving for phiE, Initial residual = 2.00098e-06, Final residual = 9.09235e-09, No Iterations 2 smoothSolver: Solving for phiE, Initial residual = 2.00131e-06, Final residual = 9.10815e-09, No Iterations 2 smoothSolver: Solving for phiE, Initial residual = 2.0024e-06, Final residual = 9.20389e-09, No Iterations 2 smoothSolver: Solving for phiE, Initial residual = 2.00751e-06, Final residual = 1.05039e-08, No Iterations 2 smoothSolver: Solving for phiE, Initial residual = 2.06764e-06, Final residual = 2.18651e-08, No Iterations 2 smoothSolver: Solving for phiE, Initial residual = 2.72883e-06, Final residual = 8.38954e-08, No Iterations 2 smoothSolver: Solving for phiE, Initial residual = 7.30545e-06, Final residual = 2.6689e-08, No Iterations 4 smoothSolver: Solving for phiE, Initial residual = 3.10926e-05, Final residual = 3.82843e-08, No Iterations 5 smoothSolver: Solving for phiE, Initial residual = 0.000149551, Final residual = 5.68219e-08, No Iterations 6 smoothSolver: Solving for phiE, Initial residual = 0.000753353, Final residual = 8.61768e-08, No Iterations 7 smoothSolver: Solving for phiE, Initial residual = 0.00389063, Final residual = 3.72685e-08, No Iterations 9 smoothSolver: Solving for phiE, Initial residual = 0.0201471, Final residual = 5.71e-08, No Iterations 10 smoothSolver: Solving for phiE, Initial residual = 0.0968377, Final residual = 8.0832e-08, No Iterations 11 smoothSolver: Solving for phiE, Initial residual = 0.330082, Final residual = 8.08282e-08, No Iterations 12 smoothSolver: Solving for phiE, Initial residual = 0.583957, Final residual = 4.1842e-08, No Iterations 13 smoothSolver: Solving for phiE, Initial residual = 0.671177, Final residual = 4.92793e-08, No Iterations 13 smoothSolver: Solving for phiE, Initial residual = 0.687466, Final residual = 5.15537e-08, No Iterations 13 DILUPBiCG: Solving for Ux, Initial residual = 1, Final residual = 8.88689e-11, No Iterations 49 DILUPBiCG: Solving for Uy, Initial residual = 1, Final residual = 8.54483e-11, No Iterations 47 DILUPBiCG: Solving for Uz, Initial residual = 1, Final residual = 9.77718e-11, No Iterations 46 DICPCG: Solving for p_rgh, Initial residual = 1, Final residual = 9.26224e-11, No Iterations 481 time step continuity errors : sum local = 5.4911e-05, global = -9.71439e-09, cumulative = -9.71439e-09 ExecutionTime = 9.1 s ClockTime = 9 s Courant Number mean: 1.63727e+07 max: 5.36038e+08 Interface Courant Number mean: 1.56047e+06 max: 5.36038e+08 Time = 0.002 #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::multiply(Foam::Field<double>&, Foam::UList<double> const&, Foam::UList<double> const&) at ??:? #4 Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam::operator*<Foam::fvPatchField, Foam::volMesh>(Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > const&, Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > const&) at ??:? #5 Foam::interfaceEHDPropertiesPFM::calculateMobility() at ??:? #6 ? at ??:? #7 ? at ??:? #8 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6" #9 ? at ??:?
可以看到,Initial residual在几个迭代步后迅速增大,这应该是计算发散的表征。这个算例里,我的不同相的sigmaE的比值是5,Laplace方程求解的格式是常用的Gauss linear corrected。所以,我猜想这应该和我引入的电场力无关,而主要是laplace方程的求解分散问题。
-
@cfd_lilili 在 关于多相流的电势方程(Laplace方程)的求解问题 中说:
fvScalarMatrix phiEEqn
(
fvm::laplacian( sigmaE, phiE)
);这个方程不需要迭代多次
-
@东岳 和@yfclark 感谢两位的建议
对这个问题,我实在无从下手,于是刚刚尝试了一下换个版本的求解器试试看。于是,我将同样的代码片段植入到of4.0和fe4.0的interFoam求解器中,并做了同样的算例。结果发现同样的条件下的Laplace方程,of4.0解不了,fe4.0可以解。这让我很迷惑。这个是of4.0求解器的算例的log文件,可以看到它的 Initial residual并没有收敛的迹象。
/*---------------------------------------------------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.x | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ Build : 4.x Exec : interFoamtest Date : Oct 28 2019 Time : 16:51:11 Host : "cfd" PID : 116917 Case : /home/cfd/OpenFOAM/cfd-4.x/run/interFoamtest/damBreak nProcs : 1 sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE). fileModificationChecking : Monitoring run-time modified files using timeStampMaster allowSystemOperations : Allowing user-supplied system call operations // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Create time Create mesh for time = 0 PIMPLE: Operating solver in PISO mode Reading field p_rgh Reading field U Reading/calculating face flux field phi Reading transportProperties Selecting incompressible transport model Newtonian Selecting incompressible transport model Newtonian Selecting turbulence model type laminar Reading g Reading hRef Calculating field g.h No MRF models present No finite volume options present DICPCG: Solving for pcorr, Initial residual = 0, Final residual = 0, No Iterations 0 time step continuity errors : sum local = 0, global = 0, cumulative = 0 Courant Number mean: 0 max: 0 Starting time loop Courant Number mean: 0 max: 0 Interface Courant Number mean: 0 max: 0 Time = 0.001 PIMPLE: iteration 1 smoothSolver: Solving for alpha.water, Initial residual = 0, Final residual = 0, No Iterations 0 Phase-1 volume fraction = 0.0247173 Min(alpha.water) = 0 Max(alpha.water) = 1 MULES: Correcting alpha.water MULES: Correcting alpha.water Phase-1 volume fraction = 0.0247173 Min(alpha.water) = 0 Max(alpha.water) = 1 smoothSolver: Solving for phiE, Initial residual = 1, Final residual = 0.00666667, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 0.969654, Final residual = 0.955898, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 0.999906, Final residual = 0.999906, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 0.999943, Final residual = 0.999943, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 0.999959, Final residual = 0.999959, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 0.99997, Final residual = 0.99997, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 0.999977, Final residual = 0.999977, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 0.999982, Final residual = 0.999982, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 0.999986, Final residual = 0.999986, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 0.999989, Final residual = 0.999989, No Iterations 1000 DICPCG: Solving for p_rgh, Initial residual = 1, Final residual = 0.0288118, No Iterations 2 time step continuity errors : sum local = 3.79873e-07, global = -1.14217e-22, cumulative = -1.14217e-22 DICPCG: Solving for p_rgh, Initial residual = 0.014257, Final residual = 0.000679011, No Iterations 51 time step continuity errors : sum local = 1.80931e-08, global = 1.97801e-23, cumulative = -9.44368e-23 DICPCG: Solving for p_rgh, Initial residual = 0.000685827, Final residual = 9.85239e-08, No Iterations 330 time step continuity errors : sum local = 2.59978e-12, global = -2.24454e-24, cumulative = -9.66814e-23 ExecutionTime = 29.16 s ClockTime = 29 s Courant Number mean: 8.45892e-06 max: 0.00486238 Interface Courant Number mean: 0 max: 0 Time = 0.002 PIMPLE: iteration 1 smoothSolver: Solving for alpha.water, Initial residual = 1.03138e-05, Final residual = 1.278e-11, No Iterations 1 Phase-1 volume fraction = 0.0247173 Min(alpha.water) = 0 Max(alpha.water) = 1 MULES: Correcting alpha.water MULES: Correcting alpha.water Phase-1 volume fraction = 0.0247173 Min(alpha.water) = -1.02138e-12 Max(alpha.water) = 1 smoothSolver: Solving for phiE, Initial residual = 0.999991, Final residual = 0.999991, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 0.999993, Final residual = 0.999993, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 0.999994, Final residual = 0.999994, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 0.999995, Final residual = 0.999995, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 0.999996, Final residual = 0.999996, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 0.999997, Final residual = 0.999997, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 0.999997, Final residual = 0.999997, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 0.999998, Final residual = 0.999998, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 0.999998, Final residual = 0.999998, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 0.999998, Final residual = 0.999998, No Iterations 1000 DICPCG: Solving for p_rgh, Initial residual = 0.148216, Final residual = 0.00717185, No Iterations 8 time step continuity errors : sum local = 1.53736e-07, global = 1.00047e-22, cumulative = 3.36563e-24 DICPCG: Solving for p_rgh, Initial residual = 0.00694699, Final residual = 0.00032885, No Iterations 69 time step continuity errors : sum local = 7.31529e-09, global = -5.63383e-24, cumulative = -2.2682e-24 DICPCG: Solving for p_rgh, Initial residual = 0.000331229, Final residual = 9.04502e-08, No Iterations 320 time step continuity errors : sum local = 2.00174e-12, global = -1.03358e-23, cumulative = -1.2604e-23 ExecutionTime = 55.26 s ClockTime = 55 s Courant Number mean: 1.00744e-05 max: 0.00608536 Interface Courant Number mean: 0 max: 0 Time = 0.003 PIMPLE: iteration 1 smoothSolver: Solving for alpha.water, Initial residual = 1.17667e-05, Final residual = 1.48862e-11, No Iterations 1 Phase-1 volume fraction = 0.0247173 Min(alpha.water) = -7.81203e-23 Max(alpha.water) = 1 MULES: Correcting alpha.water MULES: Correcting alpha.water Phase-1 volume fraction = 0.0247173 Min(alpha.water) = -2.49888e-15 Max(alpha.water) = 1 smoothSolver: Solving for phiE, Initial residual = 0.999998, Final residual = 0.999998, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 0.999999, Final residual = 0.999999, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 0.999999, Final residual = 0.999999, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 0.999999, Final residual = 0.999999, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 0.999999, Final residual = 0.999999, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 0.999999, Final residual = 0.999999, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 0.999999, Final residual = 0.999999, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 0.999999, Final residual = 0.999999, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 0.999999, Final residual = 0.999999, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 0.999999, Final residual = 0.999999, No Iterations 1000 DICPCG: Solving for p_rgh, Initial residual = 0.0570031, Final residual = 0.00216312, No Iterations 3 time step continuity errors : sum local = 4.53781e-08, global = -1.07358e-25, cumulative = -1.27114e-23 DICPCG: Solving for p_rgh, Initial residual = 0.00216994, Final residual = 0.000103227, No Iterations 32 time step continuity errors : sum local = 2.19448e-09, global = 2.56894e-23, cumulative = 1.29781e-23 DICPCG: Solving for p_rgh, Initial residual = 0.000103679, Final residual = 9.68435e-08, No Iterations 180 time step continuity errors : sum local = 2.06555e-12, global = 2.39499e-23, cumulative = 3.6928e-23 ExecutionTime = 80.51 s ClockTime = 80 s Courant Number mean: 1.02305e-05 max: 0.0059902 Interface Courant Number mean: 0 max: 0 Time = 0.004 PIMPLE: iteration 1 smoothSolver: Solving for alpha.water, Initial residual = 1.14624e-05, Final residual = 1.20817e-11, No Iterations 1 Phase-1 volume fraction = 0.0247173 Min(alpha.water) = -2.32959e-16 Max(alpha.water) = 1 MULES: Correcting alpha.water MULES: Correcting alpha.water Phase-1 volume fraction = 0.0247173 Min(alpha.water) = -6.27415e-12 Max(alpha.water) = 1 smoothSolver: Solving for phiE, Initial residual = 0.999999, Final residual = 0.999999, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 0.999999, Final residual = 0.999999, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 0.999999, Final residual = 0.999999, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 0.999999, Final residual = 0.999999, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 0.999999, Final residual = 0.999999, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 0.999999, Final residual = 0.999999, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 0.999999, Final residual = 0.999999, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 0.999999, Final residual = 0.999999, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 0.999999, Final residual = 0.999999, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 0.999999, Final residual = 0.999999, No Iterations 1000 DICPCG: Solving for p_rgh, Initial residual = 0.025679, Final residual = 0.00121229, No Iterations 2 time step continuity errors : sum local = 2.4847e-08, global = 4.56559e-24, cumulative = 4.14936e-23 DICPCG: Solving for p_rgh, Initial residual = 0.00123628, Final residual = 5.7827e-05, No Iterations 29 time step continuity errors : sum local = 1.18735e-09, global = -1.92179e-25, cumulative = 4.13014e-23 DICPCG: Solving for p_rgh, Initial residual = 5.83662e-05, Final residual = 9.44483e-08, No Iterations 129 time step continuity errors : sum local = 1.94768e-12, global = -2.79384e-23, cumulative = 1.3363e-23 ExecutionTime = 105.48 s ClockTime = 105 s Courant Number mean: 1.02721e-05 max: 0.00571222 Interface Courant Number mean: 0 max: 0 Time = 0.005 PIMPLE: iteration 1 smoothSolver: Solving for alpha.water, Initial residual = 1.10272e-05, Final residual = 9.91906e-12, No Iterations 1 Phase-1 volume fraction = 0.0247173 Min(alpha.water) = -1.84397e-16 Max(alpha.water) = 1 MULES: Correcting alpha.water MULES: Correcting alpha.water Phase-1 volume fraction = 0.0247173 Min(alpha.water) = -5.64491e-12 Max(alpha.water) = 1 smoothSolver: Solving for phiE, Initial residual = 0.999999, Final residual = 0.999999, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 0.999999, Final residual = 0.999999, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 0.999999, Final residual = 0.999999, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 0.999999, Final residual = 0.999999, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 0.999999, Final residual = 0.999999, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 0.999999, Final residual = 0.999999, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 0.999999, Final residual = 0.999999, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 0.999999, Final residual = 0.999999, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 0.999999, Final residual = 0.999999, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 0.999999, Final residual = 0.999999, No Iterations 1000 DICPCG: Solving for p_rgh, Initial residual = 0.0170557, Final residual = 0.000707649, No Iterations 2 time step continuity errors : sum local = 1.40556e-08, global = 5.55595e-24, cumulative = 1.8919e-23 DICPCG: Solving for p_rgh, Initial residual = 0.00072258, Final residual = 3.40642e-05, No Iterations 66 time step continuity errors : sum local = 6.7235e-10, global = -1.97122e-24, cumulative = 1.69477e-23 DICPCG: Solving for p_rgh, Initial residual = 3.47482e-05, Final residual = 9.44334e-08, No Iterations 110 time step continuity errors : sum local = 1.97407e-12, global = 2.71579e-25, cumulative = 1.72193e-23 ExecutionTime = 132.15 s ClockTime = 132 s Courant Number mean: 1.03787e-05 max: 0.00551763
这里是fe4.0的求解器的算例的log文件,它的Initial residual则呈现了收敛的趋势
/*---------------------------------------------------------------------------*\ | ========= | | | \\ / F ield | foam-extend: Open Source CFD | | \\ / O peration | Version: 4.0 | | \\ / A nd | Web: http://www.foam-extend.org | | \\/ M anipulation | For copyright notice see file Copyright | \*---------------------------------------------------------------------------*/ Build : 4.0 Exec : interFoamtest Date : Oct 28 2019 Time : 16:44:23 Host : cfd PID : 116498 CtrlDict : "/home/cfd/foam/cfd-4.0/run/damBreak/system/controlDict" Case : /home/cfd/foam/cfd-4.0/run/damBreak nProcs : 1 SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE). // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Create time Create mesh for time = 0 PIMPLE: Operating solver in PISO mode Reading g Reading field pd Reading field alpha1 Reading field U Reading/calculating face flux field phi Reading transportProperties Selecting incompressible transport model Newtonian Selecting incompressible transport model Newtonian Calculating field g.h Selecting turbulence model type laminar time step continuity errors : sum local = 0, global = 0, cumulative = 0 PCG: Solving for pcorr, Initial residual = 0, Final residual = 0, No Iterations 0 time step continuity errors : sum local = 0, global = 0, cumulative = 0 Courant Number mean: 0 max: 0 velocity magnitude: 0 Starting time loop Courant Number mean: 0 max: 0 velocity magnitude: 0 Time = 0.001 PIMPLE: iteration 1 MULES: Solving for alpha1 Liquid phase volume fraction = 0.0247173 Min(alpha1) = 0 Max(alpha1) = 1 MULES: Solving for alpha1 Liquid phase volume fraction = 0.0247173 Min(alpha1) = 0 Max(alpha1) = 1 BiCGStab: Solving for Ux, Initial residual = 1, Final residual = 8.84344e-16, No Iterations 1 BiCGStab: Solving for Uy, Initial residual = 1, Final residual = 2.39687e-15, No Iterations 1 BiCGStab: Solving for Uz, Initial residual = 0.999809, Final residual = 1.01154e-15, No Iterations 1 smoothSolver: Solving for phiE, Initial residual = 1, Final residual = 0.00885022, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 0.00440562, Final residual = 0.00275942, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 0.00276397, Final residual = 0.00177986, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 0.00178161, Final residual = 0.00114823, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 0.00114896, Final residual = 0.000740514, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 0.000740817, Final residual = 0.000477462, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 0.000477588, Final residual = 0.000307809, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 0.000307862, Final residual = 0.000198419, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 0.000198441, Final residual = 0.000127897, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 0.000127906, Final residual = 8.24364e-05, No Iterations 1000 DICPCG: Solving for pd, Initial residual = 1, Final residual = 0.0228419, No Iterations 2 DICPCG: Solving for pd, Initial residual = 0.0113008, Final residual = 0.000494115, No Iterations 19 DICPCG: Solving for pd, Initial residual = 0.00049866, Final residual = 2.39276e-05, No Iterations 115 DICPCG: Solving for pd, Initial residual = 2.39472e-05, Final residual = 9.68596e-08, No Iterations 302 time step continuity errors : sum local = 9.29479e-09, global = 1.57022e-22, cumulative = 1.57022e-22 ExecutionTime = 30.3 s ClockTime = 30 s Courant Number mean: 0.000308178 max: 0.120588 velocity magnitude: 1.20588 Time = 0.002 PIMPLE: iteration 1 MULES: Solving for alpha1 Liquid phase volume fraction = 0.0247173 Min(alpha1) = 0 Max(alpha1) = 1 MULES: Solving for alpha1 Liquid phase volume fraction = 0.0247173 Min(alpha1) = 0 Max(alpha1) = 1 BiCGStab: Solving for Ux, Initial residual = 0.776521, Final residual = 8.28489e-11, No Iterations 2 BiCGStab: Solving for Uy, Initial residual = 0.488694, Final residual = 2.35091e-11, No Iterations 2 BiCGStab: Solving for Uz, Initial residual = 0.492107, Final residual = 6.27383e-10, No Iterations 2 smoothSolver: Solving for phiE, Initial residual = 8.24401e-05, Final residual = 5.31333e-05, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 5.31349e-05, Final residual = 3.42459e-05, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 3.42465e-05, Final residual = 2.20722e-05, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 2.20724e-05, Final residual = 1.42259e-05, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 1.4226e-05, Final residual = 9.16875e-06, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 9.1688e-06, Final residual = 5.90937e-06, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 5.90939e-06, Final residual = 3.80865e-06, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 3.80866e-06, Final residual = 2.45471e-06, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 2.45471e-06, Final residual = 1.58208e-06, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 1.58208e-06, Final residual = 1.01967e-06, No Iterations 1000 DICPCG: Solving for pd, Initial residual = 0.146545, Final residual = 0.00361308, No Iterations 2 DICPCG: Solving for pd, Initial residual = 0.00335961, Final residual = 0.000167276, No Iterations 105 DICPCG: Solving for pd, Initial residual = 0.000188382, Final residual = 9.23987e-06, No Iterations 49 DICPCG: Solving for pd, Initial residual = 9.8482e-06, Final residual = 9.46082e-08, No Iterations 286 time step continuity errors : sum local = 2.47934e-09, global = -3.54267e-22, cumulative = -1.97245e-22 ExecutionTime = 58.46 s ClockTime = 58 s Courant Number mean: 0.000218338 max: 0.0405799 velocity magnitude: 0.405799 Time = 0.003 PIMPLE: iteration 1 MULES: Solving for alpha1 Liquid phase volume fraction = 0.0247173 Min(alpha1) = 0 Max(alpha1) = 1 MULES: Solving for alpha1 Liquid phase volume fraction = 0.0247173 Min(alpha1) = 0 Max(alpha1) = 1 BiCGStab: Solving for Ux, Initial residual = 0.431649, Final residual = 2.74542e-08, No Iterations 1 BiCGStab: Solving for Uy, Initial residual = 0.223545, Final residual = 5.07216e-10, No Iterations 1 BiCGStab: Solving for Uz, Initial residual = 0.212763, Final residual = 1.13065e-09, No Iterations 1 smoothSolver: Solving for phiE, Initial residual = 1.01967e-06, Final residual = 6.57184e-07, No Iterations 1000 smoothSolver: Solving for phiE, Initial residual = 6.57184e-07, Final residual = 4.23565e-07, No Iterations 1000 DICPCG: Solving for pd, Initial residual = 0.027659, Final residual = 0.000699273, No Iterations 2 DICPCG: Solving for pd, Initial residual = 0.00069462, Final residual = 3.42751e-05, No Iterations 109 DICPCG: Solving for pd, Initial residual = 3.70155e-05, Final residual = 1.75277e-06, No Iterations 49 DICPCG: Solving for pd, Initial residual = 1.78108e-06, Final residual = 9.77867e-08, No Iterations 266 time step continuity errors : sum local = 2.18185e-09, global = 1.21446e-22, cumulative = -7.57986e-23 ExecutionTime = 65.25 s ClockTime = 65 s Courant Number mean: 0.000237433 max: 0.0260814 velocity magnitude: 0.260814 Time = 0.004 PIMPLE: iteration 1 MULES: Solving for alpha1 Liquid phase volume fraction = 0.0247173 Min(alpha1) = -5.52899e-28 Max(alpha1) = 1 MULES: Solving for alpha1 Liquid phase volume fraction = 0.0247173 Min(alpha1) = 0 Max(alpha1) = 1 BiCGStab: Solving for Ux, Initial residual = 0.212063, Final residual = 1.20667e-11, No Iterations 1 BiCGStab: Solving for Uy, Initial residual = 0.157791, Final residual = 5.26792e-13, No Iterations 1 BiCGStab: Solving for Uz, Initial residual = 0.144847, Final residual = 8.02311e-13, No Iterations 1 smoothSolver: Solving for phiE, Initial residual = 4.23565e-07, Final residual = 2.73004e-07, No Iterations 1000 DICPCG: Solving for pd, Initial residual = 0.00638702, Final residual = 0.000228527, No Iterations 2 DICPCG: Solving for pd, Initial residual = 0.000229721, Final residual = 1.09143e-05, No Iterations 115 DICPCG: Solving for pd, Initial residual = 1.142e-05, Final residual = 4.41946e-07, No Iterations 58 DICPCG: Solving for pd, Initial residual = 4.43246e-07, Final residual = 9.98953e-08, No Iterations 236 time step continuity errors : sum local = 1.92551e-09, global = -2.38779e-22, cumulative = -3.14578e-22 ExecutionTime = 69.77 s ClockTime = 69 s Courant Number mean: 0.000307195 max: 0.0317014 velocity magnitude: 0.317014 Time = 0.005 PIMPLE: iteration 1 MULES: Solving for alpha1 Liquid phase volume fraction = 0.0247173 Min(alpha1) = 0 Max(alpha1) = 1 MULES: Solving for alpha1 Liquid phase volume fraction = 0.0247173 Min(alpha1) = 0 Max(alpha1) = 1 BiCGStab: Solving for Ux, Initial residual = 0.141162, Final residual = 1.73043e-11, No Iterations 1 BiCGStab: Solving for Uy, Initial residual = 0.123101, Final residual = 6.00829e-13, No Iterations 1 BiCGStab: Solving for Uz, Initial residual = 0.11123, Final residual = 9.9712e-13, No Iterations 1 smoothSolver: Solving for phiE, Initial residual = 2.73004e-07, Final residual = 1.75965e-07, No Iterations 1000 DICPCG: Solving for pd, Initial residual = 0.0068371, Final residual = 0.000235051, No Iterations 2 DICPCG: Solving for pd, Initial residual = 0.000232659, Final residual = 1.10913e-05, No Iterations 27 DICPCG: Solving for pd, Initial residual = 1.12968e-05, Final residual = 5.32458e-07, No Iterations 125 DICPCG: Solving for pd, Initial residual = 5.36239e-07, Final residual = 9.64374e-08, No Iterations 42 time step continuity errors : sum local = 1.68223e-09, global = 4.27902e-22, cumulative = 1.13324e-22 ExecutionTime = 74.91 s ClockTime = 75 s Courant Number mean: 0.000376038 max: 0.0360665 velocity magnitude: 0.360665
姑且假设我写的求解器没有大问题的条件下,上述结果说明,两个版本的求解结果存在了不同。
所以,我在想是不是of40和fe40的Laplace求解器在什么地方存在差异,导致了这样的结果? -
-
@东岳 openFoam-extend4.0,不好意思,我以为这个是通用的简写
-
@cfd_lilili 在 关于多相流的电势方程(Laplace方程)的求解问题 中说:
smoothSolver: Solving for phiE, Initial residual = 1, Final residual = 0.00666667, No Iterations 1000
smoothSolver: Solving for phiE, Initial residual = 0.969654, Final residual = 0.955898, No Iterations 1000
smoothSolver: Solving for phiE, Initial residual = 0.999906, Final residual = 0.999906, No Iterations 1000
smoothSolver: Solving for phiE, Initial residual = 0.999943, Final residual = 0.999943, No Iterations 1000
smoothSolver: Solving for phiE, Initial residual = 0.999959, Final residual = 0.999959, No Iterations 1000
smoothSolver: Solving for phiE, Initial residual = 0.99997, Final residual = 0.99997, No Iterations 1000
smoothSolver: Solving for phiE, Initial residual = 0.999977, Final residual = 0.999977, No Iterations 1000
smoothSolver: Solving for phiE, Initial residual = 0.999982, Final residual = 0.999982, No Iterations 1000
smoothSolver: Solving for phiE, Initial residual = 0.999986, Final residual = 0.999986, No Iterations 1000
smoothSolver: Solving for phiE, Initial residual = 0.999989, Final residual = 0.999989, No Iterations 1000你在求解一个方程求解多次。另外,迭代次数1000,没有收敛,
这是一个非常简单的方程,你需要更细心的debug
-
@东岳 谢谢老师
我把代码换了写法,问题就解决了
这是原来的写法fvScalarMatrix phiEEqn ( fvm::laplacian( phiE ) ); phiEEqn.relax(); solve(phiEEqn);
把它简单地写为
solve( fvm::laplacian(sigmaE, phiE) );
问题勉强算解决了,但还不知道之前的问题出在哪。