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

Plot residuals to observe convergens

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 6, 2014, 08:46
Default Plot residuals to observe convergens
  #1
New Member
 
Peter Rosén
Join Date: Sep 2014
Posts: 12
Rep Power: 12
Zappstar is on a distinguished road
Hello!

I am using CAELinux2013. Is there an easy way to see (Plot) the residuals while calculation is running ? I would like to know if the residual is steady or unsteady without manually reading the log file.

Regards,

Peter
Zappstar is offline   Reply With Quote

Old   October 6, 2014, 17:01
Default pyFoam is what you need
  #2
Senior Member
 
Alex
Join Date: Oct 2013
Posts: 337
Rep Power: 22
zfaraday will become famous soon enough
Hello Peter,

In order to be able to view residuals plotted on the fly I recomend you to install PyFoam.

Regards,

Alex
__________________
Web site where I present my Master's Thesis: foamingtime.wordpress.com

The case I talk about in this site was solved with chtMultiRegionSimpleFoam solver and involves radiation. Some basic tutorials are also resolved step by step in the web. If you are interested in these matters, you are invited to come in!
zfaraday is offline   Reply With Quote

Old   October 7, 2014, 02:49
Default
  #3
New Member
 
Peter Rosén
Join Date: Sep 2014
Posts: 12
Rep Power: 12
Zappstar is on a distinguished road
Hello and Thank you!

Installed and done! But now comes the question, how do i run it? to i have to use foamjob? Or can i look at the residual from my log file named listing made from Code-Saturn? How would i run that in terminal if i for instance want to use pyFoamPlotWatcher ? I have manage to run python shell in terminal, what is the next step?

regards, peter
Zappstar is offline   Reply With Quote

Old   October 7, 2014, 12:17
Default
  #4
Senior Member
 
Alex
Join Date: Oct 2013
Posts: 337
Rep Power: 22
zfaraday will become famous soon enough
There's no need to use foamJob, Peter. Just type pyFoamPlotWatcher.py <log file name> and enjoy your foaming!

regards,

alex
__________________
Web site where I present my Master's Thesis: foamingtime.wordpress.com

The case I talk about in this site was solved with chtMultiRegionSimpleFoam solver and involves radiation. Some basic tutorials are also resolved step by step in the web. If you are interested in these matters, you are invited to come in!
zfaraday is offline   Reply With Quote

Old   October 8, 2014, 05:40
Default Hello
  #5
New Member
 
Peter Rosén
Join Date: Sep 2014
Posts: 12
Rep Power: 12
Zappstar is on a distinguished road
Hello and thank you!

when i am in the logg file directrory i type,

python
pyFoamPlotWacher.py listing (have tried pyFoamPlotWacher.py <listing>)

and i get "SyntaxError: invalid syntax File"<stdin>", line1"

what am i doing wrong?

regard, Peter
Zappstar is offline   Reply With Quote

Old   October 8, 2014, 08:26
Default
  #6
Senior Member
 
Alex
Join Date: Oct 2013
Posts: 337
Rep Power: 22
zfaraday will become famous soon enough
Well I see what your problem is. You don't really need to enter the python shell, pyFoam applications work without that. I will try to explain more accurately the steps to create the residuals plot (more plots will be created).

Imagine you are running a case using icoFoam solver. You proceed this way to create the log file:

Code:
icoFoam > log.icoFoam 2>&1
Then you just have to type in the terminal the following statement:

Code:
pyFoamPlotWatcher.py log.icoFoam
Note: you don't have to wait until the solver finishes, you can run pyFoamPlotWatcher on the fly while the solver is runing.

EDIT: Remember, if in doubt you can always invoke an application with the -help flag to see all its options and modes of use.

Hope it helps.


Regards,

Alex
__________________
Web site where I present my Master's Thesis: foamingtime.wordpress.com

The case I talk about in this site was solved with chtMultiRegionSimpleFoam solver and involves radiation. Some basic tutorials are also resolved step by step in the web. If you are interested in these matters, you are invited to come in!

Last edited by zfaraday; October 8, 2014 at 08:29. Reason: in red
zfaraday is offline   Reply With Quote

Old   October 8, 2014, 11:55
Default Thank you!
  #7
New Member
 
Peter Rosén
Join Date: Sep 2014
Posts: 12
Rep Power: 12
Zappstar is on a distinguished road
Hi again, and thank you for your instructions it feels like i am getting closer.

I am using simpleFoam and therefor tried,

simpleFoam > log.simpleFoam 2>&

I attach my log file below, The directory, that simpleFoam is trying to find does not exist. I can not find much in simpleFoam -help

regards,


/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.1.1 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
Build : 2.1.1-221db2718bbb
Exec : simpleFoam
Date : Oct 08 2014
Time : 16:29:59
Host : "peter-VirtualBox"
PID : 12775
Case : /home/peter/Project/Skyware/Parabol_0deg/PARABOL_CGNS/RUN1/RESU/20141008-1618
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Disallowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time



--> FOAM FATAL IO ERROR:
cannot find file

file: /home/peter/Project/Skyware/Parabol_0deg/PARABOL_CGNS/RUN1/RESU/20141008-1618/system/controlDict at line 0.

From function regIOobject::readStream()
in file db/regIOobject/regIOobjectRead.C at line 73.

FOAM exiting
Zappstar is offline   Reply With Quote

Old   October 8, 2014, 13:30
Default
  #8
Senior Member
 
Alex
Join Date: Oct 2013
Posts: 337
Rep Power: 22
zfaraday will become famous soon enough
As per what the message says there is no controlDict file in the system directory of your case "20141008-1618". If this is not the name of your case maybe you are executing the solver in the wrong directory... If this is your case directory, then you missed the controlDict file within the system directory.
__________________
Web site where I present my Master's Thesis: foamingtime.wordpress.com

The case I talk about in this site was solved with chtMultiRegionSimpleFoam solver and involves radiation. Some basic tutorials are also resolved step by step in the web. If you are interested in these matters, you are invited to come in!
zfaraday is offline   Reply With Quote

Old   November 19, 2014, 08:50
Default I get a strange error message and no plot. What about openFoam version?
  #9
New Member
 
Peter Rosén
Join Date: Sep 2014
Posts: 12
Rep Power: 12
Zappstar is on a distinguished road
peter@peter-Sigma:~/OpenFOAM/peter-2.3.x/run/Skyware$ pyFoamPlotWatcher.py log
PyFoam WARNING on line 235 of file /home/peter/OpenFOAM/PyFoam-0.6.2/lib/python2.7/site-packages/PyFoam/Applications/PyFoamApplication.py : $WM_PROJECT_VERSION unset. PyFoam will not be able to determine the OpenFOAM-version and behave strangely

gnuplot> set terminal x11
^
line 0: unknown or ambiguous terminal type; type just 'set terminal' for a list


gnuplot> set terminal x11 noraise
^
line 0: unknown or ambiguous terminal type; type just 'set terminal' fo
Zappstar is offline   Reply With Quote

Old   November 19, 2014, 09:03
Default
  #10
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

http://www.cfd-online.com/Forums/ope...-problems.html

(there's Search functionality, you know)

About $WM_PROJECT_VERSION: are you sure your environment was set up? What's the output of

Code:
$ export | grep WM_
command?
alexeym 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
[Tutorials] Tutorial of how to plot residuals ! wolle1982 OpenFOAM Community Contributions 172 December 6, 2024 07:20
plot residuals in multiregion solver val46 OpenFOAM 4 December 12, 2016 07:06
[swak4Foam] Foam warnings - related to swak4Foam Salam-H OpenFOAM Community Contributions 20 August 2, 2015 16:40
How to plot residuals of all iterations in Fluent FJSJ FLUENT 4 September 20, 2013 10:47
Residuals Plot kamalipour FLUENT 2 December 15, 2011 04:44


All times are GMT -4. The time now is 02:51.