|
[Sponsors] |
December 2, 2016, 14:39 |
Command line, plots cuts into BMPs *updated*
|
#1 |
New Member
Thomas Evans
Join Date: Dec 2015
Posts: 21
Rep Power: 10 |
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. Last edited by windscion; December 8, 2016 at 11:56. Reason: updated |
|
December 5, 2016, 10:31 |
how to use
|
#2 |
New Member
Thomas Evans
Join Date: Dec 2015
Posts: 21
Rep Power: 10 |
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. |
|
|
|
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 |