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

Command line, plots cuts into BMPs

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 2, 2016, 14:39
Default Command line, plots cuts into BMPs *updated*
  #1
New Member
 
Thomas Evans
Join Date: Dec 2015
Posts: 21
Rep Power: 10
windscion is on a distinguished road
Overall status:
Beta. It has useful command-line arguments now. See second post.

License: DWTFYW

What it makes:
* checkmesh_basic checks the mesh, tests a few simple cuts against the mesh.
* pp_openfoam makes BMP image files from cuts through the data.

Requirements:
C compiler.

What it does:
Looks thru a directory (char *case_path in pp_openfoam.c:CreateFieldImage()) for files of type 'directory' matching [0-9]+[.]?[0-9]* -- i.e., times. These are sorted.
Loops over the times found, and finds files inside the directory.
Allows indexed or full RGBA images. Also, you can change the granularity of the colormap by using anywhere from 3 to 4096 entries. Using more than 224 entries forces the code to use full RGBA format. (The first 32 colormap entries are reserved.)


What it does not do:
* Process "0/" -- this is usually a bunch of text, not actual data.
* Handle dynamic grids. No way, not happening.
* Limit itself to a range or set of times. (Not a priority THB.)
* Handle binary faces files which are not in format faceCompactList.
* Make beautiful text. Ugly ASCII text, that is my limit.
* Interpolate. Data at faces is the average of connected cells. Data inside cell is value for cell.
* Pay attention to boundary data. It reads the internal fields and that is all.

==============

Fixed major portability issues -- attched file has been updated.
Attached Files
File Type: gz toolkit.tar.gz (47.5 KB, 0 views)

Last edited by windscion; December 8, 2016 at 11:56. Reason: updated
windscion is offline   Reply With Quote

Old   December 5, 2016, 10:31
Default how to use
  #2
New Member
 
Thomas Evans
Join Date: Dec 2015
Posts: 21
Rep Power: 10
windscion is on a distinguished road
Okay, the image generation is done in pp_openfoam.c, CreateFieldImage().

Change char *case_name to change the case name, if "./" isn't your style.

To create a new/different cut:
* Define your cut using a point on the plane and a normal to the plane. This is all that the code to read the data requires.
* Define (Plot_Layout).mpx and .mpy -- these are the row-vectors for your matrix to project the 3D domain onto the image plane.
* If you wish to, you can set .dpx and .dpy manually -- these represent the median pixel width and height. You can also modify the line (currently 29) for "static int ppc=2;" to make the image larger or smaller.
* Name your cut something useful, e.g., .blurb = "y=3.1416"

To change the plotted range, modify gate[2] and gate[3]. If gate[3] <= gate[2], it will scale the range using the current range on the local cut. If gate[3] > gate[2], those become limits for the cut.

==================

Command-line options:

-cut:z0:y625:x400:z=-16
separated by: colon, comma
format: [xyz] followed by optional =, followed by value. It will then generate a cut as defined. Eventually, maybe it will support oblique or even skew cuts.

-onlycut:
same as "-cut:" but discards the defaults cuts z=0, z=(zmax+zmin)/2 and y=(ymax+ymin)/2

-map:n
use colormap n
1=cool-to-warm extended
2=greyscale
3=blackbodyradiation
default=cool-to-warm

-field:nut,p_rgh
Adds to list of fields to plot. Note that adding $ to the field name, as e.g. alpha$, will match any filename starting with the string.

-onlyfield:
like "-field:", but clears defaults fields of {ux,uy,uz,zvort,alpha$}

-ppc:n
set the number of pixels per median length scale (i.e., cell size). Default value is two.

-bands:n
set the number of discrete levels in the colormap. Must be at least three and no more than 4096. Default value is 128.

Last edited by windscion; December 8, 2016 at 11:54.
windscion is offline   Reply With Quote

Reply


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
how to produce nice plots besh Main CFD Forum 3 August 9, 2013 08:47
Cp Plots Saj STAR-CCM+ 1 October 12, 2010 09:50
vector plots and contour plots do not match swati_mohanty FLUENT 1 August 26, 2010 05:53
Smooth plots of external data samu Siemens 2 May 21, 2006 13:08
drawing of contour plots chinthakindi Main CFD Forum 1 April 27, 2004 04:33


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