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

How does SU2 calculate of_gradient.plt?

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   July 8, 2013, 09:27
Default How does SU2 calculate of_gradient.plt?
  #1
Member
 
Roberto Pieri
Join Date: Feb 2012
Location: Milan
Posts: 57
Rep Power: 14
robyTKD is on a distinguished road
Hi developers,

I don't understand how SU2 evaluates objective functions gradient. I thought it simply evaluates shape sensitivity at each position of design variable and imposes this value as \delta_n of Hicks-Henne bump functions, but in SU2_GPC I found these lines:

Code:
		/*--- Continuous adjoint gradient computation ---*/
		if (rank == MASTER_NODE)
			cout << "Evaluate functional gradient using the continuous adjoint strategy." << endl;
		
    /*--- Load the delta change in the design variable (finite difference step). 
     Note that this assumes DV_Value_New = finite_diff_step and DV_Value_Old = 0.0
     in the config file. ---*/
		delta_eps = config->GetDV_Value_New(iDV);
    my_Gradient = 0.0; Gradient = 0.0;
      
      /*--- Reset update points ---*/
      for (iPoint = 0; iPoint < boundary->GetnPoint(); iPoint++)
        UpdatePoint[iPoint] = true;
      
      for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) {
				if (config->GetMarker_All_Moving(iMarker) == YES) {
					for (iVertex = 0; iVertex < boundary->nVertex[iMarker]; iVertex++) {
						
						iPoint = boundary->vertex[iMarker][iVertex]->GetNode();
						if ((iPoint < boundary->GetnPointDomain()) && UpdatePoint[iPoint]) {
							
							Normal = boundary->vertex[iMarker][iVertex]->GetNormal();
							VarCoord = boundary->vertex[iMarker][iVertex]->GetVarCoord();
							Sensitivity = boundary->vertex[iMarker][iVertex]->GetAuxVar();
							
							dS = 0.0; 
							for (iDim = 0; iDim < boundary->GetnDim(); iDim++) {
								dS += Normal[iDim]*Normal[iDim];
								deps[iDim] = VarCoord[iDim] / delta_eps;
							}
							dS = sqrt(dS);
							
							dalpha_deps = 0.0;
							for (iDim = 0; iDim < boundary->GetnDim(); iDim++) {
								dalpha[iDim] = Normal[iDim] / dS;
								dalpha_deps -= dalpha[iDim]*deps[iDim];
							}
							
							my_Gradient += Sensitivity*dalpha_deps;
							UpdatePoint[iPoint] = false;
						}
					}
				}				
    }
Does this imply that the deformation d \epsilon, deps in the code, is projected along the surface normal and then multiplied by Sensitivity? Why does this operation is needed since shape sensitivity is a gradient expressing the maximum change in the objective function due to a normal deformation?

In the picture attached below you find shape sensitivity with DRAG as objective function in blue, of_gradient in red. I don't understand why gradient evaluation doesn't follow shape sensitivity.

Cheers,
Roberto
Attached Images
File Type: jpg CdGradient.jpg (38.1 KB, 57 views)
robyTKD is offline   Reply With Quote

 


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
FSI with SU2 akail SU2 4 February 18, 2015 13:12
Welcome to the Stanford University Unstructured (SU2) forum! economon SU2 0 January 7, 2013 02:48
New SU2 Forum Opened at CFD Online pete Site News & Announcements 0 January 5, 2013 17:59
Stanford University Unstructured (SU2) Open-Source Code Released Today praveen Main CFD Forum 1 May 21, 2012 20:52
calculate values for eps and k from Re or u????? sbar OpenFOAM Pre-Processing 5 August 16, 2010 04:10


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