|
[Sponsors] |
![]() |
![]() |
#1 |
New Member
A Roy
Join Date: Sep 2022
Posts: 15
Rep Power: 4 ![]() |
Hello SU2 community,
I am looking to construct TargetCp files for some inverse design pressure cases by interpolating from a target solution to the mesh being optimized. However, at the moment I am interpolating using the surface solution output files, from which I don't think I can find any global index. I am writing a python script to scrape the x and y coordinates from the interpolated solution file, and scraping the node indices and their corresponding x and y coords from the mesh file, then searching the latter to match to the former...but with my limited algorithms knowledge, this doesn't seem to be very fast (especially for 3D meshes with much larger element counts). Would anyone know if there is a way to directly get the actual node indices from the solution file in some way? Or is this boundary information lost when creating the solution file or extracting the surface solution subset? Thank you! |
|
![]() |
![]() |
![]() |
![]() |
#2 |
New Member
A Roy
Join Date: Sep 2022
Posts: 15
Rep Power: 4 ![]() |
Absent a better solution, I am posting my python script below if it may help any readers that come across this in the future.
The script is fairly barebones and inflexible at the moment (and currently only has 2D functionality, although adding 3D functionality is not a particularly involved extension so I might update this at some point, or if anyone wants to have at it for their own work); it takes as input: - CSV data file containing x, y, Pressure, Mach, Cp headers and fields in that column order - Name of the boundary marker that the indices need to be scraped from (currently 1 boundary at a time) - Mesh file that the solution is interpolated to, must be in SU2 format - Name of the output file that the inverse design style output is written to; it is written mimicking the TargetCp.dat format in the SU2 Inverse Design test cases such that the fields are Index, x, y, Pressure, Cp, Mach in that order |
|
![]() |
![]() |
![]() |
![]() |
#3 |
Senior Member
bigfoot
Join Date: Dec 2011
Location: Netherlands
Posts: 596
Rep Power: 17 ![]() |
The indices in the SU2 mesh and the indices in the restart file are the same. I think even the indices in the paraview file are the same as the su2 mesh.
The pressure coefficient is saved in the restart file, so you could go to the mesh, grab the global indices of the marker there and then go to the restart file with that information. You can even save the restart file in ASCII format with OUTPUT_FILES=RESTART_ASCII. |
|
![]() |
![]() |
![]() |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[swak4Foam] swak4foam building problem | GGerber | OpenFOAM Community Contributions | 54 | April 24, 2015 16:02 |
[OpenFOAM] Annoying issue of automatic "Rescale to Data Range " with paraFoam/paraview 3.12 | keepfit | ParaView | 60 | September 18, 2013 03:23 |
[swak4Foam] Error bulding swak4Foam | sfigato | OpenFOAM Community Contributions | 18 | August 22, 2013 12:41 |
OpenFOAM on MinGW crosscompiler hosted on Linux | allenzhao | OpenFOAM Installation | 127 | January 30, 2009 19:08 |
ParaView Compilation | jakaranda | OpenFOAM Installation | 3 | October 27, 2008 11:46 |