|
[Sponsors] |
July 20, 2005, 07:48 |
UDF to rotate
|
#1 |
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, |
|
July 20, 2005, 08:08 |
Re: UDF to rotate
|
#2 |
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); } } |
|
July 20, 2005, 08:22 |
Re: UDF to rotate
|
#3 |
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, |
|
July 20, 2005, 08:42 |
Re: UDF to rotate
|
#4 |
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. |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
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 22: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 04:03 |
UDF, UDF, UDF, UDF | Luc SEMINEL | Main CFD Forum | 0 | November 25, 2002 04:01 |