|
[Sponsors] |
January 27, 2016, 11:21 |
SU2 output reordered mesh
|
#1 |
New Member
Join Date: Dec 2015
Location: Switzerland
Posts: 4
Rep Power: 10 |
Hi all,
I'm using SU2 to solve the steady state Euler equations in order to develop some reduced order model from the algebraic structures computed by SU2 (jacobian matrix and residual). The problem is that when I output the jacobian matrix and the residuals the point ordering is not the original one because of the inverse Cuthill-McKee reordering. It's therefore impossible to plot any result as the module SU2_SOL assumes that the solution given in the restart_flow.dat is in the original node numbering. First of all, I don't really understand the option MESH_OUT_FILENAME in the config file. It's set by default to "mesh_out.su2" but at the end, no file is generated. Is this only for parallel computations, when ParMetis decomposes the original mesh into several meshes ? Is the output mesh in the original node numbering or the reordered one ? Secondly, I'd like to output the mesh after the Cuthill-McKee reordering. Is this possible ? A list of the reordered points would be sufficient. Thanks in advance, Lio EDIT : Sorry, I just saw that the same question has been asked yesterday... Last edited by lwilhelm; January 27, 2016 at 11:28. Reason: The same question has been asked yesterday |
|
January 27, 2016, 13:19 |
|
#2 |
Member
Mandar Kulkarni
Join Date: Nov 2013
Location: Virginia Tech, Blacksburg, VA
Posts: 52
Rep Power: 13 |
Hi Lio,
Regarding your first question, one use of the parameter MESH_OUT_FILENAME is to set name of the output file after running the SU2_DEF code. Basically SU2_DEF deforms the mesh according to settings in the DESIGN VARIABLE PARAMETERS section of the config file. I am not sure of any other use. Just as you, I am waiting for the answer related to local node ordering in SU2. A crude way to do it would be to use the function Geometry::TestGeometry(void) I have modified this function a little so that when I call this function at ExtIter = 0 and it output the information about the edges, local node numbers corresponding to the edges, and coordinates of the nodes. This is done for the internal edges and also for the edges on the boundary markers. Now one can use the coordinates a node to figure out what what the global node number is. In fact I was thinking of writing a function which outputs just the local node number and its coordinates. However, there could be a smart way of doing this with the use of the transformation vector(s) that have been stored somewhere in SU2. Hope this helps, Mandar |
|
January 27, 2016, 13:56 |
|
#3 |
New Member
Join Date: Dec 2015
Location: Switzerland
Posts: 4
Rep Power: 10 |
Hi Mandar,
I found a barbarian way to proceed. For my application, as told before, I have to extract the solution, the jacobian and the residual at given iterations. In order to know how the nodes are renumbered I use the following procedure : 1. Tell SU2 to extract the structures at iteration 0 2. Take whaterver solution_flow.dat and replace the first conservative variable with the node index 3. Set EXT_ITER = 1 and RESTART_SOL = YES in the config file. 4. As I run SU2_CFD, it saves the solution at the first iteration, before computing the residuals and the jacobian. When SU2 tries to compute the residuals it diverges (obviously) 5. The value of the first conservative variable in the exported file correspond to the local node number It is not elegant at all but at least it works... P.S. in order to extract the solution I just add the following piece of code in "solver_direct_mean.cpp", just before the line : "CSysSolve system". The variables "extract_iteration", "current_iteration" and "nPointsInitialMesh" are global variables defined in "SU2_CFD.cpp" if (extract_iteration == true && nPointDomain == nPointsInitialMesh ){ string name("u_n"); string extension(".txt"); char numstr[21]; sprintf(numstr, "%lu",current_iteration); string filename (name+numstr+extension); ofstream mysolution; mysolution.open(filename.c_str()); for (iPoint = 0; iPoint < nPointDomain; iPoint++) { for (iVar = 0; iVar < nVar; iVar++) { mysolution << node[iPoint]->GetSolution(iVar) << "\n" ; } } mysolution.close(); } |
|
January 27, 2016, 14:07 |
|
#4 |
Member
Mandar Kulkarni
Join Date: Nov 2013
Location: Virginia Tech, Blacksburg, VA
Posts: 52
Rep Power: 13 |
Hi Lio,
Thanks for sharing, Mandar |
|
January 28, 2016, 04:22 |
|
#5 |
Super Moderator
Tim Albring
Join Date: Sep 2015
Posts: 195
Rep Power: 11 |
You can also disable the reordering by commenting out SU2_CFD/src/definition_structure.cpp:256.
|
|
January 30, 2016, 08:45 |
|
#6 |
Member
Mandar Kulkarni
Join Date: Nov 2013
Location: Virginia Tech, Blacksburg, VA
Posts: 52
Rep Power: 13 |
I would rather have the reordering ON so that I get a nice diagonally dominant Jacobian matrix. But thanks for sharing the option to turn it OFF.
Regards, Mandar |
|
Tags |
cuthill-mckee, mesh, output, reordering, rom |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
sliding mesh problem in CFX | Saima | CFX | 46 | September 11, 2021 08:38 |
how to set periodic boundary conditions | Ganesh | FLUENT | 15 | November 18, 2020 07:09 |
hard to convergent with SU2 4.0 for Euler adjoint | Xianguu | SU2 | 1 | July 14, 2015 18:09 |
best setting for SU2 | mechy | SU2 | 3 | April 20, 2014 20:13 |
Icemcfd 11: Loss of mesh from surface mesh option? | Joe | CFX | 2 | March 26, 2007 19:10 |