DEFINE_SOURCE - Problem
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 |
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. |
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?
|
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.
|
Got it, thanks a lot
|
All times are GMT -4. The time now is 05:00. |