Optimizing the source term added to the momentum equation #392
Replies: 9 comments 19 replies
-
You can use fvOptions to add source terms in DAFoam. But we did not test if the adjoint accuracy was good... |
Beta Was this translation helpful? Give feedback.
-
Yes, you can use |
Beta Was this translation helpful? Give feedback.
-
Yes. Check: dafoam/tests/runTests_MphysAeroProp.py Line 84 in 273a80b |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Regarding your first Q, you can verify if fvSouce is updated as expected by manually setting a non-zero fvSource initial field in runScript.py. Regarding your 2nd Q, yes, what you want is sort of a topology optimization. We have a DAFoam tutorial for that. One last thing, we found was that the IPOPT did not work for topology optimization, you have to use SNOPT instead. So the fvSource not changing issue may be caused by the IPOPT optimizer. |
Beta Was this translation helpful? Give feedback.
-
Yeah, the choice of the optimizer will not impact the gradient accuracy. I am not sure what caused the super large gradient values near the far field bc. Did the adjoint converge well? |
Beta Was this translation helpful? Give feedback.
-
Can you use the finite-difference or forward-mode AD to check if the adjoint gradients are accurate? We know that the adjoint gradients may become inaccurate if there is flow separation. I suggest you try the |
Beta Was this translation helpful? Give feedback.
-
The gradients MAY be inaccurate if there is a large flow separation. I suggest you verify the gradients before running an optimization. We managed to run many optimizations for separated flows without a problem. However, in some rare cases, the gradients become inaccurate. This issue should be caused by the bounding in the |
Beta Was this translation helpful? Give feedback.
-
Thanks for this discussion, it has been very helpful! |
Beta Was this translation helpful? Give feedback.
-
Hi,
You mentioned that there is no support for fvOptions.
I wanted to know how straightforward would it be to optimize a source term added to the momentum equation (in DASimpleFoam solver for example) to reduce a pre-defined objective function (from say DAObjFunc) and what would be a good place for me to start looking.
Beta Was this translation helpful? Give feedback.
All reactions