|
[Sponsors] |
Read SU2 native binary restart file in python |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 6, 2021, 07:59 |
Read SU2 native binary restart file in python
|
#1 |
New Member
Guangnan Jia
Join Date: Oct 2021
Posts: 5
Rep Power: 5 |
Hi, Everyone.
I would like to read the data stored in the file called like restart_flow_*****.dat, which contain all the data of the each mesh point. Is there some good ways to output these data and make them be organised in python? Thanks very much. |
|
December 6, 2021, 08:30 |
|
#2 |
Senior Member
bigfoot
Join Date: Dec 2011
Location: Netherlands
Posts: 676
Rep Power: 21 |
You'll need the SU2 mesh as well to know where the data is. Why not use the paraview data instead and load that in python? with pyvista you can basically do:
Code:
mesh = pv.read("output.vtk") cpos = mesh.plot() |
|
December 6, 2021, 09:15 |
|
#3 |
New Member
Guangnan Jia
Join Date: Oct 2021
Posts: 5
Rep Power: 5 |
Thanks for reply. The reason that I use python to read data is that I want to extract the times series data from an unsteady simulation, which will take a lot of time for importing every data file into tecplot or paraview and then export. I think loading the binary file directly using the loop will be more convenient, I tried using Numpy but there are some decoding errors.
|
|
December 6, 2021, 09:49 |
|
#4 |
Member
Akshay Koodly
Join Date: Aug 2017
Location: The Netherlands
Posts: 43
Rep Power: 9 |
You can use paraview in batch mode using python scripts (https://www.paraview.org/Wiki/PvPython_and_PvBatch). If you have installed paraview, you will also have executables called pvpython and pvbatch.
The website gives you some instructions on how to generate a sample python file but you can also generate a python script example to perform any paraview operation from paraview. Open paraview, before performing any operations do "Tools->Start Trace". This will record all your operations into a python file. You can perform whatever operation you want for one file and then do "Stop Trace". This gives a python file which you can manipulate as you wish. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[swak4Foam] Installation Problem with OF 6 version | Aurel | OpenFOAM Community Contributions | 14 | November 18, 2020 17:18 |
[foam-extend.org] Problems installing foam-extend-4.0 on openSUSE 42.2 and Ubuntu 16.04 | ordinary | OpenFOAM Installation | 19 | September 3, 2019 19:13 |
[Other] Adding solvers from DensityBasedTurbo to foam-extend 3.0 | Seroga | OpenFOAM Community Contributions | 9 | June 12, 2015 18:18 |
Problem compiling a custom Lagrangian library | brbbhatti | OpenFOAM Programming & Development | 2 | July 7, 2014 12:32 |
[swak4Foam] Error bulding swak4Foam | sfigato | OpenFOAM Community Contributions | 18 | August 22, 2013 13:41 |