CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Tecplot (https://www.cfd-online.com/Forums/tecplot/)
-   -   Extract field data in tecplot over time (https://www.cfd-online.com/Forums/tecplot/253987-extract-field-data-tecplot-over-time.html)

saeed jamshidi January 13, 2024 07:17

Extract field data in tecplot over time
 
1 Attachment(s)
Hello everyone,

I'm going to prepare some data for machine learning. To this end, I need to get field data such as pressure and velocity over time for all cell centers.

However, I have simulated my problem in Fluent Unsteady. So, how can I extract the field data in tecplot over time?

In tecplot I follow up these procedures:
  1. create macro
  2. load data
  3. create rectangular zone
  4. interpolate data to the zone
  5. and finally write the data

All are good, except third step, where I should define I and J numbers.
How can I extract data for all cells over time respectively?
Thank you.

saeed jamshidi January 14, 2024 06:09

Any Idea?🙏

wsfowler May 6, 2024 18:50

PyTecplot is a great way to grab raw data from Tecplot 360.

If the data are already cell-centered, simply grab and array of data using the following PyTecplot (python code)

Code:

import tecplot as tp
from tecplot.constant import *
dataset = tp.active_frame().dataset

# Get an array of Pressure values for the first zone
zone = dataset.zone(0) # zone numbers are zero based in PyTecplot
variable = dataset.variable("Pressure")
values = zone.values(variable)[:]

# Loop over all zones and all variables, getting the cell-centered data values
for z in dataset.zones():
    for v in dataset.variables():
        var_values = z.values(v)
        if var_values.location == ValueLocation.CellCentered:
            cc_values = var_values[:]
            # Do something with cc_values



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