|
[Sponsors] |
December 22, 2016, 09:42 |
UDF piston movement problem
|
#1 |
New Member
Join Date: Dec 2016
Posts: 24
Rep Power: 9 |
Hi everyone,
I'm trying to simulate a moving piston in a cylinder. The simple UDF i've written contains a sine wave to describe the velocity. It compiles correctly, and when I ask Fluent to 'Display Zone Motion', the piston starts accelerating and slowing down as expected. BUT, when it has come to a halt, instead of decelerating to a negative velocity, it accelerates in the positive direction! It appears like the absolute value is computed instead of the real one. The UDF looks as follows: -------------------------------------------------------------------------------- #include "udf.h" DEFINE_CG_MOTION(object_mov, dt, vel, omega, time, dtime) { real w, r, l; w = 146.6; r = 0.030; l = 0.1; /* define object movement law */ vel[0] = 0.1*(r*w*sin(w*time)+(r*r*w*sin(2*w*time))/(2*l)); vel[1] = 0; vel[2] = 0; } ---------------------------------------------------------------------------------- Any help/suggestion is more than welcome! |
|
December 22, 2016, 10:49 |
|
#2 |
Senior Member
Kevin
Join Date: Dec 2016
Posts: 138
Rep Power: 9 |
So are you saying the piston keeps on advancing in between halts? Did you hook your UDF? And have you tried with a simple sine wave?
|
|
December 26, 2016, 10:56 |
|
#3 |
New Member
Join Date: Dec 2016
Posts: 24
Rep Power: 9 |
Hi Kevin, thanks for your reply.
I've managed to resolve this issue by decreasing the time step. Also, the problem only emerged when I was using the 'Display Zone Motion' function. |
|
Tags |
fluent - udf |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
ATTN ALL: SOLUTON TO UDF COMPILE PROBLEM | Rizwan | Fluent UDF and Scheme Programming | 40 | March 18, 2018 07:05 |
UDF Compilation Error - Loading Library - COMMON Problem! Help! | robtheslob | Fluent UDF and Scheme Programming | 8 | July 24, 2015 01:53 |
Vaporization pressure UDF property problem? | lehoanganh07 | Fluent UDF and Scheme Programming | 1 | September 13, 2014 11:59 |
UDF Problem about Grid Motion !!! | Zhengyu Gao | Fluent UDF and Scheme Programming | 0 | December 6, 2013 20:45 |
UDF using problem, error happens-heip!! | Michael | FLUENT | 1 | December 9, 2008 08:51 |