Represent fvSource by tensor basis #867
Replies: 2 comments 12 replies
-
|
If I understand you correctly, I believe the best way to implement this is to keep the regression model and DASolver unchanged, but add a child class to DAFvSource. In this child class, you need to implement how to use g_i and T_i to compute fvSource (check other child classes for example). Then, in the optimization, you can use this newly added childClass in runScript.py->daOptions->fvSource, and directly use g_i as the design variable (field inversion; set this g_i in inputInfo). Alternatively, you can call the regressionModel in runScript.py->daOptions->regressionModel to compute g_i and then use the regressionModel's parameters as the design variables. The adjoint should be automatically done, even if your change is outside of the regression model. DAFoam uses automatic differentiation to facilitate the adjoint computation, so as long as your forward simulation works, the adjoint is automatically done. One thing you need to do is to create g_i as a member variable in the DAFvSource child class and make sure to register it into the mesh database, such that the regressionModel can access g_i from mesh.thisDb() later. |
Beta Was this translation helpful? Give feedback.
-
|
@HerryJhonson No, you. can't add two fvSources in DAFoam. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I want to achieve the following:
fvSource = div(g_1T_1+g_2T_2+...), where g_i is a scalar field used as the coefficient, and T_i is a tensor field constructed by tensors S and R used as the tensor basis.
I have two candidates.
My questions are:
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions