CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Adjoint method

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 16, 2011, 09:28
Default Adjoint method
  #1
New Member
 
Join Date: Jul 2009
Posts: 10
Rep Power: 17
Jens is on a distinguished road
Hi,

Is there anybody who have experiences with the adjoint method to optimise a
geometry?
I implemented the adjoint equations based on papers and work of C. Othmers:

=================================================
tmp<fvVectorMatrix> adUEqn
(
...

);


=================================================

I think my problem is in the pressure correction. In all papers that i found they use the
simple method and i did it in the same way:

=================================================
adp.boundaryField().updateCoeffs();

...
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
fvScalarMatrix adpEqn
(
...
);


=================================================


If I calculated adU there are values with 10^(11) or sometimes 10^(30) near the outlet-patch. I think that is not correct

Thanks for every comment.
Regards,
Jens

Last edited by Jens; March 14, 2011 at 12:39.
Jens is offline   Reply With Quote

Old   February 17, 2011, 03:50
Default
  #2
Senior Member
 
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 279
Rep Power: 21
kalle is on a distinguished road
Hi!

I never tried this stuff, but I read somewhat about it earlier... are you sure about those boundary conditions? If I understood correctly, your cost function should come into the BC's for the adjoint eqs (if the cost function is described as a integral function over the domain). Check 'eq' 44-48 in C. Othmer, Int. J. Numer. Meth. Fluids 2008; 58:861–877

Regard,
K
kalle is offline   Reply With Quote

Old   February 17, 2011, 08:59
Default
  #3
Senior Member
 
David Boger
Join Date: Mar 2009
Location: Penn State Applied Research Laboratory
Posts: 146
Rep Power: 17
boger is on a distinguished road
Jens,

Did the equations converge?
__________________
David A. Boger
boger is offline   Reply With Quote

Old   February 17, 2011, 09:34
Default
  #4
New Member
 
Join Date: Jul 2009
Posts: 10
Rep Power: 17
Jens is on a distinguished road
Hi,

Thanks for the replies.

@Kalle
I see your point and you are right, the BC's are one problem to solve and the equations are very sensitive to the BC's but the problem is ... that leads me to

@boger
No, that is the "main" problem/issue. The normal velocity converge but "adjoint U" dont converge. The problem is, if i print the divergence of adjoint velocity the values are very hight (16.xx or 0.1) but the priority/task of the pressure correction is the divergence of adjoint U is equal to zero. Well, I think the first problem to solve is that the pressure correction solve -> div(adjoint U) = 0. Isn't it?
The question is, is there a term missing or something else?

Regards,
Jens
Jens is offline   Reply With Quote

Old   March 10, 2011, 02:47
Default
  #5
Senior Member
 
fumiya's Avatar
 
Fumiya Nozaki
Join Date: Jun 2010
Location: Yokohama, Japan
Posts: 266
Blog Entries: 1
Rep Power: 19
fumiya is on a distinguished road
Hi Jens,

Is your pressure equation right?
I think the right hand side of this equation is the divergence of the adjoint velocity field.

Regards,
Fumiya
fumiya is offline   Reply With Quote

Old   March 10, 2011, 08:14
Default
  #6
Senior Member
 
David Boger
Join Date: Mar 2009
Location: Penn State Applied Research Laboratory
Posts: 146
Rep Power: 17
boger is on a distinguished road
Good point, Fumiya - you're correct!
__________________
David A. Boger
boger is offline   Reply With Quote

Old   March 10, 2011, 08:49
Default
  #7
New Member
 
Join Date: Jul 2009
Posts: 10
Rep Power: 17
Jens is on a distinguished road
Thanks for your help and hints.
I got also a few hints by C. Othmer and the problem was the pressure equation.

Last edited by Jens; March 14, 2011 at 12:39.
Jens is offline   Reply With Quote

Old   March 10, 2011, 22:49
Default
  #8
Senior Member
 
fumiya's Avatar
 
Fumiya Nozaki
Join Date: Jun 2010
Location: Yokohama, Japan
Posts: 266
Blog Entries: 1
Rep Power: 19
fumiya is on a distinguished road
In my calculations, the continuity error of the adjoint velocity field does not drop compared to that of the primal velocity field.

1) Though there may be problems in my code, do the adjoint equations have this tendency?
2) Are the adjoint equations sensitive to the boundary conditions?
Do they converge with the same boundary conditions as the primal ones?

I would be grateful if you could share findings from your computations with the original solver from Dr. Othmer.

Regards,
Fumiya
fumiya is offline   Reply With Quote

Old   March 11, 2011, 04:36
Default
  #9
New Member
 
Join Date: Jul 2009
Posts: 10
Rep Power: 17
Jens is on a distinguished road
Quote:
Originally Posted by fumiya View Post
1) Though there may be problems in my code, do the adjoint equations have this tendency?
2) Are the adjoint equations sensitive to the boundary conditions?
Do they converge with the same boundary conditions as the primal ones?
The second problem was the boundary conditions ("kalle" his hint was right). You need special boundary conditions derived from the adjoint equations and the cost function on the boundary.

Regards,
Jens
Jens is offline   Reply With Quote

Old   March 12, 2011, 06:55
Default
  #10
Senior Member
 
BastiL
Join Date: Mar 2009
Posts: 530
Rep Power: 20
bastil is on a distinguished road
Quote:
Originally Posted by Jens View Post
You need special boundary conditions derived from the adjoint equations and the cost function on the boundary
Jens,

thanks for the findings. How do these BCs look like?
Would you mind posting your final case and solver? Thanks.

Regards Bastian.
bastil is offline   Reply With Quote

Old   March 13, 2011, 11:39
Default
  #11
New Member
 
Join Date: Jul 2009
Posts: 10
Rep Power: 17
Jens is on a distinguished road
Quote:
Originally Posted by bastil View Post
Jens,

thanks for the findings. How do these BCs look like?
Would you mind posting your final case and solver? Thanks.

Regards Bastian.
Unfortunately, I cant.

Regards,
Jens

Last edited by Jens; March 14, 2011 at 12:40.
Jens is offline   Reply With Quote

Old   March 14, 2011, 22:45
Default
  #12
Senior Member
 
fumiya's Avatar
 
Fumiya Nozaki
Join Date: Jun 2010
Location: Yokohama, Japan
Posts: 266
Blog Entries: 1
Rep Power: 19
fumiya is on a distinguished road
I would be grateful if you could post contour plots of the adjoint pressure and
velocity fields for a simple duct when the cost function is dissipated power
and flow is laminar.

I would like to use these data for comparison with my results.
I will prepare a case if it could save your work.

Regards,
Fumiya

Last edited by fumiya; March 16, 2011 at 02:12.
fumiya is offline   Reply With Quote

Old   March 16, 2011, 02:52
Default
  #13
Senior Member
 
fumiya's Avatar
 
Fumiya Nozaki
Join Date: Jun 2010
Location: Yokohama, Japan
Posts: 266
Blog Entries: 1
Rep Power: 19
fumiya is on a distinguished road
I calculated surface sensitivities according to Dr. Othmer's article
when the cost function is dissipated power. In this calculation,
outlet boundary conditions are not properly imposed. I have to
implement new boundary conditions to obtain more precise results.

Regards,
Fumiya
Attached Images
File Type: jpg surface_sensitivity.jpg (18.5 KB, 132 views)

Last edited by fumiya; March 18, 2011 at 04:11.
fumiya is offline   Reply With Quote

Old   March 18, 2011, 04:11
Default SIMPLE algorithm
  #14
Senior Member
 
fumiya's Avatar
 
Fumiya Nozaki
Join Date: Jun 2010
Location: Yokohama, Japan
Posts: 266
Blog Entries: 1
Rep Power: 19
fumiya is on a distinguished road
I'm implementing the adjoint solver in OpenFOAM by myself.
Any comments are appreciated.

***************SIMPLE algorithm***************

/*--------------------------------------------------*\
//Momentum predictor step
\*--------------------------------------------------*/
//Define the equation for adU(adjoint velocity field)
tmp<fvVectorMatrix> adUEqn
(
fvm::div(-phi,adU) //Flux phi is obtained from the primal flow solutions
- (fvc::grad(adU) & U)
+ turbulence->divDevReff(adU)
);

//Under-relax(Inertial relaxation) the equation for adU
adUEqn().relax();

//Solve the momentum predictor using the last known adp(adjoint pressure field) on the RHS.
//This gives us a adjoint velocity field that is "not divergence free", but approximately satisfies momentum.
eqnResidual = solve
(
adUEqn() == -fvc::grad(adp)
).initialResidual();

maxResidual = max(eqnResidual, maxResidual);

//Update the boundary conditions for adp
adp.boundaryField().updateCoeffs();


/*--------------------------------------------------*\
//Pressure solution step(estimate a new pressure field
//that satisfies zero adjoint velocity divergence)
\*--------------------------------------------------*/



To be continued . . .

Last edited by fumiya; March 20, 2011 at 12:00.
fumiya is offline   Reply With Quote

Old   June 12, 2011, 22:09
Default
  #15
Senior Member
 
fumiya's Avatar
 
Fumiya Nozaki
Join Date: Jun 2010
Location: Yokohama, Japan
Posts: 266
Blog Entries: 1
Rep Power: 19
fumiya is on a distinguished road
I have run several cases and found it difficult to obtain a converged
solution. I think it is related to the adjoint transpose convection term.

What should I do to improve convergence of the adjoint equations?


Best regards,
fumiya
fumiya is offline   Reply With Quote

Reply


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
[Gmsh] discretizer - gmshToFoam Andyjoe OpenFOAM Meshing & Mesh Conversion 13 March 14, 2012 05:35
SQP method for adjoint based aerodynamic shape optimization cfdbooks Main CFD Forum 2 May 26, 2009 11:40
Code for most powerfull FDV Method D.S.Nasan Main CFD Forum 6 September 4, 2008 03:08
Adjoint method for error estimation Fab Main CFD Forum 0 May 27, 2008 03:11
A question about discrete adjoint method Thomas Main CFD Forum 3 August 9, 2006 13:37


All times are GMT -4. The time now is 22:19.