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

Create a between-cell airflow rate matrix

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 7, 2014, 01:41
Default Create a between-cell airflow rate matrix
  #1
New Member
 
Join Date: Apr 2014
Posts: 1
Rep Power: 0
chunchen1987 is on a distinguished road
Dear all, I want to create a between-cell airflow rate matrix using UDF. For example, if there are 4 cells in the domain, I want to create a 4x4 matrix P, where P[i][j] is the airflow rate from cell i to cell j. I wrote a UDF as below, but it doesn't work. The idea is to use F_FLUX(f,t) for each face. Is this the right direction to do that? Or is there any stupid mistakes in the UDF?

I am a new learner of Fluent UDF. Any suggestions would be highly appreciated!!



#include"udf.h"

int P[4][4];

DEFINE_ON_DEMAND(calculate_P)
{
Domain *domain;
Thread *f_thread;
face_t f = -1;
Thread *t = NULL;
cell_t c0, c1 = -1;
Thread *t0, *t1 = NULL;
domain=Get_Domain(1);


thread_loop_f(f_thread, domain)/* loops over all face threads in a domain*/
{
c0 = F_C0(f,t);
t0 = F_C0_THREAD(f,t);
c1 = F_C1(f,t);
t1 = F_C1_THREAD(f,t);


if(F_FLUX(f,t)>0)
P[c0][c1]=F_FLUX(f,t);
else
P[c1][c0]=-F_FLUX(f,t);

}
}
chunchen1987 is offline   Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Meshing a Sphere Ajay FLUENT 10 September 3, 2016 15:18
Create a layer of cell above ground of 1m tall sammi FLUENT 0 August 11, 2008 01:34
fluent add additional zones for the mesh file SSL FLUENT 2 January 26, 2008 12:55
How to create a Cell Zone Bikash FLUENT 4 October 26, 2003 16:04
cell flow rate sivakumar FLUENT 0 March 31, 2003 15:05


All times are GMT -4. The time now is 18:11.