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

Analyzing log with PyFoam without GNUPlot windows

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By inabower
  • 1 Post By inabower

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 7, 2019, 23:17
Default Analyzing log with PyFoam without GNUPlot windows
  #1
New Member
 
R inaba
Join Date: Jan 2016
Posts: 2
Rep Power: 0
inabower is on a distinguished road
Hi FOAMers.

I'm trying to manipulate OpenFOAM in iPython (jupyter notebook).
I want to get like a plot data generated by pyFoamPlotWatcher.py in line as following.

[In]
Code:
import os
import shutil
from PyFoam.RunDictionary.ParsedParameterFile import ParsedParameterFile
from PyFoam.Execution.BasicRunner import BasicRunner
from PyFoam.Execution.GnuplotRunner import GnuplotRunner

from PyFoam.IPythonHelpers.Case import Case

orgCase = os.path.join(os.environ['FOAM_TUTORIALS'],'incompressible','simpleFoam','pitzDaily')
newCase = os.path.join('./result/pitzDaily_')
shutil.copytree(orgCase, newCase)

blockMesh = BasicRunner(['blockMesh','-case',newCase], silent=True).start()
simpleFoam = GnuplotRunner(['simpleFoam','-case',newCase], progress=True).start()

case = Case(newCase)
plots = case.pickledPlots(case.sol.pickledPlots[0])
plots['linear'].head()
[out]
Code:
           Ux  Ux_final  Ux_iterations        Uy  Uy_final  Uy_iterations  \
1.0  1.000000  0.053810            1.0  1.000000  0.030925            2.0   
2.0  0.437824  0.030824            5.0  0.283531  0.025853            4.0   
3.0  0.123694  0.011162            4.0  0.201901  0.015971            4.0   
4.0  0.068341  0.004392            5.0  0.101704  0.008352            4.0   
5.0  0.057485  0.003968            5.0  0.087349  0.008410            4.0   

      epsilon  epsilon_final  epsilon_iterations         k   k_final  \
1.0  0.199984       0.010028                 3.0  1.000000  0.043920   
2.0  0.153314       0.010948                 3.0  0.419186  0.031304   
3.0  0.101901       0.008398                 2.0  0.179557  0.014245   
4.0  0.078654       0.005480                 2.0  0.116407  0.010367   
5.0  0.051670       0.004668                 2.0  0.086742  0.005037   

     k_iterations         p   p_final  p_iterations  
1.0           3.0  1.000000  0.068427          17.0  
2.0           3.0  0.052242  0.004242          15.0  
3.0           3.0  0.148196  0.011370           6.0  
4.0           3.0  0.123471  0.010857           6.0  
5.0           4.0  0.117570  0.011387           3.0
then, I could get dataFrames like pandas' .

BUT a gnuplot window always did popup and I don't need it because I want to do case study and to compare the plots of the each cases.

Do you have any ideas to avoid the pop-up window of gnu plot or to analyze logs silent ?

Best regards.

inabower
rob3rt 0ng likes this.
inabower is offline   Reply With Quote

Old   January 10, 2019, 05:45
Default Solved
  #2
New Member
 
R inaba
Join Date: Jan 2016
Posts: 2
Rep Power: 0
inabower is on a distinguished road
Solved as following.

Code:
simpleFoam = GnuplotRunner(['simpleFoam','-case',newCase],progress=True,gnuplotTerminal='/dev/null').start()
Thanks
snak likes this.
inabower is offline   Reply With Quote

Reply

Tags
ipython, jupyter, pyfoam


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
[Other] CFDSupport's port for Windows: gnuplot 'command not found' Paul Fionn OpenFOAM Installation 18 May 15, 2021 09:11
[PyFoam] PyFoam 0.6.9 wrong path to gnuplot klausb OpenFOAM Community Contributions 5 March 15, 2018 15:28
[OpenFOAM plus] Windows version: the Editor and Gnuplot jackeyhust OpenFOAM 1 September 10, 2016 13:44
CFX11 + Fortran compiler ? Mohan CFX 20 March 30, 2011 19:56
Gnuplot and Fluent on Windows Arianna FLUENT 4 January 25, 2007 12:00


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