KR122: Access MRF parameters using UDF's

While using MRF model in Fluent, user can only specify constant values of angular velocity for fluid and wall zones using GUI.

Also, Fluent GUI does not have any direct hooks for these parameters, thus the dynamic control of these parameters can be obtained by accessing them using an UDF.

Following UDF can be used to ramp up the Angular velocity of a Fluid zone(e.g.,zone id = 86, can be obtained from Fluent Boundary Conditions panel).

/* UDF to ramp up the Angular velocity of rotation of a Fluid zone in MRF model */
#include "udf.h" /*Important--*/
#define interval 25 /* iteration update interval */
#define omg_min 0.001 /* starting omega */
#define omg_max 20.0 /* final omega */
#define del_omg 0.2 /* incremental omega */
int zoneID;
float omega=261.0;
Thread *tc;
zoneID = 86;/*A fluid zone id from Fluent*/
tc = Lookup_Thread(domain,zoneID);
if ( (N_ITER%interval)==0 )
{ /*N_ITER returns iter returns the iteration no.*/
omega = omg_min + (N_ITER/interval)*del_omg;
if ( omega > omg_max ) omega = omg_max;
THREAD_VAR(tc) = omega;
Message("At iter=%d ` omega updated to %fn",iter, omega);
Message("Axis of rotation is %f %f %fn", THREAD_VAR(tc).fluid.axis[0],THREAD_VAR(tc).fluid.axis[1],THREAD_VAR(tc).fluid.axis[2]);
Message("Location of Axis of rotation is %f %f %fn",THREAD_VAR(tc).fluid.origin[0],THREAD_VAR(tc).fluid.origin[1],THREAD_VAR(tc).fluid.origin[2]);

Show Form
No comments yet. Be the first to add a comment!