CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

fvScalarMatrix.solve() how to get the number of iterations?

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By linch

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 5, 2014, 09:34
Default fvScalarMatrix.solve() how to get the number of iterations?
  #1
Senior Member
 
Illya Shevchuk
Join Date: Aug 2009
Location: Darmstadt, Germany
Posts: 176
Rep Power: 17
linch is on a distinguished road
Hi Foamers,

it's common knowledge, that whith .solve().initialResidual() one can get the normalized initial residual of the linear system of eqs., before it is being solved iteratively.

Do you know, how can I get the initial residuals and the number of iterations were made to reach the final residuals (and probably also the final residuals)?

Best regards,
Ilya
linch is offline   Reply With Quote

Old   September 5, 2014, 09:42
Default
  #2
Senior Member
 
Illya Shevchuk
Join Date: Aug 2009
Location: Darmstadt, Germany
Posts: 176
Rep Power: 17
linch is on a distinguished road
P.S. I mean, lduMatrix has public functions initialResidual() finalResidulal() and noIterations(), but how to get them all together at ones, without executing .solve() three times?

Last edited by linch; September 5, 2014 at 10:46.
linch is offline   Reply With Quote

Old   September 5, 2014, 11:06
Default
  #3
Senior Member
 
Illya Shevchuk
Join Date: Aug 2009
Location: Darmstadt, Germany
Posts: 176
Rep Power: 17
linch is on a distinguished road
Answering my own question:
Code:
    scalar eqnInitialResidual = 1;
    label  eqnNoIterations = 0;
    lduMatrix::solverPerformance solverPerf;

    solverPerf = Eqn.solve();
    eqnNoIterations = solverPerf.nIterations();
    eqnInitialResidual = solverPerf.initialResidual();
jherb and ruloz like this.
linch is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sudden jump in Courant number NJG OpenFOAM Running, Solving & CFD 7 May 15, 2014 14:52
Help for the small implementation in turbulence model shipman OpenFOAM Programming & Development 25 March 19, 2014 11:08
rhoSimplecFoam Mach0.8 no pressure values CFDnewbie147 OpenFOAM Running, Solving & CFD 16 November 23, 2013 06:58
calculation stops after few time steps sivakumar OpenFOAM Running, Solving & CFD 7 March 17, 2013 07:37
Differences between serial and parallel runs carsten OpenFOAM Bugs 11 September 12, 2008 12:16


All times are GMT -4. The time now is 05:41.