|
[Sponsors] |
PyTecplot routine for automated post-processing of CFD |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 15, 2019, 04:25 |
PyTecplot routine for automated post-processing of CFD
|
#1 |
Member
Join Date: Apr 2011
Posts: 32
Rep Power: 15 |
Hi all,
is there already a python routine out there which automatically, by means of tecplot plotting capabilities,: - analyses the domain (cylindrical or cartesian; min/max dimensions) - creates equidistant slices through domain - plots variables in contour/line plots with appropriate legends, units - orders plots in report form ? The background is that I would like to create of bunch of plots for every CFD task I conduct. These plot ought to roughly represent the CFD result for the sake of doing sanity checks. These plots do not necessarily need to be nice to look at for papers. This pdf roughly shows what I mean wrt. CFD-Post: https://wissen.cadfem.net/de-de/Medi...20CFD-Post.pdf Thx and best regards, MK |
|
October 21, 2019, 14:37 |
|
#2 |
Senior Member
Scott Fowler
Join Date: May 2009
Posts: 112
Rep Power: 16 |
Of course! This is exactly what PyTecplot is designed to do.
To draw a slice at equidistant locations throughout your domain for many files you could do something roughly like this: Code:
import tecplot as tp import numpy as np files = ... list of files to process ... for f in files: # Load data in Tecplot format dataset = tp.data.load_tecplot(f) # Get the extents in the X direction xmin, xmax = dataset.variable('X').minmax() # Create 10 slice positions across the domain slice_positions = np.linspace(xmin, xmax, 10) # Loop over the positions and export an image for slice_pos in slice_positions: ... execute commands to set slice position and plot style ... tp.export.save_png("outputfile_slice_{}".format(slice_pos)) |
|
October 24, 2019, 02:59 |
|
#3 |
Member
Join Date: Apr 2011
Posts: 32
Rep Power: 15 |
Thx, this is a good start. I also took the example for the slices
(https://www.tecplot.com/docs/pytecpl...yle.html#id115) and replaced the start/end position by using the minmax command. I wonder, how to create radial planes in case of postprocessing turbomachinary CFDs. I know how to do it in Tecplot via isosurface along a variable {R} = sqrt(X**2 + Y**2), but how would I do it in pytecplot? Can the slice command and its parameter for orientation handle this? How can I automtaically detect if I have a cylindrical or cartesian domain, aren't all the domains cartesian? Btw, I have another more basic problem. I work in a company in which the individual engineer cannot change the windows system variables to connect python and tecplot. Is there any other way to run this pytecplot interface in case you don't have admin rights and can change these windows settings? Last edited by MainzerKaiser; October 24, 2019 at 08:15. |
|
October 24, 2019, 11:55 |
|
#4 |
Senior Member
Scott Fowler
Join Date: May 2009
Posts: 112
Rep Power: 16 |
Tecplot 360 uses a Cartesian coordinate system. To create cylindrical slices you can, as you pointed out, compute a radius variable and use an isosurface. This can be done in PyTecplot using tp.data.operate.execute_equation(). A "radial" slice (one at a constant Theta) could be done with an Arbitrary slice by giving it the proper normal direction. A slice will, however, pass through the origin point. Alternately you could create an IJ-Ordered zone at the proper orientation and interpolate values to it.
PyTecplot scripts can be recorded from the User Interface via the Scripting menu - this will give you the set of PyTecplot commands required to do the work you're looking to accomplish. You can then edit the script to improve execution speed and generalize it. See this blog post: https://www.tecplot.com/2019/10/02/i...t-performance/ Python itself can be installed without administrator rights and PyTecplot can be installed without admin rights by using 'pip install --user pytecplot' If you need more detailed help you can always contact Tecplot support via email at support@tecplot.com Scott |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
cfd post processing | mostanad | Visualization & Post-Processing | 0 | December 29, 2016 15:24 |
Medical Image Processing Softwares with CFD Analysis and 3D Printing Capabilities | CornBlitz | Main CFD Forum | 3 | December 15, 2016 05:05 |
Modifying Session Files for CFD Post processing | Crank-Shaft | CFX | 6 | November 11, 2012 04:46 |
user defined function | cfduser | CFX | 0 | April 29, 2006 10:58 |
cfd post processing | aurel | Main CFD Forum | 0 | September 22, 2005 04:36 |