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

Diverging sensitivities in SU2.

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

Like Tree3Likes
  • 2 Post By hlk
  • 1 Post By fpalacios

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 10, 2015, 13:13
Post Diverging sensitivities in SU2.
  #1
New Member
 
Amit Kamboj
Join Date: Jan 2015
Posts: 11
Rep Power: 11
amitkamboj is on a distinguished road
I am trying to optimize the shape of a simple blunt nose and cylinder configuration. I am attaching a .png image showing the configuration. The case is 2D (Axis-symmetric), Euler and Perfect Gas. The Mach number being considered is 15.

I am able to achieve a converged solution using SU2_CFD. But when running the shape_optimization.py script, the "sens_geo" and "sens_Mach" terms are diverging even for the first design. Also I am getting warnings saying, "The solution contains 'n' non physical points". I am using Hicks_Henne approach for optimization.

I checked forums on cfd-online where I could find following possible solution to this problem,
1. reducing CFL number
2. changing the scale of the design variable in DV_definition to reduce the sensitivity values.

I tried both possibilities but the sensitivities still did not converge for my case.

I would be grateful if you could help me with this. I am also attaching the .cfg file for this case

Thank you!
Attached Images
File Type: png body_MACH_wireframe.png (56.2 KB, 38 views)
File Type: png body_MACH_surface_with_edges.png (47.3 KB, 35 views)
Attached Files
File Type: txt config_blunt_2D_Euler.cfg.txt (16.6 KB, 19 views)
amitkamboj is offline   Reply With Quote

Old   February 10, 2015, 20:40
Default
  #2
hlk
Senior Member
 
Heather Kline
Join Date: Jun 2013
Posts: 309
Rep Power: 13
hlk is on a distinguished road
Quote:
Originally Posted by amitkamboj View Post
I am trying to optimize the shape of a simple blunt nose and cylinder configuration. I am attaching a .png image showing the configuration. The case is 2D (Axis-symmetric), Euler and Perfect Gas. The Mach number being considered is 15.

I am able to achieve a converged solution using SU2_CFD. But when running the shape_optimization.py script, the "sens_geo" and "sens_Mach" terms are diverging even for the first design. Also I am getting warnings saying, "The solution contains 'n' non physical points". I am using Hicks_Henne approach for optimization.

I checked forums on cfd-online where I could find following possible solution to this problem,
1. reducing CFL number
2. changing the scale of the design variable in DV_definition to reduce the sensitivity values.

I tried both possibilities but the sensitivities still did not converge for my case.

I would be grateful if you could help me with this. I am also attaching the .cfg file for this case

Thank you!
thank you for your question
What is happening is that the adjoint solution is diverging. You can switch to using finite differences (this will increase the time to compute gradients, but you won't have to worry about the adjoint settings). This can be controlled through the shape_optimization script (the -h output should be helpful there). It defaults to adjoint.
If you would like to use the adjoint, take a look at the associated settings in the config files for the tutorials and test cases (https://github.com/su2code/SU2/wiki/User-Tutorials) to get an idea of where to start. If you have not done so already, I also recommend running through the optimization tutorials first.
beatlejuice and Allen zhu like this.
hlk is offline   Reply With Quote

Old   February 11, 2015, 08:58
Default
  #3
New Member
 
Amit Kamboj
Join Date: Jan 2015
Posts: 11
Rep Power: 11
amitkamboj is on a distinguished road
Thank you for your reply.
I changed the problem from DIRECT to ADJOINT and executed SU2_CFD to make sure that it was this adjoint solution which was diverging while running shape_optimization.py script.

Then I ran the shape_opt with "-g FINDIFF" to use finite differences instead of adjoints to compute gradients. But the problem still did not converge. I checked and modified the .cfg file (which I am attaching with this post) which resulted in converged finite difference sensitivities.

For this case I used Hicks Henne approach with two design variables. Going through the output I identified that in first iteration, it kept the first variable constant and varied the second, and in the second iteration it did the other way. Finally it computed the change in both the design variables and started with Design_002.

I noticed that the solution for second design was not converging. I let the iterations complete and then visualised the flow.vtk for the Design_002 (.png attached). Surprisingly (for me), it had modified the symmetry boundary along with the wall boundary. My design variables were present on the wall boundary. I am currently looking into why did that happen and how can the influence of the Hicks_Henne bump can be localised only to wall boundary.

I would like to use the adjoint approach to compute the gradients. Currently, I am not very much comfortable with all the options available for adjoints and I am still reading on adjoints. I have looked at the rotating naca and oneram6 optimization case. For now, I have restricted myself to the default options available in the 2D rotating NACA Euler case (The case I am considering is also 2D (axis symmetry), Euler). The solution for adjoint case is still diverging.

I would be grateful for any help you could provide me on these two issues.
Attached Images
File Type: png Design_002_symm_modified.png (64.2 KB, 22 views)
Attached Files
File Type: txt config_blunt_2D_euler.cfg.txt (16.4 KB, 12 views)
amitkamboj is offline   Reply With Quote

Old   February 11, 2015, 12:41
Default
  #4
hlk
Senior Member
 
Heather Kline
Join Date: Jun 2013
Posts: 309
Rep Power: 13
hlk is on a distinguished road
Quote:
Originally Posted by amitkamboj View Post
Thank you for your reply.
I changed the problem from DIRECT to ADJOINT and executed SU2_CFD to make sure that it was this adjoint solution which was diverging while running shape_optimization.py script.

Then I ran the shape_opt with "-g FINDIFF" to use finite differences instead of adjoints to compute gradients. But the problem still did not converge. I checked and modified the .cfg file (which I am attaching with this post) which resulted in converged finite difference sensitivities.

For this case I used Hicks Henne approach with two design variables. Going through the output I identified that in first iteration, it kept the first variable constant and varied the second, and in the second iteration it did the other way. Finally it computed the change in both the design variables and started with Design_002.

I noticed that the solution for second design was not converging. I let the iterations complete and then visualised the flow.vtk for the Design_002 (.png attached). Surprisingly (for me), it had modified the symmetry boundary along with the wall boundary. My design variables were present on the wall boundary. I am currently looking into why did that happen and how can the influence of the Hicks_Henne bump can be localised only to wall boundary.

I would like to use the adjoint approach to compute the gradients. Currently, I am not very much comfortable with all the options available for adjoints and I am still reading on adjoints. I have looked at the rotating naca and oneram6 optimization case. For now, I have restricted myself to the default options available in the 2D rotating NACA Euler case (The case I am considering is also 2D (axis symmetry), Euler). The solution for adjoint case is still diverging.

I would be grateful for any help you could provide me on these two issues.
I assume that you changed the problem back to DIRECT before running the optimization.
For the deformation: yes, this is a problem with symmetry conditions that I have encountered as well. They are set up to deform in case there is in-plane motion, but unfortunately if the deformation is normal to the plane it causes the problems you saw. A work around is to set it as a wall (in euler flow this is equivalent since it is a slip wall) which I think will force it to be non-deforming. Or you can make sure that the tip of the geometry never deforms, by putting it in its own boundary marker, or by using FFD boxes that don't intersect the symmetry plane, or by setting the hickes henne bumps to be further away. I'm adding the symmetry plane issue to the github issue tracker.

The adjoint solution is often sensitive to the numerical method - JST and the 4th order artificial dissipation coefficient or ROE and the limiter coefficient (make sure to set the order to 2nd_order_limiter if you want to use the limiter). I can't tell you exactly what settings will work - that depends on your case and the mesh.
hlk is offline   Reply With Quote

Old   February 11, 2015, 13:37
Default
  #5
New Member
 
Amit Kamboj
Join Date: Jan 2015
Posts: 11
Rep Power: 11
amitkamboj is on a distinguished road
Sir,

Thanks once again for your reply.

The option of putting tip in a different wall boundary condition is interesting. I will try that and update you if that works. But I have been previously trying 2D FFD boxes for this case. There is this little confusion I have regarding them. The FFD control point which is supposed to be (1, 1) is actually (1, 1, 0.5) and (1, 1, -0.5), that is, even the 2D FFD boxes are actually 3D. And, the FFD_Surface_points are of the form (x, y, 0.5). But the DEFINITION_DV defined here,

http://www.cfd-online.com/Forums/su2...imization.html

treats them as 2D.

I would be glad if you could clarify this.
Thanks.
amitkamboj is offline   Reply With Quote

Old   February 18, 2015, 00:28
Default
  #6
New Member
 
Amit Kamboj
Join Date: Jan 2015
Posts: 11
Rep Power: 11
amitkamboj is on a distinguished road
Quote:
Originally Posted by hlk View Post
A work around is to set it as a wall (in euler flow this is equivalent since it is a slip wall) which I think will force it to be non-deforming. Or you can make sure that the tip of the geometry never deforms, by putting it in its own boundary marker, or by using FFD boxes that don't intersect the symmetry plane, or by setting the hickes henne bumps to be further away. I'm adding the symmetry plane issue to the github issue tracker.
I tried all the above suggestions, only thing that worked was changing the symmetry boundary marker to wall. Rest all other options are still deforming the symmetry boundary. But, I can not change the symmetry boundary to wall as I am solving for axis symmetric flow. Is there a way to modify the code to keep the symmetry boundary from deforming?

Thanks in Advance.
amitkamboj is offline   Reply With Quote

Old   February 18, 2015, 13:24
Default
  #7
Super Moderator
 
Francisco Palacios
Join Date: Jan 2013
Location: Long Beach, CA
Posts: 404
Rep Power: 15
fpalacios is on a distinguished road
Hi,

If your take a look at

void CVolumetricMovement::SetBoundaryDisplacements(CGeo metry *geometry, CConfig *config) in grid_movement_structure.cpp

you will check that symmetry in 3D is constrained in some direction:

for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) {
if ((config->GetMarker_All_KindBC(iMarker) == SYMMETRY_PLANE) && (nDim == 3)) {

for (iDim = 0; iDim < nDim; iDim++) MeanCoord[iDim] = 0.0;
for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) {
iPoint = geometry->vertex[iMarker][iVertex]->GetNode();
VarCoord = geometry->node[iPoint]->GetCoord();
for (iDim = 0; iDim < nDim; iDim++)
MeanCoord[iDim] += VarCoord[iDim]*VarCoord[iDim];
}
for (iDim = 0; iDim < nDim; iDim++) MeanCoord[iDim] = sqrt(MeanCoord[iDim]);

if ((MeanCoord[0] <= MeanCoord[1]) && (MeanCoord[0] <= MeanCoord[2])) axis = 0;
if ((MeanCoord[1] <= MeanCoord[0]) && (MeanCoord[1] <= MeanCoord[2])) axis = 1;
if ((MeanCoord[2] <= MeanCoord[0]) && (MeanCoord[2] <= MeanCoord[1])) axis = 2;

for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) {
iPoint = geometry->vertex[iMarker][iVertex]->GetNode();
total_index = iPoint*nDim + axis;
LinSysRes[total_index] = 0.0;
LinSysSol[total_index] = 0.0;
StiffMatrix.DeleteValsRowi(total_index);
}
}
}

You can add something like

for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) {
if ((config->GetMarker_All_KindBC(iMarker) == SYMMETRY_PLANE) && (nDim == 2)) {

for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) {
iPoint = geometry->vertex[iMarker][iVertex]->GetNode();
for (iDim = 0; iDim < nDim; iDim++) {
total_index = iPoint*nDim + iDim;
LinSysRes[total_index] = 0.0;
LinSysSol[total_index] = 0.0;
StiffMatrix.DeleteValsRowi(total_index);
}
}
}
}

To avoid any movement of the symmetry plane.

Thanks for using SU2,

Best,

Francisco Palacios
SU2 lead developer
amitkamboj likes this.
fpalacios is offline   Reply With Quote

Old   February 18, 2015, 22:46
Default
  #8
New Member
 
Amit Kamboj
Join Date: Jan 2015
Posts: 11
Rep Power: 11
amitkamboj is on a distinguished road
Thank You Sir.
amitkamboj is offline   Reply With Quote

Reply

Tags
optimization, sensitivities, shape

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
Official Release of SU2 V3.2 economon SU2 News & Announcements 6 April 17, 2015 23:28
Tool to download: SU2 post-processing Combas SU2 2 June 5, 2014 14:55
Pointwise-SU2 joint webinar (April 29th) and SU2 v3.1.0 new release fpalacios SU2 News & Announcements 1 April 30, 2014 02:40
Official release of SU2 V3.0 and SU2 Educational V1.0 fpalacios SU2 News & Announcements 2 January 22, 2014 05:28
Welcome to the Stanford University Unstructured (SU2) forum! economon SU2 0 January 7, 2013 02:48


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