CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > SU2

SU2 output reordered mesh

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 27, 2016, 10:21
Default SU2 output reordered mesh
  #1
New Member
 
Join Date: Dec 2015
Location: Switzerland
Posts: 4
Rep Power: 10
lwilhelm is on a distinguished road
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 10:28. Reason: The same question has been asked yesterday
lwilhelm is offline   Reply With Quote

Old   January 27, 2016, 12:19
Default
  #2
Member
 
Mandar Kulkarni
Join Date: Nov 2013
Location: Virginia Tech, Blacksburg, VA
Posts: 52
Rep Power: 12
kmandar is on a distinguished road
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
kmandar is offline   Reply With Quote

Old   January 27, 2016, 12:56
Default
  #3
New Member
 
Join Date: Dec 2015
Location: Switzerland
Posts: 4
Rep Power: 10
lwilhelm is on a distinguished road
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();
}
lwilhelm is offline   Reply With Quote

Old   January 27, 2016, 13:07
Default
  #4
Member
 
Mandar Kulkarni
Join Date: Nov 2013
Location: Virginia Tech, Blacksburg, VA
Posts: 52
Rep Power: 12
kmandar is on a distinguished road
Hi Lio,

Thanks for sharing,

Mandar
kmandar is offline   Reply With Quote

Old   January 28, 2016, 03:22
Default
  #5
Super Moderator
 
Tim Albring
Join Date: Sep 2015
Posts: 195
Rep Power: 10
talbring is on a distinguished road
You can also disable the reordering by commenting out SU2_CFD/src/definition_structure.cpp:256.
talbring is offline   Reply With Quote

Old   January 30, 2016, 07:45
Default
  #6
Member
 
Mandar Kulkarni
Join Date: Nov 2013
Location: Virginia Tech, Blacksburg, VA
Posts: 52
Rep Power: 12
kmandar is on a distinguished road
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
kmandar is offline   Reply With Quote

Reply

Tags
cuthill-mckee, mesh, output, reordering, rom

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
sliding mesh problem in CFX Saima CFX 46 September 11, 2021 07:38
how to set periodic boundary conditions Ganesh FLUENT 15 November 18, 2020 06:09
hard to convergent with SU2 4.0 for Euler adjoint Xianguu SU2 1 July 14, 2015 17:09
best setting for SU2 mechy SU2 3 April 20, 2014 19:13
Icemcfd 11: Loss of mesh from surface mesh option? Joe CFX 2 March 26, 2007 18:10


All times are GMT -4. The time now is 02:48.