CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Programming & Development (
-   -   Adjoint Methods in OpenFOAM (

treima May 23, 2012 08:30

Adjoint Methods in OpenFOAM

I`ve calculated some adjoint equations for optimization problems of a few equations. An easy example is the heat conduction.

Now Iīm trying to implement them in OpenFOAM. For the heat conduction example my idea is to extend the solver laplacianFoam. Is this possile? Perhaps in an easy way? And how does it look like for other solvers?

If you have a look at adjointShapeOptimizationFoam, is this an extension or modification of an existing solver?

Do anybody have some experience on this field and have done anything similar? Are there any tutorials relating to this?


sylvester May 23, 2012 09:30

Hi treima,

AdjointShapeOptimizationFoam is based on the simpleFoam solver.
It should be possible to build an adjoint heat conduction solver from an existing solver, for example laplacianFoam as you mentioned. Which solver is best suited will depend on the formulation of your adjoint equations and possibly also the intended application of your solver.

Best regards,

treima May 23, 2012 09:51

Thank you!

One task for heat conduction is, for example:
There is a domain, which boundary can be divided into three parts. One Dirichlet-part with given temperature, one Neumann-part, with given derivation of the temperature, and on the last part part, you are able to control the temperature. Itīs a Dirichlet-part, too. Now it should be possible to control the temperature, that you get a given temperature on the Neumann-part.

I know, this is a very mathematical question and donīt always reflect the reality. But for test, if itīs possible to implement a adjoint solver in OpenFOAM, i think itīs just right.

While Iīm new to programming OpenFOAM (except making some little changes in solvers), is there some good place where i can get some information? Especially about adjoint methods?

sylvester May 23, 2012 10:28

The best place for assistance on programming OpenFOAM is this forum, in my opinion. With the help of Google you can find a lot of information here. The wiki might also be able to help you out.

The only information I could find on the implementation of the adjoint equations in OpenFOAM are the papers by Carsten Othmer. AdjointShapeOptimizationFoam.C gives the reference IIRC.

Unfortunately I can't help you much more than this, as I have not delved into the subject very deeply. Adjoint methods are of interest to me though, so I try to follow (and participate in) discussions whenever I can.

Best regards,


hjasak May 24, 2012 05:57

For the record, I run a Summer School in Zagreb for this reason: to improve people's knowledge of CFD, OpenFOAM, numerics, programming, physical modelling etc. We have closed the application for this year, but there's going to be another one in 2013.


All times are GMT -4. The time now is 12:33.