CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Programming & Development (
-   -   Resetting all fields and mesh motion (

wavemaster May 21, 2012 13:00

Resetting all fields and mesh motion
Dear all,
I am attempting to write some implicit solver for a body moved by a fluid.
I would like to move the body boundary, calculate the fluid, obtain accelerations and then reset to where I started and repeat as often as I need before advancing the timestep.

The .prevIter(); seems to store all fields all right, so before entering into my implicit loop I am able to save all my fields like this.
Inside the implicit loop I use something like

to get back to the starting point of the current timestep.

I can run a case without moving the mesh and it seems to repeat every timestep a couple of times which shows i am OK, I suppose.
Moving meshes run but diverge, so I must be resetting something badly.
The same case as an explicit method works, so with my additional iterations it should only take longer...
I use the same for cellDisplacement and pointDisplacement as above.
But how do i reset the mesh motion best?
Is something like this correct?

Is there a structure/method to reset the whole simulation to the previous state more elegantly? I do not yet understand some aspects of time, so that could be an error ...
Any comments are much appreciated,

All times are GMT -4. The time now is 05:41.