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

[PyFoam] why pyfoam doesn't draw residuals?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 11, 2013, 14:19
Default why pyfoam doesn't draw residuals?
  #1
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
im using pyfoam in parallel mode but it doesn't draw residuals during the run.how it can be solved to see residual figures?
immortality is offline   Reply With Quote

Old   January 11, 2013, 15:21
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by immortality View Post
im using pyfoam in parallel mode but it doesn't draw residuals during the run.how it can be solved to see residual figures?
The output of the solver for serial and parallel looks exactly the same so pyFoam doesn't make a difference between them. You are using the PlotRunner? The normal runner won't plot residuals (that's why it hasn't got a Plot in the name)

For serial runs it worked with the same solver/case

Also: usually pyFoam needs 2 or 3 timesteps to start plotting. Sometimes people get impatient with large cases.

In very rare cases (but this is only a handful of solvers) pyFoam can't detect the current timestep because the writer of the solver chose to not output the current time in the "Time = x.xx"-form. In those cases a different pattern can be specified.
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   January 15, 2013, 12:07
Default
  #3
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
Thanks.I haven't used plot in the name.but now when I use "pyFoamPlotRunner.py --procnr=8 rhoCentralFoam" command and error appears as below:
Code:
Build  : 2.1.0-0bc225064152
Exec   : /opt/openfoam210/platforms/linux64GccDPOpt/bin/rhoCentralFoam -parallel
Date   : Feb 15 2012
Time   : 19:30:41
Host   : "thesis-X58A-UD7"
PID    : 23659
Case   : /home/thesis/Desktop/WR_1
nProcs : 8
Slaves :
7
(
"thesis-X58A-UD7.23660"
"thesis-X58A-UD7.23661"
"thesis-X58A-UD7.23662"
"thesis-X58A-UD7.23663"
"thesis-X58A-UD7.23664"
"thesis-X58A-UD7.23665"
"thesis-X58A-UD7.23666"
)

Pstream initialized with:
floatTransfer     : 0
nProcsSimpleSum   : 0
commsType         : nonBlocking
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

Create mesh for time = 0

Reading thermophysical properties

Selecting thermodynamics package ePsiThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>
Reading field U

Creating turbulence model

Selecting turbulence model type laminar
Reading thermophysicalProperties

fluxScheme: Kurganov

Starting time loop

Mean and max Courant Numbers = 16.2751 61.1753
deltaT = 1.63399e-10
Time = 1.63399e-10

diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for rhoUx, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for rhoUy, Initial residual = 0, Final residual = 0, No Iterations 0
smoothSolver:  Solving for Ux, Initial residual = 1.77051e-05, Final residual = 3.12577e-17, No Iterations 3
smoothSolver:  Solving for Uy, Initial residual = 1, Final residual = 4.90108e-17, No Iterations 3
diagonal:  Solving for rhoE, Initial residual = 0, Final residual = 0, No Iterations 0
[1] swak4Foam: Allocating new repository for sampledGlobalVariables
[2] swak4Foam: Allocating new repository for sampledGlobalVariables
[3] swak4Foam: Allocating new repository for sampledGlobalVariables
[4] swak4Foam: Allocating new repository for sampledGlobalVariables
[5] swak4Foam: Allocating new repository for sampledGlobalVariables
[6] swak4Foam: Allocating new repository for sampledGlobalVariables
[0] swak4Foam: Allocating new repository for sampledGlobalVariables
[7] swak4Foam: Allocating new repository for sampledGlobalVariables
smoothSolver:  Solving for e, Initial residual = 6.5453e-06, Final residual = 3.22542e-08, No Iterations 201
ExecutionTime = 3.03 s  ClockTime = 3 s

Mean and max Courant Numbers = 0.00265935 0.00593525
deltaT = 1.90892e-10
Time = 3.54291e-10

diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for rhoUx, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for rhoUy, Initial residual = 0, Final residual = 0, No Iterations 0
smoothSolver:  Solving for Ux, Initial residual = 2.1714e-05, Final residual = 6.51247e-17, No Iterations 3
smoothSolver:  Solving for Uy, Initial residual = 0.226173, Final residual = 1.65286e-17, No Iterations 3
diagonal:  Solving for rhoE, Initial residual = 0, Final residual = 0, No Iterations 0
smoothSolver:  Solving for e, Initial residual = 1.19468e-05, Final residual = 1.92275e-08, No Iterations 201
ExecutionTime = 5.24 s  ClockTime = 5 s

Mean and max Courant Numbers = 0.00310681 0.00693387
deltaT = 2.18043e-10
Time = 5.72334e-10
Traceback (most recent call last):
  File "/usr/local/bin/pyFoamPlotRunner.py", line 5, in <module>
    PlotRunner()
  File "/usr/local/lib/python2.7/dist-packages/PyFoam/Applications/PlotRunner.py", line 60, in __init__
    description=description)
  File "/usr/local/lib/python2.7/dist-packages/PyFoam/Applications/PyFoamApplication.py", line 213, in __init__
    result=self.run()
  File "/usr/local/lib/python2.7/dist-packages/PyFoam/Applications/PlotRunner.py", line 141, in run
    run.start()
  File "/usr/local/lib/python2.7/dist-packages/PyFoam/Execution/BasicRunner.py", line 287, in start
    self.lineHandle(line)
  File "/usr/local/lib/python2.7/dist-packages/PyFoam/Execution/GnuplotRunner.py", line 173, in lineHandle
    GnuplotCommon.lineHandle(self,line)
  File "/usr/local/lib/python2.7/dist-packages/PyFoam/Execution/AnalyzedCommon.py", line 75, in lineHandle
    self.analyzer.analyzeLine(line)
  File "/usr/local/lib/python2.7/dist-packages/PyFoam/LogAnalysis/FoamLogAnalyzer.py", line 125, in analyzeLine
    self.analyzers[nm].doAnalysis(line)
  File "/usr/local/lib/python2.7/dist-packages/PyFoam/LogAnalysis/TimeLineAnalyzer.py", line 43, in doAnalysis
    self.notifyNewTime(m)
  File "/usr/local/lib/python2.7/dist-packages/PyFoam/LogAnalysis/TimeLineAnalyzer.py", line 32, in notifyNewTime
    self.notify(float(m.group(2)))
  File "/usr/local/lib/python2.7/dist-packages/PyFoam/LogAnalysis/LogLineAnalyzer.py", line 65, in notify
    f(*data)
  File "/usr/local/lib/python2.7/dist-packages/PyFoam/LogAnalysis/FoamLogAnalyzer.py", line 71, in setTime
    listener.timeChanged()
  File "/usr/local/lib/python2.7/dist-packages/PyFoam/Execution/StepAnalyzedCommon.py", line 32, in timeChanged
    self.timeHandle()
  File "/usr/local/lib/python2.7/dist-packages/PyFoam/Execution/GnuplotRunner.py", line 82, in timeHandle
    self.plots[p].redo()
  File "/usr/local/lib/python2.7/dist-packages/PyFoam/Basics/GeneralPlotTimelines.py", line 112, in redo
    self.doReplot()
  File "/usr/local/lib/python2.7/dist-packages/PyFoam/Basics/GnuplotTimelines.py", line 115, in doReplot
    self.replot()
  File "/usr/local/lib/python2.7/dist-packages/PyFoam/ThirdParty/Gnuplot/_Gnuplot.py", line 333, in replot
    self.refresh()
  File "/usr/local/lib/python2.7/dist-packages/PyFoam/ThirdParty/Gnuplot/_Gnuplot.py", line 226, in refresh
    self(self.plotcmd + ' ' + string.join(plotcmds, ', '))
  File "/usr/local/lib/python2.7/dist-packages/PyFoam/ThirdParty/Gnuplot/_Gnuplot.py", line 210, in __call__
    self.gnuplot(s)
  File "/usr/local/lib/python2.7/dist-packages/PyFoam/ThirdParty/Gnuplot/gp_unix.py", line 210, in __call__
    self.flush()
IOError: [Errno 32] Broken pipe
thank you for consideration.
immortality is offline   Reply With Quote

Old   January 15, 2013, 12:40
Default
  #4
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by immortality View Post
Thanks.I haven't used plot in the name.but now when I use "pyFoamPlotRunner.py --procnr=8 rhoCentralFoam" command and error appears as below:
Code:
Mean and max Courant Numbers = 0.00265935 0.00593525
deltaT = 1.90892e-10
Time = 3.54291e-10

diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for rhoUx, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for rhoUy, Initial residual = 0, Final residual = 0, No Iterations 0
smoothSolver:  Solving for Ux, Initial residual = 2.1714e-05, Final residual = 6.51247e-17, No Iterations 3
smoothSolver:  Solving for Uy, Initial residual = 0.226173, Final residual = 1.65286e-17, No Iterations 3
diagonal:  Solving for rhoE, Initial residual = 0, Final residual = 0, No Iterations 0
smoothSolver:  Solving for e, Initial residual = 1.19468e-05, Final residual = 1.92275e-08, No Iterations 201
ExecutionTime = 5.24 s  ClockTime = 5 s

Mean and max Courant Numbers = 0.00310681 0.00693387
deltaT = 2.18043e-10
Time = 5.72334e-10
Traceback (most recent call last):
  File "/usr/local/bin/pyFoamPlotRunner.py", line 5, in <module>
    PlotRunner()
  File "/usr/local/lib/python2.7/dist-packages/PyFoam/Applications/PlotRunner.py", line 60, in __init__
    description=description)
  File "/usr/local/lib/python2.7/dist-packages/PyFoam/Applications/PyFoamApplication.py", line 213, in __init__
    result=self.run()
  File "/usr/local/lib/python2.7/dist-packages/PyFoam/Applications/PlotRunner.py", line 141, in run
    run.start()
  File "/usr/local/lib/python2.7/dist-packages/PyFoam/Execution/BasicRunner.py", line 287, in start
    self.lineHandle(line)
  File "/usr/local/lib/python2.7/dist-packages/PyFoam/Execution/GnuplotRunner.py", line 173, in lineHandle
    GnuplotCommon.lineHandle(self,line)
  File "/usr/local/lib/python2.7/dist-packages/PyFoam/Execution/AnalyzedCommon.py", line 75, in lineHandle
    self.analyzer.analyzeLine(line)
  File "/usr/local/lib/python2.7/dist-packages/PyFoam/LogAnalysis/FoamLogAnalyzer.py", line 125, in analyzeLine
    self.analyzers[nm].doAnalysis(line)
  File "/usr/local/lib/python2.7/dist-packages/PyFoam/LogAnalysis/TimeLineAnalyzer.py", line 43, in doAnalysis
    self.notifyNewTime(m)
  File "/usr/local/lib/python2.7/dist-packages/PyFoam/LogAnalysis/TimeLineAnalyzer.py", line 32, in notifyNewTime
    self.notify(float(m.group(2)))
  File "/usr/local/lib/python2.7/dist-packages/PyFoam/LogAnalysis/LogLineAnalyzer.py", line 65, in notify
    f(*data)
  File "/usr/local/lib/python2.7/dist-packages/PyFoam/LogAnalysis/FoamLogAnalyzer.py", line 71, in setTime
    listener.timeChanged()
  File "/usr/local/lib/python2.7/dist-packages/PyFoam/Execution/StepAnalyzedCommon.py", line 32, in timeChanged
    self.timeHandle()
  File "/usr/local/lib/python2.7/dist-packages/PyFoam/Execution/GnuplotRunner.py", line 82, in timeHandle
    self.plots[p].redo()
  File "/usr/local/lib/python2.7/dist-packages/PyFoam/Basics/GeneralPlotTimelines.py", line 112, in redo
    self.doReplot()
  File "/usr/local/lib/python2.7/dist-packages/PyFoam/Basics/GnuplotTimelines.py", line 115, in doReplot
    self.replot()
  File "/usr/local/lib/python2.7/dist-packages/PyFoam/ThirdParty/Gnuplot/_Gnuplot.py", line 333, in replot
    self.refresh()
  File "/usr/local/lib/python2.7/dist-packages/PyFoam/ThirdParty/Gnuplot/_Gnuplot.py", line 226, in refresh
    self(self.plotcmd + ' ' + string.join(plotcmds, ', '))
  File "/usr/local/lib/python2.7/dist-packages/PyFoam/ThirdParty/Gnuplot/_Gnuplot.py", line 210, in __call__
    self.gnuplot(s)
  File "/usr/local/lib/python2.7/dist-packages/PyFoam/ThirdParty/Gnuplot/gp_unix.py", line 210, in __call__
    self.flush()
IOError: [Errno 32] Broken pipe
.
thank you for consideration.
Sometimes when a run crashes PyFoam swallows some of the error messages from OpenFOAM. Try running your case without pyFoam with

mpirun -np 8 rhoCentralFoam -parallel

the reason why I thinnk that your run has failed is that you have a very small timestep (1e-10) but nevertheless the courant in the beginning is approx 60. This looks like the run is exploding because of inappropriate initial conditions. But if you confirm that the run works without PyFoam I will look into it
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   January 16, 2013, 10:03
Default
  #5
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
yes the run is performed without pyfoam(although it crashes at the middle of running due to another reason) but with pyfoam it crashes at initial runs.when the courant is 60?
immortality is offline   Reply With Quote

Old   January 16, 2013, 11:01
Default
  #6
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by immortality View Post
yes the run is performed without pyfoam(although it crashes at the middle of running due to another reason) but with pyfoam it crashes at initial runs.when the courant is 60?
Just on top of your output it says that the Courant-number is 60:

Code:
Starting time loop

Mean and max Courant Numbers = 16.2751 61.1753
deltaT = 1.63399e-10
Time = 1.63399e-10
"at the middle of running means" how many timesteps later?

Anyway: the location where the problem occurs is when the python program talks to the Gnuplot-process but the Gnuplot-process does not accept the input (thus the IOError). Reason could be for instance that Gnuplot didn't start up properly. Which is strange. Starting PlotRunner ON THE SAME MACHINE works in serial?
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   January 16, 2013, 11:48
Default
  #7
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
yes by rhoCentralFoam | tee log it works until .0006s.initial conditions are like that in shock tube.i have attached the case in another thread "an uncovered error.please help".could you have a look to it?
Thanks.
immortality is offline   Reply With Quote

Old   January 16, 2013, 15:48
Default
  #8
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by immortality View Post
yes by rhoCentralFoam | tee log it works until .0006s.initial conditions are like that in shock tube.i have attached the case in another thread "an uncovered error.please help".could you have a look to it?
Thanks.
No time to search that thread.

To check whether pyFoam/Gnuplot is broken run the watcher on the log file

pyFoamPlotWatcher.py log

To summarize:

- pyFoamPlotRunner.py in parallel: FAILS
- no PyFoam ("rhoCentralFoam | tee log") in serial: WORKS
- pyFoamPlotRunner.py in serial: UNSURE (you never said explicitly)
- no pyFoam in parallel ("mpirun -np 8 rhoCentralFoam -parallel | tee log"): HAVE you already tried this?

Also: have you tried pyFoamRunner.py (no plotting) to rule out the possibility that "only" plotting is the problem?
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   January 23, 2013, 05:56
Default
  #9
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
thanks for your precise categorization.gnuplot was not installed properly at my advisor's room.
immortality 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
How to plot residuals vs iterations using pyFoam... ata313ata Visualization & Post-Processing 1 February 6, 2018 05:34
Plot Residuals in each Outer Iteration using foamLog or PyFoam coolcrasher OpenFOAM Running, Solving & CFD 1 October 30, 2015 11:41
[PyFoam] doesn't plot residuals immortality OpenFOAM Community Contributions 4 June 28, 2015 11:13
[PyFoam] Plotting values (e.g. residuals) from all iterations with pyFoam chriss85 OpenFOAM Community Contributions 5 November 11, 2014 12:13
[PyFoam] plotting residuals with different line types or points and fewer variables gustavo_nicknich OpenFOAM Community Contributions 7 March 25, 2013 07:46


All times are GMT -4. The time now is 01:28.