Adjoint method. Backwards in time
Hello,
I'm trying to code the adjoint method for the unsteady heat equation in OpenFOAM. I am able to solve the forward problem, but I'm having some trouble with the backwards problem. Actually, I don't know how to tell OpenFoam to solve a problem backwards in time, I've tried something like runTime--, but apparently this doesn't make sense to OF. Any idea on this? Another option I'm thinking about is to solve the adjoint problem forward in time by means of a change of variable like tau = T - t. However, in this case I have to reverse the contents in the time folders, so that data files in folder 0 go to folder T, data files in folder 1 go to folder T - 1, and so on... How could I achieve this? Thank you. |
I have tried the second option, reading the volScalarFields in reverse direction and saving the result. This way I can solve the adjoint problem in forward direction. However, probably there are more elegant ways of doing so, I would appreciate if someone could give some hints.
By the way, maybe this thread should go in the "Programming & Development" sub-forum, but I don't know how to move it. writeAdjointSourceTerm.H Code:
// Reverse source term in the adjoint equation |
Did you try using a negative time step? I find it works.
Quote:
|
All times are GMT -4. The time now is 11:26. |