
[Sponsors] 
February 10, 2015, 13:13 
Diverging sensitivities in SU2.

#1 
New Member
Amit Kamboj
Join Date: Jan 2015
Posts: 11
Rep Power: 10 
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 (Axissymmetric), 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 cfdonline 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! 

February 10, 2015, 20:40 

#2  
Senior Member
Heather Kline
Join Date: Jun 2013
Posts: 309
Rep Power: 12 
Quote:
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/UserTutorials) to get an idea of where to start. If you have not done so already, I also recommend running through the optimization tutorials first. 

February 11, 2015, 08:58 

#3 
New Member
Amit Kamboj
Join Date: Jan 2015
Posts: 11
Rep Power: 10 
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. 

February 11, 2015, 12:41 

#4  
Senior Member
Heather Kline
Join Date: Jun 2013
Posts: 309
Rep Power: 12 
Quote:
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 inplane 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 nondeforming. 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. 

February 11, 2015, 13:37 

#5 
New Member
Amit Kamboj
Join Date: Jan 2015
Posts: 11
Rep Power: 10 
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.cfdonline.com/Forums/su2...imization.html treats them as 2D. I would be glad if you could clarify this. Thanks. 

February 18, 2015, 00:28 

#6  
New Member
Amit Kamboj
Join Date: Jan 2015
Posts: 11
Rep Power: 10 
Quote:
Thanks in Advance. 

February 18, 2015, 13:24 

#7 
Super Moderator
Francisco Palacios
Join Date: Jan 2013
Location: Long Beach, CA
Posts: 404
Rep Power: 14 
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 

February 18, 2015, 22:46 

#8 
New Member
Amit Kamboj
Join Date: Jan 2015
Posts: 11
Rep Power: 10 
Thank You Sir.


Tags 
optimization, sensitivities, shape 
Thread Tools  Search this Thread 
Display Modes  


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 postprocessing  Combas  SU2  2  June 5, 2014 14:55 
PointwiseSU2 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 