CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (http://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   pyFoam - plotting residuals with different line types or points and fewer variables (http://www.cfd-online.com/Forums/openfoam-post-processing/115097-pyfoam-plotting-residuals-different-line-types-points-fewer-variables.html)

gustavo_nicknich March 23, 2013 17:18

pyFoam - plotting residuals with different line types or points and fewer variables
 
Hi everyone,

I'm using pyFoamPlotWatcher and pyFoamPlotRunner to plot the residuals. Problem is I need to use those graphs in a paper, so I can't use colors to differentiate between variables. Rather I would like to use different line or point types available in gnuplot.
Also I would like to plot fewer variables. For example, I'm using viscoelasticFluidFoam that solvers for three components in U and six components in tau. Plus p, it makes ten, resulting in a very messy plot.

Best regards.

aljazari March 23, 2013 18:56

I can see from the options for pyFoamPlotWatcher that there is one for custom regular expressions, maybe that can be used.

What I would do is use the option: --write-files

Code:

pyFoamPlotWatcher.py --silent --write-files --hardcopy --solver-not-running-anymore log
This will create a folder called log.analyzed with files for different variables, you can then use your favourite plotting tool on these files.

gschaider March 23, 2013 19:59

Quote:

Originally Posted by gustavo_nicknich (Post 415915)
Hi everyone,

I'm using pyFoamPlotWatcher and pyFoamPlotRunner to plot the residuals. Problem is I need to use those graphs in a paper, so I can't use colors to differentiate between variables. Rather I would like to use different line or point types available in gnuplot.
Also I would like to plot fewer variables. For example, I'm using viscoelasticFluidFoam that solvers for three components in U and six components in tau. Plus p, it makes ten, resulting in a very messy plot.

Best regards.

aljazari option is one way to do it. The other would be to write a customRegexp that only scans for the residuals you're interested in (just because they are plotted once doesn't mean they can't be plotted once again)

I see your problem with the styles, but that is not so easy to fix (especially for the predefined plots=

gustavo_nicknich March 24, 2013 14:42

I've used aljazari's option with gnuplot and it worked just fine, thanks!
Luckily I was able to avoid regular expressions, since I'm not familiar with it.

Best regards.

gschaider March 24, 2013 18:00

Quote:

Originally Posted by gustavo_nicknich (Post 416058)
I've used aljazari's option with gnuplot and it worked just fine, thanks!
Luckily I was able to avoid regular expressions, since I'm not familiar with it.

They're not that complicated. And very useful (not only in PyFoam, but also in regular OpenFOAM for flexible specifications of boundary conditions)

gustavo_nicknich March 24, 2013 19:46

Benhard, could you please indicate some material about using regular expressions in OpenFOAM?

gschaider March 25, 2013 06:20

Quote:

Originally Posted by gustavo_nicknich (Post 416100)
Benhard, could you please indicate some material about using regular expressions in OpenFOAM?

Well. In dictionaries you can use regular expressions instead of keywords and requests matching that expression will give that result. See for instance http://www.cfd-online.com/Forums/ope...tml#post273069

gustavo_nicknich March 25, 2013 07:46

Thanks, I'll take a look at that.


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