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

Introducing DAFoam: A discrete adjoint optimization framework with OpenFOAM

Register Blogs Community New Posts Updated Threads Search

Like Tree8Likes
  • 7 Post By friedenhe
  • 1 Post By friedenhe

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 18, 2019, 14:19
Default Introducing DAFoam: A discrete adjoint optimization framework with OpenFOAM
  #1
New Member
 
Ping He
Join Date: Jun 2019
Posts: 7
Rep Power: 7
friedenhe is on a distinguished road
Dear Foamers,

We are pleased to introduce DAFoam: an open-source discrete-adjoint framework for multidisciplinary design optimization with OpenFOAM. The source code is available at https://github.com/mdolab/dafoam and the full documentation (download, installation, and tutorials) is available at https://dafoam.rtfd.io

DAFoam contains a suite of discrete adjoint solvers for OpenFOAM. These adjoint solvers run as standalone executives to compute derivatives. DAFoam also has a Python interface that allows the adjoint solvers to interact with external modules for high-fidelity, multidisciplinary design optimization.

DAFoam supports design optimizations for a wide range of disciplines such as aerodynamics, heat transfer, structures, hydrodynamics.
It has been used to handle optimization problems such as aircraft aerodynamic design, turbine aerothermal design, compressor aerostructural design, and ship hydrodynamic design.

We hope you will find it useful. If you want to try DAFoam and have questions, do not hesitate to contact us. Thanks!

Regards,
Ping

Attached Images
File Type: png DPW6_Transparent.png (116.7 KB, 407 views)
elvis, LVDH, fumiya and 4 others like this.
friedenhe is offline   Reply With Quote

Old   November 2, 2020, 02:08
Default pyOptSparse Error: There was an error importing the compiled snopt module
  #2
Member
 
JunaidAhmad's Avatar
 
Junaid Ahmad Khan
Join Date: Mar 2010
Location: Islamabad
Posts: 43
Rep Power: 16
JunaidAhmad is on a distinguished road
Hello Ping,


I want to change the optimizer to snopt, but getting this error.


"pyOptSparse Error: There was an error importing the compiled snopt module"


kindly guide me.
Junaid
JunaidAhmad is offline   Reply With Quote

Old   November 2, 2020, 10:36
Default
  #3
New Member
 
Ping He
Join Date: Jun 2019
Posts: 7
Rep Power: 7
friedenhe is on a distinguished road
Quote:
Originally Posted by JunaidAhmad View Post
Hello Ping,


I want to change the optimizer to snopt, but getting this error.


"pyOptSparse Error: There was an error importing the compiled snopt module"


kindly guide me.
Junaid
Thanks for your interest. SNOPT is a commercial optimizer and is not included in the Docker image. Refer to https://mdolab-pyoptsparse.readthedo...s/pysnopt.html on how to buy and compile SNOPT in pyOptSparse.
friedenhe is offline   Reply With Quote

Old   November 5, 2020, 05:37
Default
  #4
Member
 
JunaidAhmad's Avatar
 
Junaid Ahmad Khan
Join Date: Mar 2010
Location: Islamabad
Posts: 43
Rep Power: 16
JunaidAhmad is on a distinguished road
Thanks for reply.
Can you share any link where I can learn ins and outs of DAFoam via videos or written tutorials. From pyHyp, pyGeo to DAFoam all steps.

Also as DAFoam solves both in-compressible and compressible problem. however adjoint optimization in OpenFoam v1906 is only valid for incompressible flows.



Question

Is DAFoam solver are based on openFaom or ADflow for compressible flows?
JunaidAhmad is offline   Reply With Quote

Old   November 5, 2020, 10:25
Default
  #5
New Member
 
Ping He
Join Date: Jun 2019
Posts: 7
Rep Power: 7
friedenhe is on a distinguished road
Quote:
Originally Posted by JunaidAhmad View Post
Thanks for reply.
Can you share any link where I can learn ins and outs of DAFoam via videos or written tutorials. From pyHyp, pyGeo to DAFoam all steps.

Also as DAFoam solves both in-compressible and compressible problem. however adjoint optimization in OpenFoam v1906 is only valid for incompressible flows.



Question

Is DAFoam solver are based on openFaom or ADflow for compressible flows?
For your questions:

Refer to http://dafoam.github.io for DAFoam documentation. In the "Get started--Details of transcripts" section, you can find instructions on the interfaces for pyGeo, IDWarp, pyOptSparse, etc. In the tutorials section, you can find a bunch of DAFoam tutorials.

Check this website for the details of each component in the MACH optimization framework: https://mdolab-mach-aero.readthedocs...html#mach-aero

Check this open-access paper on the details of DAFoam https://doi.org/10.2514/1.J058853

For your last question: we didn't use the OpenFOAM's built-in continuous adjoint solver, which is indeed for incompressible flow only. Instead, we implemented our own discrete adjoint solvers, which apply to incompressible, compressible, and transonic flows. Check the paper mentioned above. For flow simulations, yes we use OpenFOAM's built-in solvers, like simpleFoam, rhoSimpleFoam.
JunaidAhmad likes this.
friedenhe is offline   Reply With Quote

Old   November 29, 2020, 22:54
Default Residual calculation
  #6
Member
 
Charlie
Join Date: Dec 2010
Location: USA
Posts: 85
Rep Power: 16
cheng1988sjtu is on a distinguished road
Dear Ping He,

Thank you very much for the great contribution. I am learning about your code (DAFOAM), could you please elaborate more on the residual calculation? For a fvVectorMatrix UEqn, I see that the momentum residual is calculated as:

UEqn & U_ - fvc::grad(p_).

Is it the same as UEqn.A() & U_ - UEqn.H() - fvc::grad(p_) or UEqn.A() & U_ - fvc::grad(p_)?

In addition, U_ and p_ are perturbed solution, is it correct?
cheng1988sjtu is offline   Reply With Quote

Old   November 30, 2020, 18:22
Default
  #7
New Member
 
Ping He
Join Date: Jun 2019
Posts: 7
Rep Power: 7
friedenhe is on a distinguished road
Quote:
Originally Posted by cheng1988sjtu View Post
Dear Ping He,

Thank you very much for the great contribution. I am learning about your code (DAFOAM), could you please elaborate more on the residual calculation? For a fvVectorMatrix UEqn, I see that the momentum residual is calculated as:

UEqn & U_ - fvc::grad(p_).

Is it the same as UEqn.A() & U_ - UEqn.H() - fvc::grad(p_) or UEqn.A() & U_ - fvc::grad(p_)?

In addition, U_ and p_ are perturbed solution, is it correct?
Hi Charlie,

Thanks for your interest in our code. If you do URes = UEqn.A() * U_ - UEqn.H() + fvc::grad(p_), I expect you will get the same results as UEqn & U_ + fvc::grad(p_). However, the latter is recommended because it is much more flexible and general.

Regarding your second question, U_ and p_ can be original (converged) fields or perturbed fields. If the former, URes is the original residual. If the latter, URes will be the perturbed residual. Both the original and perturbed residuals will be used for computing the partial derivatives using the finite-difference method.

Ping
friedenhe is offline   Reply With Quote

Old   December 18, 2020, 17:28
Default
  #8
New Member
 
Ping He
Join Date: Jun 2019
Posts: 7
Rep Power: 7
friedenhe is on a distinguished road
We will no longer track this thread. If you have more questions, please post them to the DAFoam Github Discussions. We will respond as soon as possible.
friedenhe is offline   Reply With Quote

Old   November 20, 2023, 09:44
Default Idwarp as moveDynamicMesh solver? Is it possible?
  #9
Senior Member
 
M. Montero
Join Date: Mar 2009
Location: Madrid
Posts: 155
Rep Power: 17
be_inspired is on a distinguished road
Hi,

Dafoam includes IDwarp as morphing solution for the meshes. According to the documentation, it is a quite robust approach based on the displacement of points using a inverse distance algorithm.
The current displacement solvers implemented in OpenFoam are based on cell displacement and after that, the point coordinates are reconstructed. It is sometimes not very robust, mainly for high reynolds numbers flows with a y+=1.

Could it be possible to use IDwarp for that?

BR
Marcelino
be_inspired is offline   Reply With Quote

Old   September 25, 2024, 04:06
Default Issue related to IDWarp
  #10
New Member
 
Bilal
Join Date: Apr 2019
Posts: 6
Rep Power: 7
Muhammad Bilal Anwar is on a distinguished road
Hi

Can anyone pls help me on this? I am stuck on this for the past 2 weeks and is really frustrated now.

I am using IDWarp to deform a volume mesh. I have created a fluid domain with an Onera wing inside it. The unstructured mesh (Tri, tetra) is created using ICEM and exported in .cgns format.

When I read this mesh using IDWarp it gives me th following error.

"IDWarp cannot handle boundary conditions defined by "PointRange" or "PointList". Please use boundary conditions defined by "ElementRange" or "ElementList" instead"

I don't have any idea how to do define that. I have tried different strategies to give BC inside ICEM. but none is working.

Any help on this appreciated. I am attaching the screen shot of the mesh, bounday conditions and the error.
Attached Images
File Type: jpg mesh.jpg (54.5 KB, 2 views)
File Type: png boundary conditions.png (10.5 KB, 1 views)
File Type: jpg error.jpg (31.9 KB, 1 views)
Muhammad Bilal Anwar 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
the gradients calculated through discrete adjoint are near zero Haowang SU2 9 October 17, 2019 23:53
The discrete adjoint method uses too large memory. Yminjo SU2 1 April 27, 2016 11:52
OpenFOAM v3.0.1 Training, London, Houston, Berlin, Jan-Mar 2016 cfd.direct OpenFOAM Announcements from Other Sources 0 January 5, 2016 04:18
OpenFOAM Training, London, Chicago, Munich, Sep-Oct 2015 cfd.direct OpenFOAM Announcements from Other Sources 2 August 31, 2015 14:36
Discrete Adjoint Euler Computation doan.nak SU2 2 June 6, 2014 05:01


All times are GMT -4. The time now is 23:16.