|
[Sponsors] |
Initial residual and Final residual values do not change |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
September 20, 2020, 17:44 |
Initial residual and Final residual values do not change
|
#1 | ||
New Member
Join Date: Sep 2020
Posts: 11
Rep Power: 6 |
Dear Foamers,
Now I encountered a problem that the Initial residual and Final residual are the same at a single step, but do have a small change at the next time step. The solved fields do not move with the fluid (they stay the same although the velocity do change). The first step for a variable HE, Quote:
Quote:
Does anyone know the issue with this? Any comment is appreciated. Thank you! Wang |
|||
September 20, 2020, 23:49 |
Check your linear solver tolerance
|
#2 |
Senior Member
Fumiya Nozaki
Join Date: Jun 2010
Location: Yokohama, Japan
Posts: 266
Blog Entries: 1
Rep Power: 19 |
As you can see, No Iterations are 0 in your simulation.
This means the initial residual satisfies the (absolute) tolerance you specified in the solvers dictionary(initial residual < tolerance) and the HE equation is not solved. If you decrease the tolerance or add the minIter entry to the solvers dictionary, the HE equation will be solved. You can find some tutorials where minIter is used. Hope this helps, Fumiya
__________________
[Personal]
|
|
September 21, 2020, 09:09 |
|
#3 | |
New Member
Join Date: Sep 2020
Posts: 11
Rep Power: 6 |
Dear Fumiya,
Thank you very much for your kind reply. I forgot to attach my fvSolution in the last post. Here it is. Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.3.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object fvSolution; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // solvers { "(rho|G)" { solver PCG; preconditioner DIC; tolerance 1e-05; relTol 0.1; } "(rho|G)Final" { $rho; tolerance 1e-05; relTol 0; } p { solver GAMG; tolerance 1e-06; relTol 0.01; smoother GaussSeidel; nPreSweeps 0; nPostSweeps 2; nFinestSweeps 2; cacheAgglomeration on; nCellsInCoarsestLevel 10; agglomerator faceAreaPair; mergeLevels 1; } pFinal { $p; tolerance 1e-06; relTol 0; } U { solver smoothSolver; smoother symGaussSeidel; tolerance 1e-05; relTol 0.1; } UFinal { $U; tolerance 1e-05; relTol 0; } HE { solver PBiCG; preconditioner DILU; tolerance 1e-6; relTol 0; } HEFinal { $Z; tolerance 1e-06; relTol 0; } } PIMPLE { transonic no; momentumPredictor yes; nOuterCorrectors 1; nCorrectors 2; nNonOrthogonalCorrectors 0; } //relaxationFactors //{ // fields // { // ".*Final" 1; // } // equations // { // ".*Final" 1; // } //} Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.3.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object fvSolution; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // solvers { "(rho|G)" { solver PCG; preconditioner DIC; tolerance 1e-05; relTol 0.1; } "(rho|G)Final" { $rho; tolerance 1e-05; relTol 0; } p { solver GAMG; tolerance 1e-06; relTol 0.01; smoother GaussSeidel; nPreSweeps 0; nPostSweeps 2; nFinestSweeps 2; cacheAgglomeration on; nCellsInCoarsestLevel 10; agglomerator faceAreaPair; mergeLevels 1; } pFinal { $p; tolerance 1e-06; relTol 0; } U { solver smoothSolver; smoother symGaussSeidel; tolerance 1e-06; relTol 0.1; } UFinal { $U; tolerance 1e-06; relTol 0; } HE { solver PBiCG; preconditioner DILU; tolerance 1e-7; relTol 0; minIter 1; //solver smoothSolver; //smoother symGaussSeidel; //tolerance 1e-07; //relTol 0.1; //minIter 1; } HEFinal { $HE; tolerance 1e-07; relTol 0; minIter 1; } } PIMPLE { transonic no; momentumPredictor yes; nOuterCorrectors 1; nCorrectors 2; nNonOrthogonalCorrectors 0; } relaxationFactors { fields { ".*Final" 1; } equations { ".*Final" 1; } } Quote:
Best regards, Wang |
||
September 21, 2020, 09:39 |
|
#4 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
Hi,
actually, you don´t have to set the minIter keyword for your linear solver. If you don´t set it, as Fumiya pointed out, your linear solver does not have to do anything as your initial residual is smaller than the specified tolerance (in your case it is set to 1e-7). Hence, you solve the system Ax = b until the remaining error is smaller than 1e-7. If you reach this limit, your linear solver does not need to make more progress because - again - the set-up tells the solver to stop at 1e-7. There are two options you can do to let your solver still iterate over your linear system either by setting the already mentioned minIter keyword or reducing your tolerance to a limit of e.g., 1e-12. To your querstions:
I already had a few posts in which I explain the relaxation factors. The field relaxation you set (a value of 1) will not influence anything. So for the pressure field you should set e.g., 0.8 or a value smaller 1. The equation relaxtion of 1 will make your matrix you are investigating at least diagonal-dominant. So now you should know what it means. To keep it simple, it will increase the diagonal dominance of your matrix to support your linear solvers (they converge better). However, doing so, you make your matrix system more explicit. However, commonly you use values < 1 here too. Only if you know that you just need diagonal-dominance or in other words, if you know that you have non-diagonal dominant entries in your matrix, you can set it to 1. To stabilize you could use the PIMPLE algorithm instead of using PISO. This allows you to use relaxation factors < 1 because running in PISO with *Final < 1 is not consistent with respect to time. Just have a look in the forum. I posted this topic several times. The PIMPLE algorithm is explained in my book and different tutorials can be found on my website. PS: Are you using OpenFOAM-2.3? I hope you are aware that we are at version 8.
__________________
Keep foaming, Tobias Holzmann |
|
September 21, 2020, 09:41 |
|
#5 | |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
Quote:
__________________
Keep foaming, Tobias Holzmann |
||
September 21, 2020, 13:01 |
|
#6 | ||
New Member
Join Date: Sep 2020
Posts: 11
Rep Power: 6 |
Hi Tobi,
Thank you very much for your detailed reply. That really helped me a lot. For the relationFactor setup, the following could work for a stable simulation, right? Quote:
Quote:
In my setup, I already used the PIMPLE algorithm, right? I will check your website soon. Thank you again for your kind help. Yes, I am using the old version of OpenFOAM 2.3.1. You are using the new version of OpenFOAM 8.0? Last edited by fluid2020; September 21, 2020 at 13:05. Reason: add information |
|||
September 21, 2020, 14:35 |
|
#7 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
Hi,
yes I am always using the latest versions of FOAM (ESI + Foundation + extend). I guess I do have around 10 foam versions on my system. However, back to your topic.
If you set a field relaxation for p to 0.8, you cannot say that it will be a stable situation. Commonly people under-relax, U, p, k, epsilon, and the energy equation. As already pointed out, for U, k, epsilon, omega, ... h, e we manipulate the matrix rather than the field.
__________________
Keep foaming, Tobias Holzmann |
|
September 21, 2020, 15:02 |
|
#8 | ||
New Member
Join Date: Sep 2020
Posts: 11
Rep Power: 6 |
Hello Tobi,
Thank you very much for your guidance. After reading your post at the openfoam wiki page, I set the reactionFactors as follows, Quote:
Quote:
Thank you again for your kind assistance! |
|||
September 21, 2020, 15:10 |
|
#9 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
You simply can use fvOption and take the limitVelocity function to limit the maximum value of the velocity. Doing so, you will not just cut the values, it is a smarter way (numerically better).
If you are not using the PIMPLE algorithm, you will not use the smaller relaxation factors for the equations (always requesting the *.Final one). If you don't care about time-consistency, you can simply set all relaxation factors (including final) to 0.5 for example. Some people stated, that they need even less relaxation factors.
__________________
Keep foaming, Tobias Holzmann |
|
September 21, 2020, 15:28 |
|
#10 |
New Member
Join Date: Sep 2020
Posts: 11
Rep Power: 6 |
Yes, I researched this function (limitVelocity), but it does not exist in the old version of OF. I moved the code from the new version to the old version I am using. But it seems it does not actually make effects.
Thank you very much for your suggestion. I will look at this further. |
|
September 22, 2020, 04:11 |
|
#11 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
I am not sure in which release the fvOptions capabilities was introduced but it was not included in 2.3.1. Hence, you are not able to use it even if you are copy pasting some code ... you need to update the equations but the implementation of fvOPtions is not just copy & pasting some simple stuff. My suggestion is that you move to a newer version.
__________________
Keep foaming, Tobias Holzmann |
|
September 22, 2020, 04:19 |
|
#12 |
New Member
Join Date: Sep 2020
Posts: 11
Rep Power: 6 |
I am currently testing if the PIMPLE algorithm can help the stability. If the PIMPLE works, I will not artificially limit the velocity. After all, the latter is the last choice for fluid simulation.
|
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
laplacianFoam with source term | Herwig | OpenFOAM Running, Solving & CFD | 17 | November 19, 2019 14:47 |
Segmentation fault when using reactingFOAM for Fluids | Tommy Floessner | OpenFOAM Running, Solving & CFD | 4 | April 22, 2018 13:30 |
chtMultiRegionSimpleFoam turbulent case | Aditya Patil | OpenFOAM Running, Solving & CFD | 6 | April 24, 2017 23:13 |
simpleFoam error - "Floating point exception" | mbcx4jc2 | OpenFOAM Running, Solving & CFD | 12 | August 4, 2015 03:20 |
calculation stops after few time steps | sivakumar | OpenFOAM Running, Solving & CFD | 7 | March 17, 2013 07:37 |