CFD Online Logo CFD Online URL
Home > Forums > General Forums > Main CFD Forum

Discrete Adjoint derivative computation - help understanding Finite Difference

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

LinkBack Thread Tools Search this Thread Display Modes
Old   July 21, 2021, 06:54
Default Discrete Adjoint derivative computation - help understanding Finite Difference
New Member
Join Date: Mar 2018
Posts: 5
Rep Power: 8
topheruk29 is on a distinguished road
I am looking for some guidance on the implementation of the Discrete Adjoint method, specifically the computation of the partial derivatives via Finite Differencing.

DAFoam: An Open-Source Adjoint Framework for Multidisciplinary Design Optimization with OpenFOAM

The first major step in solving the Discrete Adjoint is computing the partial derivatives of the vector of flow residuals (\textbf{R}) with respect to the vector state variables (\textbf{w}). This is possible via Finite Difference:

Set \textbf{w}=[u,v,w,p,\nu,\phi] and \textbf{R}=[R_u,R_v,R_w,R_p,R_\nu,R_\phi],


where the subscripts i and j are the row and column indices, respectively, \epsilon is the step size, and \textbf{e}_j is a unit vector with unity in row j. 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 n_{\textbf{w}}\times n_{\textbf{w}} matrix, with n_{\textbf{w}} 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 5\times 5 diagonal Jacobian matrix but I am not sure what step this relates to in the context of computing the partial derivates for \frac{\partial\textbf{R}}{\partial\textbf{w}}, particularly for a 3D problem.

1. For an unperturbed and converged flow solution, each cell contains a 1\times n_{\textbf{w}} vector of flow variables and a 1\times n_{\textbf{w}} vector of residuals.

1. when the source(s) discusses graph-colouring, what matrix are they referring to? Is the n_{\textbf{w}}\times n_{\textbf{w}} Jacobian of \frac{\partial\textbf{R}}{\partial\textbf{w}} in each cell?
2. when perturbing a flow variable e.g. the u-component of velocity, is \epsilon 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,


Last edited by topheruk29; July 21, 2021 at 06:57. Reason: missed out vector definitions
topheruk29 is offline   Reply With Quote


adjoint, mathematics, optimization

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
The adjoint equation in the discrete adjoint solver Zhen ZHANG SU2 3 July 16, 2021 07:59
Nonlinear derivative in finite difference BoxQwerty Main CFD Forum 2 February 23, 2021 12:49
Fixed CL Mode and Discrete Adjoint Question Parth Kumar SU2 0 January 29, 2020 22:30
Direct derivatives kmandar SU2 12 May 2, 2016 15:18
finite difference method for navier-stokes problem dallybird Main CFD Forum 5 February 17, 2003 22:00

All times are GMT -4. The time now is 21:15.