Replies: 3 comments 1 reply
-
Hi, how to get the gradient of particular design variables value |
Beta Was this translation helpful? Give feedback.
-
In addition to the previously asked question about the gradient of symmetric points being different, I have read your article, which contains the term
My approach was to modify the code in So to summarize the results of my experiment, this example is from the |
Beta Was this translation helpful? Give feedback.
-
@WZDDZFJ You can use task=checkTotal (https://github.com/DAFoam/tutorials/blob/607a4f7738d067dd0921eecd4a96750c69443811/NACA0012_Airfoil/incompressible/runScript.py#L271) in a v3 script to use FD values as references. But in the case of 2D airfoil, you can't simply perturb one FFD in FD. This is because a small perturbation of any FFD point will violate the symmetry boundary condition and return unphysical results. So the FD-based totals are not correct. What you can do is use the twist (refer to a 3D wing case on how to add a twist DV into the NACA0012 tutorial) as the design variable and then run checkTotals. |
Beta Was this translation helpful? Give feedback.
-
In the
verification
section, you introduced forward-mode differentiation to check the correctness of the gradients. Could you provide an example of using finite differences to directly check the correctness of the gradients? Because I followed the tutorial to analyze the two-dimensional airwing of NACA0012, but when I looked at the gradient filetotalderivist.txt
, I found that the FFD points in a symmetric position had different gradient values, and the gap was relatively small when it was not deformed, but the gap was large after deformation. For example, what I've framed in red is a typical set of symmetric FFD points. Usually, we use the finite difference method to verify the gradient, that is, manually give a disturbance to the FFD point, see how the objective function changes, and then obtain the gradient value. But in this case of the airfoil, do I perturb one FFD point at a time, or do I perturb a set of symmetric FFD points at the same time and then compare it to the gradient obtained by the discrete adjoint solution?Beta Was this translation helpful? Give feedback.
All reactions