CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > FLUENT

UDF to rotate

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

Reply
 
LinkBack Thread Tools Display Modes
Old   July 20, 2005, 07:48
Default UDF to rotate
  #1
Jon
Guest
 
Posts: n/a
Hi all,

I'm looking to write a udf to produce a rotating motion (rad/sec) for a volume, around a specified axis (0,0). I've been able to produce udf's that produce a circular motion by specifying a sinusoidal x and y motion, but now need the volume to actually rotate.

Hope you can help,

Thanks,
  Reply With Quote

Old   July 20, 2005, 08:08
Default Re: UDF to rotate
  #2
edi ghirardi
Guest
 
Posts: n/a
The following is an example on how to ramp up the rotational speed as function of iteration supposing that you use MRF (or SRF). Changing it as function of flow time for unsteady simulations should be straightforward (Rp_Get_Real("Flow Time")).

Hope this helps

Edi.

#include "udf.h"

#define Niter 25 /* iteration update interval */ #define omg_mn 0.00001 /* starting omega */ #define omg_mx 20.0 /* final omega */ #define del_omg 0.2 /* incremental omega */

DEFINE_ADJUST(myadjust,domain) { int zoneID; int iter = (nres==0)?(1)(int)count2[nres-1]); float omega; Thread *tc;

zoneID = 2; tc = Lookup_Thread(domain,zoneID);

if ( (iter%Niter)==0 ) { omega = omg_mn + (iter/Niter)*del_omg; if ( omega > omg_mx ) omega = omg_mx; THREAD_VAR(tc).fluid.omega = omega; Message("At iter=%d - update omega to %f\n",iter,omega); } }
  Reply With Quote

Old   July 20, 2005, 08:22
Default Re: UDF to rotate
  #3
Jon
Guest
 
Posts: n/a
thanks for your reply Edi. The rotational velocity is constant throughout however (150 radians per second). I just want to make a volume rotate about a central axis at this speed. Ideally, the udf would use t and simply increment the angle of rotation based on the value of t during interation.

Thanks again,
  Reply With Quote

Old   July 20, 2005, 08:42
Default Re: UDF to rotate
  #4
edi ghirardi
Guest
 
Posts: n/a
Sorry, might be a silly question, maybe I misunderstood your problem again, but what about defining a moving wall? In the BC panel you can define the rotational speed (relative to adjacent cell zone) and axis of rotation.

Edi.
  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
UDF parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 23:14
How to add a UDF to a compiled UDF library kim FLUENT 3 October 26, 2011 21:38
How to rotate a wall?( with udf) pejmanpark Fluent UDF and Scheme Programming 0 July 13, 2009 07:37
UDF...UDF...UDF...UDF Luc SEMINEL FLUENT 0 November 25, 2002 05:03
UDF, UDF, UDF, UDF Luc SEMINEL Main CFD Forum 0 November 25, 2002 05:01


All times are GMT -4. The time now is 12:02.