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

[PyFoam] plotting residuals with different line types or points and fewer variables

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 23, 2013, 17:18
Default plotting residuals with different line types or points and fewer variables
  #1
New Member
 
Gustavo Nicknich
Join Date: Mar 2013
Posts: 4
Rep Power: 13
gustavo_nicknich is on a distinguished road
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.
gustavo_nicknich is offline   Reply With Quote

Old   March 23, 2013, 18:56
Default
  #2
New Member
 
Abdulhaq
Join Date: Oct 2012
Posts: 27
Rep Power: 14
aljazari is on a distinguished road
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.
aljazari is offline   Reply With Quote

Old   March 23, 2013, 19:59
Default
  #3
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 gustavo_nicknich View Post
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=
__________________
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   March 24, 2013, 14:42
Default
  #4
New Member
 
Gustavo Nicknich
Join Date: Mar 2013
Posts: 4
Rep Power: 13
gustavo_nicknich is on a distinguished road
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.
gustavo_nicknich is offline   Reply With Quote

Old   March 24, 2013, 18:00
Default
  #5
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 gustavo_nicknich View Post
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)
__________________
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   March 24, 2013, 19:46
Default
  #6
New Member
 
Gustavo Nicknich
Join Date: Mar 2013
Posts: 4
Rep Power: 13
gustavo_nicknich is on a distinguished road
Benhard, could you please indicate some material about using regular expressions in OpenFOAM?
gustavo_nicknich is offline   Reply With Quote

Old   March 25, 2013, 06:20
Default
  #7
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 gustavo_nicknich View Post
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
__________________
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   March 25, 2013, 07:46
Default
  #8
New Member
 
Gustavo Nicknich
Join Date: Mar 2013
Posts: 4
Rep Power: 13
gustavo_nicknich is on a distinguished road
Thanks, I'll take a look at that.
gustavo_nicknich is offline   Reply With Quote

Reply

Tags
gnuplot, 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



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