# Problem with DEFINE_SOURCE

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

 December 11, 2008, 07:59 Problem with DEFINE_SOURCE #1 Jacques Guest   Posts: n/a Hi there, I try to specify my problem and hope someone can help me out! I want to add a source term with DEFINE_SOURCE to only the closest(the first) cells around my geometry. How to add the source term only there isn't the problem. The problem is, that I want to calculate for each cell a different source-term. And I need to calculate it with the area normal vector of each cells boundary face. I wrote a udf with the c_face_loop macro. But when I fprint the area normal vector it is in every cell the same vector. Would be great if someone can help me or has an idea... Thank you for any reply! Jacques

 December 11, 2008, 11:09 Re: Problem with DEFINE_SOURCE #2 mange Guest   Posts: n/a If you post your UDF source code i may be able to give you some advice

 December 15, 2008, 10:25 Re: Problem with DEFINE_SOURCE #4 mange Guest   Posts: n/a Hi, Where do you hook your UDF? normally if you hook a UDF source function it will already be in a loop. So that if you hook it in a fluid domain, on the liquid level (if you have more than one phase) it should already be looping though all your cells.

 December 16, 2008, 10:44 Re: Problem with DEFINE_SOURCE #5 Jacques Guest   Posts: n/a Hi, I solved the problem. here is the code (without the header): c_face_loop(c,t,n) { f = C_FACE (c,t,n); tf = C_FACE_THREAD (c,t,n); if ( THREAD_TYPE(tf) == THREAD_F_WALL ) { F_AREA(A,f,tf); uvf = C_U(c,t); vvf = C_V(c,t); source = (NVD_DOT(A,uvf,vvf,0); } return source; }

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post zbpeng FLUENT 0 July 25, 2008 04:19 Li FLUENT 0 May 8, 2008 23:13 Phanindra FLUENT 1 February 23, 2007 10:03 PK FLUENT 0 December 6, 2006 11:36 mazao FLUENT 1 November 15, 2005 07:20

All times are GMT -4. The time now is 22:28.