CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (http://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   negative time step, possible to set? (http://www.cfd-online.com/Forums/openfoam-programming-development/132121-negative-time-step-possible-set.html)

sawyer86 March 26, 2014 06:39

negative time step, possible to set?
 
hi there,

Do you know if it possible to introduce in OF, icoFoam algorithm in particular, a time step (adjusted or not) which is negative?

I mean, can I run a simulation in OF that start from t=0 and it goes till t=tstar with tstar<0 with a deltaT<0?

Thank you in advance

Regards

mturcios777 March 26, 2014 12:50

I don't believe you can do that with the default time classes, as there is only has increment operator:
http://foam.sourceforge.net/docs/cpp/a02579.html

I'm not sure in what situation these would be useful. If you really wanted it you would have to have your own time counter and decrement it, although this would only mean that your simulation was still evolving forward in time and you've flipped your time axis.

That, or you could find a flux capacitor and drive 88 mph...

sawyer86 March 26, 2014 12:57

Quote:

Originally Posted by mturcios777 (Post 482246)
I don't believe you can do that with the default time classes, as there is only has increment operator:
http://foam.sourceforge.net/docs/cpp/a02579.html

I'm not sure in what situation these would be useful. If you really wanted it you would have to have your own time counter and decrement it, although this would only mean that your simulation was still evolving forward in time and you've flipped your time axis.

That, or you could find a flux capacitor and drive 88 mph...

You got me. This was just the theoretical plot draft for "back to future IV"! :)

Anyway my question was bad posed. Indeed the equation I want to solve are not NS classic ones but a motification of them with the temporal term which is going to be -ddt(U)...OF icofoam solver comes to be just the skeleton of the algorithm...

How can I create "my own time counter"?

Thank you in advance to support my idea

mturcios777 March 26, 2014 13:06

I don't think you would need a negative time-step to do what you want. Is ddt(U) negative because it absolutely needs to be, or just because its on the RHS of the equation you are solving (a reference to the equations you are solving would be helpful)?

sawyer86 March 26, 2014 13:15

Quote:

Originally Posted by mturcios777 (Post 482249)
I don't think you would need a negative time-step to do what you want. Is ddt(U) negative because it absolutely needs to be, or just because its on the RHS of the equation you are solving (a reference to the equations you are solving would be helpful)?

No, it is not just a change of hand side. It is the prescription of the equation, indeed I am dealing with the Adjoint Navier Stokes equation wich prescribe this procedure...

sawyer86 March 27, 2014 05:40

Quote:

Originally Posted by mturcios777 (Post 482249)
I don't think you would need a negative time-step to do what you want. Is ddt(U) negative because it absolutely needs to be, or just because its on the RHS of the equation you are solving (a reference to the equations you are solving would be helpful)?

I was thinking about it...could it work if I would just change the sing in the time schemes discretization that OF does in CrankNicholson (for instance)?

I mean leaving the time flows as positive but introducing at the place of Dt the term -1*Dt in the CrankNicholson schemes...

My question at this point could be. If it is possible, where is that OF does compute the CrankNicholson scheme, where is the exact file where it does the discretization?

tom ato November 6, 2014 05:36

Dear Tom, Dear Foamers,

In my point of view, the problem here is to set the right boundary conditions in time for the adjoint NSE. To make sure, that the problem is well posed, one definitely is forced to compute the solution of ANSE backward in time.

Tom, did you find a way to realize a computation in openFOAM with negative timeSteps? I tried a lot so far, but haven't find a satisfying answer yet, so even short hints might be very useful ( I hope you're still familiar with the subject posted above...).

Kind regards

Tom


All times are GMT -4. The time now is 04:55.