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

UDF for source term at wall

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

Reply
 
LinkBack Thread Tools Display Modes
Old   August 19, 2017, 18:44
Post UDF for source term at wall
  #1
New Member
 
Yatin Suri
Join Date: Aug 2017
Posts: 3
Rep Power: 2
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 18:52. Reason: updated the post with code
y.suri is offline   Reply With Quote

Reply

Tags
source term, udf code

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
Source Term UDF VS Porous Media Model pchoopanya Fluent UDF and Scheme Programming 1 August 28, 2013 06:12
Accessing wall shear stress using UDF Robert Fluent UDF and Scheme Programming 2 July 31, 2013 08: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 09:37
Wall motion as a UDF, is it possible? linch FLUENT 1 August 31, 2009 09:18


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