Using Dynamic Mesh with UDF

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

 August 16, 2012, 13:44 Using Dynamic Mesh with UDF #1 New Member   Abhinav Join Date: Mar 2011 Posts: 17 Rep Power: 8 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

August 16, 2012, 23:24
#2
Senior Member

Ehsan Asgari
Join Date: Apr 2010
Posts: 312
Rep Power: 10
Quote:
 Originally Posted by abhinavgupta88 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.

 August 22, 2012, 14:14 Dynamic Wall UDF #3 New Member   Abhinav Join Date: Mar 2011 Posts: 17 Rep Power: 8 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.

August 22, 2012, 15:07
#4
Senior Member

Ehsan Asgari
Join Date: Apr 2010
Posts: 312
Rep Power: 10
Quote:
 Originally Posted by abhinavgupta88 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.

August 22, 2012, 15:21
#5
New Member

Abhinav
Join Date: Mar 2011
Posts: 17
Rep Power: 8
Quote:
 Originally Posted by syavash 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.

August 22, 2012, 21:13
#6
Senior Member

Ehsan Asgari
Join Date: Apr 2010
Posts: 312
Rep Power: 10
Quote:
 Originally Posted by abhinavgupta88 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.
2-Do this in Fluent at Grid-->Separate by region.

 Thread Tools Display Modes Linear Mode

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

 Similar Threads Thread Thread Starter Forum Replies Last Post Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 06:20 Peter FLUENT 2 November 12, 2007 03:10 ALPER ALBAYRAQ FLUENT 0 October 24, 2005 08:41 Ryan FLUENT 6 April 29, 2004 09:29 lyf FLUENT 1 April 19, 2004 06:43

All times are GMT -4. The time now is 11:44.