|
[Sponsors] |
Analyzing log with PyFoam without GNUPlot windows |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 7, 2019, 23:17 |
Analyzing log with PyFoam without GNUPlot windows
|
#1 |
New Member
R inaba
Join Date: Jan 2016
Posts: 2
Rep Power: 0 |
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() 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 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 |
|
January 10, 2019, 05:45 |
Solved
|
#2 |
New Member
R inaba
Join Date: Jan 2016
Posts: 2
Rep Power: 0 |
Solved as following.
Code:
simpleFoam = GnuplotRunner(['simpleFoam','-case',newCase],progress=True,gnuplotTerminal='/dev/null').start() |
|
Tags |
ipython, jupyter, pyfoam |
|
|
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 |