When you enable Sensitivity analysis, the stationary solvers compute — in addition to the basic forward solution — the sensitivity of a functional
with respect to the sensitivity variables p. The forward solution
up is a solution to the parameterized discrete forward problem
where Λp are the constraint Lagrange multipliers, or (generalized) reaction forces, corresponding to the constraints
M. It is assumed that
Q does not explicitly depend on
Λp.
To compute the sensitivity of Q with respect to
p, first apply the chain rule:
where uflux are the accurate boundary degrees of freedom. In this expression, the sensitivity of the solution with respect to the sensitivity variables,
∂u/∂p, is still an unknown quantity. Therefore, differentiate the forward problem in
Equation 20-18 formally with respect to
p:
Here, K =
−∂L/∂u and
N =
−∂M/∂u as usual. Assuming that the constraint force Jacobian
NF is independent of
p (that is,
∂NF/∂p = 0), you can write the above relations in matrix form
Solve for the sensitivities ∂up/∂p and
∂Λp/∂p, and plug them back into
Equation 20-19:
This formula gives dQ/dp explicitly in terms of known quantities, but in practice it is too expensive to invert the matrix
J.
where Kflux is not dependent on either the parameter
p or the solution. The
Lflux, on the other hand, can be a solution- and parameter-dependent quantity, and therefore the sensitivity solvers assemble these derivatives:
If the number of individual sensitivity variables, pj, is small,
Equation 20-21 can be solved for each right-hand side
[∂L/∂pj ∂Μ/∂pj]T, and the solution is then inserted into
Equation 20-19. This is the
forward method, which in addition to the sensitivity
dQ/dp returns the sensitivity of the solution,
∂up/∂p. The matrix
J is in fact the same matrix as in the last linearization of the forward problem. The forward method therefore requires one additional back-substitution for each sensitivity variable.
If there are many sensitivity variables and the sensitivity of the solution itself, ∂up/∂p, is not required, the
adjoint method is more efficient. It is based on using auxiliary variables
u* and
L*, known as the
adjoint solution, to rewrite
Equation 20-22:
When using the segregated solver, you need to add the control variables to the right segregated groups. From Equation 20-20, it is clear that for the forward sensitivity problem to be constrained correctly, the control variables need to be added to all the segregated groups where they are part of the constraints. For the adjoint method, the equations are the ones in
Equation 20-23 and here the control variables are not involved. The correct constraint handling is taken into account after the segregated solver has converged by using the formula in
Equation 20-23 without the explicit need to add them to any group.