Sensitivity Analysis Framework
5.5 Sensitivities of Aero Solver Module
It is now required to calculate all the intermediate jacobians which play a role in the adjoint method, presented in the beginning of this chapter. Observing Table 4.4 one can remember that the residuals depend explicitly on the variablesCP,LPP,LV,αandV∞. Moreover, solving the residual system of equations leads to the aerodynamic solution in terms of the doublet intensitiesµ, which depend implicitly of the last five variables. Therefore, the sensitivity analysis for this module consists in calculating six jacobian matrices. As already shown in section 5.3, symbolic differentiation and post coding can be a great advantage, specially in MATLABR where vectorization is possible. For this reason and similarly to section 5.3, all of these jacobians were calculated by hand with the aid of symbolic differentiation.
5.5.1 Partial Derivatives w.r.t. Collocation Points
Remember the residual associated with the panel(i, j), given by Equation (4.48). Taking the partial derivative with respect to the collocation points and after some algebra yields
∂Rij
∂CPkh =
N
X
n=1
M−1
X
m=1
∂Cijmn
∂CPkh
µmn+∂Bijmn
∂CPkh
σmn
if(k, h) = (i, j)
∂Cijkh
∂CPkh
µkh+ ∂Bijkh
∂CPkh
σkh if(k, h)6= (i, j)andk6=M
∂Cijkh
∂CPkh
µ(M−1)h−µ1h
if(k, h)6= (i, j)andk=M
(5.31)
where the partial derivative of ∂C∂CPijmn
kh is defined as
∂Cijmn
∂CPkh
= ∂Cijmn1
∂r1ijmn
∂r1ijmn
∂CPij
∂CPij
∂CPkh
+∂r1ijmn
∂CPmn
∂CPmn
∂CPkh
+
∂C2ijmn
∂r2ijmn
∂r2ijmn
∂CP2ij
∂CP2ij
∂CPij
∂CPij
∂CPkh+∂r2ijmn
∂CPmn
∂CPmn
∂CPkh
(5.32) where, additionally, r1ijmn andr2ijmn are the collocation point and respective image’s locations from panel(i, j), written in the(m, n)panel’s frame of reference. With this in mind, the partial derivatives of r1ijmn andr2ijmn with respect to the respective collocation points, in Equation (5.32), are calculated
using Equation (5.29). SinceCP2ij is the image ofCPij, the respective partial derivative is given by
∂CP2ij
∂CPij =
1 0 0
0 −1 0
0 0 1
(5.33)
It should also be noticed that the source influence B has the same variable dependence as C, thus,
∂Bijmn
∂CPkh is calculated using Equation (5.32) replacingCbyB. All the partial derivatives of the source and dipole influences with respect to all their dependencies, already and lately presented, are introduced in section A.2 in Appendix A.
5.5.2 Partial Derivatives w.r.t. Local Corner Points
Each residual associated with panel(i, j)depends also on the influence panel’s corner points, written in its own frame of reference. Taking the partial derivative with respect to the pointsX01kh,X02kh,X03kh, X04kh, or simply with respect toLPPkh
∂Rij
∂LPPkh
=
∂Cijkh
∂LPPkh
µ(M−1)h−µ1h
ifk=M
∂Cijkh
∂LPPkhµkh+ ∂Bijkh
∂LPPkhσkh ifk6=M
(5.34)
5.5.3 Partial Derivatives w.r.t. Basis Vectors
The residuals also present explicit dependence on the panel’s basis vectors. Taking now the partial derivatives with respect toLVkh, leads to
∂Rij
∂LVkh =
∂Cijkh
∂LVkh µ(M−1)h−µ1h
ifk=M
∂Cijkh
∂LVkh
µkh+ ∂Bijkh
∂LVkh
σkh+Bijkh
∂σkh
∂LVkh
ifk6=M
(5.35)
where ∂LV∂Cijkh
kh is given by
∂Cijkh
∂LVkh
= ∂Cijkh1
∂r1ijmn
r1ijmn
∂LVkh
+ ∂Cijkh2
∂r2ijmn
r2ijmn
∂LVkh
(5.36) and r∂LV1ijmn
kh and r∂LV2ijmn
kh are calculated using Equation (5.30). As previously, ∂B∂LVijkh
kh is calculated easily replacingCbyBin Equation (5.36).
5.5.4 Partial Derivatives w.r.t. Angle-of-Attack and Airspeed
The residuals depend also on the angle of attack and on the absolute value of the free-stream velocity vector. Taking the partial derivatives with respect to these two variables yields
∂Rij
∂α =
N
X
n=1 M−1
X
m=1
Bijmn
∂σmn
∂α (5.37a)
∂Rij
∂V∞ =
N
X
n=1 M−1
X
m=1
Bijmn
∂σmn
∂V∞ (5.37b)
Partial Derivatives w.r.t. Source and Doublet Intensities
As observed in this section and also in section 5.5.3, it is required to calculate the partial derivatives of the source intensities with respect to its dependencies. Observing Equation (4.49), it may be concluded that those dependencies are on the panel’s unitary normal and the free-stream velocity vectors. Taking the partial derivatives with respect toLVkh,αandV∞, results
∂σkh
∂LVkh =
[0] [0] ∂σkh
∂nkh
=V∞.h
[0 0 0] [0 0 0] [cosα 0 sinα]
i
(5.38)
∂σkh
∂α =V∞.[nkh3cosα−nkh1sinα] (5.39)
∂σkh
∂V∞ = σkh
V∞ (5.40)
5.5.5 Partial Derivative w.r.t. the Doublet Intensities
Finally, the residuals’ partial derivatives with respect to the double intensities still need to be calcu- lated. Considering once more Equation (4.48) and taking the partial derivative with respect toµkhone may write
∂Rij
∂µkh
=
Cij1h− CijM h ifk= 1 Cij(M−1)h+CijM h ifk=M−1
Cijkh ifk6= 1∧k6=M−1
(5.41)
5.5.6 Benchmark - Automatic Differentiation
It is now required to verify the sensitivity analysis of the present module since the differentiation was carried by hand with the aid of symbolic differentiation. Assuming the same wing configuration as previously, a benchmark with the results obtained with the forward mode of automatic differentiation will be presented.
Jacobian Entry
0 2000 4000 6000 8000 10000 12000
Absolute Error
×10-14
0 1 2 3 4 5 6 7 8 9
Benchmark w/ AD
(a) Absolute error for all the entries of dCPdR
Jacobian Entry ×104
0 0.5 1 1.5 2 2.5 3 3.5 4
Absolute Error
×10-13
0 1 2 3 4 5
Benchmark w/ AD
(b) Absolute error for all the entries of dLVdR
Figure 5.3: Absolute error for all the entries of dCPdR and dLVdR
Jacobian Entry
0 500 1000 1500 2000 2500 3000 3500 4000
Absolute Error
-1 -0.5 0 0.5 1
Benchmark w/ AD
(a) Absolute error for all the entries of dRdµ
Jacobian Entry ×104
0 1 2 3 4 5
Absolute Error
×10-13
0 1 2 3 4 5 6 7
Benchmark w/ AD
(b) Absolute error for all the entries ofdLPPdR
Figure 5.4: Absolute error for all the entries of dRdµ anddLPPdR
Jacobian Entry
0 10 20 30 40 50 60
Absolute Error
-1 -0.5 0 0.5 1
Benchmark w/ AD
(a) Absolute error for all the entries of dVdR
∞
Jacobian Entry
0 10 20 30 40 50 60
Absolute Error
×10-15
0 1 2 3 4 5 6
Benchmark w/ AD
(b) Absolute error for all the entries ofdRdα
Figure 5.5: Absolute error for all the entries of dVdR∞ and dRdα
Figures 5.3 through 5.5 presents the absolute error associated with the six jacobian matrices pro- duced in this module, for all the jacobian entries, taking the results obtained with AD as reference and for a mesh with200panels. The calculated errors are bounded and, for the worst case scenario, some components are about10−12, proving the constructed framework’s validity.
The developed module was also benchmarked with AD, according to the computational cost. The run time spent by the AD tool corresponds to the time to generate the differentiated code with respect to each of the independent variables, and the time to run it. The former corresponds to the smaller portion of time and took about 10 seconds. As observed in Table 5.4, the new developed module is about 200 times faster than using AD with savings above 99%. Moreover, the AD tool run times are absolutely unacceptable, even for course meshes, proving the efficiency of the new developed module.
No. panels 50 200 450 SD time [s] 3.796 40.797 222.411 AD time [s] 749.964 8653.022 40582.198 savings [%] 99.5 99.5 99.5
Table 5.4: Computational cost of theAero Solversensitivity analysis module forM =N.