A problem about "verify the total derivatives against the finite-difference" #905
Replies: 6 comments 7 replies
-
|
I remember that the two-dimensional example cannot be used to test the derivatives of FFD using the finite difference method. Because simply moving a FFD point would violate the symmetrical boundary conditions on both sides. I think you could try manually perturbing a pair of symmetrical FFD points to calculate a flow field, and then calculate the gradient using the finite difference method once. Compare this gradient value with the result obtained by reverse automatic differentiation of these two FFD points (sum these two automatic differentiation results), and see if they are very close. If you have the comparison results, please feel free to reply to me. |
Beta Was this translation helpful? Give feedback.
-
|
@GreenSoyBeanI you should not use such a small step in finite-difference. Try to use 1e-3 or 1e-4. @101709 Yes, we can use the 2D case for verifying the totals, we have fixed the issues in v4, check the latest NACA0012 tutorials |
Beta Was this translation helpful? Give feedback.
-
|
I also would like to ask you, which file controls these output messages? I can't find this file. Also, I would like to ask, is the "check_totals" here obtained using the forward automatic differentiation( Although there are 8 independent variables, shouldn't the gradients of the upper and lower control points at the leading and trailing edges be different? How can one obtain the output of 10 control points? |
Beta Was this translation helpful? Give feedback.
-
|
@101709 Jfor is the adjoint derivative. |
Beta Was this translation helpful? Give feedback.
-
|
There are 8 independent shape vars because the two FFD points at the leading edge are linked. Same for the trailing edge. You can see the derivs for all outputs if you set |
Beta Was this translation helpful? Give feedback.
-
|
@GreenSoyBeanI . Are your flow simulations and adjoint computation converge well? I suspect the inaccurate gradients are caused by flow convergence |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I met a problem when running the case NACA0012-incompressible.
Here I upload the zip
NACA0012_incompressible_fd_step7.zip
about the case with mesh Generated by script named naca0012_rans.py.
The mesh Generated by naca0012_rans.py is finer than before.
When I set the step size of fd to 1e-5 to 1e-7, I get:
"
Full Model: 'scenario1.aero_post.functionals.CD' wrt 'dvs.patchV'
Analytic Magnitude: 2.314747e-02
Fd Magnitude: 4.256817e-02 (fd:central)
Absolute Error (Jan - Jfd) : 5.369372e-02 *
"
even worse
"
Full Model: 'scenario1.aero_post.functionals.CL' wrt 'dvs.shape'
Analytic Magnitude: 1.617682e+01
Fd Magnitude: 1.432387e+02 (fd:central)
Absolute Error (Jan - Jfd) : 1.520629e+02 *
"
Could you advise me what I should do to solve this or whether there is something wrong with this case
Beta Was this translation helpful? Give feedback.
All reactions