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

udf explaination

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

Reply
 
LinkBack Thread Tools Display Modes
Old   May 4, 2012, 06:31
Default udf explaination
  #1
New Member
 
Ijaz
Join Date: Dec 2011
Location: Singapore
Posts: 17
Rep Power: 5
Ijaz is on a distinguished road
This is the udf for mix tank Tutorial 23- for eulerian multiphase granular flow. Can anyone please explain the udf,as in my case only a simple disc is rotating. I need to modify the udf. Can anyone please help...

#include "udf.h"
#include "sg.h"
#define FLUID_ID 1
#define ua1 -7.1357e-2
#define ua2 54.304
#define ua3 -3.1345e3
#define ua4 4.5578e4
#define ua5 -1.9664e5
#define va1 3.1131e-2
#define va2 -10.313
#define va3 9.5558e2
#define va4 -2.0051e4
#define va5 1.1856e5
#define ka1 2.2723e-2
#define ka2 6.7989
#define ka3 -424.18
#define ka4 9.4615e3
#define ka5 -7.7251e4
#define ka6 1.8410e5
#define da1 -6.5819e-2
#define da2 88.845
#define da3 -5.3731e3
#define da4 1.1643e5
#define da5 -9.1202e5
#define da6 1.9567e6

DEFINE_PROFILE(fixed_u, thread, np)
{
real r;
begin_c_loop (c,thread)
{
/* centroid is defined to specify position dependent profiles*/
C_CENTROID(x,c,thread);
r =x[1];
F_PROFILE(c,thread,np) =
ua1+(ua2*r)+(ua3*r*r)+(ua4*r*r*r)+(ua5*r*r*r*r);
}
end_c_loop (c,thread)
}

DEFINE_PROFILE(fixed_v, thread, np)
{
cell_t c;
real x[ND_ND];
real r;
begin_c_loop (c,thread)
{
/* centroid is defined to specify position dependent profiles*/
C_CENTROID(x,c,thread);
r =x[1];
F_PROFILE(c,thread,np) =
va1+(va2*r)+(va3*r*r)+(va4*r*r*r)+(va5*r*r*r*r);
}
end_c_loop (c,thread)
}

DEFINE_PROFILE(fixed_ke, thread, np)
{
cell_t c;
real x[ND_ND];
real r;
begin_c_loop (c,thread)
{
/* centroid is defined to specify position dependent profiles*/
C_CENTROID(x,c,thread);
r =x[1];
F_PROFILE(c,thread,np) =
ka1+(ka2*r)+(ka3*r*r)+(ka4*r*r*r)+(ka5*r*r*r*r)+(k a6*r*r*r*r*r);
}
end_c_loop (c,thread)
}

DEFINE_PROFILE(fixed_diss, thread, np)
{
cell_t c;
real x[ND_ND];
real r;
begin_c_loop (c,thread)
{
/* centroid is defined to specify position dependent profiles*/
C_CENTROID(x,c,thread);
r =x[1];
F_PROFILE(c,thread,np) =
da1+(da2*r)+(da3*r*r)+(da4*r*r*r)+(da5*r*r*r*r)+(d a6*r*r*r*r*r);
}
end_c_loop (c,thread)
}
Ijaz is offline   Reply With Quote

Old   May 4, 2012, 12:36
Default
  #2
Senior Member
 
Lucky Tran
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 696
Rep Power: 13
LuckyTran will become famous soon enough
Try posting in the UDF forum?
LuckyTran is offline   Reply With Quote

Old   May 5, 2012, 17:32
Default
  #3
Member
 
Join Date: Nov 2011
Location: Czech Republic
Posts: 95
Rep Power: 5
Sixkillers is on a distinguished road
The mentioned UDF is just setting velocity and turbulent quantities in the fluid domain according to radius
Code:
r =x[1];
(it is asymmetrical simulation). More precisely the UDF is setting 3 components of velocity (u, v, w), turbulence kinetic energy (k) and rate of dissipation of the turbulence kinetic energy (epsilon). The coefficients in the polynomials (defined constants) were obtained from experimental data, so I am not sure, if it is exactly what you want. You might want to use MRF method instead to simulate impeller motion without need of experimental data.
Sixkillers is offline   Reply With Quote

Old   May 6, 2012, 20:59
Default Thanks
  #4
New Member
 
Ijaz
Join Date: Dec 2011
Location: Singapore
Posts: 17
Rep Power: 5
Ijaz is on a distinguished road
Thanks for the explanation...does the radius pertain to radius of impeller?
I have an impeller rotating with speed "a" asymmetrically at a distance of 0.16 m from the centre and also need to rotate the tank with speed "b". Could you give me any which way I could do it? is udf necessary?
Ijaz is offline   Reply With Quote

Old   May 8, 2012, 04:24
Default
  #5
Member
 
Join Date: Nov 2011
Location: Czech Republic
Posts: 95
Rep Power: 5
Sixkillers is on a distinguished road
Quote:
Thanks for the explanation...does the radius pertain to radius of impeller?
No, it pertains to radius of cylindrical domain. Basically they are setting flow properties by this UDF.

For your simulation, if you don't have an experimental data, which you would like to use, you will have to use a different approach. For example the MRF method comes to my mind (assuming that you want to do steady state simulation). Basically you will have to divide your domain into two subdomains and set demanded angular velocities in them.

Last edited by Sixkillers; May 8, 2012 at 05:18.
Sixkillers 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
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
RE: the explaination of Error while compling UDF li li FLUENT 0 October 24, 2003 00:47
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 21:40.