CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Community Contributions (https://www.cfd-online.com/Forums/openfoam-community-contributions/)
-   -   [PyFoam] why pyfoam doesn't draw residuals? (https://www.cfd-online.com/Forums/openfoam-community-contributions/111644-why-pyfoam-doesnt-draw-residuals.html)

immortality January 11, 2013 14:19

why pyfoam doesn't draw residuals?
 
im using pyfoam in parallel mode but it doesn't draw residuals during the run.how it can be solved to see residual figures?

gschaider January 11, 2013 15:21

Quote:

Originally Posted by immortality (Post 401431)
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.

immortality January 15, 2013 12:07

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.

gschaider January 15, 2013 12:40

Quote:

Originally Posted by immortality (Post 401998)
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

immortality January 16, 2013 10:03

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?

gschaider January 16, 2013 11:01

Quote:

Originally Posted by immortality (Post 402204)
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?

immortality January 16, 2013 11:48

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.

gschaider January 16, 2013 15:48

Quote:

Originally Posted by immortality (Post 402241)
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?

immortality January 23, 2013 05:56

thanks for your precise categorization.gnuplot was not installed properly at my advisor's room.


All times are GMT -4. The time now is 09:49.