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

[Tutorials] Tutorial of how to plot residuals !

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree322Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 19, 2020, 00:38
Default
  #161
New Member
 
Join Date: Aug 2020
Posts: 7
Rep Power: 4
Kannan86 is on a distinguished road
Hi Peter,

Thanks a lot for the suggestion.


I changed the script as u said


My Script:
----------------------------------------------------------------------------------------------------------------------------
set xrange [1:*]
set logscale y
set title "Residuals"
set ylabel 'Residual'
set xlabel 'Iteration'
plot "< cat log | grep 'Solving for Ux' | cut -d' ' -f9 | tr -d ','" title 'Ux' with lines,\
"< cat log | grep 'Solving for Uy' | cut -d' ' -f9 | tr -d ','" title 'Uy' with lines,\
"< cat log | grep 'Solving for Uz' | cut -d' ' -f9 | tr -d ','" title 'Uz' with lines,\
"< cat log | grep 'Solving for omega' | cut -d' ' -f9 | tr -d ','" title 'omega' with lines,\
"< cat log | grep 'Solving for k' | cut -d' ' -f9 | tr -d ','" title 'k' with lines,\
"< cat log | grep 'Solving for p' | cut -d' ' -f9 | tr -d ','" title 'p' with lines
pause 1
reread
------------------------------------------------------------------------------------------------------------------------

But, still I am getting error message...

---------------------------------------------------------------------------------------------------------------------------------------------------------------
gnuplot> load "Residuals"
"Residuals" line 11: warning: Skipping data file with no valid points
"Residuals" line 11: warning: Skipping data file with no valid points
"Residuals" line 11: warning: Skipping data file with no valid points
"Residuals" line 11: warning: Skipping data file with no valid points
"Residuals" line 11: warning: Skipping data file with no valid points
"Residuals" line 11: warning: Skipping data file with no valid points

gnuplot> plot "< cat log | grep 'Solving for Ux' | cut -d' ' -f9 | tr -d ','" title 'Ux' with lines, "< cat log | grep 'Solving for Uy' |
cut -d' ' -f9 | tr -d ','" title 'Uy' with lines, "< cat log | grep 'Solving for Uz' | cut -d' ' -f9 | tr -d ','" title 'Uz' with lines,
"< cat log | grep 'Solving for omega' | cut -d' ' -f9 | tr -d ','" title 'omega' with lines, "< cat log | grep 'Solving for k' | cut
-d' ' -f9 | tr -d ','" title 'k' with lines, "< cat log | grep 'Solving for p' | cut -d' ' -f9 | tr -d ','" title 'p' with lines



^
"Residuals" line 11: x range is invalid
--------------------------------------------------------------------------------------------------------------------------------------------------------------


Plese help me out...
Kannan86 is offline   Reply With Quote

Old   August 19, 2020, 22:59
Default
  #162
Senior Member
 
Peter Hess
Join Date: Apr 2011
Location: Austria
Posts: 229
Rep Power: 14
peterhess is on a distinguished road
I executed your skript on a case of mine.

It works actualy...

I dont see a problem with it.

Regards

Peter
Kannan86 likes this.

Last edited by peterhess; August 20, 2020 at 06:47.
peterhess is offline   Reply With Quote

Old   December 2, 2020, 13:21
Default
  #163
Member
 
Mohammad M F
Join Date: Jan 2016
Location: Washington DC, USA
Posts: 43
Rep Power: 8
mmohaqeqf is on a distinguished road
For those of you who are stuck with plotting residuals from the Windows Subsystem for Linux (bash under windows), please see the following link for some possible solutions:


Plot the residuals using pyFoamPlotWatcher
mmohaqeqf is offline   Reply With Quote

Old   January 21, 2021, 16:47
Default gnuplot not plotting residuals
  #164
New Member
 
Join Date: Dec 2020
Posts: 26
Rep Power: 3
OlivierM is on a distinguished road
Hello,
I have followed your steps but I don't succeed to plot any residuals at all.
Here the error I get:

[
gnuplot> load 'residuals.gnu'
"residuals.gnu" line 10: warning: Skipping data file with no valid points
"residuals.gnu" line 10: warning: Skipping data file with no valid points
"residuals.gnu" line 10: warning: Skipping data file with no valid points
"residuals.gnu" line 10: warning: Skipping data file with no valid points
"residuals.gnu" line 10: warning: Skipping data file with no valid points
"residuals.gnu" line 10: warning: Skipping data file with no valid points

gnuplot> plot "< cat logS | grep 'Solving for Ux' | cut -d' ' -f4 | tr -d ','" title 'Ux' with lines,
"< cat logS | grep 'Solving for Uy' | cut -d' ' -f5 | tr -d ','" title 'Uy' with lines,
"< cat logS | grep 'Solving for Uz' | cut -d' ' -f9 | tr -d ','" title 'Uz' with lines,
"< cat logS | grep 'Solving for omega' | cut -d' ' -f9 | tr -d ','" title 'omega' with lines,
"< cat logS | grep 'Solving for k' | cut -d' ' -f9 | tr -d ','" title 'k' with lines,
"< cat logS | grep 'Solving for p' | cut -d' ' -f9 | tr -d ','" title 'p' with lines

^
"residuals.gnu" line 10: x range is invalid
]

Here is an extract of the 'logS' file:

[
Time = 601

smoothSolver: Solving for Ux, Initial residual = 0.00152791, Final residual = 1.34114e-06, No Iterations 10
smoothSolver: Solving for Uy, Initial residual = 0.00188445, Final residual = 1.40107e-06, No Iterations 11
smoothSolver: Solving for Uz, Initial residual = 0.000782393, Final residual = 6.19569e-07, No Iterations 10
GAMG: Solving for p, Initial residual = 0.0083305, Final residual = 3.68604e-05, No Iterations 4
GAMG: Solving for p, Initial residual = 0.000366117, Final residual = 2.0491e-06, No Iterations 4
time step continuity errors : sum local = 1.35357e-05, global = -1.07648e-06, cumulative = 1.73712
smoothSolver: Solving for omega, Initial residual = 2.75059e-06, Final residual = 7.9774e-09, No Iterations 9
smoothSolver: Solving for k, Initial residual = 0.00298973, Final residual = 2.85537e-06, No Iterations 11
ExecutionTime = 14.02 s ClockTime = 14 s
]


Is there anyone who can help me understanding this problem ?


Gnuplot is v5.4 installed on W10
OF is v2012 installed on Ubuntu 20.04 WSL2
OlivierM is offline   Reply With Quote

Old   July 22, 2022, 09:08
Default mix/max(T)
  #165
New Member
 
Join Date: May 2022
Posts: 6
Rep Power: 2
ade10 is on a distinguished road
how can i plot the value of max temperature in my domain?
ade10 is offline   Reply With Quote

Old   September 29, 2022, 11:54
Default
  #166
New Member
 
Seyfi Girgin
Join Date: Aug 2015
Posts: 12
Rep Power: 9
seyfigirgin is on a distinguished road
Hi all
In my cases i have the following data

GMRES iteration:0 Residual: value 1 value 2 value 3
GMRES iteration:1 Residual: value 4 value 5 value 6

How can i select the value 2?

Regards
seyfigirgin is offline   Reply With Quote

Old   September 29, 2022, 13:02
Default
  #167
Member
 
Flavio Galeazzo
Join Date: Mar 2009
Location: Karlsruhe, Germany
Posts: 34
Rep Power: 16
flavio_galeazzo is on a distinguished road
You can try this:

plot "< cat log | grep 'GMRES iteration:0' | cut -d' ' -f7 | tr -d ','" title 'Value 2' with lines
flavio_galeazzo is offline   Reply With Quote

Old   September 29, 2022, 13:26
Default
  #168
New Member
 
Seyfi Girgin
Join Date: Aug 2015
Posts: 12
Rep Power: 9
seyfigirgin is on a distinguished road
Quote:
Originally Posted by flavio_galeazzo View Post
You can try this:

plot "< cat log | grep 'GMRES iteration:0' | cut -d' ' -f7 | tr -d ','" title 'Value 2' with lines
Thank you very much

What if they are in the form of

GMRES iteration:0 Residual: (value 1 value 2 value 3)
GMRES iteration:1 Residual: (value 4 value 5 value 6)

and i want to pick up value 1, in that case -f6 or whatever -f number does not work because of the parenthesis i guess. I received "invalid x range" error.

What could be done for this case?
seyfigirgin is offline   Reply With Quote

Old   September 29, 2022, 13:36
Default
  #169
Member
 
Flavio Galeazzo
Join Date: Mar 2009
Location: Karlsruhe, Germany
Posts: 34
Rep Power: 16
flavio_galeazzo is on a distinguished road
Ok, try this instead

plot "< cat log | grep 'GMRES iteration:0' | cut -d' ' -f4 | tr -d '('" title 'Value 1' with lines
flavio_galeazzo is offline   Reply With Quote

Old   October 5, 2022, 16:01
Default
  #170
New Member
 
Tunc
Join Date: Nov 2021
Posts: 4
Rep Power: 3
tuncm18 is on a distinguished road
Quote:
Originally Posted by bioexplore View Post
Hi, can this method applicable to parallel cases?
Yes, you can apply as long as you have merged solution log if I am not wrong.
tuncm18 is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
plot residuals in multiregion solver val46 OpenFOAM 4 December 12, 2016 07:06
To Plot Residuals on the fly. neeraj OpenFOAM Running, Solving & CFD 5 October 2, 2013 07:23
[PyFoam] why pyFoamPlotRunner doesn't plot continuity residuals? immortality OpenFOAM Community Contributions 10 May 5, 2013 07:13
plot of residuals hawkeye321 OpenFOAM 5 December 7, 2012 10:05
[Virtualization] OpenFOAM oriented tutorial on using VMware Player - support thread wyldckat OpenFOAM Installation 2 July 11, 2012 17:01


All times are GMT -4. The time now is 08:21.