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

UDF for source term at wall

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 19, 2017, 19:44
Post UDF for source term at wall
  #1
New Member
 
Yatin Suri
Join Date: Aug 2017
Posts: 7
Rep Power: 9
y.suri is on a distinguished road
Hi CFD Experts,

I am a beginner in ANSYS FLUENT. I want to write a UDF for source term at wall in order to include the water leakoff rate from wall.

I have written following code, but I am not sure if it is correctly written.
Please can you check and guide me?

# include "udf.h"

DEFINE_SOURCE(leakoffrate,cell,thread,dS,eqn)
{
real x[ND_ND];
real leak;
real length;
Domain *domain = Get_Domain(1);
face_t f;
cell_t c;
Thread *tb = Lookup_Thread(domain,2); /* Get boundary thread, wall zone id is 2 */

begin_f_loop (f,thread)
{ F_CENTROID (x,f,thread)

if(c = F_C0(f,tb)) /* if cell is wall boundary cell */
{
if (length > 0 and length < 0.25)
leak = 17-22*length;
elseif (length > 0.25 and length < 0.45)
leak = 13.0625-6.25*length;
elseif (length > 0.45 and length < 0.85)
leak = 10;
else
leak=7.17+3.33*length;
}
dS[eqn]=0;

else
{
leak = 0;
dS[eqn]=0;
}
return leak;
}

end_f_loop (f,thread)
}

Many thanks and regards,
Yatin

Last edited by y.suri; August 19, 2017 at 19:52. Reason: updated the post with code
y.suri is offline   Reply With Quote

Reply

Tags
source term, udf code


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Source Term UDF VS Porous Media Model pchoopanya Fluent UDF and Scheme Programming 1 August 28, 2013 07:12
Accessing wall shear stress using UDF Robert Fluent UDF and Scheme Programming 2 July 31, 2013 09:34
wall boundary condition in UDF ssamton FLUENT 0 January 31, 2011 04:07
Free Stream & Wall Temp UDF jww FLUENT 0 October 2, 2009 10:37
Wall motion as a UDF, is it possible? linch FLUENT 1 August 31, 2009 10:18


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