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

Using Dynamic Mesh with UDF

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   August 16, 2012, 14:44
Default Using Dynamic Mesh with UDF
  #1
New Member
 
Abhinav
Join Date: Mar 2011
Posts: 17
Rep Power: 5
abhinavgupta88 is on a distinguished road
I have a 2D Geometry which has Piston on two sides and Top and Bottom are walls. I wanna move the Two Pistons Simultaneously using the UDF. For motion I am using Sine Function. I am using Fluent. Please Help
abhinavgupta88 is offline   Reply With Quote

Old   August 17, 2012, 00:24
Default
  #2
Senior Member
 
Syavash
Join Date: Apr 2010
Location: Tehran, Karaj
Posts: 177
Rep Power: 6
syavash is on a distinguished road
Quote:
Originally Posted by abhinavgupta88 View Post
I have a 2D Geometry which has Piston on two sides and Top and Bottom are walls. I wanna move the Two Pistons Simultaneously using the UDF. For motion I am using Sine Function. I am using Fluent. Please Help
Hi,
If you are newbie in udf, take a deep look at fluent udf manual. It can help you more than anyone else. (search for define_cg_motion)
Good luck.
syavash is offline   Reply With Quote

Old   August 22, 2012, 15:14
Default Dynamic Wall UDF
  #3
New Member
 
Abhinav
Join Date: Mar 2011
Posts: 17
Rep Power: 5
abhinavgupta88 is on a distinguished road
I have gone through the Manual. I am able to compile my UDF and Hook it to the walls. But I can see both the walls moving in the same direction. I am using the following UDF:
#include "udf.h"
#include "dynamesh_tools.h"

/************************************************** ********************/
/***** UDF for displacer motiion *****/
/************************************************** ********************/

DEFINE_CG_MOTION(displacer_func, dt, vel, omega, time, dtime)

{

Thread *t;
face_t f;
real a = 1.58712757;
real pai = 3.141592654;

/* reset velocities */
NV_S (vel, =, 0.0);
NV_S (omega, =, 0.0);

if (!Data_Valid_P ())
return;

t=DT_THREAD (dt);

if(time<=8.0)



vel[0] = ( a * ( cos(2*pai*75*time)) ) ;
else


vel[0] = -( a * ( cos(2*pai*75*time)) ) ;

}

I appreciate if anyone can help.
abhinavgupta88 is offline   Reply With Quote

Old   August 22, 2012, 16:07
Default
  #4
Senior Member
 
Syavash
Join Date: Apr 2010
Location: Tehran, Karaj
Posts: 177
Rep Power: 6
syavash is on a distinguished road
Quote:
Originally Posted by abhinavgupta88 View Post
I have gone through the Manual. I am able to compile my UDF and Hook it to the walls. But I can see both the walls moving in the same direction. I am using the following UDF:
#include "udf.h"
#include "dynamesh_tools.h"

/************************************************** ********************/
/***** UDF for displacer motiion *****/
/************************************************** ********************/

DEFINE_CG_MOTION(displacer_func, dt, vel, omega, time, dtime)

{



Thread *t;
face_t f;
real a = 1.58712757;
real pai = 3.141592654;

/* reset velocities */
NV_S (vel, =, 0.0);
NV_S (omega, =, 0.0);

if (!Data_Valid_P ())
return;

t=DT_THREAD (dt);

if(time<=8.0)



vel[0] = ( a * ( cos(2*pai*75*time)) ) ;
else


vel[0] = -( a * ( cos(2*pai*75*time)) ) ;


}

I appreciate if anyone can help.
well, you should make two further steps.
1.separate two pistons in two distinct zones (if not already.)
2.make a copy of your define cg motion with a different name and a minus sign in velocity. Now assign each cg motion into one of pistons.
Good luck.
syavash is offline   Reply With Quote

Old   August 22, 2012, 16:21
Default
  #5
New Member
 
Abhinav
Join Date: Mar 2011
Posts: 17
Rep Power: 5
abhinavgupta88 is on a distinguished road
Quote:
Originally Posted by syavash View Post
well, you should make two further steps.
1.separate two pistons in two distinct zones (if not already.)
2.make a copy of your define cg motion with a different name and a minus sign in velocity. Now assign each cg motion into one of pistons.
Good luck.
Thank You for the Reply. You mean to say Separate Two pistons in two distinct zones, in Gambit. I understand what you wrote but I am little confused with first step.
abhinavgupta88 is offline   Reply With Quote

Old   August 22, 2012, 22:13
Default
  #6
Senior Member
 
Syavash
Join Date: Apr 2010
Location: Tehran, Karaj
Posts: 177
Rep Power: 6
syavash is on a distinguished road
Quote:
Originally Posted by abhinavgupta88 View Post
Thank You for the Reply. You mean to say Separate Two pistons in two distinct zones, in Gambit. I understand what you wrote but I am little confused with first step.
You should refer to BC panel in Fluent. If there are two walls with different name, It's OK. Otherwise, you may have two options.
1-Return to Gambit and separate two walls as you know.
2-Do this in Fluent at Grid-->Separate by region.
syavash is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 07:20
Dynamic mesh UDF problem Peter FLUENT 2 November 12, 2007 03:10
writing a dynamic mesh udf ALPER ALBAYRAQ FLUENT 0 October 24, 2005 09:41
Problem related with UDF for dynamic mesh Ryan FLUENT 6 April 29, 2004 10:29
UDF problem for dynamic mesh??? lyf FLUENT 1 April 19, 2004 07:43


All times are GMT -4. The time now is 00:04.