# Discrete Adjoint derivative computation - help understanding Finite Difference

 Register Blogs Members List Search Today's Posts Mark Forums Read

 July 21, 2021, 06:54 Discrete Adjoint derivative computation - help understanding Finite Difference #1 New Member   topheruk Join Date: Mar 2018 Posts: 5 Rep Power: 8 I am looking for some guidance on the implementation of the Discrete Adjoint method, specifically the computation of the partial derivatives via Finite Differencing. source(s): DAFoam: An Open-Source Adjoint Framework for Multidisciplinary Design Optimization with OpenFOAM https://arc.aiaa.org/doi/10.2514/1.J058853 The first major step in solving the Discrete Adjoint is computing the partial derivatives of the vector of flow residuals () with respect to the vector state variables (). This is possible via Finite Difference: Set and , where the subscripts and are the row and column indices, respectively, is the step size, and is a unit vector with unity in row . As I understand it, this involves sequentially perturbing each element of the state variable vector in a reference cell and recomputing the residual vector. This should produce a matrix, with calls to residual function (equal to the number of columns). Is this correct? In the DAFoam implementation, a graph-colouring method is used to accelerate the computation of the partial derivatives via Finite Difference. This works by exploiting the sparsity of a Jacobian matrix to simultaneously perturb sets of columns that influence independent rows. An example is given for a diagonal Jacobian matrix but I am not sure what step this relates to in the context of computing the partial derivates for , particularly for a 3D problem. Assumptions: 1. For an unperturbed and converged flow solution, each cell contains a vector of flow variables and a vector of residuals. Questions: 1. when the source(s) discusses graph-colouring, what matrix are they referring to? Is the Jacobian of in each cell? 2. when perturbing a flow variable e.g. the u-component of velocity, is added to the reference value in a specific cell only, or does this perturbation affect the reference values in neighbouring cells? 3. how does perturbing a flow variable in a cell influence other rows in the matrix? Appreciate any input, Chris Last edited by topheruk29; July 21, 2021 at 06:57. Reason: missed out vector definitions