|
[Sponsors] |
January 12, 2016, 15:58 |
UDF called twice per step
|
#1 |
New Member
Yang Liu
Join Date: Jan 2015
Posts: 2
Rep Power: 0 |
Hi I am a new udf user and am controlling the dynamic mesh using udf, but I am encountered with a problem here.
After each time step, I can see two messages coming out, as follows. Since this message is written in udf, I assume it's called twice per step. Now the problem is the values for each of the variables are not the same. Which one is correct and passed to the next step? I appreciate any comments. Thanks. Updating solution at time level N... done. time = 0.256000, p_x = -0.001251, p_y = -0.000218, radius = 0.001270, x_vel = 0.007985, y_vel = -0.024104, force_x = -0.449745, force_y = -0.715030, 22.200000contact, centriforce = 0.000000 Updating mesh at time level N... time = 0.256000, p_x = -0.001251, p_y = -0.000218, radius = 0.001270, x_vel = 0.007639, y_vel = -0.024654, force_x = -0.449745, force_y = -0.715030, 22.200000contact, centriforce = 0.000000 |
|
January 12, 2016, 17:34 |
|
#2 |
Senior Member
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,761
Rep Power: 66 |
I'm not sure what your UDF does, but it is called twice because of the transient simulation + dynamic meshing. The key is to understand what & when it is being updated.
This step is related to the update of the solution as a result of the dynamic meshing. This is the earliest in the the time-stepping procedure. In this process, the most recent solution is transferred to become the new previous time-step. Only after this can you then proceed to solve for the new time-step. At the end of this update, the current variables are effectively the initial guesses for the new time-step. You will then need to do the inner iterations and update the solution. In other words, immediately before this update the variables from the previous calculation were in their final state before being passed. I'm not sure if you want your UDF to be called twice or when, depends on what you're trying to do with the UDF. |
|
January 13, 2016, 16:23 |
|
#3 |
New Member
Yang Liu
Join Date: Jan 2015
Posts: 2
Rep Power: 0 |
Thanks for your informative reply. I want the udf to be called only once. The first updated values at time level N should be passed to compute the next step. Is there anyway to do that?
|
|
Tags |
dynamic mesh event, udf cg motion |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
time step continuity problem in VAWT simulation | lpz_michele | OpenFOAM Running, Solving & CFD | 5 | February 22, 2018 20:50 |
Floating point exception error | lpz_michele | OpenFOAM Running, Solving & CFD | 53 | October 19, 2015 03:50 |
obtain species concentration in every time step to use in a udf | solmaz aryafar | Fluent UDF and Scheme Programming | 0 | April 8, 2015 11:52 |
InterFoam negative alpha | karasa03 | OpenFOAM | 7 | December 12, 2013 04:41 |
calling result of a UDF into current time step | Komon | Fluent UDF and Scheme Programming | 1 | April 1, 2012 20:53 |