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

How to change Iterations Output format

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 15, 2013, 22:59
Default How to change Iterations Output format
  #1
New Member
 
woodwick's Avatar
 
Alessandro
Join Date: Feb 2013
Location: Italia
Posts: 15
Rep Power: 13
woodwick is on a distinguished road
Hello,

Do you know how the iteration output format is controlled in openFOAM?
for example if we take the output of simpleFoam:
Code:
smoothSolver:  Solving for Ux, Initial residual = 0.205736, Final residual = 0.140782, No Iterations 1000
smoothSolver:  Solving for Uy, Initial residual = 1, Final residual = 0.00808331, No Iterations 1
smoothSolver:  Solving for Uz, Initial residual = 1, Final residual = 0.0090793, No Iterations 1
GAMG:  Solving for p, Initial residual = 1, Final residual = 0.0525214, No Iterations 1
time step continuity errors : sum local = 8.60297e-16, global = 3.22238e-17, cumulative = 3.22238e-17
smoothSolver:  Solving for omega, Initial residual = 0.00905611, Final residual = 0.00024144, No Iterations 1
smoothSolver:  Solving for k, Initial residual = 1, Final residual = 0.0303447, No Iterations 1
ExecutionTime = 0.09 s  ClockTime = 0 s
Suppose that we want to print on screen just the Ux and omit Uy and Uz. Is it possible? Which and where are the files that control the format and can I modify them?

Thank you in advance.
woodwick is offline   Reply With Quote

Old   July 16, 2013, 04:17
Default
  #2
Senior Member
 
Join Date: Mar 2010
Location: Germany
Posts: 154
Rep Power: 16
cutter is on a distinguished road
Hi,

what do you really want to achieve? Plot the residuals? There's a nice tool named pyFoamPlotWatcher to do these kind of things.

A nice way to filter out the interesting values is to pipe the solver's output through the Unix grep and awk commands for example. This will keep you from changing you solvers' output formats constantly.

To answer your last question: You need to read the code of your particular solver. The print statements (Info << "some string") are usually scattered throughout the solver loop and the library functions (see includes).

Cutter
cutter is offline   Reply With Quote

Old   July 16, 2013, 07:37
Default
  #3
New Member
 
woodwick's Avatar
 
Alessandro
Join Date: Feb 2013
Location: Italia
Posts: 15
Rep Power: 13
woodwick is on a distinguished road
Thanks Cutter,

yes, my question was raised from plotting the residuals from an output with multi-regions, I had several domains with temperature residuals,

Code:
Solving for solid region case
GAMG:  Solving for T, Initial residual = 0.0045469064, Final residual = 0.00016222444, No Iterations 1
GAMG:  Solving for T, Initial residual = 0.00016208411, Final residual = 6.5429215e-06, No Iterations 7
Min/max T:279.34359 289.03605
.....

---Solving for SOLID region: shaft ---

Solving for solid region shaft
GAMG:  Solving for T, Initial residual = 0.0027614384, Final residual = 0.00013059475, No Iterations 14  

....ect
I wanted to extract just one of those and if I use grep 'Solving for T' I get all regions. I ended up following your advice, using awk :

Code:
set logscale y 
set title "Case" 
set ylabel 'Temperature Residuals' 
set xlabel 'Iteration' 
plot "< cat log | awk '/Solving for solid region case/{getline; print}'| cut -d' ' -f9 | tr -d ','" title 'T' with lines 
pause 1 
reread
[essentially the same script from wolfgang, just a little bit modified]
Still after doing that, I was thinking: what if one day I need a variable or residual that the solver does not give on output. Can I modify the output of the solver itself? How does it work? So if I understood well your suggestion, to get an idea of how the solver collect and send the output on the screen I have to type:
Code:
grep -r  "info <<" /path_of_the_solver_of_interest
+ check the includes , you mean for example in the case of simpleFoam all those that I find in at the beginning of simpleFoam.C?
Code:
#include "fvCFD.H"
#include "singlePhaseTransportModel.H"
#include "RASModel.H"
#include "simpleControl.H"
#include "fvIOoptionList.H"
woodwick is offline   Reply With Quote

Old   February 7, 2014, 05:24
Default
  #4
Member
 
Tobias Adam
Join Date: Oct 2013
Location: Siegen
Posts: 55
Rep Power: 13
Tobias Adam is on a distinguished road
Hello,

I have a different problem with my solver output.

My solver doesnīt give me any information about the Residuals.
I didnīt change the options, or disabled the output manually ( as far as I know :-D )

My output is as follows
Code:
Time = 1

time step continuity errors : sum local = 511.432, global = 31.4965, cumulative = 31.4965
bounding omega, min: -5403.9 max: 1.7591e+11 average: 1.91796e+07
ExecutionTime = 3542.94 s  ClockTime = 3551 s
Thank you for your advice :-)

best regards Tobi
Tobias Adam is offline   Reply With Quote

Old   February 12, 2014, 10:22
Default
  #5
Member
 
Tobias Adam
Join Date: Oct 2013
Location: Siegen
Posts: 55
Rep Power: 13
Tobias Adam is on a distinguished road
It definitely has something to do with the openFoam-version.

Normally I use OF 2.2.0, but we already installed OF 2.2.x_131223 in our office.
Does anybody know, if the missing solver output is a bug of this version? Or maybe I just have to do a little entry in a dict-file to enable the output again.
I would be very happy to see some answers :-)

thanks in advance
and best regards Tobi
Tobias Adam 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
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 07:20
How to write k and epsilon before the abnormal end xiuying OpenFOAM Running, Solving & CFD 8 August 27, 2013 16:33
calculation stops after few time steps sivakumar OpenFOAM Running, Solving & CFD 7 March 17, 2013 07:37
Interfoam blows on parallel run danvica OpenFOAM Running, Solving & CFD 16 December 22, 2012 03:09
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:08.