Large error in shape derivatives using checkTotals #515
Replies: 3 comments 3 replies
-
The error you saw is expected. This is caused by the finite-difference method for this special 2D case. When we use the finite-difference method and perturb one FFD point, it will create asymmetry geometry in the z direction and violate the symmetry boundary condition. So in this case, we should not trust the finite-difference totals. Please use the forward AD method to compute the ref derivatives for the shape variables. Check here: https://dafoam.github.io/mydoc_verifications_dasimplefoam.html. Anyway, I believe the adjoint is still accurate, but the finite-difference gradients for the shape variables are NOT. |
Beta Was this translation helpful? Give feedback.
-
It is good to hear that DAFoam is useful. Regarding the inaccurate dafoam/src/adjoint/DAFvSource/DAFvSource.C Line 147 in 767274c |
Beta Was this translation helpful? Give feedback.
-
@EdoAlvarezR dafoam/tests/runTests_DASimpleFoam.py Line 172 in 234fbd3 |
Beta Was this translation helpful? Give feedback.
-
Hi all,
Running the checkTotals task in the
NACA0012_Airfoil/incompressible
example points out that the shape derivatives wrt CL and CD have an error of ~100% with adjoint compared to finite difference. Is this expected?I tried varying the finite difference step (from 1e-3 down to 1e-6 and up to 1e-1) and running it single-threaded, but the results were the same.
Here is the output of checkTotals and I'm attaching the case files (I am running everything in the Docker container from here):
naca0012-incompressible.zip
Beta Was this translation helpful? Give feedback.
All reactions