|
[Sponsors] |
May 12, 2011, 06:45 |
DEFINE_SOURCE - Problem
|
#1 |
New Member
Join Date: May 2011
Posts: 7
Rep Power: 15 |
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 |
|
May 12, 2011, 16:41 |
|
#2 |
Senior Member
|
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. |
|
May 13, 2011, 10:21 |
|
#3 |
New Member
Join Date: May 2011
Posts: 7
Rep Power: 15 |
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?
|
|
May 13, 2011, 10:56 |
|
#5 |
New Member
Join Date: May 2011
Posts: 7
Rep Power: 15 |
Got it, thanks a lot
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF compiling problem | Wouter | Fluent UDF and Scheme Programming | 6 | June 6, 2012 05:43 |
Incoherent problem table in hollow-fiber spinning | Gianni | FLUENT | 0 | April 5, 2008 11:33 |
natural convection problem for a CHT problem | Se-Hee | CFX | 2 | June 10, 2007 07:29 |
Adiabatic and Rotating wall (Convection problem) | ParodDav | CFX | 5 | April 29, 2007 20:13 |
Is this problem well posed? | Thomas P. Abraham | Main CFD Forum | 5 | September 8, 1999 15:52 |