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

DEFINE_SOURCE - Problem

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

Reply
 
LinkBack Thread Tools Display Modes
Old   May 12, 2011, 05:45
Default DEFINE_SOURCE - Problem
  #1
New Member
 
Join Date: May 2011
Posts: 7
Rep Power: 5
Hgyn is on a distinguished road
Hello,
I'm trying to write a UDF for an laminar duct flow that effects the fluid like there is a semi-high wall in the middle. This is what i have:

#include "udf.h"

DEFINE_SOURCE(xmom,cell,thread,dS,eqn)
{
real source, CON = 10000.0;
face_t f;
Domain *domain;
domain = Get_Domain(1);

int zone_ID = 12;
Thread *rand = Lookup_Thread(domain,zone_ID);

begin_f_loop(f, rand)
{
source=-CON*C_U(cell,thread);
/* dS[eqn]=-CON; */
}
end_f_loop(f, rand)
return source;
}

Zone 12 is a wall which is adjusted on interior.
But the UDF is not working the way it should.
What's my fault.

Thanks
Hgyn is offline   Reply With Quote

Old   May 12, 2011, 15:41
Default
  #2
Senior Member
 
Amir's Avatar
 
Amir
Join Date: May 2009
Location: Shiraz, Iran
Posts: 735
Blog Entries: 1
Rep Power: 13
Amir is on a distinguished road
Hi,
your UDF has some logical errors.
you loop over faces of your thread and then include source to the whole domain!!!
you have to separate a zone near the plate and include source to that.
Amir is offline   Reply With Quote

Old   May 13, 2011, 09:21
Default
  #3
New Member
 
Join Date: May 2011
Posts: 7
Rep Power: 5
Hgyn is on a distinguished road
Thanks for your reply, I understand what you mean, so I implement a if-else-condition, but what can I use as condition, or how can I realise that the flow is just influenced at that position?
Hgyn is offline   Reply With Quote

Old   May 13, 2011, 09:35
Default
  #4
Senior Member
 
Amir's Avatar
 
Amir
Join Date: May 2009
Location: Shiraz, Iran
Posts: 735
Blog Entries: 1
Rep Power: 13
Amir is on a distinguished road
As I said before, you have permission to add source terms to cells, so separate a zone near your area and then hook the UDF over separated zone in boundary condition panel.
Amir is offline   Reply With Quote

Old   May 13, 2011, 09:56
Default
  #5
New Member
 
Join Date: May 2011
Posts: 7
Rep Power: 5
Hgyn is on a distinguished road
Got it, thanks a lot
Hgyn 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 compiling problem Wouter Fluent UDF and Scheme Programming 6 June 6, 2012 04:43
Incoherent problem table in hollow-fiber spinning Gianni FLUENT 0 April 5, 2008 10:33
natural convection problem for a CHT problem Se-Hee CFX 2 June 10, 2007 06:29
Adiabatic and Rotating wall (Convection problem) ParodDav CFX 5 April 29, 2007 19:13
Is this problem well posed? Thomas P. Abraham Main CFD Forum 5 September 8, 1999 14:52


All times are GMT -4. The time now is 14:03.