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

How can I get the residual?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 19, 2019, 15:04
Default How can I get the residual?
  #1
New Member
 
Sicheng Sun
Join Date: Jun 2016
Posts: 9
Rep Power: 10
ssc0109 is on a distinguished road
Hello everyone,
I am wondering how can I extract the residual of the solution?

I found some information from Residuals for convergence of segregated solvers

by using
lduMatrix::solverPerformance sp = solve(...
or
lduMatrix::solverPerformance sp = xEqn.solve();

however, it seems not working for OpenFoam/7.0 since it was a poster 14 years ago.

I tried
Foam:: solverPerformance sp = xEqn.solve();

it seems to work

but
Foam:: solverPerformance sp = solve(...)
does not work.

so what's the correct function should I call?

I am really appreciate for your help.
ssc0109 is offline   Reply With Quote

Old   November 19, 2019, 17:33
Default
  #2
New Member
 
Sicheng Sun
Join Date: Jun 2016
Posts: 9
Rep Power: 10
ssc0109 is on a distinguished road
For people who meet the same problem,
I got the solution like:

vector Uresidual;
Uresidual = solve(UEqn == -fvc::grad(p)).initialResidual();


scalar presidual;
presidual = pEqn.solve().initialResidual();
ssc0109 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
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


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