CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

UDF piston movement problem

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 22, 2016, 09:42
Default UDF piston movement problem
  #1
New Member
 
Join Date: Dec 2016
Posts: 24
Rep Power: 10
Dozer_94 is on a distinguished road
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!
Dozer_94 is offline   Reply With Quote

Old   December 22, 2016, 10:49
Default
  #2
Senior Member
 
Kevin
Join Date: Dec 2016
Posts: 138
Rep Power: 10
KevinZ09 is on a distinguished road
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?
KevinZ09 is offline   Reply With Quote

Old   December 26, 2016, 10:56
Default
  #3
New Member
 
Join Date: Dec 2016
Posts: 24
Rep Power: 10
Dozer_94 is on a distinguished road
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.
Dozer_94 is offline   Reply With Quote

Reply

Tags
fluent - udf


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 18:46.