|
[Sponsors] |
October 7, 2017, 12:22 |
A tiny error in linear PCG solver
|
#1 |
Senior Member
Sergei
Join Date: Dec 2009
Posts: 261
Rep Power: 21 |
A tiny error in linear PCG solver.
https://cpp.openfoam.org/v5/PCG_8C_source.html#l00066 It does one more iteration than specified in variable maxIter_ (which is read from system/fvSolution dictionary): Code:
// “PCG.C” Foam::solverPerformance Foam::PCG::solve ( ... ) const { ... // --- Solver iteration do { ... } while ( ( solverPerf.nIterations()++ < maxIter_ ... ) ... ); ... } Code:
// “PCG.C” Foam::solverPerformance Foam::PCG::solve ( ... ) const { ... // --- Solver iteration do { ... } while ( ( ++solverPerf.nIterations() < maxIter_ ... ) ... ); ... } |
|
October 9, 2017, 05:37 |
|
#2 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
Hi Sergei,
I came across of that problems several times but never thought about that However, based on your post, I thought it is worth to mention in the bug-tracking system: https://bugs.openfoam.org/view.php?id=2716
__________________
Keep foaming, Tobias Holzmann Last edited by Tobi; October 14, 2017 at 07:54. |
|
October 9, 2017, 08:26 |
|
#3 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
It is already resolved by the commit: https://github.com/OpenFOAM/OpenFOAM...7f0fa442d4ac56
In addition henry changed it in two other gradient based solvers
__________________
Keep foaming, Tobias Holzmann |
|
October 14, 2017, 07:32 |
|
#4 |
Senior Member
Sergei
Join Date: Dec 2009
Posts: 261
Rep Power: 21 |
Hi, Tobias. Thanks for taking a burden of posting a bug report from me. The error was found a while ago but was left where it sat till recent moment. Sometimes searching for a bug in the code can be fun.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Steady-State and Transient Solvers | 70m1 | OpenFOAM Running, Solving & CFD | 21 | May 8, 2021 08:09 |
PEMFC model with FLUENT | brahimchoice | FLUENT | 22 | April 19, 2020 16:44 |
fluent divergence for no reason | sufjanst | FLUENT | 2 | March 23, 2016 17:08 |
Heat flux BC | lfrigeri3 | OpenFOAM | 9 | February 22, 2014 12:59 |
suitable boundary condition for scavenging process? | immortality | OpenFOAM Running, Solving & CFD | 3 | January 25, 2013 20:10 |