CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   Update every iteration!!!!! (https://www.cfd-online.com/Forums/fluent-udf/237240-update-every-iteration.html)

David070 July 7, 2021 04:35

Update every iteration!!!!!
 
Hi everyone,

I am currently doing a fsi problem using udf. The problem I model is an object that is attached with a torsional spring, and the other end of the spring is under a prescribed motion. So the object will move under the interaction of the fluid and the elastic reaction force. I use the DEFINE_ZONE_MOTION to update the velocity of the object. The problem is that this macro is called every time step, and the fluid force may not converge or let's say may be higher than reality, then the object will move fast because of the fluid force, then at the second timestep the fast speed will cause an even large fluid force, and then the calculation would soon diverge.

I want to modify the program by this: the position of the object will update at every time step, but the velocity of the dynamic motion(fsi) is updated at every iteration. Once the dynamic motion is converged, then it enters the next time step. By doing this, the dynamic motion of the object will easily converge at every timestep. Then the calculation should be work.

So, I want to ask that does anyone know how to embed this algorithm? Is there a macro that can be called every iteration, not every timestep? Thank you very much!

David

pakk July 7, 2021 13:56

I understand your problem (I think), but your proposed solution makes no sense...

Change the object velocity every time iteration. .. To what?

David070 July 7, 2021 20:19

I mean the body dynamic equation will be called after every iteration, and so the velocity of the object (the part from the passive motion (the solution from the dynamic equation)) will be updated after iteration, but the position of the object will only be updated every timestep. Thus, it may easier to converge.

So the thing we need to do is using a macro to modify the velocity of every node of the grids of the object after every iteration, and the said velocity is modified according to the updates from the body dynamic equation.

Quote:

Originally Posted by pakk (Post 807736)
I understand your problem (I think), but your proposed solution makes no sense...

Change the object velocity every time iteration. .. To what?


AlexanderZ July 7, 2021 22:25

did you try to decrease time step size?


All times are GMT -4. The time now is 21:12.